diff --git a/src/mycomponents/query/balanceQuery.vue b/src/mycomponents/query/balanceQuery.vue index 4a687b4e..298e4538 100644 --- a/src/mycomponents/query/balanceQuery.vue +++ b/src/mycomponents/query/balanceQuery.vue @@ -253,20 +253,15 @@ getBalanceByBusiness(itemCode, businessType) { var params = { itemCode: itemCode, - businessType: businessType + businessType: businessType, + inOrOut:"out" } getBalanceByBusinessType(params).then(res => { uni.hideLoading() if (res.data && res.data.length > 0) { this.tableData = res.data } else { - var hint ="" - if(businessType=="Issue"){ - hint="发料中" - }else if(businessType=="Repleinment"){ - hint="补料中" - } - this.showErrorMessage(hint+"未查询到物料号[" + itemCode + "]的库存") + this.showErrorMessage(res.data.msg) } }).catch(error => { diff --git a/src/mycomponents/scan/winScanParentPackage.vue b/src/mycomponents/scan/winScanParentPackage.vue index 8a0553a8..45d4ce23 100644 --- a/src/mycomponents/scan/winScanParentPackage.vue +++ b/src/mycomponents/scan/winScanParentPackage.vue @@ -161,7 +161,7 @@ //packageInfo.subList子包装数量大于0扫描的就是父包装 //1.当扫描箱时,同时查询箱和托的库存 - if (childPackingNumber) { + if (parentPackingNumber) { let packingNumber = parentPackingNumber + "," + childPackingNumber; filters.push({ column: "packingNumber", @@ -172,7 +172,7 @@ filters.push({ column: "packingNumber", action: "==", - value: packingNumber + value: childPackingNumber }) } @@ -224,6 +224,7 @@ }) } else { //扫描的是子包装 + //扫描的是父包装,(新加的) balance.childBalance = res.data.list.filter(r => r.packingNumber == childPackingNumber) balance.parentBalance = res.data.list.filter(r => r.packingNumber == parentPackingNumber) callback(balance); diff --git a/src/pages/issue/record/directIssue0816.vue b/src/pages/issue/record/directIssue0816.vue index 89d4915e..d1d4b493 100644 --- a/src/pages/issue/record/directIssue0816.vue +++ b/src/pages/issue/record/directIssue0816.vue @@ -200,7 +200,6 @@ let pack = result.package; let childBalance = result.balance.childBalance; let parentBalance = result.balance.parentBalance[0]; - //1.先判断是否重复扫描 if (this.itemCode) { var item = this.detailSource.find(res => res.itemCode == pack.itemCode) @@ -240,35 +239,46 @@ this.setPackageData(childBalance[0], pack); } } else { - let packparams = ''; - pack.subList.forEach(pack => { - packparams = packparams + pack.number + ',' - }) - packparams = packparams.trimEnd(','); - this.getTransactionList(packparams, transactionRes => { - //扫描的是父包装,要过滤掉不在超市的库存,加上没有的库存 - pack.subList.forEach(sub => { - let subBalance = childBalance.find(r => r.packingNumber == sub.number); - if (subBalance) { - //校验父包装和子包装是否在一个库位 - if (subBalance.locationCode == parentBalance.locationCode) { - this.setPackageData(subBalance, sub); - } else { - //不在一个库位暂时先不加 - } - + //扫描的是没有父包装的,自己就是子包装 + if(pack.subList.length==0){ + this.getTransactionList(pack.number, transactionRes => { + if (transactionRes.length == 0) { + this.setPackageData(childBalance[0], pack); } else { - //如果子包装没有库存,取父包装库存 - //查询是不是已经出过库,在发料任务中产生了出库库存事务 - let transaction = transactionRes.find(p => p.packingNumber == sub - .number) - if (!transaction) { - this.setPackageData(parentBalance, sub); - } + this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + + "]已经发过料") } + }); + }else { + let packparams = ''; + pack.subList.forEach(pack => { + packparams = packparams + pack.number + ',' }) - }) - + packparams = packparams.trimEnd(','); + this.getTransactionList(packparams, transactionRes => { + //扫描的是父包装,要过滤掉不在超市的库存,加上没有的库存 + pack.subList.forEach(sub => { + let subBalance = childBalance.find(r => r.packingNumber == sub.number); + if (subBalance) { + //校验父包装和子包装是否在一个库位 + if (subBalance.locationCode == parentBalance.locationCode) { + this.setPackageData(subBalance, sub); + } else { + //不在一个库位暂时先不加 + } + + } else { + //如果子包装没有库存,取父包装库存 + //查询是不是已经出过库,在发料任务中产生了出库库存事务 + let transaction = transactionRes.find(p => p.packingNumber == sub + .number) + if (!transaction) { + this.setPackageData(parentBalance, sub); + } + } + }) + }) + } } },