From b9c4169441b3ba83a680bbe6e639814b4c7abe4d Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Sat, 8 Jun 2024 19:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A3=85=E9=85=8D=E5=AE=8C?= =?UTF-8?q?=E5=B7=A5=E6=94=B6=E8=B4=A7=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 12 +++ src/mycomponents/scan/winComScanFg.vue | 2 + .../job/fgProductReceiptDetail.vue | 78 +++++++++++-------- 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/src/api/request2.js b/src/api/request2.js index 63398de4..8d95d217 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -4137,3 +4137,15 @@ export function getPackageLabel(packageCode) { data: params, }); } + +/** + * 装配收货mes码是否已经完工 + * @param {*} + */ +export function isCheckMesCode(code) { + return request({ + url: baseApi + "/wms/productreceipt-detailb/getCheckWhetherItExists?remark="+code, + method: "get", + data: {}, + }); +} diff --git a/src/mycomponents/scan/winComScanFg.vue b/src/mycomponents/scan/winComScanFg.vue index 6a804a6e..68d87e2f 100644 --- a/src/mycomponents/scan/winComScanFg.vue +++ b/src/mycomponents/scan/winComScanFg.vue @@ -197,8 +197,10 @@ let batch = content.substr(lengthMat + 8, 3); let order = content.substr(-8); if (itemCode != partNumber) { + that.clear(); throw new Error("解析错误:扫描物料号【" + itemCode + "】与查询物料号【" + partNumber + "】不一致") + } let scanResult = { diff --git a/src/pages/productReceipt/job/fgProductReceiptDetail.vue b/src/pages/productReceipt/job/fgProductReceiptDetail.vue index a3302ed0..61a8cd7f 100644 --- a/src/pages/productReceipt/job/fgProductReceiptDetail.vue +++ b/src/pages/productReceipt/job/fgProductReceiptDetail.vue @@ -78,7 +78,8 @@ productReceiptJobsubmit, getPrintProductReceiptList, getBalanceToPackage, - batchPrintingLable + batchPrintingLable, + isCheckMesCode } from '@/api/request2.js'; import { goHome, @@ -245,42 +246,50 @@ }, getScanResult(result) { + let that = this; //TODO缺少零件号的对应关系 - let that = this; - if (that.detailSource.length > 0) { - let item = that.detailSource[0]; //应该按零件号查找 - result.uom = item.uom; - if (item.subList.length > 0) { - let subItem = item.subList[0]; - subItem.scaned = true; - if (subItem.fgList == undefined) { - subItem.fgList = []; - } - - if (subItem.fgList.length == 0) { - subItem.fgList.push(result); - that.calcFgQty(this.detailSource); - } else { - var itemIndex = subItem.fgList.findIndex(r => - r.itemCode == result.itemCode && - r.productDate == result.productDate && - r.order == result.order); - if (itemIndex == -1) { - subItem.fgList.push(result); - that.calcFgQty(this.detailSource); - } else { - this.showQuestionMessage("标签【" + result.content + '】已经扫描,是否移除', confirm => { - subItem.fgList.splice(itemIndex, 1) + //查询mes码是否完工 + isCheckMesCode(result.content).then(res=>{ + if(res.data){ + if (that.detailSource.length > 0) { + let item = that.detailSource[0]; //应该按零件号查找 + result.uom = item.uom; + if (item.subList.length > 0) { + let subItem = item.subList[0]; + subItem.scaned = true; + if (subItem.fgList == undefined) { + subItem.fgList = []; + } + + if (subItem.fgList.length == 0) { + subItem.fgList.push(result); that.calcFgQty(this.detailSource); - }) + } else { + var itemIndex = subItem.fgList.findIndex(r => + r.itemCode == result.itemCode && + r.productDate == result.productDate && + r.order == result.order); + if (itemIndex == -1) { + subItem.fgList.push(result); + that.calcFgQty(this.detailSource); + } else { + this.showQuestionMessage("标签【" + result.content + '】已经扫描,是否移除', confirm => { + subItem.fgList.splice(itemIndex, 1) + that.calcFgQty(this.detailSource); + }) + } + } + + setTimeout(r => { + this.scanPopupGetFocus(); + }, 500) } } - - setTimeout(r => { - this.scanPopupGetFocus(); - }, 500) } - } + }).catch(error=>{ + this.showErrorMessage(error) + }) + }, calcFgQty() { @@ -448,7 +457,9 @@ } } }else { - subitem.handleQty=subitem.qty + if(!subitem.handleQty){ + subitem.handleQty=subitem.qty + } subitem.scaned = true this.submitJob(); } @@ -508,7 +519,6 @@ res.outsideItemCode = res.itemCode res.outsideProduceDate = res.productDate res.outsideSerialNumber = res.order - res.lowerLim=res.content }) }else { detail.fgList=[]