diff --git a/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue b/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue index 1d20826..83b48a6 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue @@ -225,6 +225,7 @@ >
+
+ +
+ 位置{{ positionGrid[0].position }}当前不可用,请检查托盘位置状态 +
@@ -558,6 +564,8 @@ export default { this.scanCode = '' this.scanPosition = '' this.scanLayer = 1 + // 新栈板先清掉旧托盘层高,后续以当前栈板类型和可用位置接口返回值为准 - rqrq + this.currentMaxLayer = 0 this.currentSelectedPosition = '' this.manualRemark = '' this.savedManualRemark = '' @@ -751,7 +759,11 @@ export default { } this.scanModalVisible = true this.scanCode = '' + // 每次打开扫码弹窗清除上次托盘的位置,防止尚未加载新位置时误扫到旧位置 - rqrq + this.scanPosition = '' this.currentSelectedPosition = '' + this.positionGrid = [] + this.availablePositions = [] this.needRefreshOnClose = false if (this.operationType === 'in') { this.scanLayer = 1 @@ -799,8 +811,12 @@ export default { }) }, loadAvailablePositions() { + // 刷新位置期间暂停扫码,返回后仅恢复仍可用的上次选择;失败时保持禁用,避免误写已占用位置 - rqrq + const selectedPosition = this.currentSelectedPosition this.positionGridLoading = true this.availablePositions = [] + this.currentSelectedPosition = '' + this.scanPosition = '' getPalletDetails({ site: this.site, palletId: this.palletCode, @@ -823,11 +839,28 @@ export default { if (data && data.code === 0) { const result = data.data || {} const positions = result.positions || [] + // 以当前栈板接口返回的层高为准,避免类型清单尚未加载时把单层托盘当成不限高 - rqrq + if (result.maxLayer != null) { + this.currentMaxLayer = Number(result.maxLayer) + if (this.currentMaxLayer > 0) { + this.scanLayerOptions = Array.from({ length: this.currentMaxLayer }, (_, i) => i + 1) + } + } this.availablePositions = result.availablePositions || [] this.positionGrid = positions.map((position) => ({ position, count: positionCountMap[position] || 0 })) + // 单位置托盘只在位置可用时默认选中;不可用或多位置时清理失效选择,避免扫码提交到错误位置 - rqrq + if (positions.length === 1 && this.availablePositions.includes(positions[0])) { + this.currentSelectedPosition = positions[0] + this.scanPosition = positions[0] + this.moveFocusToScanInput() + } else if (this.availablePositions.includes(selectedPosition)) { + this.currentSelectedPosition = selectedPosition + this.scanPosition = selectedPosition + this.moveFocusToScanInput() + } } else { this.availablePositions = [] this.positionGrid = [] diff --git a/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue b/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue index eb5e8c3..7aa5bfd 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue @@ -268,7 +268,7 @@
+ +
+ 位置{{ positionGrid[0].position }}当前不可用,请检查托盘位置状态 +
@@ -612,6 +616,8 @@ export default { this.scanCode = '' this.scanPosition = '' this.scanLayer = 1 + // 新栈板先清掉旧托盘层高,后续以当前栈板类型和可用位置接口返回值为准 - rqrq + this.currentMaxLayer = 0 this.currentSelectedPosition = '' this.manualRemark = '' this.savedManualRemark = '' @@ -812,7 +818,11 @@ export default { } this.scanModalVisible = true this.scanCode = '' + // 每次打开扫码弹窗清除上次托盘的位置,防止尚未加载新位置时误扫到旧位置 - rqrq + this.scanPosition = '' this.currentSelectedPosition = '' + this.positionGrid = [] + this.availablePositions = [] this.needRefreshOnClose = false if (this.operationType === 'in') { this.scanLayer = 1 @@ -862,8 +872,12 @@ export default { }, // 按层加载位置网格与可扫位置,确保禁用态/加载态与原页面一致 - rqrq loadAvailablePositions() { + // 刷新位置期间暂停扫码,返回后仅恢复仍可用的上次选择;失败时保持禁用,避免误写已占用位置 - rqrq + const selectedPosition = this.currentSelectedPosition this.positionGridLoading = true this.availablePositions = [] + this.currentSelectedPosition = '' + this.scanPosition = '' getPalletDetails({ site: this.site, palletId: this.palletCode, @@ -886,11 +900,28 @@ export default { if (data && data.code === 0) { const result = data.data || {} const positions = result.positions || [] + // 以当前栈板接口返回的层高为准,避免类型清单尚未加载时把单层托盘当成不限高 - rqrq + if (result.maxLayer != null) { + this.currentMaxLayer = Number(result.maxLayer) + if (this.currentMaxLayer > 0) { + this.scanLayerOptions = Array.from({ length: this.currentMaxLayer }, (_, i) => i + 1) + } + } this.availablePositions = result.availablePositions || [] this.positionGrid = positions.map((position) => ({ position, count: positionCountMap[position] || 0 })) + // 单位置托盘只在位置可用时默认选中;不可用或多位置时清理失效选择,避免扫码提交到错误位置 - rqrq + if (positions.length === 1 && this.availablePositions.includes(positions[0])) { + this.currentSelectedPosition = positions[0] + this.scanPosition = positions[0] + this.moveFocusToScanInput() + } else if (this.availablePositions.includes(selectedPosition)) { + this.currentSelectedPosition = selectedPosition + this.scanPosition = selectedPosition + this.moveFocusToScanInput() + } } else { this.availablePositions = [] this.positionGrid = [] diff --git a/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue b/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue index f99e18a..2790293 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue @@ -282,7 +282,7 @@
+ +
+ 位置{{ positionGrid[0].position }}当前不可用,请检查托盘位置状态 +
@@ -675,6 +679,8 @@ export default { this.scanCode = '' this.scanPosition = '' this.scanLayer = 1 + // 新栈板先清掉旧托盘层高,后续以当前栈板类型和可用位置接口返回值为准 - rqrq + this.currentMaxLayer = 0 this.currentSelectedPosition = '' this.sortingList = [] this.originalDetailCache = {} @@ -799,7 +805,11 @@ export default { showScanModal() { this.scanModalVisible = true this.scanCode = '' + // 每次打开扫码弹窗清除上次托盘的位置,防止尚未加载新位置时误扫到旧位置 - rqrq + this.scanPosition = '' this.currentSelectedPosition = '' + this.positionGrid = [] + this.availablePositions = [] this.needRefreshOnClose = false if (this.operationType === 'in') { this.scanLayer = 1 @@ -846,8 +856,12 @@ export default { }, // 按层加载位置网格与可扫位置,确保禁用态/加载态与原页面一致 - rqrq loadAvailablePositions() { + // 刷新位置期间暂停扫码,返回后仅恢复仍可用的上次选择;失败时保持禁用,避免误写已占用位置 - rqrq + const selectedPosition = this.currentSelectedPosition this.positionGridLoading = true this.availablePositions = [] + this.currentSelectedPosition = '' + this.scanPosition = '' getPalletDetails({ site: this.site, palletId: this.palletCode, @@ -870,11 +884,28 @@ export default { if (data && data.code === 0) { const result = data.data || {} const positions = result.positions || [] + // 以当前栈板接口返回的层高为准,避免类型清单尚未加载时把单层托盘当成不限高 - rqrq + if (result.maxLayer != null) { + this.currentMaxLayer = Number(result.maxLayer) + if (this.currentMaxLayer > 0) { + this.scanLayerOptions = Array.from({ length: this.currentMaxLayer }, (_, i) => i + 1) + } + } this.availablePositions = result.availablePositions || [] this.positionGrid = positions.map((position) => ({ position, count: positionCountMap[position] || 0 })) + // 单位置托盘只在位置可用时默认选中;不可用或多位置时清理失效选择,避免扫码提交到错误位置 - rqrq + if (positions.length === 1 && this.availablePositions.includes(positions[0])) { + this.currentSelectedPosition = positions[0] + this.scanPosition = positions[0] + this.moveFocusToScanInput() + } else if (this.availablePositions.includes(selectedPosition)) { + this.currentSelectedPosition = selectedPosition + this.scanPosition = selectedPosition + this.moveFocusToScanInput() + } } else { this.availablePositions = [] this.positionGrid = []