Commit 33965f4b authored by 沈翠玲's avatar 沈翠玲

检测模版 检测种类

parent f0ca3fe9
...@@ -370,7 +370,6 @@ export default { ...@@ -370,7 +370,6 @@ export default {
this.reset(); this.reset();
const templateId = row.id || this.ids const templateId = row.id || this.ids
getQctemplate(templateId).then(response => { getQctemplate(templateId).then(response => {
debugger;
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改检测模板"; this.title = "修改检测模板";
...@@ -380,15 +379,21 @@ export default { ...@@ -380,15 +379,21 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
const params = JSON.parse(JSON.stringify(this.form))
if (params.qcType === 'IQC') {
params.qcTypesParam = null
} else {
if (!params.qcTypesParam || params.qcTypesParam.length === 0) return this.$message.warning('检测种类必选')
}
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateQctemplate(this.form).then(response => { updateQctemplate(params).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addQctemplate(this.form).then(response => { addQctemplate(params).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment