|
|
|
@ -164,7 +164,26 @@ |
|
|
|
|
Train.getCaseDetail({id: this.dataForm.id}).then((res) => { |
|
|
|
|
this.dataForm = res.data; |
|
|
|
|
// 下拉框标签回显问题 |
|
|
|
|
this.dataForm.type = String(res.type); |
|
|
|
|
this.dataForm.type = String(res.data.type); |
|
|
|
|
// 下拉框标签回显问题 |
|
|
|
|
this.dataForm.taskList = res.data.taskList; |
|
|
|
|
this.dataForm.taskList.forEach(item => { |
|
|
|
|
item.taskOperate = String(item.taskOperate) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//右侧指标显示问题 |
|
|
|
|
this.rightTargetList = this.dataForm.taskList;//taskList 会跟着 rightTargetList 变化 |
|
|
|
|
//左侧字典指标显示问题 |
|
|
|
|
this.rightTargetList.forEach(rItem => { |
|
|
|
|
let index = this.leftDictTargetList.findIndex(lItem => { |
|
|
|
|
if(rItem.id == lItem.id){ |
|
|
|
|
this.$set(rItem,"seq",lItem.seq); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.leftDictTargetList.splice(index, 1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (this.$route.query.isEdit === 1) { |
|
|
|
|
// 编辑 |
|
|
|
|
this.formAction = 1; |
|
|
|
@ -343,18 +362,30 @@ |
|
|
|
|
// if (self.formAction == 0 && self.$store.state.app.user.userType) { |
|
|
|
|
// self.dataForm.isAdmin = self.$store.state.app.user.userType == 1 ? 0 : 1; |
|
|
|
|
// } |
|
|
|
|
Train.insertCase(self.dataForm).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
// self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
|
self.formAction = 1; |
|
|
|
|
self.$message.success("操作成功!"); |
|
|
|
|
self.goBackList(); |
|
|
|
|
} else { |
|
|
|
|
self.$message.error(res.msg); |
|
|
|
|
} |
|
|
|
|
}).catch(error => { |
|
|
|
|
self.$message.error(error); |
|
|
|
|
}); |
|
|
|
|
if(this.formAction == 0){//新增 |
|
|
|
|
Train.insertCase(self.dataForm).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
// self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
|
self.$message.success("操作成功!"); |
|
|
|
|
self.goBackList(); |
|
|
|
|
} else { |
|
|
|
|
self.$message.error(res.msg); |
|
|
|
|
} |
|
|
|
|
}).catch(error => { |
|
|
|
|
self.$message.error(error); |
|
|
|
|
}); |
|
|
|
|
}else if(this.formAction == 1){//编辑 |
|
|
|
|
Train.updateCase(self.dataForm).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
self.$message.success("操作成功!"); |
|
|
|
|
self.goBackList(); |
|
|
|
|
} else { |
|
|
|
|
self.$message.error(res.msg); |
|
|
|
|
} |
|
|
|
|
}).catch(error => { |
|
|
|
|
self.$message.error(error); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
self.$message.error('系统输入验证失败!'); |
|
|
|
|
return false; |
|
|
|
|