From f0b31ffadf5c7da264f7c73d5694e4deac45ec15 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 12 Mar 2025 14:24:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=8E=BB=E7=BA=A4=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=89=A9=E6=96=99=E6=89=AB=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=88=E6=89=B9=E6=AC=A1=E4=B9=9F=E7=94=A8batch=E6=83=85?= =?UTF-8?q?=E5=86=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/mlogb_form.vue | 82 ++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/src/views/wpm_bx/mlogb_form.vue b/src/views/wpm_bx/mlogb_form.vue index 2ce96381..a29f4e49 100644 --- a/src/views/wpm_bx/mlogb_form.vue +++ b/src/views/wpm_bx/mlogb_form.vue @@ -231,40 +231,56 @@ export default { that.$message.error("批次号不存在"); }); }else{ - that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => { - if(res.length>0){ - let bwitem = {}; - bwitem.mlogb=""; - bwitem.number=res[0].number; - bwitem.wpr=res[0].id; - let arr = that.materialOptions.filter((item) => { - return item.id == res[0].wm; - }) - if(arr.length>0){ //车间存在该批次 - let batch = arr[0].batch; - that.wm_in = arr[0].batch; - that.mlogbInCount = arr[0].count;//该批次数量 - //判断日志中是否存在该批次 - let arr0= that.mlogbIns.filter((item)=>{ - return item.batch == batch; - }) - if (arr0.length > 0) { - that.hasMlogbIn = true; - that.form.count_use = 1; - bwitem.mlogb = arr0[0].id; - }else{ - that.form.batch = arr[0].batch; - that.form.wm_in = arr[0].id; - that.form.count_use = 1; - that.wm_in = arr[0].batch; - } - that.bwItemForm = bwitem; - }else{ - that.wm_in = ''; - that.$message.error("批次号不存在"); - } + if(that.tracking==10){//批次 + arr = that.materialOptions.filter((item) => { + return item.batch == code; + }) + if (arr.length > 0) { + that.form.batch = arr[0].batch; + that.form.wm_in = arr[0].id; + that.form.count_use = arr[0].count; + that.wm_in = arr[0].batch; + }else{ + that.wm_in = ''; + that.$message.error("批次号不存在"); } - }) + }else{//单件 + that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => { + if(res.length>0){ + let bwitem = {}; + bwitem.mlogb=""; + bwitem.number=res[0].number; + bwitem.wpr=res[0].id; + let arr = that.materialOptions.filter((item) => { + return item.id == res[0].wm; + }) + if(arr.length>0){ //车间存在该批次 + let batch = arr[0].batch; + that.wm_in = arr[0].batch; + that.mlogbInCount = arr[0].count;//该批次数量 + //判断日志中是否存在该批次 + let arr0= that.mlogbIns.filter((item)=>{ + return item.batch == batch; + }) + if (arr0.length > 0) { + that.hasMlogbIn = true; + that.form.count_use = 1; + bwitem.mlogb = arr0[0].id; + }else{ + that.form.batch = arr[0].batch; + that.form.wm_in = arr[0].id; + that.form.count_use = 1; + that.wm_in = arr[0].batch; + } + that.bwItemForm = bwitem; + }else{ + that.wm_in = ''; + that.$message.error("批次号不存在"); + } + } + }) + } + } },