This commit is contained in:
2026-09-24 14:20:26 +08:00
parent c4b1d281dc
commit 5b3d8b00d5
@@ -107,8 +107,8 @@ export default {
completedDestinationLabel() { return this.destinationLabel({ fbaWarehouseCode: this.completedDestination, destinationType: this.completedDestinationType }) },
totalCartons() { return this.pallets.reduce((sum, pallet) => sum + Math.max(0, Number(pallet.cartonCount) || 0), 0) },
cartonDifference() { return this.totalCartons - Number(this.selected?.packageCount || 0) },
isInventoryTransfer() { return Boolean(this.selected && ['WAIT_PDA_RECEIVING', 'APPROVED', 'ALLOCATED', 'PARTIALLY_RECEIVED'].includes(String(this.selected.status)) && this.selected.inboundCode && this.selected.inboundCode !== this.selected.transferNo) },
isMeasurementComplete() { return Boolean(this.selected && !['WAIT_PDA_RECEIVING', 'APPROVED', 'ALLOCATED', 'PARTIALLY_RECEIVED'].includes(String(this.selected.status))) },
isInventoryTransfer() { return Boolean(this.selected && this.selected.status === 'WAIT_PDA_RECEIVING' && this.selected.inboundCode && this.selected.inboundCode !== this.selected.transferNo) },
isMeasurementComplete() { return Boolean(this.selected && !['WAIT_PDA_RECEIVING', 'PARTIALLY_RECEIVED'].includes(String(this.selected.status))) },
totalVolume() { return this.pallets.reduce((sum, pallet) => sum + this.rawPalletVolume(pallet), 0).toFixed(3) },
totalWeight() { return this.pallets.reduce((sum, pallet) => sum + Math.max(0, Number(pallet.grossWeightKg) || 0), 0).toFixed(2) },
validationMessage() {
@@ -169,14 +169,17 @@ export default {
this.loading = true; this.error = null
try {
const activeNo = String(warehouseWork.warehouseTransfer.currentNo || '')
const measuredStatuses = new Set(['WAIT_PDA_RECEIVING', 'APPROVED', 'ALLOCATED', 'PARTIALLY_RECEIVED'])
const measuredStatuses = new Set(['WAIT_PDA_RECEIVING', 'PARTIALLY_RECEIVED'])
this.candidates = (await listWarehouseTransferCandidates()).map((item) => String(item.transferNo) === activeNo && item.status === 'WAIT_PDA_RECEIVING' ? { ...item, status: 'PARTIALLY_RECEIVED' } : item)
this.candidates = this.candidates.filter((item) => ['WAIT_PDA_RECEIVING', 'APPROVED', 'ALLOCATED', 'PARTIALLY_RECEIVED'].includes(String(item.status)))
this.candidates = this.candidates.filter((item) => measuredStatuses.has(String(item.status)))
// 服务端已完成当前单但设备在提交响应前断网时,本地 currentNo 会遗留。
// 候选已成功读取且当前单不再可测,清掉本地锁,允许继续下一票。
if (activeNo && !this.candidates.some((item) => String(item.transferNo) === activeNo && measuredStatuses.has(String(item.status)))) {
resetWarehouseDomain('warehouseTransfer')
}
if (this.selected && !this.candidates.some((item) => String(item.transferNo) === String(this.selected.transferNo))) {
this.selected = null; this.pallets = [newPallet()]; this.photoFileIds = []; this.photoUrls = {}; this.photoNames = []
}
} catch (e) { this.error = e } finally { this.loading = false }
},
async select(item, fromExplicitTask = false) {