|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2022-02-10 14:49:20
|
|
|
- * @LastEditTime: 2022-02-10 17:18:44
|
|
|
+ * @LastEditTime: 2022-02-11 10:34:04
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: 编辑职员
|
|
|
* @FilePath: \Foshan4A4.0\src\views\staffManagement\compontents\staffEdit.vue
|
|
@@ -38,12 +38,12 @@
|
|
|
</div>
|
|
|
<div class="power-content flex-wrap">
|
|
|
<div class="r24 flex1 part">
|
|
|
- <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @getTreeindex="getTreeindex" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :checkBoxList="checkBoxList" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
|
|
|
+ <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
|
|
|
</div>
|
|
|
<!--开启多对多-->
|
|
|
<template v-if="OpenAuthData">
|
|
|
<div class="flex1 part">
|
|
|
- <Rolelist @checkChange="checkChange" :checkBoxList="roleCheckBoxs" :roleType="roleType" :active="true" class="hucRole" :number="4" title="账号列表" />
|
|
|
+ <Rolelist @checkChange="accountChange" :checkBoxList="checkBoxList" :roleType="roleType" :active="true" class="hucRole" :number="4" title="账号列表" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<!--未开启多对多-->
|
|
@@ -210,6 +210,20 @@ export default {
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
|
+ mainData: {
|
|
|
+ handler (arr) {
|
|
|
+ if (this.radioCheck) {
|
|
|
+ let ids = null;
|
|
|
+ arr.forEach((item, index) => {
|
|
|
+ if (item.JobId == this.radioCheck) {
|
|
|
+ ids = index;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.radioNum = ids;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
},
|
|
|
created () {
|
|
|
const { OrganId, Status, OfficerId } = this.$route.query;
|
|
@@ -308,7 +322,7 @@ export default {
|
|
|
UserList.forEach(item => {
|
|
|
datas.push(item.UserId);
|
|
|
})
|
|
|
- this.roleCheckBoxs = datas;
|
|
|
+ this.checkBoxList = datas;
|
|
|
}
|
|
|
this.checkedList = TacList;
|
|
|
this.loginCheckBoxs = TacList;
|
|
@@ -344,6 +358,7 @@ export default {
|
|
|
//获取组织选中的数据
|
|
|
getOrgan (arr) {
|
|
|
const { OrganId } = arr[0];
|
|
|
+ this.AppId = OrganId;
|
|
|
this.getJobListByOrgan(OrganId);
|
|
|
},
|
|
|
//获取指定数据
|
|
@@ -362,13 +377,11 @@ export default {
|
|
|
arr.push(obj);
|
|
|
this.$store.dispatch("auth/changeAuthArrs", arr);
|
|
|
},
|
|
|
- //岗位选择
|
|
|
- getTreeindex (index) {
|
|
|
- console.log(index)
|
|
|
- },
|
|
|
//根据主岗查询角色
|
|
|
radioChange (val) {
|
|
|
- console.log(val)
|
|
|
+ const { JobId } = this.mainData[val];
|
|
|
+ this.JobId = JobId;
|
|
|
+ this.radioCheck = null;
|
|
|
},
|
|
|
//根据岗位获取角色
|
|
|
async getRoleByJob (id, index) {
|
|
@@ -413,19 +426,9 @@ export default {
|
|
|
const res = await organgitpost(params);
|
|
|
if (res.code === 0) {
|
|
|
const datas = res.returnData;
|
|
|
- if (this.orgTypes.length < 2) {
|
|
|
- datas.forEach((item, index) => {
|
|
|
- item.name = item.JobName;
|
|
|
- if (item.JobId == this.radioCheck) {
|
|
|
- this.radioNum = index;
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.radioCheck = null;
|
|
|
- datas.forEach((item) => {
|
|
|
- item.name = item.JobName;
|
|
|
- });
|
|
|
- }
|
|
|
+ datas.forEach((item) => {
|
|
|
+ item.name = item.JobName;
|
|
|
+ });
|
|
|
this.mainData = datas;
|
|
|
} else {
|
|
|
this.$message.error(res.message);
|
|
@@ -458,6 +461,10 @@ export default {
|
|
|
console.log("出错了", error);
|
|
|
}
|
|
|
},
|
|
|
+ //账号列表选取
|
|
|
+ accountChange (arr) {
|
|
|
+ this.checkBoxList = arr;
|
|
|
+ },
|
|
|
//角色选取
|
|
|
checkChange (arr) {
|
|
|
const datas = [];
|
|
@@ -499,10 +506,6 @@ export default {
|
|
|
this.$message.error("请选中一个组织后再新增");
|
|
|
return false;
|
|
|
}
|
|
|
- if (!this.radioCheck && this.lessChecksData.length > 1) {
|
|
|
- this.$message.error("已选择副岗,请选中一个主岗后再新增");
|
|
|
- return false;
|
|
|
- }
|
|
|
} else {
|
|
|
this.AppId = this.oldOrganId
|
|
|
}
|
|
@@ -533,6 +536,7 @@ export default {
|
|
|
Status: Number(this.Status),
|
|
|
OrganId: this.AppId,
|
|
|
OfficerId: this.OfficerId,
|
|
|
+ UserList: this.checkBoxList
|
|
|
});
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success(res.message);
|