diff --git a/src/pages/issue/record/directIssue.vue b/src/pages/issue/record/directIssue.vue index de6a8e70..facf5fa5 100644 --- a/src/pages/issue/record/directIssue.vue +++ b/src/pages/issue/record/directIssue.vue @@ -81,7 +81,7 @@ getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js'; - + import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue' @@ -187,7 +187,7 @@ getScanResult(result) { this.setData(result); }, - setData(result) { + async setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; @@ -224,6 +224,7 @@ this.detailSource.push(itemp) this.itemCode = balance.itemCode; this.fromLocationCode = balance.locationCode + await this.getToLocationBalance(this.fromLocationCode,result) this.scanPopupGetFocus() } else { var detail = item.subList.find(r => { diff --git a/src/pages/repleinsh/record/directRepleinshRecord.vue b/src/pages/repleinsh/record/directRepleinshRecord.vue index 00eec775..9982ac72 100644 --- a/src/pages/repleinsh/record/directRepleinshRecord.vue +++ b/src/pages/repleinsh/record/directRepleinshRecord.vue @@ -17,10 +17,8 @@ + :isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowToLocation="false" + :isShowParentToLocation="false" @updateData="updateData" @removePack="removePack"> @@ -28,8 +26,7 @@ - + @@ -81,6 +78,7 @@ calcHandleQty } from '@/common/record.js'; + import { getManagementPrecisions, getPrecisionStrategyList, @@ -218,14 +216,14 @@ this.setData(result); }, - setData(result) { + async setData(result) { let balance = result.balance; let label = result.label; let pack = result.package; if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { - this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this + this.showErrorMessage("批次[" + balance.batch + "]在库位[" + this .fromLocationCode + "]没有库存余额") return; } @@ -256,11 +254,11 @@ this.detailSource.push(itemp) this.itemCode = balance.itemCode; this.fromLocationCode = balance.locationCode + await this.getToLocationBalance(this.toLocationCode,result) this.scanPopupGetFocus() } else { var detail = item.subList.find(r => { - if (r.packingNumber == pack.number && - r.batch == balance.batch && + if (r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { return r; @@ -303,7 +301,7 @@ }) if (checkData) { //是否移除 - this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber+"]" + "批次[" + balance + this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber + "]" + "批次[" + balance .batch + "]是父包装,是否移除子包装", res => { if (res) { item.subList = []; @@ -334,14 +332,81 @@ this.scanPopupGetFocus() } else { if (detail.scaned == true) { - this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") + detail.handleQty = calc.add(detail.handleQty, result.label.qty) + // this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") } } } calcHandleQty(this.detailSource); }, + //查询到目标库位的库存余额 + async getToLocationBalance(toLocationCode, result) { + uni.showLoading({ + title: '查询中', + mask: true + }) + var filters = [] + if (result.package.parentNumber) { + var packingNumber = result.package.parentNumber + "," + result.package.number; + filters.push({ + column: "packingNumber", + action: "in", + value: packingNumber + }) + } else { + filters.push({ + column: "packingNumber", + action: "==", + value: result.package.number + }) + } + filters.push({ + column: "itemCode", + action: "==", + value: result.package.itemCode + }) + filters.push({ + column: "batch", + action: "==", + value: result.package.batch + }) + + filters.push({ + column: "areaType", + action: "in", + value: this.toLocationAreaTypeList.join(',') + }) + + + var params = { + filters: filters, + pageNo: 1, + pageSize: 100, + } + await getManagementPrecisions([result.package.itemCode], toLocationCode, async res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == 'BY_BATCH') ? + 'BY_BATCH' : '' + if (this.managementType == 'BY_BATCH') { + uni.hideLoading() + } else { + await getBalanceByFilter(params).then(res => { + uni.hideLoading() + if (res.data.list.length > 0) { + this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); + } + // callback(res.data) + }).catch(err => { + this.showErrorMessage(err.message); + }) + } + } + }) + + }, showErrorMessage(message) { this.$refs.comMessage.showErrorMessage(message, res => {