From 7b0c2b536808d9152afb4713316f37f1faefc567 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 13 Mar 2025 14:34:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=8E=BB=E7=BA=A4=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=89=A9=E6=96=99=E6=97=B6wpr=E9=80=89=E6=8B=A9=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/mlogb_form.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/wpm_bx/mlogb_form.vue b/src/views/wpm_bx/mlogb_form.vue index f4acca18..5c3f8089 100644 --- a/src/views/wpm_bx/mlogb_form.vue +++ b/src/views/wpm_bx/mlogb_form.vue @@ -141,6 +141,11 @@ export default { mlog: "", material_in__isnull: 0, }, + bwItemForm:{ + wpr:"", + mlogb:"", + number:"", + }, }; }, mounted() { @@ -238,6 +243,7 @@ export default { that.$message.error("批次号不存在"); }); }else{ + that.scanKyes = ""; if(that.tracking==10){//批次 arr = that.materialOptions.filter((item) => { return item.batch == code; @@ -254,12 +260,13 @@ export default { }else{//单件 that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => { if(res.length>0){ + let index = res.length-1; let bwitem = {}; bwitem.mlogb=""; - bwitem.number=res[0].number; - bwitem.wpr=res[0].id; + bwitem.number=res[index].number; + bwitem.wpr=res[index].id; let arr = that.materialOptions.filter((item) => { - return item.id == res[0].wm; + return item.id == res[index].wm; }) if(arr.length>0){ //车间存在该批次 let batch = arr[0].batch; @@ -309,20 +316,21 @@ export default { that.form.mlog = that.mlog; that.$API.wpm.mlogb.in.req(that.form).then((res) => { that.$message.success("添加成功"); - that.$emit("success"); that.wm_in = ''; that.form.mtask = ''; that.form.batch = ''; that.form.parent = ''; that.form.count_use = 0; + // that.scanKyes!=='mat'&&that.mlogbInCount>1 + // that.bwItemForm.wpr!="" if(that.scanKyes!=='mat'&&that.mlogbInCount>1){ - //当批次数量不为1时 that.bwItemForm.mlogb = res.id; that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => { that.$emit("closed"); }) + }else{ + that.$emit("closed"); } - that.$emit("closed"); that.visible = false; }).catch((err) => {}); }