From 833eba96c53b44bfe836500da6929b720f3c3ae8 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 20 May 2025 09:48:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BD=A6=E9=97=B4=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E8=B0=83=E6=95=B4=EF=BC=8Cmassage=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inm/mainso.vue | 2 +- src/views/wpm_gx/inm_record_form.vue | 64 +++++++++++----------------- 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/src/views/inm/mainso.vue b/src/views/inm/mainso.vue index 74eba164..bcee7134 100644 --- a/src/views/inm/mainso.vue +++ b/src/views/inm/mainso.vue @@ -217,7 +217,7 @@ export default { }) } }else{ - that.$message.console.error("请先设置打印机"); + that.$message.error("请先设置打印机"); } }, }, diff --git a/src/views/wpm_gx/inm_record_form.vue b/src/views/wpm_gx/inm_record_form.vue index f1bf47dc..54cc9fe2 100644 --- a/src/views/wpm_gx/inm_record_form.vue +++ b/src/views/wpm_gx/inm_record_form.vue @@ -282,18 +282,11 @@ export default { if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") { that.$API.wpm.wmaterial.list.req(obj).then((res) => { that.wbatchOptions = res; - if(res.length>0&&that.codeText!==''){ - that.codeTextChange(that.codeText); - // let arr = []; - // arr = res.filter(item => item.batch == that.codeText); - // if(arr.length>0){ - // that.selectBatch = arr[0].id; - // that.form.batch = arr[0].batch; - // that.form.wm = arr[0].id; - // that.form.count = arr[0].count; - // }else{ - // this.$message.warning("该物料没有库存"); - // } + if(that.codeText!==''){ + setTimeout(() => { + that.codeTextChange(that.codeText); + this.codeText = ''; + }, 100); } }); } @@ -306,21 +299,6 @@ export default { obj.material = that.form.material; this.$API.inm.warehouse.batch.req(obj).then((res) => { this.batchOptions = res; - if(res.length>0&&that.codeText!==''){ - that.codeTextChange(that.codeText); - // let arr = []; - // arr = res.filter(item => item.batch == that.codeText); - // if(arr.length>0){ - // that.form.material = arr[0].material - // that.selectBatch = arr[0].id; - // that.form.batch = arr[0].batch; - // that.form.warehouse = arr[0].warehouse; - // that.form.mb = arr[0].id; - // that.form.count = arr[0].count; - // }else{ - // this.$message.warning("该物料没有库存"); - // } - } }); }, codeTextChange(data){ @@ -337,23 +315,28 @@ export default { }else{//入库----工段 arr = this.wbatchOptions.filter(item => item.batch == res.batch); } - console.log('arr',arr); if(arr.length>0){ - // that.selectBatch = arr[0].id; if(that.mode == "add"){ - that.selectBatch.push(arr[0].id); - let obj = {}; - obj.batch = arr[0].batch; - obj.warehouse = arr[0].warehouse; - obj.mb = arr[0].id; - obj.count = Number(arr[0].count); - if(this.cate == 'do_out'){ - obj.mb = arr[0].id; - obj.warehouse = arr[0].warehouse; + let arrF = that.selectList.filter(item => + item.batch == arr[0].batch + ) + if(arrF.length>0){ + that.$message.error("该批次已存在"); + that.codeText = ""; }else{ - obj.wm = arr[0].id; + let obj = {}; + obj.batch = arr[0].batch; + obj.warehouse = arr[0].warehouse; + obj.mb = arr[0].id; + obj.count = Number(arr[0].count); + if(this.cate == 'do_out'){ + obj.mb = arr[0].id; + obj.warehouse = arr[0].warehouse; + }else{ + obj.wm = arr[0].id; + } + that.selectList.push(obj); } - that.selectList.push(obj); }else{ that.selectBatch = arr[0].id; that.form.material = arr[0].material; @@ -368,6 +351,7 @@ export default { } }else{ that.$message.error("该批次不存在") + that.codeText = ""; } }) },