1.增加按钮,修改页面

master
x_z 3 years ago
parent 4fc5ddda33
commit 58a86cd8ec

@ -74,5 +74,12 @@ export function getTargetSubInv(query) {
}); });
} }
export function testPlatformConnection(query) {
return axios({
url: "/udims/platform/testPlatformConnection",
method: "get",
params: query
})
}

@ -139,12 +139,47 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="15" class="el-col" type="flex">
<div class="text item">
<el-form-item label="账号" prop="platformUsername">
<el-input
v-model="editLogin.platformUsername"
placeholder="请输入账号"
style="width: 75%"
size="small"
@input="change()"
></el-input>
<el-button type="primary" style="margin-left: 3px;" @click.native="testUserInfo">账号验证</el-button>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="15" class="el-col" type="flex">
<div class="text item">
<el-form-item label="密码" prop="platformPassword">
<el-input
v-model="editLogin.platformPassword"
placeholder="请输入密码"
style="width: 75%"
size="small"
type="password"
show-password
@input="change()"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col" type="flex"> <el-col :span="20" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<el-form-item label="目标仓库分库" prop="invCode"> <el-form-item label="目标仓库" prop="invCode">
<el-select v-model="editLogin.invCode" <el-select v-model="editLogin.invCode"
style="width: 35%;" style="width: 35%;"
:disabled="targetPlatformEdit"
placeholder="目标仓库信息" @change="locInvChange" placeholder="目标仓库信息" @change="locInvChange"
clearable> clearable>
<el-option <el-option
@ -155,8 +190,18 @@
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col" type="flex">
<div class="text item">
<el-form-item label="目标分库" prop="invSubCode">
<el-select v-model="editLogin.invSubCode" placeholder="目标分库信息" <el-select v-model="editLogin.invSubCode" placeholder="目标分库信息"
style="width: 35%;" style="width: 35%;"
:disabled="targetPlatformEdit"
@change="locSubInvChange" @change="locSubInvChange"
clearable> clearable>
<el-option <el-option
@ -179,6 +224,7 @@
<el-select <el-select
v-model="editLogin.targetAction" v-model="editLogin.targetAction"
style="width: 65%" style="width: 65%"
:disabled="targetPlatformEdit"
placeholder="请选择目标单据类型" placeholder="请选择目标单据类型"
> >
<el-option <el-option
@ -194,39 +240,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="15" class="el-col" type="flex">
<div class="text item">
<el-form-item label="账号" prop="platformUsername">
<el-input
v-model="editLogin.platformUsername"
placeholder="请输入账号"
style="width: 78%"
size="small"
@input="change()"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="15" class="el-col" type="flex">
<div class="text item">
<el-form-item label="密码" prop="platformPassword">
<el-input
v-model="editLogin.platformPassword"
placeholder="请输入密码"
style="width: 78%"
size="small"
type="password"
show-password
@input="change()"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -299,6 +312,7 @@ export default {
targetActions: [], targetActions: [],
targetInvs: [], targetInvs: [],
targetSubInvs: [], targetSubInvs: [],
targetPlatformEdit: true, //
platformRules: { platformRules: {
corpName: [ corpName: [
{required: true, message: "请选择往来单位", trigger: "change"} {required: true, message: "请选择往来单位", trigger: "change"}
@ -653,6 +667,9 @@ export default {
locSubInvChange() { locSubInvChange() {
this.getTargetActions(); this.getTargetActions();
}, },
testUserInfo() {
},
}, },
mounted() { mounted() {
}, },

@ -41,7 +41,7 @@
prop="host" prop="host"
width="260" width="260"
></el-table-column> ></el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="220">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@ -50,7 +50,6 @@
>编辑 >编辑
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -58,6 +57,13 @@
>删除 >删除
</el-button </el-button
> >
<el-button
type="text"
size="small"
@click.native.stop="testConnection(scope.row)"
>测试连通
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -118,7 +124,8 @@
import { import {
getPlatform, getPlatform,
updatePlatform, updatePlatform,
deletePlatform deletePlatform,
testPlatformConnection
} from "../../api/auth/platform"; } from "../../api/auth/platform";
export default { export default {
@ -176,6 +183,9 @@ export default {
formSubmit() { formSubmit() {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (valid) { if (valid) {
//
testPlatformConnection({host: this.formData.host}).then((res) => {
if (res.code === 20000) {
this.loading = true; this.loading = true;
updatePlatform(this.formData) updatePlatform(this.formData)
.then((response) => { .then((response) => {
@ -192,6 +202,10 @@ export default {
this.cancelDialog(); this.cancelDialog();
this.loading = false; this.loading = false;
}); });
} else {
this.$message.error("连通失败,请检查自助平台访问地址!")
}
})
} }
}); });
}, },
@ -220,7 +234,6 @@ export default {
handleAddClick() { handleAddClick() {
this.editType = "add"; this.editType = "add";
this.formVisible = true; this.formVisible = true;
this.resetForm();
this.formData = { this.formData = {
id: null, id: null,
name: null, name: null,
@ -257,7 +270,19 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
},
testConnection(row) {
let params = {host: row.host};
testPlatformConnection(params).then((res) => {
if (res.code === 20000) {
this.$message.success("连接成功");
return true;
} else {
this.$message.error("连通失败,请检查自助平台访问地址!");
return false;
} }
})
},
}, },
mounted() { mounted() {
}, },

Loading…
Cancel
Save