From 263a914fa9ff39259e3ba8c9219f251d7134b08a Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 1 Aug 2024 17:38:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=8D=E5=90=88=E6=A0=BC=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_gx/handover.vue | 22 +++++++++++-- src/views/wpm_gx/mlogb_check.vue | 56 +++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/src/views/wpm_gx/handover.vue b/src/views/wpm_gx/handover.vue index 0b920f63..bd8c4639 100644 --- a/src/views/wpm_gx/handover.vue +++ b/src/views/wpm_gx/handover.vue @@ -74,10 +74,26 @@ - + + + + diff --git a/src/views/wpm_gx/mlogb_check.vue b/src/views/wpm_gx/mlogb_check.vue index 522659f6..791de3bc 100644 --- a/src/views/wpm_gx/mlogb_check.vue +++ b/src/views/wpm_gx/mlogb_check.vue @@ -62,6 +62,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -72,6 +73,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -82,6 +84,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -92,6 +95,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -102,6 +106,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -112,6 +117,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -122,6 +128,7 @@ :min="0" class="width-100" controls-position="right" + @change="countChange" /> @@ -181,7 +188,17 @@ export default { Object.assign(this.form, data); console.log(this.form); }, - + countChange() { + this.form.count_notok = + this.form.count_n_hs + + this.form.count_n_qp + + this.form.count_n_swen + + this.form.count_n_bb + + this.form.count_n_md + + this.form.count_n_xh + + this.form.count_n_wm; + this.form.count_ok = this.form.count_real - this.form.count_notok; + }, //表单提交方法 submit() { let that = this; @@ -189,17 +206,32 @@ export default { if (valid) { that.isSaveing = true; that.form.mlog = that.mlog; - that.$API.wpm.mlogb.updateOut - .req(that.form.id, that.form) - .then((res) => { - that.isSaveing = false; - that.$emit("success"); - that.visible = false; - that.$message.success("操作成功"); - }) - .catch((err) => { - that.isSaveing = false; - }); + this.form.count_notok = + this.form.count_n_hs + + this.form.count_n_qp + + this.form.count_n_swen + + this.form.count_n_bb + + this.form.count_n_md + + this.form.count_n_xh + + this.form.count_n_wm; + let sum = this.form.count_ok + this.form.count_notok; + if (sum - this.form.count_real == 0) { + that.$API.wpm.mlogb.updateOut + .req(that.form.id, that.form) + .then((res) => { + that.isSaveing = false; + that.$emit("success"); + that.visible = false; + that.$message.success("操作成功"); + }) + .catch((err) => { + that.isSaveing = false; + }); + } else { + this.$message.error( + "使用数量与合格数不合格数数量不对等" + ); + } } }); },