From 1ac73237f937fe1da741aed4584c87f450e07b68 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 13 Mar 2025 16:34:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=8E=BB=E7=BA=A4=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=BE=93=E5=85=A5=E7=89=A9=E6=96=99=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BB=E8=A6=81=E6=89=B9=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/handover_form.vue | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/views/wpm_bx/handover_form.vue b/src/views/wpm_bx/handover_form.vue index 2c59507d..db6c401a 100644 --- a/src/views/wpm_bx/handover_form.vue +++ b/src/views/wpm_bx/handover_form.vue @@ -699,10 +699,14 @@ export default { if(data.indexOf('#')>-1){ let id = data.split('#')[1]; this.$API.cm.labelmat.item.req(id).then((res) => { - let arr = that.form.handoverb.filter((item) => { - return item.batch == res.batch&&item.state==res.state; - }) + let arr = []; + if(that.form.handoverb&&that.form.handoverb.length>0){ + arr = that.form.handoverb.filter((item) => { + return item.batch == res.batch&&item.state==res.state; + }) + } if(arr.length>0){ + that.wm_in = ""; that.$message.error("该批次已存在") }else{ that.materialOptions.forEach((item) => { @@ -727,14 +731,22 @@ export default { handoverbw.push(obj1); }) obj.handoverbw = handoverbw; - that.form.handoverb.push(obj); + if(that.form.handoverb&&that.form.handoverb.length>0){ + that.form.handoverb.push(obj); + }else{ + that.form.handoverb = []; + that.form.handoverb.push(obj); + } + that.wm_in = ""; }) + }else{ + that.$message.error("该批次不存在") + that.wm_in = ""; } }) } }) }else{//wpr的number - debugger; that.$API.wpm.wpr.list.req({number:data,page:0}).then((res) => { if(res.length>0){ let indexs = 0,arr =[]; @@ -753,6 +765,7 @@ export default { return item1.wpr == res[0].id; }) if(arr1.length>0){ + that.wm_in = ""; that.$message.error("该物料已存在"); }else{ let obj1 = {}; @@ -760,6 +773,7 @@ export default { obj1.number = res[0].number; that.form.handoverb[indexs].count+=1; that.form.handoverb[indexs].handoverbw.push(obj1); + that.wm_in = ""; } }else{ that.form.handoverb[indexs].handoverbw = []; @@ -768,6 +782,7 @@ export default { obj1.number = res[0].number; that.form.handoverb[indexs].count=1; that.form.handoverb[indexs].handoverbw.push(obj1); + that.wm_in = ""; } }else{//handoverb里没有有这个物料批次 console.log('handoverb里没有有这个物料批次'); @@ -792,7 +807,11 @@ export default { that.form.handoverb.push(obj2); } }) + that.wm_in = ""; } + }else{ + that.wm_in = ""; + that.$message.error("该批次不存在") } }) }