diff --git a/src/common/balance.js b/src/common/balance.js index 30ee40ad..078a7a80 100644 --- a/src/common/balance.js +++ b/src/common/balance.js @@ -131,8 +131,58 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) { callback(result); }) } +//通过父包装查询 +export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { + let result = { + list: [], + success: true, + message: '' + }; + let params = { + itemCodes: [label.itemCode], + locationCode: locationCode + }; + // let jsonParem = JSON.stringify(param) + getManagementPrecision(params).then(res => { + let managementPrecision = res.data[0].ManagementPrecision; + switch (managementPrecision) { + case 'BY_PACKAGING': + byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => { + res.managementPrecision = managementPrecision; + callback(res); + }); + break; + case 'BY_BATCH': + byBatch(label, locationCode, fromInventoryStatuses, res => { + res.managementPrecision = managementPrecision; + callback(res); + }); + break; + case 'BY_QUANTITY': + byQuantity(label, locationCode, fromInventoryStatuses, res => { + res.managementPrecision = managementPrecision; + callback(res); + }); + break; + case 'BY_UNIQUEID': + byUniqueId(label, fromInventoryStatuses, res => { + res.managementPrecision = managementPrecision; + callback(res); + }); + break; + } + }).catch(error => { + let result = { + success: false, + message: error + }; + callback(result); + }) +} -export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) { + + +export function getBalanceByManagementPrecision(label,locationCode, fromInventoryStatuses, callback) { let result = { list: [], success: true, @@ -147,7 +197,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento let managementPrecision = res.data[0].ManagementPrecision; switch (managementPrecision) { case 'BY_PACKAGING': - byPacking(label, locationCode, fromInventoryStatuses, res => { + byPacking(label, "",locationCode, fromInventoryStatuses, res => { res.managementPrecision = managementPrecision; callback(res); }); @@ -184,18 +234,30 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento * @param {Object} locationCode * @param {Object} callback */ -export function byPacking(label, locationCode, fromInventoryStatuses, callback) { +export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { let result = { success: true, message: '', data: {} }; var filters = [] - filters.push({ - column: "packingNumber", - action: "==", - value: label.packingNumber - }) + + if (packageInfo&&packageInfo.parentNumber) { + var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; + filters.push({ + column: "packingNumber", + action: "in", + value: packingNumber + }) + } else { + filters.push({ + column: "packingNumber", + action: "==", + value: label.packingNumber + }) + } + + filters.push({ column: "itemCode", action: "==", diff --git a/src/mycomponents/balance/balance.vue b/src/mycomponents/balance/balance.vue index 86762135..3239f206 100644 --- a/src/mycomponents/balance/balance.vue +++ b/src/mycomponents/balance/balance.vue @@ -2,6 +2,7 @@ + diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index 96b0d9cf..18c69860 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -58,7 +58,7 @@ import winComScan from '@/mycomponents/scan/winComScan.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import { - getBalanceByManagementPrecision, + getBalanceByManagementPrecisionByPacking, } from '@/common/balance.js'; import { @@ -245,7 +245,6 @@ mask: true }); getBasicLocationByCode(this.fromLocationCode).then(res => { - uni.hideLoading(); if (res.data.total > 0) { let result = res.data.list[0]; var type = result.areaType; @@ -256,11 +255,13 @@ // this.packGetFocus(); this.checkPackage(scanResult); } else { + uni.hideLoading(); var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList); this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]是[" + getLocationAreaTypeName(result.areaType) + "],需要的库区是[" + hint + "]") } } else { + uni.hideLoading(); this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { this.locationGetFocus(); }) @@ -303,7 +304,7 @@ // mask: true // }) // 采购上架任务--大哥让去掉 fromInventoryStatuses - getBalanceByManagementPrecision(result.label, this.fromLocationCode, this + getBalanceByManagementPrecisionByPacking(result.label,result.package, this.fromLocationCode, this .balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined, res => { uni.hideLoading(); @@ -318,6 +319,7 @@ // uni.hideLoading(); }); } else { + uni.hideLoading(); this.packCallBack(null); } } diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue index da064ae4..31271ec8 100644 --- a/src/pages/repleinsh/coms/comScanReplishPack.vue +++ b/src/pages/repleinsh/coms/comScanReplishPack.vue @@ -249,7 +249,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; mask: true }) - this.getBalance(result.label, balances => { + this.getBalance(result.label,packageInfo, balances => { + //扫描的是外包装 let s = ''; if (result.package.parentNumber == null || result.package.parentNumber == '') { @@ -303,13 +304,24 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; } }, - getBalance(label, callback) { + getBalance(label, packageInfo,callback) { var filters = [] - filters.push({ - column: "packingNumber", - action: "==", - value: label.packingNumber - }) + + if (packageInfo.parentNumber) { + var packingNumber = packageInfo.parentNumber + "," + packageInfo.packingNumber; + filters.push({ + column: "packingNumber", + action: "in", + value: packingNumber + }) + } else { + filters.push({ + column: "packingNumber", + action: "==", + value: packageInfo.packingNumber + }) + } + filters.push({ column: "itemCode", action: "==", diff --git a/src/pages/repleinsh/job/repleinshDetail.vue b/src/pages/repleinsh/job/repleinshDetail.vue index f1d1416c..87d166e8 100644 --- a/src/pages/repleinsh/job/repleinshDetail.vue +++ b/src/pages/repleinsh/job/repleinshDetail.vue @@ -56,6 +56,7 @@ getCurrDateTime, getDirectoryItemArray, getPackingNumberAndBatch, + deepCopyData } from '@/common/basic.js'; import { @@ -238,13 +239,6 @@ setSubmitParamsAndSubmit() { //目前任务只到一个库位 - var itemCodes = [] - let locationCode = this.toLocationCode - this.detailSource.forEach(toLocation => { - toLocation.Items.forEach(item => { - itemCodes.push(item.itemCode) - }) - }) this.submitJob(); //使用在途库,不查询管理模式 // if (this.jobContent.useOnTheWayLocation == 'TRUE') { @@ -305,34 +299,45 @@ // .packingNumber; record.fromBatch = r.batch; record.fromContainerNumber = r - .ContainerNumber; + .containerNumber; record.toContainerNumber = r - .ContainerNumber; + .containerNumber; record.toInventoryStatus = r .inventoryStatus; record.toLocationCode = this .toLocationCode; record.supplierCode = r.supplierCode; - if (r.parentPackingNumber != '' && r - .parentPackingNumber != null) { - record.fromPackingNumber = r - .parentPackingNumber; - record.toPackingNumber = r - .packingNumber; - // record.fromPackUnit = r.packUnit; - record.toPackUnit = r.packUnit; - } else { - record.fromPackingNumber = r - .packingNumber; - record.toPackingNumber = r - .packingNumber; - record.toPackUnit = r.packUnit; - } + record.fromParentPackingNumber = r + .parentPackingNumber; + + record.fromPackingNumber = r + .packingNumber; + record.toPackingNumber = r + .packingNumber; + record.toPackUnit = r.packUnit; record.toBatch = r.batch; + // if (r.parentPackingNumber != '' && r + // .parentPackingNumber != null) { + // record.fromPackingNumber = r + // .parentPackingNumber; + // record.toPackingNumber = r + // .packingNumber; + // // record.fromPackUnit = r.packUnit; + // record.toPackUnit = r.packUnit; + // } else { + // record.fromPackingNumber = r + // .packingNumber; + // record.toPackingNumber = r + // .packingNumber; + // record.toPackUnit = r.packUnit; + // } + // record.toBatch = r.batch; + + // //使用在途库不改变管理模式 // if (this.jobContent // .useOnTheWayLocation == @@ -353,7 +358,7 @@ // } subItem.recordList.push(record); }) - commitSubList.push(subItem); + commitSubList.push(deepCopyData(subItem)); } } }) @@ -464,9 +469,6 @@ this.scanPopupGetFocus(); }, - showScanMessage(message) { - this.$refs.comMessage.showScanMessage(message); - }, closeScanMessage() { this.scanPopupGetFocus(); diff --git a/src/pages/repleinsh/record/directRepleinshRecord.vue b/src/pages/repleinsh/record/directRepleinshRecord.vue index 1d13ea42..b8593b4c 100644 --- a/src/pages/repleinsh/record/directRepleinshRecord.vue +++ b/src/pages/repleinsh/record/directRepleinshRecord.vue @@ -166,6 +166,8 @@ var itemp = createItemInfo(balance, pack); let newDetail = createDetailInfo(balance, pack); // + newDetail.parentNumber =pack.parentNumber; + newDetail.packingNumber =pack.number newDetail.packUnit =packUnit; newDetail.packQty=packQty; itemp.subList.push(newDetail); @@ -183,6 +185,8 @@ }) if (detail == undefined) { let newDetail = createDetailInfo(balance, pack); + newDetail.parentNumber =pack.parentNumber; + newDetail.packingNumber =pack.number newDetail.packUnit =packUnit; newDetail.packQty=packQty; item.subList.push(newDetail); @@ -334,8 +338,11 @@ { toInventoryStatus:detail.inventoryStatus, fromPackingNumber:info.packingNumber, + fromParentPackingNumber: detail.parentNumber, fromBatch:info.batch, + toPackingNumber:info.packingNumber, + toBatch:info.batch, fromLocationCode:detail.locationCode, toLocationCode:detail.toLocationCode,