|
|
@@ -25,12 +25,12 @@
|
|
|
关联人员列表
|
|
|
</h3>
|
|
|
<div style="margin-bottom: 10px">
|
|
|
- <el-button
|
|
|
- @click="openSelect"
|
|
|
+ <el-button v-if="userSource === 1"
|
|
|
+ @click="openSelect"
|
|
|
><span class="requiredlabel">选择关联人员</span></el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- @click="deleteSelected"
|
|
|
+ @click="deleteSelected"
|
|
|
>批量删除</el-button
|
|
|
>
|
|
|
</div>
|
|
|
@@ -60,16 +60,31 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="subUserRoleNames"
|
|
|
+ prop="roleNames"
|
|
|
label="角色"
|
|
|
width="300px"
|
|
|
align="center"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="associated"
|
|
|
+ label="关联关系"
|
|
|
+ width="300px"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
+ <template slot-scope="r">
|
|
|
+ {{
|
|
|
+ r.row.associated == 1
|
|
|
+ ? "被关联"
|
|
|
+ : "关联"
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template v-slot="{ row }">
|
|
|
- <el-button
|
|
|
+ <el-button
|
|
|
type="text"
|
|
|
@click="removeRow(row)"
|
|
|
>删除</el-button
|
|
|
@@ -113,6 +128,7 @@ export default {
|
|
|
selectedRows:[],
|
|
|
searchUserPrap:{ source:0},
|
|
|
|
|
|
+ userSource: 0,
|
|
|
//基础信息key
|
|
|
infoKeys: [
|
|
|
{ label: '用户名称', key: 'username' },
|
|
|
@@ -143,7 +159,7 @@ export default {
|
|
|
total: 0,
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
+ computed: {
|
|
|
},
|
|
|
created() {
|
|
|
},
|
|
|
@@ -155,8 +171,8 @@ export default {
|
|
|
},
|
|
|
async show(id, other = {}) {
|
|
|
this.userId=id;
|
|
|
- this.tableData=[];
|
|
|
- await this.getInfo(id, other);
|
|
|
+ this.tableData=[];
|
|
|
+ await this.getInfo(id, other);
|
|
|
this.isShow = true;
|
|
|
},
|
|
|
getInfo(userId) {
|
|
|
@@ -170,6 +186,7 @@ export default {
|
|
|
this.roleName = data.roleName;
|
|
|
this.sex = data.sex;
|
|
|
this.status = data.status;
|
|
|
+ this.userSource = data.source;
|
|
|
});
|
|
|
getUserMapper(userId).then((data) => {
|
|
|
if (!data.data) return;
|
|
|
@@ -199,7 +216,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
// this.tableData = this.tableData.filter((d) => selectedIds.includes(d.id));
|
|
|
-
|
|
|
+
|
|
|
// 一个机构下人只能关联一个自建账号
|
|
|
for (let i = 0; i < selectList.length; i++) {
|
|
|
let item = selectList[i];
|
|
|
@@ -214,7 +231,7 @@ export default {
|
|
|
subUserOrgId: item.orgId,
|
|
|
subUserOrgName: item.orgName,
|
|
|
subUserAccount: item.userName,
|
|
|
- subUserRoleNames: item.roleNames,
|
|
|
+ roleNames: item.roleNames,
|
|
|
};
|
|
|
this.tableData.push(tem);
|
|
|
// console.log(tem,"tem")
|
|
|
@@ -249,7 +266,8 @@ export default {
|
|
|
this.tableData.map((item) => item.subUserId);
|
|
|
let data = {
|
|
|
masterUserId: this.userId,
|
|
|
- mapperUserIds: this.tableData && this.tableData.length>0 ? this.tableData.map((item) => item.subUserId):[]
|
|
|
+ mapperUserIds: this.tableData && this.tableData.length>0 ? this.tableData.map((item) => item.subUserId):[],
|
|
|
+ userSource: this.userSource
|
|
|
}
|
|
|
updateUserMapper(data).then((response) => {
|
|
|
this.$modal.msgSuccess("关联成功");
|
|
|
@@ -260,9 +278,9 @@ export default {
|
|
|
onClose()
|
|
|
{
|
|
|
this.userId=null;
|
|
|
- this.tableData=[];
|
|
|
- this.isShow=false;
|
|
|
- }
|
|
|
+ this.tableData=[];
|
|
|
+ this.isShow=false;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|