From 0d90011cf5a19b2e102eae475816a149afdb0ccb Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Fri, 19 Jan 2024 13:47:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F=E5=BF=99?= =?UTF-8?q?=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycomponents/scan/winComScan.vue | 25 ++++++------ pages/count/job/countDetail.vue | 66 ++++++++++++++++---------------- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/mycomponents/scan/winComScan.vue b/mycomponents/scan/winComScan.vue index 81671bdd..1007a446 100644 --- a/mycomponents/scan/winComScan.vue +++ b/mycomponents/scan/winComScan.vue @@ -10,7 +10,7 @@ @input="handelScanMsg" :cursor="cursorIndex"> - + @@ -84,7 +84,7 @@ type: Boolean, default: true }, - headerType:{ + headerType: { type: String, default: 'HPQ' //HLB HMQ HCQ HPQ } @@ -103,7 +103,7 @@ } }, mounted() { - if(document.querySelector('textarea')!=null){ + if (document.querySelector('textarea') != null) { document.querySelector('textarea').setAttribute('inputmode', 'none') } // if (this.$el.querySelector('textarea') != null) { @@ -134,9 +134,12 @@ this.handelScanMsg(); }, handelScanMsg() { - let that = this; //点击了回车 - + uni.showLoading({ + title: '解析中...', + mask: true + }) + let that = this; let index = that.scanMsg.indexOf('\n'); if (index > 0) { // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; @@ -147,16 +150,12 @@ that.getfocus(); return; } - + if (that.isShowHistory) { that.scanList.unshift(content); } - - uni.showLoading({ - title:'解析中...', - mask:true - }) - getLabelInfo(content,this.headerType, callback => { + + getLabelInfo(content, this.headerType, callback => { uni.hideLoading(); let scanResult = callback; if (scanResult.success) { @@ -170,7 +169,7 @@ that.getfocus(); } }) - } + } }); }, 500); } diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index 464ac304..befc76da 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -380,12 +380,12 @@ editConfirm(qty, inventoryStatus, mode) { let that = this; - var detail = this.detailSource.find(r => r.itemCode == that.package.itemCode); + var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); //检查物料号是否存在 if (detail == undefined) { //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 - this.addNewItemCodeToList(result) + that.addNewItemCodeToList() } else { var itemEditInfo = detail.subList.find(item => { if (item.packingNumber == that.package.number && @@ -397,23 +397,23 @@ if (itemEditInfo == undefined) { //不在任务列表中,提示是否添加到列表 - this.addExistItemCodeToList(detail); + that.addExistItemCodeToList(detail, qty, inventoryStatus); } else { itemEditInfo.scaned = true; itemEditInfo.handleQty = qty; - itemEditInfo.balanceQty = this.balance.qty; - itemEditInfo.stdPackQty = this.package.stdPackQty; - itemEditInfo.stdPackUnit = this.package.stdPackUnit; + itemEditInfo.balanceQty = that.balance.qty; + itemEditInfo.stdPackQty = that.package.stdPackQty; + itemEditInfo.stdPackUnit = that.package.stdPackUnit; this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail .subList); - this.updateData() + that.updateData() } //如果是编辑,移除之前的盘点结果 if (mode == 'edit') { - this.currentEditItem.handleQty = 0; - this.currentEditItem.scaned = false; - this.currentEditItem = {}; + that.currentEditItem.handleQty = 0; + that.currentEditItem.scaned = false; + that.currentEditItem = {}; } setTimeout(r => { @@ -449,7 +449,7 @@ //检查物料号是否存在 if (detail == undefined) { //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 - this.addNewItemCodeToList(result) + this.addNewItemCodeToList() } else { //物料号存在,查询是否在任务列表中 itemEditInfo = detail.subList.find(item => { @@ -514,7 +514,8 @@ res => { if (res) { detail.qty = calc.add(detail.qty, detail.qty) - let newDetail = this.createAddDetailInfo(this.balance, this.package); // + //this.balance, this.package, + let newDetail = this.createAddDetailInfo(); // detail.subList.push(newDetail); this.updateData() @@ -522,46 +523,45 @@ }) }, - createAddItemInfo(balance, pack) { + createAddItemInfo() { let item = { - itemCode: pack.itemCode, - itemName: pack.itemName, - stdPackQty: pack.stdPackQty, - stdPackUnit: pack.stdPackUnit, - qty: Number(balance.qty), + itemCode: this.package.itemCode, + itemName: this.package.itemName, + stdPackQty: this.package.stdPackQty, + stdPackUnit: this.package.stdPackUnit, + qty: Number(qty), handleQty: 0, uom: pack.uom, subList: [], - } return item; }, - createAddDetailInfo(balance, pack) { + createAddDetailInfo() { var detail = { id: "0", scaned: true, countDetailNumber: "", - ownerCode: balance.ownerCode, + ownerCode: this.balance.ownerCode, packingNumber: pack.number, - containerNumber: balance.containerNumber, + containerNumber: this.balance.containerNumber, batch: pack.batch, - inventoryStatus: balance.inventoryStatus, - itemCode: pack.itemCode, - itemName: pack.itemName, - itemDesc1: pack.itemDesc1, - itemDesc2: pack.itemDesc2, + inventoryStatus:this. balance.inventoryStatus, + itemCode: this.package.itemCode, + itemName: this.package.itemName, + itemDesc1: this.package.itemDesc1, + itemDesc2: this.package.itemDesc2, projectCode: "", qty: 0, - handleQty: balance.qty, + handleQty: this.balance.qty, uom: balance.uom, number: this.jobContent.number, remark: "", - countQty: balance.qty, - balanceQty: balance.qty, - fromLocationCode: balance.locationCode, - stdPackQty: pack.stdPackQty, - stdPackUnit: pack.stdPackUnit, + countQty: this.balance.qty, + balanceQty:this. balance.qty, + fromLocationCode: this.balance.locationCode, + stdPackQty: this.package.stdPackQty, + stdPackUnit: this.package.stdPackUnit, creator: this.$store.state.user.id } return detail;