|
@@ -25,10 +25,12 @@
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
<el-select
|
|
<el-select
|
|
|
- v-model="form.userId"
|
|
|
|
|
|
|
+ v-model="selectId"
|
|
|
clearable
|
|
clearable
|
|
|
|
|
+ multiple
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
:filterable="true"
|
|
:filterable="true"
|
|
|
|
|
+ @change="handleUserChange"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in userOptions"
|
|
v-for="item in userOptions"
|
|
@@ -155,10 +157,13 @@
|
|
|
return {
|
|
return {
|
|
|
form: {
|
|
form: {
|
|
|
userId: '',
|
|
userId: '',
|
|
|
|
|
+ userName: '',
|
|
|
reason: '',
|
|
reason: '',
|
|
|
- useDeptId: ''
|
|
|
|
|
|
|
+ useDeptId: '',
|
|
|
|
|
+ assignList: []
|
|
|
},
|
|
},
|
|
|
userOptions: [],
|
|
userOptions: [],
|
|
|
|
|
+ selectId: [],
|
|
|
isSaveLoading:false
|
|
isSaveLoading:false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -169,6 +174,26 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleUserChange(val, option){
|
|
|
|
|
+ console.log(val, option, 'val');
|
|
|
|
|
+ // 通过选中的采购员Id数组,获取对应的name数组
|
|
|
|
|
+ if (val && val.length > 0) {
|
|
|
|
|
+ const userNameArray = val.map(userId => {
|
|
|
|
|
+ const user = this.userOptions.find(item => item.id === userId);
|
|
|
|
|
+ return user ? {userId: user.id, userName: user.name} : '';
|
|
|
|
|
+ }).filter(name => name);
|
|
|
|
|
+ // assignList数组
|
|
|
|
|
+ this.form.assignList = [...userNameArray];
|
|
|
|
|
+ this.form.userId = this.form.assignList[0]?.userId || '';
|
|
|
|
|
+ this.form.userName = this.form.assignList[0]?.userName || '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.userId = '';
|
|
|
|
|
+ this.form.userName = '';
|
|
|
|
|
+ this.form.assignList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log('assignList数组:', this.form.assignList);
|
|
|
|
|
+ },
|
|
|
/** 处理转办审批人 */
|
|
/** 处理转办审批人 */
|
|
|
handleUpdateAssignee() {
|
|
handleUpdateAssignee() {
|
|
|
this.$emit('handleUpdateAssignee');
|
|
this.$emit('handleUpdateAssignee');
|
|
@@ -217,9 +242,10 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async handleAudit(status) {
|
|
async handleAudit(status) {
|
|
|
- let userInfo = this.userOptions.find(
|
|
|
|
|
- (item) => item.id == this.form.userId
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ // let userInfo = this.userOptions.find(
|
|
|
|
|
+ // (item) => item.id == this.form.userId
|
|
|
|
|
+ // );
|
|
|
|
|
+ console.log(this.form)
|
|
|
//主管指派采购员
|
|
//主管指派采购员
|
|
|
if (this.taskDefinitionKey === 'deptLeaderAssign') {
|
|
if (this.taskDefinitionKey === 'deptLeaderAssign') {
|
|
|
if (!this.form.userId) {
|
|
if (!this.form.userId) {
|
|
@@ -227,8 +253,9 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
await assign({
|
|
await assign({
|
|
|
- userId: userInfo.id,
|
|
|
|
|
- userName: userInfo.name,
|
|
|
|
|
|
|
+ userId: this.form.userId,
|
|
|
|
|
+ userName: this.form.userName,
|
|
|
|
|
+ assignList: this.form.assignList,
|
|
|
id: this.taskId,
|
|
id: this.taskId,
|
|
|
reason: this.form.reason,
|
|
reason: this.form.reason,
|
|
|
businessId: this.businessId
|
|
businessId: this.businessId
|
|
@@ -247,7 +274,7 @@
|
|
|
id: this.taskId,
|
|
id: this.taskId,
|
|
|
reason: this.form.reason,
|
|
reason: this.form.reason,
|
|
|
variables: {
|
|
variables: {
|
|
|
- userId: userInfo?.id,
|
|
|
|
|
|
|
+ userId: this.form.userId,
|
|
|
pass: !!status
|
|
pass: !!status
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|