From 41929415aa8bb3e8d8cf3992df753e4603b62978 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 11 Nov 2025 09:34:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=89=AB=E6=8F=8F=E7=89=A9?= =?UTF-8?q?=E6=96=99=E8=AF=86=E5=88=AB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/handover_form.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/wpm_bx/handover_form.vue b/src/views/wpm_bx/handover_form.vue index a9ce1c52..2bf994f3 100644 --- a/src/views/wpm_bx/handover_form.vue +++ b/src/views/wpm_bx/handover_form.vue @@ -592,6 +592,7 @@ export default { }, materialChange() { let that = this; + that.form.new_batch = ""; let totalCount = 0,data = []; if(that.selectItems.length>0){ data = that.materialOptions.filter((item) => { @@ -630,7 +631,6 @@ export default { that.form.handoverb = data; }, getWprList(id,index){ - console.log('id',id,'index',index); let that = this; let handoverbw = []; that.$API.wpm.wpr.list.req({wm:id,page:0,can_use:'yes'}).then((res) => { @@ -713,7 +713,6 @@ export default { //表单注入数据 setData(data) { let that = this; - console.log('交接记录查看',data) this.totalCount = data.count?data.count:data.handoverb.count; Object.assign(this.form, data); this.$API.system.user.list.req({ depts: data.send_dept, page: 0 }).then((res) => { @@ -823,6 +822,7 @@ export default { return item.batch == data; }) if(arr.length>0){//有批次 + console.log('批次处理'); let arr2 = []; if(that.form.handoverb&&that.form.handoverb.length>0){ arr2 = that.form.handoverb.filter((item) => { @@ -833,7 +833,7 @@ export default { that.$message.error("该批次已存在") }else{ if(that.type==50){ - that.form.new_batch = data[0].batch+'-G'; + that.form.new_batch = arr[0].batch+'-G'; } let params = {material: arr[0].material,type: that.type}; that.$API.wpm.handover.mgroups.req(params).then((res0) => { @@ -850,19 +850,20 @@ export default { that.form.handoverb.push(obj2); } }else{//单件 + console.log('单件处理'); let res = await that.$API.wpm.wpr.list.req({number:data,page:0}); if(res.length>0){ - let indexs = 0,arr =[]; + let indexs = 0,arrs =[]; if( that.form.handoverb&&that.form.handoverb.length>0){ that.form.handoverb.forEach((item,index) => { if(item.wm == res[0].wm){ indexs = index; - arr.push(item); + arrs.push(item); } }) } //handoverb里有这个物料批次 - if(arr.length>0){ + if(arrs.length>0){ //判断是否有wpr,若无将wpr放进去 if(that.form.handoverb[indexs].handoverbw&&that.form.handoverb[indexs].handoverbw.length>0){ let arr1 = []; @@ -890,7 +891,7 @@ export default { that.materialOptions.forEach((item) => { if(item.id == res[0].wm){ if(that.type==50){ - that.form.new_batch = data[0].batch+'-G'; + that.form.new_batch = item.batch+'-G'; } let params = {material: item.material,type: that.type}; that.$API.wpm.handover.mgroups.req(params).then((res1) => {