|
@ -701,36 +701,48 @@ export default { |
|
|
}, 30); |
|
|
}, 30); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
submit(reset) { |
|
|
submit(reset, endXc = false) { |
|
|
console.log("提交表单 >>>> ", this.formData); |
|
|
console.log("提交表单 >>>> ", this.formData); |
|
|
return new Promise((r, j) => { |
|
|
return new Promise((r, j) => { |
|
|
this.$refs.formRef.validate((valid) => { |
|
|
this.$refs.formRef.validate((valid) => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
this.items?.forEach((v) => { |
|
|
// 二次确认 |
|
|
if (v.hasProblem != "1") { |
|
|
this.$confirm(`确认提交吗?`, "提示", { |
|
|
v.problem = ""; |
|
|
confirmButtonText: "确定", |
|
|
v.problemImages = []; |
|
|
cancelButtonText: "取消", |
|
|
} |
|
|
type: "warning", |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
(this.id ? updateRecordData : addRecordData)({ |
|
|
|
|
|
id: this.id || null, |
|
|
|
|
|
...this.formData, |
|
|
|
|
|
items: this.items, |
|
|
|
|
|
startDate: this.xcDateArr[0] || "", |
|
|
|
|
|
endDate: this.xcDateArr[1] || "", |
|
|
|
|
|
subPlanStartDate: this.subPlanDateArr[0] || "", |
|
|
|
|
|
subPlanEndDate: this.subPlanDateArr[1] || "", |
|
|
|
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then(() => { |
|
|
this.$message.success("提交成功"); |
|
|
this.items?.forEach((v) => { |
|
|
if (reset) { |
|
|
if (v.hasProblem != "1") { |
|
|
this.reset(); |
|
|
v.problem = ""; |
|
|
} |
|
|
v.problemImages = []; |
|
|
r(); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
(this.id ? updateRecordData : addRecordData)({ |
|
|
|
|
|
id: this.id || null, |
|
|
|
|
|
...this.formData, |
|
|
|
|
|
items: this.items, |
|
|
|
|
|
startDate: this.xcDateArr[0] || "", |
|
|
|
|
|
endDate: this.xcDateArr[1] || "", |
|
|
|
|
|
subPlanStartDate: this.subPlanDateArr[0] || "", |
|
|
|
|
|
subPlanEndDate: this.subPlanDateArr[1] || "", |
|
|
|
|
|
status: endXc ? "1" : "0", |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
this.$message.success("提交成功"); |
|
|
|
|
|
if (reset) { |
|
|
|
|
|
this.reset(); |
|
|
|
|
|
} |
|
|
|
|
|
r(); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((e) => { |
|
|
|
|
|
console.log("err >>>>> ", e); |
|
|
|
|
|
j(); |
|
|
|
|
|
}); |
|
|
}) |
|
|
}) |
|
|
.catch((e) => { |
|
|
.catch(() => { |
|
|
console.log("err >>>>> ", e); |
|
|
|
|
|
j(); |
|
|
j(); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|