fix: 流程部门、用户选择显示完善

main
wx-jincw 2 weeks ago
parent fca31bb136
commit 09ce747ead

@ -280,6 +280,13 @@ export default {
if (!val) return;
this.checkedKeys = val;
this.initCheckedData();
},
data() {
this.initCheckedData();
this.$nextTick(() => {
this.handleCheckChange();
});
}
}
};

@ -39,7 +39,7 @@
multiple
clearable
checkStrictly
nodeKey="id"
node-key="deptId"
:checkedKeys="deptIds"
@change="checkedDeptChange">
</tree-select>
@ -90,6 +90,7 @@
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="deptId"
default-expand-all
@node-click="handleNodeClick"
/>
@ -99,8 +100,12 @@
<el-col :span="17">
<el-table ref="multipleTable" height="600" :data="userTableList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户名" align="center" prop="nickName" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
<el-table-column label="用户名" align="center" prop="realName" />
<el-table-column label="部门" align="center" prop="deptNames" >
<template slot-scope="scope">
{{scope.row.deptNames ? scope.row.deptNames.join('、') : '-'}}
</template>
</el-table-column>
</el-table>
<pagination
:total="userTotal"
@ -157,7 +162,7 @@ export default {
deptOptions: [],
deptProps: {
children: "children",
label: "label"
label: "deptName"
},
deptTempOptions: [],
userTableList: [],
@ -268,7 +273,7 @@ export default {
getDeptTreeData() {
function refactorTree(data) {
return data.map(node => {
let treeData = { id: `DEPT${node.id}`, label: node.label, parentId: node.parentId, weight: node.weight };
let treeData = { deptId: `DEPT${node.deptId}`, deptName: node.deptName, parentId: node.parentId, weight: node.weight };
if (node.children && node.children.length > 0) {
treeData.children = refactorTree(node.children);
}
@ -306,11 +311,11 @@ export default {
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.deptName.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.queryParams.deptId = data.deptId;
this.getUserList();
},
//
@ -334,18 +339,18 @@ export default {
return;
}
userTaskForm.dataType = 'USERS';
this.selectedUser.text = this.selectedUserDate.map(k => k.nickName) || [];
this.selectedUser.text = this.selectedUserDate.map(k => k.realName) || [];
if (this.selectedUserDate.length === 1) {
let data = this.selectedUserDate[0];
userTaskForm.assignee = data.userId;
userTaskForm.text = data.nickName;
userTaskForm.assignee = data.id;
userTaskForm.text = data.realName;
userTaskForm.candidateUsers = null;
this.showMultiFlog = false;
this.multiLoopType = 'Null';
this.changeMultiLoopType();
} else {
userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.userId).join() || null;
userTaskForm.text = this.selectedUserDate.map(k => k.nickName).join() || null;
userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.id).join() || null;
userTaskForm.text = this.selectedUserDate.map(k => k.realName).join() || null;
userTaskForm.assignee = null;
this.showMultiFlog = true;
}
@ -386,12 +391,12 @@ export default {
if(temp.children) {
stark = temp.children.concat(stark);
}
if(id === temp.id) {
if(id === temp.deptId) {
textArr.push(temp);
}
}
})
text = textArr?.map(k => k.label).join() || null;
text = textArr?.map(k => k.deptName).join() || null;
} else {
userTaskForm.dataType = null;
this.multiLoopType = 'Null';
@ -442,12 +447,12 @@ export default {
if(temp.children) {
stark = temp.children.concat(stark);
}
if(id === temp.id) {
if(id === temp.deptId) {
textArr.push(temp);
}
}
})
userTaskForm.text = textArr?.map(k => k.label).join() || null;
userTaskForm.text = textArr?.map(k => k.deptName).join() || null;
}
} else if (val === 'INITIATOR') {
userTaskForm.assignee = "${initiator}";

@ -28,7 +28,7 @@
closable
:disable-transitions="false"
@close="handleClose('copy', item)">
{{ item.nickName }}
{{ item.realName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectCopyUsers" />
</el-form-item>
@ -39,7 +39,7 @@
closable
:disable-transitions="false"
@close="handleClose('next', item)">
{{ item.nickName }}
{{ item.realName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectNextUsers" />
</el-form-item>
@ -161,6 +161,7 @@
:props="deptProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
node-key="deptId"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
@ -180,7 +181,7 @@
<el-table-column v-if="userData.type === 'copy' || userData.type === 'next'" width="55" type="selection" />
<el-table-column v-else width="30">
<template slot-scope="scope">
<el-radio :label="scope.row.userId" v-model="currentUserId">{{''}}</el-radio>
<el-radio :label="scope.row.id" v-model="currentUserId">{{''}}</el-radio>
</template>
</el-table-column>
<el-table-column label="用户名" align="center" prop="nickName" />
@ -271,7 +272,7 @@ export default {
userList: null,
deptProps: {
children: "children",
label: "label"
label: "deptName"
},
//
queryParams: {
@ -352,7 +353,7 @@ export default {
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.queryParams.deptId = data.deptId;
this.getList();
},
setIcon(val) {
@ -377,7 +378,7 @@ export default {
if (selection && selection.length > 0) {
this.$nextTick(()=> {
selection.forEach(item => {
let row = this.userList.find(k => k.userId === item.userId);
let row = this.userList.find(k => k.id === item.id);
this.$refs.userTable.toggleRowSelection(row);
})
})
@ -389,7 +390,7 @@ export default {
},
//
handleClose(type, tag) {
let userObj = this.userMultipleSelection.find(item => item.userId === tag.id);
let userObj = this.userMultipleSelection.find(item => item.id === tag.id);
this.userMultipleSelection.splice(this.userMultipleSelection.indexOf(userObj), 1);
if (type === 'copy') {
this.copyUser = this.userMultipleSelection;
@ -516,7 +517,7 @@ export default {
});
},
changeCurrentUser(val) {
this.currentUserId = val.userId
this.currentUserId = val.id
},
/** 返回页面 */
goBack() {
@ -553,7 +554,7 @@ export default {
this.$modal.msgError("请选择用户");
return false;
}
let userIds = this.userMultipleSelection.map(k => k.userId);
let userIds = this.userMultipleSelection.map(k => k.id);
if (type === 'copy') {
// ID
this.copyUser = this.userMultipleSelection;
@ -573,7 +574,7 @@ export default {
this.$modal.msgError("请选择用户");
return false;
}
this.taskForm.userId = this.currentUserId;
this.taskForm.id = this.currentUserId;
if (type === 'delegate') {
delegate(this.taskForm).then(res => {
this.$modal.msgSuccess('操作成功');

Loading…
Cancel
Save