diff --git a/src/pages/deliver/coms/comScanDeliverPack.vue b/src/pages/deliver/coms/comScanDeliverPack.vue index 8ca0891e..53a90ecb 100644 --- a/src/pages/deliver/coms/comScanDeliverPack.vue +++ b/src/pages/deliver/coms/comScanDeliverPack.vue @@ -171,10 +171,10 @@ const getFromLocationList = () => { } const fromLocationUpdate = (fromlocation) => { const location = fromLocationList.value.find((r) => r == fromlocation) - if (location == undefined) { - fromLocationCode.value = '' - showErrorMessage(`发货库位【${fromlocation}】不存在`) - } + // if (location == undefined) { + // showErrorMessage(`发货库位【${fromlocation}】不存在`) + // } + fromLocationCode.value = fromlocation } const onScan = (result) => { try { @@ -230,7 +230,29 @@ const afterGetBalance = (label, balance, packageInfo) => { const packingCode = label.packingNumber const lot = label.batch const item = toLocation.value.Items.find((r) => r.itemCode == itemCode) - const fromLocation = item.Locations.find((l) => l.fromLocationCode == fromLocationCode.value) + let fromLocation = item.Locations.find((l) => l.fromLocationCode == fromLocationCode.value) + if(!fromLocation){ + fromLocation = { + Batchs:[{ + Recommends:[], + Records: [], + batch: label.batch, + detail:{ + ...packageInfo, + fromLocationCode: balance.locationCode, + }, + handleQty: 0, + packingNumber: label.packingNumber, + qty: label.qty, + uom: label.uom + }], + fromLocationCode: balance.locationCode, + handleQty: 0, + qty: label.qty, + uom: label.uom + } + item.Locations.push(fromLocation) + } if (fromLocation != undefined) { const batch = fromLocation.Batchs.find((r) => r.batch == lot) if (batch != undefined) {