|
|
@@ -234,6 +234,7 @@
|
|
|
v-model="form.taskId"
|
|
|
placeholder="请选择"
|
|
|
style="width: 260px"
|
|
|
+ @change="taskListChange"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in pleaseNewStepsList"
|
|
|
@@ -564,20 +565,71 @@
|
|
|
this.attributeData.name = this.taskObj.taskName + '请托';
|
|
|
}
|
|
|
|
|
|
- if (this.chooseType == '2') {
|
|
|
- this.form.pleaseEntrustDeptName = this.$store.state.user.info.groupName;
|
|
|
- this.form.pleaseEntrustDeptId = this.$store.state.user.info.groupId;
|
|
|
- this.form.pleaseEntrustUserName = this.$store.state.user.info.name;
|
|
|
- this.form.pleaseEntrustUserId = this.$store.state.user.info.userId;
|
|
|
+ // if (this.chooseType == '2') {
|
|
|
+ // this.form.pleaseEntrustDeptName = this.$store.state.user.info.groupName;
|
|
|
+ // this.form.pleaseEntrustDeptId = this.$store.state.user.info.groupId;
|
|
|
+ // this.form.pleaseEntrustUserName = this.$store.state.user.info.name;
|
|
|
+ // this.form.pleaseEntrustUserId = this.$store.state.user.info.userId;
|
|
|
+ // const newList = this.workData.list.map((item) => {
|
|
|
+ // const copy = this.deepCopy(item);
|
|
|
+
|
|
|
+ // Object.assign(copy, {
|
|
|
+ // describes: '',
|
|
|
+ // totalCount: copy.formingNum,
|
|
|
+ // taskList: [],
|
|
|
+ // beEntrustedFactoriesId: '',
|
|
|
+ // beEntrustedFactoriesName: '',
|
|
|
+ // status: '',
|
|
|
+ // beEntrustedDeptName: '',
|
|
|
+ // beEntrustedDeptId: '',
|
|
|
+ // measuringUnit: copy.unit,
|
|
|
+ // categoryName: copy.productName,
|
|
|
+ // categoryCode: copy.productCode,
|
|
|
+ // workOrderId: copy.id,
|
|
|
+ // workOrderCode: copy.code,
|
|
|
+ // brandNum: copy.brandNo,
|
|
|
+ // modelType: copy.model,
|
|
|
+ // name: '',
|
|
|
+ // type: '',
|
|
|
+ // planDeliveryTime: copy.startTime,
|
|
|
+ // applyDeptId: this.form.pleaseEntrustDeptId,
|
|
|
+ // applyDeptName: this.form.pleaseEntrustDeptName,
|
|
|
+ // applyFactoriesId: this.form.factoriesId,
|
|
|
+ // applyFactoriesName: this.form.factoriesName
|
|
|
+ // });
|
|
|
+
|
|
|
+ // return copy;
|
|
|
+ // });
|
|
|
+
|
|
|
+ // const data = Object.assign(this.form, newList[0]);
|
|
|
+ // this.form = this.deepCopy(data);
|
|
|
+ // console.log(this.taskObj, '工单数据');
|
|
|
+ // this.form.name = this.taskObj.name
|
|
|
+ // ? this.taskObj.name + '请托'
|
|
|
+ // : this.taskObj.taskTypeName + '请托';
|
|
|
+
|
|
|
+ // this.getTaskInstanceByIdFn(this.workListIds);
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (this.chooseType === '2') {
|
|
|
+ const userInfo = this.$store.state.user.info;
|
|
|
+
|
|
|
+ Object.assign(this.form, {
|
|
|
+ pleaseEntrustDeptName: userInfo.groupName,
|
|
|
+ pleaseEntrustDeptId: userInfo.groupId,
|
|
|
+ pleaseEntrustUserName: userInfo.name,
|
|
|
+ pleaseEntrustUserId: userInfo.userId
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log(this.workData.list, 'form数据');
|
|
|
+
|
|
|
const newList = this.workData.list.map((item) => {
|
|
|
const copy = this.deepCopy(item);
|
|
|
|
|
|
- Object.assign(copy, {
|
|
|
+ const commonData = {
|
|
|
describes: '',
|
|
|
totalCount: copy.formingNum,
|
|
|
taskList: [],
|
|
|
- taskId: '',
|
|
|
- taskName: '',
|
|
|
beEntrustedFactoriesId: '',
|
|
|
beEntrustedFactoriesName: '',
|
|
|
status: '',
|
|
|
@@ -597,20 +649,23 @@
|
|
|
applyDeptName: this.form.pleaseEntrustDeptName,
|
|
|
applyFactoriesId: this.form.factoriesId,
|
|
|
applyFactoriesName: this.form.factoriesName
|
|
|
- });
|
|
|
+ };
|
|
|
+
|
|
|
+ return Object.assign(copy, commonData);
|
|
|
+ });
|
|
|
|
|
|
- return copy;
|
|
|
+ this.form = this.deepCopy({
|
|
|
+ ...this.form,
|
|
|
+ ...newList[0]
|
|
|
});
|
|
|
|
|
|
- const data = Object.assign(this.form, newList[0]);
|
|
|
- this.form = this.deepCopy(data);
|
|
|
+ console.log(this.form, '最终form数据');
|
|
|
+
|
|
|
this.form.name = this.taskObj.name
|
|
|
- ? this.taskObj.name + '请托'
|
|
|
- : this.taskObj.taskTypeName + '请托';
|
|
|
- const taskId = this.taskObj.name
|
|
|
- ? this.taskObj.id
|
|
|
- : this.taskObj.taskId;
|
|
|
- this.getTaskInstanceByIdFn(this.workListIds, taskId);
|
|
|
+ ? `${this.taskObj.name}请托`
|
|
|
+ : `${this.taskObj.taskTypeName}请托`;
|
|
|
+
|
|
|
+ this.getTaskInstanceByIdFn(this.workListIds);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -632,7 +687,9 @@
|
|
|
let { data } = res;
|
|
|
if (data.length) {
|
|
|
data = data.filter((item) => item.taskId != -2);
|
|
|
- let arr = data.findIndex((item) => item.sourceTaskId == taskId);
|
|
|
+ let arr = data.findIndex((item) =>
|
|
|
+ item.name ? item.sourceTaskId : item.taskId == this.form.taskId
|
|
|
+ );
|
|
|
|
|
|
if (arr != -1) {
|
|
|
data.splice(0, arr);
|
|
|
@@ -742,6 +799,14 @@
|
|
|
this.$refs.timeDialogRef.open(this.attributeData, null, false);
|
|
|
},
|
|
|
|
|
|
+ taskListChange() {
|
|
|
+ const data = this.pleaseNewStepsList.filter(
|
|
|
+ (it) => it.taskId == this.form.taskId
|
|
|
+ );
|
|
|
+
|
|
|
+ this.form.taskName = data[0].taskTypeName;
|
|
|
+ },
|
|
|
+
|
|
|
changeTaskId(e) {
|
|
|
console.log(e);
|
|
|
const arr = this.newStepsList.find((item) => item.taskId === e);
|
|
|
@@ -864,6 +929,8 @@
|
|
|
const list = [];
|
|
|
list.push(this.form);
|
|
|
|
|
|
+ console.log(this.form, '最终form数据111111');
|
|
|
+
|
|
|
URL(list)
|
|
|
.then((res) => {
|
|
|
this.loading.close();
|