From 6035ffb19d16654d5dc9c8d321259d7b85508acd Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 13 Nov 2025 10:00:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A6=85=E9=81=93165=E3=80=81166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/total_statistics.vue | 2 +- src/views/wpm/mlog6_form.vue | 115 ++++++++++++---------- 2 files changed, 65 insertions(+), 52 deletions(-) diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue index 1c9f9ebe..1a227eab 100644 --- a/src/views/statistics/total_statistics.vue +++ b/src/views/statistics/total_statistics.vue @@ -80,7 +80,7 @@

管数据

- + + :key="item.id" + :label="item.batch" + :value="item.batch" + > + {{item.batch}} + {{item.count_cando}} + @@ -84,9 +88,11 @@ controls-position="right" :min="0" :step="1" + :max="countCanDo" :step-strictly="true" style="width: 100%" placeholder="请输入领用数量" + @change="countUseChange" > @@ -98,9 +104,11 @@ controls-position="right" :min="0" :step="1" + :max="countCanDo" :step-strictly="true" style="width: 100%" placeholder="请输入加工数量" + @change="countRealChange" > @@ -112,6 +120,7 @@ controls-position="right" :min="0" :step="1" + :max="countCanDo" :step-strictly="true" style="width: 100%" placeholder="请输入合格数" @@ -137,18 +146,6 @@ -
不合格原因及数量:
@@ -597,6 +594,7 @@ export default { handle_name: "", leader_name: "", count_n_all: null, + countCanDo:0, rules: {}, }; }, @@ -609,10 +607,6 @@ export default { this.form.material_out = this.material_out; this.form.handle_date = this.handle_date; this.form.mgroup = this.mgroup; - // if(this.mode == "add"){ - // let date = new Date(); - // this.form.work_start_time = this.$TOOL.dateFormat1(date); - // } }, methods: { getRouteOptions() { @@ -648,15 +642,18 @@ export default { page: 0, }) .then((res) => { - if (res.length > 0) { - let arr = []; - res.forEach((item) => { - arr.push(item.batch); - }); - that.wmaterialOptions = arr; - } + that.wmaterialOptions = res; }); }, + batchChange(){ + let that = this; + that.wmaterialOptions.forEach((item)=>{ + if(item.batch == that.form.batch){ + that.form.count_use = that.form.count_real = that.form.count_ok = item.count_cando; + that.countCanDo = item.count_cando; + } + }) + }, //获取车间物料批次号 getBatchs() { let that = this; @@ -689,31 +686,47 @@ export default { this.visible = true; return this; }, + countUseChange(){ + let that = this; + that.form.count_real = that.form.count_use; + that.form.count_ok = that.form.count_real - that.form.count_notok; + }, + countRealChange(){ + let that = this; + that.form.count_ok = that.form.count_real - that.form.count_notok; + }, countNotOkSun() { - this.form.count_notok = - Number(this.form.count_n_hs) + - Number(this.form.count_n_cs) + - Number(this.form.count_n_zz) + - Number(this.form.count_n_tw) + - Number(this.form.count_n_zdd) + - Number(this.form.count_n_d) + - Number(this.form.count_n_dl) + - Number(this.form.count_n_qp) + - Number(this.form.count_n_bl) + - Number(this.form.count_n_hw) + - Number(this.form.count_n_yp) + - Number(this.form.count_n_bp) + - Number(this.form.count_n_sc) + - Number(this.form.count_n_zjd) + - Number(this.form.count_n_zjx) + - Number(this.form.count_n_qx) + - Number(this.form.count_n_js) + - Number(this.form.count_n_tydd) + - Number(this.form.count_n_sw) + - Number(this.form.count_n_bhpcd) + - Number(this.form.count_n_wq) + - Number(this.form.count_n_qt) + - Number(this.form.count_n_zw); + let that = this; + that.form.count_notok = + Number(that.form.count_n_hs) + + Number(that.form.count_n_cs) + + Number(that.form.count_n_zz) + + Number(that.form.count_n_tw) + + Number(that.form.count_n_zdd) + + Number(that.form.count_n_d) + + Number(that.form.count_n_dl) + + Number(that.form.count_n_qp) + + Number(that.form.count_n_bl) + + Number(that.form.count_n_hw) + + Number(that.form.count_n_yp) + + Number(that.form.count_n_bp) + + Number(that.form.count_n_sc) + + Number(that.form.count_n_zjd) + + Number(that.form.count_n_zjx) + + Number(that.form.count_n_qx) + + Number(that.form.count_n_js) + + Number(that.form.count_n_tydd) + + Number(that.form.count_n_sw) + + Number(that.form.count_n_bhpcd) + + Number(that.form.count_n_wq) + + Number(that.form.count_n_qt) + + Number(that.form.count_n_zw); + if(that.form.count_notok < that.form.count_real){ + that.form.count_ok = that.form.count_real - that.form.count_notok; + }else{ + that.form.count_ok = that.form.count_real - that.form.count_notok; + that.$message.error("不合格数量不能大于加工数量,请检查不合格数量"); + } }, //提交 submit() {