Browse Source

newProj.vue 修正查询员工通讯录返回的结果

master
unknown 4 years ago
parent
commit
41e1e84e2a
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      src/views/components_web/newProj/newProj.vue

+ 8
- 8
src/views/components_web/newProj/newProj.vue View File

@@ -453,9 +453,9 @@
<span class="quanxuanbtn"> <span class="quanxuanbtn">
<el-checkbox class="checkBoxCol" v-model="dept.disabled" :key="group_index" @change="handleCheckItemAll(group_index,$event)">全选</el-checkbox> <el-checkbox class="checkBoxCol" v-model="dept.disabled" :key="group_index" @change="handleCheckItemAll(group_index,$event)">全选</el-checkbox>
</span> </span>
<span class="btnlabelTitle">{{dept.data.deptName}} </span>
<span class="btnlabelTitle">{{dept.deptName}} </span>
</template> </template>
<div class="user_info_item" v-for="(user,index) in listUserComputed(dept)" :label="user"
<div class="user_info_item" v-for="(user,index) in listUserComputed(dept.listUser)" :label="user"
:key="index"> :key="index">
<el-checkbox class="checkBoxCol" v-model="user.disabled" @change="handleCheckedOne(group_index,user,$event)" <el-checkbox class="checkBoxCol" v-model="user.disabled" @change="handleCheckedOne(group_index,user,$event)"
:disabled="disabled"> :disabled="disabled">
@@ -1008,8 +1008,8 @@
this.isShowManager=false; this.isShowManager=false;
//左侧选中状态根据右侧人员状态改变 //左侧选中状态根据右侧人员状态改变
// this.setFolderPerm(this.newProjData.listFolder[parseInt(index)]); // this.setFolderPerm(this.newProjData.listFolder[parseInt(index)]);
fetchPlainDeptUserList(this.$store.state.currentCompanyId).then(res => {
this.listDept = res[0].children;
fetchPlainDeptUserList(this.$store.state.currentCompanyId).then(list => {
this.listDept = list;
// this.$nextTick(() => { // this.$nextTick(() => {
// this.listDept = res[0].children//是一个包含公司部门的对象数组 每一个对象里面有具体的数据 // this.listDept = res[0].children//是一个包含公司部门的对象数组 每一个对象里面有具体的数据
// this.listDept = [...this.listDept]; // this.listDept = [...this.listDept];
@@ -1621,18 +1621,18 @@
]); ]);
const deptHeadList = treeDeptList[0].children || []; const deptHeadList = treeDeptList[0].children || [];
const oList = plainTreeNodes(deptHeadList, userList); const oList = plainTreeNodes(deptHeadList, userList);
return oList;
return oList.filter(dept => dept.listUser && dept.listUser.length);
} }
function plainTreeNodes(nodesList, userList, outputList = []) { function plainTreeNodes(nodesList, userList, outputList = []) {
(nodesList || []).forEach(node => { (nodesList || []).forEach(node => {
// node.id // node.id
node.listUser = userList.filter(user => user.deptId === node.id);
outputList.push(node);
const data = node.data;
data.listUser = userList.filter(user => user.deptId === node.id);
outputList.push(data);
if(node.children && node.children.length) { if(node.children && node.children.length) {
plainTreeNodes(node.children, userList, outputList); plainTreeNodes(node.children, userList, outputList);
} }
delete node.children;
}) })
return outputList; return outputList;
} }


Loading…
Cancel
Save