|
@@ -796,8 +796,7 @@ export default {
|
|
|
try {
|
|
try {
|
|
|
const res = await getById(id);
|
|
const res = await getById(id);
|
|
|
console.log('res----------', res);
|
|
console.log('res----------', res);
|
|
|
- this.addForm = res.data;
|
|
|
|
|
- this.addForm.id = res.data.planId;
|
|
|
|
|
|
|
+ const data = res.data;
|
|
|
// if (this.dialogTitle === '派单') {
|
|
// if (this.dialogTitle === '派单') {
|
|
|
// this.addForm.autoOrder = 1;
|
|
// this.addForm.autoOrder = 1;
|
|
|
// }
|
|
// }
|
|
@@ -829,22 +828,22 @@ export default {
|
|
|
console.log(this.ruleIdList);
|
|
console.log(this.ruleIdList);
|
|
|
|
|
|
|
|
// 处理回显数据
|
|
// 处理回显数据
|
|
|
- if (this.addForm.executeUserType === 0) {
|
|
|
|
|
|
|
+ if (data.executeUserType === 0) {
|
|
|
// 个人
|
|
// 个人
|
|
|
- this.addForm.executeIdList = this.addForm.executeUsers.map(
|
|
|
|
|
|
|
+ data.executeIdList = data.executeUsers.map(
|
|
|
(item) => item.userId
|
|
(item) => item.userId
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let groupIds = this.addForm.executeUsers
|
|
|
|
|
|
|
+ let groupIds = data.executeUsers
|
|
|
.map((i) => i.groupId)
|
|
.map((i) => i.groupId)
|
|
|
.filter((i) => i);
|
|
.filter((i) => i);
|
|
|
groupIds = Array.from(new Set(groupIds));
|
|
groupIds = Array.from(new Set(groupIds));
|
|
|
|
|
|
|
|
if (groupIds.includes('1')) {
|
|
if (groupIds.includes('1')) {
|
|
|
// 包含全部部门,置空
|
|
// 包含全部部门,置空
|
|
|
- this.addForm.groupId = '1';
|
|
|
|
|
|
|
+ data.groupId = '1';
|
|
|
} else {
|
|
} else {
|
|
|
- this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '1';
|
|
|
|
|
|
|
+ data.groupId = data.executeUsers[0]?.groupId || '1';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
groupIds.map((item) => {
|
|
groupIds.map((item) => {
|
|
@@ -852,11 +851,16 @@ export default {
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
// 班组
|
|
// 班组
|
|
|
- this.addForm.teamId = this.addForm.executeUsers?.[0]?.teamId || '';
|
|
|
|
|
|
|
+ data.teamId = data.executeUsers?.[0]?.teamId || '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.tabsValue = this.ruleIdList[0].ruleId;
|
|
this.tabsValue = this.ruleIdList[0].ruleId;
|
|
|
|
|
|
|
|
|
|
+ // this.addForm = res.data;
|
|
|
|
|
+ // this.addForm.id = res.data.planId;
|
|
|
|
|
+ this.$set(this, 'addForm', data);
|
|
|
|
|
+ this.$set(this.addForm, 'id', data.planId);
|
|
|
|
|
+
|
|
|
// this._getMatterRulesDetails(res.ruleId);
|
|
// this._getMatterRulesDetails(res.ruleId);
|
|
|
this.$set(this.addForm, 'code', res.data.code);
|
|
this.$set(this.addForm, 'code', res.data.code);
|
|
|
this.$set(this.addForm, 'urgent', JSON.stringify(res.data.urgent));
|
|
this.$set(this.addForm, 'urgent', JSON.stringify(res.data.urgent));
|
|
@@ -888,11 +892,20 @@ export default {
|
|
|
console.log(error);
|
|
console.log(error);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- typeChange() {
|
|
|
|
|
- this.addForm.groupId = '';
|
|
|
|
|
- this.addForm.executeIdList = [];
|
|
|
|
|
- this.addForm.teamId = '';
|
|
|
|
|
- this.addForm.executorId = [];
|
|
|
|
|
|
|
+ typeChange(v) {
|
|
|
|
|
+ console.log('typeChange', v, this.addForm.executeIdList);
|
|
|
|
|
+ // this.addForm.groupId = '';
|
|
|
|
|
+ // this.addForm.executeIdList = [];
|
|
|
|
|
+ // this.addForm.teamId = '';
|
|
|
|
|
+ // this.addForm.executeUsers = [];
|
|
|
|
|
+ this.$set(this.addForm, 'executeUsers', []);
|
|
|
|
|
+ if(v == 0) {
|
|
|
|
|
+ this.$set(this.addForm, 'groupId', '');
|
|
|
|
|
+ this.$set(this.addForm, 'executeIdList', []);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$set(this.addForm, 'teamId', '');
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
},
|
|
|
// 获取设备分类数据
|
|
// 获取设备分类数据
|
|
|
async categoryEquipment(id) {
|
|
async categoryEquipment(id) {
|