diff --git a/src/views/modules/researchquality/components/qualityChange-add.vue b/src/views/modules/researchquality/components/qualityChange-add.vue index e7b50ab..f1a98f1 100644 --- a/src/views/modules/researchquality/components/qualityChange-add.vue +++ b/src/views/modules/researchquality/components/qualityChange-add.vue @@ -1,7 +1,7 @@ @@ -34,7 +34,7 @@ - + @@ -250,7 +250,7 @@ export default { this.$nextTick(() => { this.$refs["dataForm"].resetFields(); if (this.dataForm.id) { - this.getInfo(); + this.getInfo() } else { } }); @@ -305,9 +305,6 @@ export default { .catch(() => { }) }, - getProcessList(val) { - console.log(val); - }, // 获取信息 getInfo() { this.$http @@ -324,6 +321,41 @@ export default { .catch(() => {}); }, // 表单提交 + dataFormSubmit() { + this.$refs["dataForm"].validate((valid) => { + if (!valid) { + return false; + } + const processArr = this.dataForm.processList.map((item) => { + return { + id:item + } + }) + this.dataForm.processList = processArr + const productTypeArr = this.dataForm.productTypeList.map((item) => { + return { + id: item + } + }) + this.dataForm.productTypeList = productTypeArr + this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + this.$message({ + message: this.$t("prompt.success"), + type: "success", + duration: 500, + onClose: () => { + this.visible = false; + this.$emit("refreshDataList"); + }, + }); + }) + .catch(() => { }); + }); + }, dataFormSubmitHandle: debounce( function () { this.$refs["dataForm"].validate((valid) => { @@ -340,9 +372,8 @@ export default { type: "success", duration: 500, onClose: () => { - console.log(1111); this.visible = false; - this.$emit("successSubmit"); + this.$emit("refreshDataList"); }, }); })