|
|
|
@ -5,14 +5,6 @@
|
|
|
|
|
<el-form-item class="query-form-item">
|
|
|
|
|
<el-input v-model="query.key" style="width: 300px;" placeholder="搜索"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item class="query-form-item">
|
|
|
|
|
<el-select v-model="query.corpType" placeholder="往来单位类型">
|
|
|
|
|
<el-option label="全部" value=""></el-option>
|
|
|
|
|
<el-option label="客户" value="1"></el-option>
|
|
|
|
|
<el-option label="供应商" value="2"></el-option>
|
|
|
|
|
<el-option label="特殊往来" value="4"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button-group>
|
|
|
|
|
<el-button
|
|
|
|
@ -42,11 +34,6 @@
|
|
|
|
|
<el-table-column label="序号" type="index" fixed></el-table-column>
|
|
|
|
|
<el-table-column label="往来单位编码" prop="unitId" fixed></el-table-column>
|
|
|
|
|
<el-table-column label="往来单位名称" prop="corpName" fixed></el-table-column>
|
|
|
|
|
<el-table-column label="往来单位类型" prop="coryType" fixed>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ coryTypeArr[scope.row.corpType] }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="拼音码" prop="pinyinCode" fixed></el-table-column>
|
|
|
|
|
<el-table-column label="医院客户名称" prop="platformName" fixed></el-table-column>
|
|
|
|
|
<el-table-column label="操作" fixed="right">
|
|
|
|
@ -218,256 +205,334 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
getUnbindUnitMaintain,
|
|
|
|
|
getUnitMaintain,
|
|
|
|
|
addUnit,
|
|
|
|
|
modifyUnit
|
|
|
|
|
} from "../../api/receipts/unitMaintain";
|
|
|
|
|
import {
|
|
|
|
|
getPlatform,
|
|
|
|
|
linkPlatform,
|
|
|
|
|
getLinkPlatformList,
|
|
|
|
|
unbindPlatform,
|
|
|
|
|
getTargetActions
|
|
|
|
|
} from "../../api/auth/platform";
|
|
|
|
|
import {getBusTypeByUser} from "@/api/warehouse/BusRole";
|
|
|
|
|
import {
|
|
|
|
|
getUnbindUnitMaintain,
|
|
|
|
|
getUnitMaintain,
|
|
|
|
|
addUnit,
|
|
|
|
|
modifyUnit
|
|
|
|
|
} from "../../api/receipts/unitMaintain";
|
|
|
|
|
import {
|
|
|
|
|
getPlatform,
|
|
|
|
|
linkPlatform,
|
|
|
|
|
getLinkPlatformList,
|
|
|
|
|
unbindPlatform,
|
|
|
|
|
getTargetActions
|
|
|
|
|
} from "../../api/auth/platform";
|
|
|
|
|
import {getBusTypeByUser} from "@/api/warehouse/BusRole";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
query: {
|
|
|
|
|
key: "",
|
|
|
|
|
coryType: null,
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
},
|
|
|
|
|
editLogin: {
|
|
|
|
|
id: null,
|
|
|
|
|
corpName: null,
|
|
|
|
|
platformId: null,
|
|
|
|
|
platformUsername: null,
|
|
|
|
|
platformPassword: null,
|
|
|
|
|
appid: null,
|
|
|
|
|
appKey: null,
|
|
|
|
|
sceretKey: null,
|
|
|
|
|
sourceAction: null,
|
|
|
|
|
targetAction: null
|
|
|
|
|
},
|
|
|
|
|
editPlatfromQuery: {
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
host: null
|
|
|
|
|
},
|
|
|
|
|
loading: false,
|
|
|
|
|
editLoginVisible: false,
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
query: {
|
|
|
|
|
key: "",
|
|
|
|
|
coryType: null,
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
},
|
|
|
|
|
editLogin: {
|
|
|
|
|
id: null,
|
|
|
|
|
corpName: null,
|
|
|
|
|
platformId: null,
|
|
|
|
|
platformUsername: null,
|
|
|
|
|
platformPassword: null,
|
|
|
|
|
appid: null,
|
|
|
|
|
appKey: null,
|
|
|
|
|
sceretKey: null,
|
|
|
|
|
sourceAction: null,
|
|
|
|
|
targetAction: null
|
|
|
|
|
},
|
|
|
|
|
editPlatfromQuery: {
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
host: null
|
|
|
|
|
},
|
|
|
|
|
loading: false,
|
|
|
|
|
editLoginVisible: false,
|
|
|
|
|
|
|
|
|
|
checked: false,
|
|
|
|
|
editDialogVisible: false,
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
multipleSelection: [],
|
|
|
|
|
platformList: [],
|
|
|
|
|
corpNamesList: [],
|
|
|
|
|
bussinessTypes: [],
|
|
|
|
|
targetActions: [],
|
|
|
|
|
platformRules: {
|
|
|
|
|
corpName: [
|
|
|
|
|
{required: true, message: "请选择往来单位", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformId: [
|
|
|
|
|
{required: true, message: "请选择自助平台", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformUsername: [
|
|
|
|
|
{required: true, message: "请输入账号", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformPassword: [
|
|
|
|
|
{required: true, message: "请输入密码", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
sourceAction: [
|
|
|
|
|
{required: true, message: "请选择本地单据类型", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
targetAction: [
|
|
|
|
|
{required: true, message: "请选择目标单据类型", trigger: "change"}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
checked: false,
|
|
|
|
|
editDialogVisible: false,
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
multipleSelection: [],
|
|
|
|
|
platformList: [],
|
|
|
|
|
corpNamesList: [],
|
|
|
|
|
bussinessTypes: [],
|
|
|
|
|
targetActions: [],
|
|
|
|
|
platformRules: {
|
|
|
|
|
corpName: [
|
|
|
|
|
{required: true, message: "请选择往来单位", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformId: [
|
|
|
|
|
{required: true, message: "请选择自助平台", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformUsername: [
|
|
|
|
|
{required: true, message: "请输入账号", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
platformPassword: [
|
|
|
|
|
{required: true, message: "请输入密码", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
sourceAction: [
|
|
|
|
|
{required: true, message: "请选择本地单据类型", trigger: "change"}
|
|
|
|
|
],
|
|
|
|
|
targetAction: [
|
|
|
|
|
{required: true, message: "请选择目标单据类型", trigger: "change"}
|
|
|
|
|
},
|
|
|
|
|
editType: 0,
|
|
|
|
|
corpTypeList: [
|
|
|
|
|
{
|
|
|
|
|
value: 1,
|
|
|
|
|
label: "客户"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 2,
|
|
|
|
|
label: "供应商"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 4,
|
|
|
|
|
label: "特殊往来"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
onReset() {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: ""
|
|
|
|
|
});
|
|
|
|
|
this.query = {
|
|
|
|
|
key: "",
|
|
|
|
|
coryType: null,
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
editType: 0,
|
|
|
|
|
corpTypeList: [
|
|
|
|
|
{
|
|
|
|
|
value: 1,
|
|
|
|
|
label: "客户"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 2,
|
|
|
|
|
label: "供应商"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 4,
|
|
|
|
|
label: "特殊往来"
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getLinkPlatformList(this.query).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = res.data || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
cancelDialog() {
|
|
|
|
|
this.editLoginVisible = false;
|
|
|
|
|
},
|
|
|
|
|
handleModifyClick(row) {
|
|
|
|
|
if (row.platformId != null) {
|
|
|
|
|
//已经绑定过
|
|
|
|
|
this.$confirm("是否需要重新关联自助平台?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.editType = 2;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editLogin = row;
|
|
|
|
|
this.editDialogVisible = true;
|
|
|
|
|
this.getUnitMaintain();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
this.getLocalBussinessType();
|
|
|
|
|
this.getTargetActions(row.platformId);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.editType = 2;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editLogin = row;
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
coryTypeArr: {
|
|
|
|
|
1: "客户",
|
|
|
|
|
2: "供应商",
|
|
|
|
|
4: "特殊往来"
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
handleAddClick() {
|
|
|
|
|
this.editType = 0;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editDialogVisible = false;
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
onReset() {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: ""
|
|
|
|
|
});
|
|
|
|
|
this.query = {
|
|
|
|
|
key: "",
|
|
|
|
|
coryType: null,
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getLinkPlatformList(this.query).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = res.data || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
cancelDialog() {
|
|
|
|
|
this.editLoginVisible = false;
|
|
|
|
|
},
|
|
|
|
|
handleModifyClick(row) {
|
|
|
|
|
if (row.platformId != null) {
|
|
|
|
|
//已经绑定过
|
|
|
|
|
this.$confirm("是否需要重新关联自助平台?", "提示", {
|
|
|
|
|
//清空表单数据
|
|
|
|
|
this.editLogin = {
|
|
|
|
|
id: null,
|
|
|
|
|
corpName: null,
|
|
|
|
|
platformId: null,
|
|
|
|
|
platformUsername: null,
|
|
|
|
|
platformPassword: null,
|
|
|
|
|
appid: null,
|
|
|
|
|
appKey: null,
|
|
|
|
|
sceretKey: null,
|
|
|
|
|
sourceAction: null,
|
|
|
|
|
targetAction: null
|
|
|
|
|
};
|
|
|
|
|
this.getLocalBussinessType();
|
|
|
|
|
this.getUnitMaintain();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
},
|
|
|
|
|
change() {
|
|
|
|
|
},
|
|
|
|
|
getUnitMaintain() {
|
|
|
|
|
let unitQuery = {
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
corpType: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
getUnitMaintain(unitQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.corpNamesList = response.data.list || [];
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取自助平台数据
|
|
|
|
|
getPlatformList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getPlatform().then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.platformList = response.data.list || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.platformList = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
intentPlatform(value) {
|
|
|
|
|
this.editPlatfromQuery.id = value;
|
|
|
|
|
//拉取对应平台的单据类型
|
|
|
|
|
this.getTargetActions(value);
|
|
|
|
|
},
|
|
|
|
|
getTargetActions(platformId) {
|
|
|
|
|
this.targetActions = [];
|
|
|
|
|
let query = {
|
|
|
|
|
platformId: platformId
|
|
|
|
|
};
|
|
|
|
|
getTargetActions(query).then((res) => {
|
|
|
|
|
this.targetActions = res.data.list || [];
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error("获取自助平台单据类型失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getLocalBussinessType() {
|
|
|
|
|
let tQuery = {};
|
|
|
|
|
getBusTypeByUser(tQuery).then((res) => {
|
|
|
|
|
this.bussinessTypes = res.data.list || [];
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取往来单位集合
|
|
|
|
|
formSubmit() {
|
|
|
|
|
this.$refs["editQuery"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.editType == 0) {
|
|
|
|
|
addUnit(this.editQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "添加成功"
|
|
|
|
|
});
|
|
|
|
|
this.cancelDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
modifyUnit(this.editQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "修改成功"
|
|
|
|
|
});
|
|
|
|
|
this.cancelDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
unbindDialog(row) {
|
|
|
|
|
this.$confirm("此操作将解除绑定, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.editType = 2;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editLogin = row;
|
|
|
|
|
this.editDialogVisible = true;
|
|
|
|
|
this.getUnitMaintain();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
this.getLocalBussinessType();
|
|
|
|
|
this.getTargetActions(row.platformId);
|
|
|
|
|
this.loading = true;
|
|
|
|
|
console.log(row)
|
|
|
|
|
let query = {
|
|
|
|
|
corpId: row.id
|
|
|
|
|
};
|
|
|
|
|
unbindPlatform(query).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message.success("解绑成功");
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message.error("解绑失败");
|
|
|
|
|
});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.editType = 2;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editLogin = row;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleAddClick() {
|
|
|
|
|
this.editType = 0;
|
|
|
|
|
this.editLoginVisible = true;
|
|
|
|
|
this.editDialogVisible = false;
|
|
|
|
|
},
|
|
|
|
|
linkSubmit() {
|
|
|
|
|
//判断此用户是否已经添加过
|
|
|
|
|
let corpId = this.editLogin.corpName;
|
|
|
|
|
if (!this.editDialogVisible) {
|
|
|
|
|
let corpNameTemp = null;
|
|
|
|
|
this.corpNamesList.forEach(item => {
|
|
|
|
|
if (item.id == this.editLogin.corpName) {
|
|
|
|
|
corpNameTemp = item.name;
|
|
|
|
|
corpId = item.id;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//清空表单数据
|
|
|
|
|
this.editLogin = {
|
|
|
|
|
id: null,
|
|
|
|
|
corpName: null,
|
|
|
|
|
platformId: null,
|
|
|
|
|
platformUsername: null,
|
|
|
|
|
platformPassword: null,
|
|
|
|
|
appid: null,
|
|
|
|
|
appKey: null,
|
|
|
|
|
sceretKey: null,
|
|
|
|
|
sourceAction: null,
|
|
|
|
|
targetAction: null
|
|
|
|
|
};
|
|
|
|
|
this.getLocalBussinessType();
|
|
|
|
|
this.getUnitMaintain();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
},
|
|
|
|
|
change() {
|
|
|
|
|
},
|
|
|
|
|
getUnitMaintain() {
|
|
|
|
|
let unitQuery = {
|
|
|
|
|
customerId: this.$store.getters.customerId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
getUnitMaintain(unitQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.corpNamesList = response.data.list || [];
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取自助平台数据
|
|
|
|
|
getPlatformList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getPlatform().then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.platformList = response.data.list || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.platformList = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
intentPlatform(value) {
|
|
|
|
|
this.editPlatfromQuery.id = value;
|
|
|
|
|
//拉取对应平台的单据类型
|
|
|
|
|
this.getTargetActions(value);
|
|
|
|
|
},
|
|
|
|
|
getTargetActions(platformId) {
|
|
|
|
|
this.targetActions = [];
|
|
|
|
|
let query = {
|
|
|
|
|
platformId: platformId
|
|
|
|
|
};
|
|
|
|
|
getTargetActions(query).then((res) => {
|
|
|
|
|
this.targetActions = res.data.list || [];
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error("获取自助平台单据类型失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getLocalBussinessType() {
|
|
|
|
|
let tQuery = {};
|
|
|
|
|
getBusTypeByUser(tQuery).then((res) => {
|
|
|
|
|
this.bussinessTypes = res.data.list || [];
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取往来单位集合
|
|
|
|
|
formSubmit() {
|
|
|
|
|
this.$refs["editQuery"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.editType == 0) {
|
|
|
|
|
addUnit(this.editQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "添加成功"
|
|
|
|
|
});
|
|
|
|
|
this.cancelDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
modifyUnit(this.editQuery)
|
|
|
|
|
let flag = false;
|
|
|
|
|
//此时为添加
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
if (item.corpName == corpNameTemp) {
|
|
|
|
|
flag = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
this.$message.error('“' + corpNameTemp + '”' + " 已经关联");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
let corpNameTemp = null;
|
|
|
|
|
this.corpNamesList.forEach(item => {
|
|
|
|
|
if (item.name == this.editLogin.corpName) {
|
|
|
|
|
corpNameTemp = item.name;
|
|
|
|
|
corpId = item.id;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$refs["editLogin"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.editLogin.id = corpId;
|
|
|
|
|
linkPlatform(this.editLogin)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "修改成功"
|
|
|
|
|
message: "关联成功"
|
|
|
|
|
});
|
|
|
|
|
this.cancelDialog();
|
|
|
|
|
} else {
|
|
|
|
@ -477,70 +542,25 @@ export default {
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
unbindDialog(row) {
|
|
|
|
|
this.$confirm("此操作将解除绑定, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
console.log(row)
|
|
|
|
|
let query = {
|
|
|
|
|
corpId: row.id
|
|
|
|
|
};
|
|
|
|
|
unbindPlatform(query).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message.success("解绑成功");
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message.error("解绑失败");
|
|
|
|
|
});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
linkSubmit() {
|
|
|
|
|
this.$refs["editLogin"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.editLogin.id = this.editLogin.corpName;
|
|
|
|
|
linkPlatform(this.editLogin)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "关联成功"
|
|
|
|
|
});
|
|
|
|
|
this.cancelDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
exportTxt() {
|
|
|
|
|
},
|
|
|
|
|
exportTxt() {
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.query.page = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.query.page = val;
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getPlatformList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|