From f8dd086cf9bfdd4fd3d8521423cba0b2bd58f238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Fri, 14 Jul 2023 16:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/qualityChange-add.vue | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) 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"); }, }); })