fix: expose manual plans awaiting pallets

This commit is contained in:
2026-09-10 16:33:43 +08:00
parent 4382351569
commit 0ed913a114
5 changed files with 11 additions and 8 deletions
@@ -131,7 +131,7 @@ describe('last-mile order overseas API', () => {
const record = {
sourceContainerBookingId: '2092873463568597001', containerNo: 'CONT-15', totalOrderCount: 15,
inboundCodeCount: 13, missingInboundCodeCount: 2, planCount: 10, plannedInboundCodeCount: 10,
pendingPlanCount: 5, plannedArrivalAt: '2026-09-01T08:00:00', allPlansReady: false, blockingReason: '存在2票缺少入仓码',
pendingPlanCount: 5, resourcePendingPlanCount: 0, plannedArrivalAt: '2026-09-01T08:00:00', allPlansReady: false, blockingReason: '存在2票缺少入仓码',
}
vi.mocked(overseasHttp.get).mockResolvedValue({
code: '200', message: 'success', data: { records: [record], page: '2', size: '10', total: '21', pages: '3' },
@@ -182,6 +182,7 @@ export interface ContainerPlanProgressSummaryDto {
planCount: number
plannedInboundCodeCount: number
pendingPlanCount: number
resourcePendingPlanCount: number
plannedArrivalAt: string | null
allPlansReady: boolean
blockingReason: string | null
@@ -52,7 +52,7 @@ const summary = {
overseasWarehouseId: '9007199254740995', overseasWarehouseCode: 'LAX01', overseasWarehouseName: '洛杉矶接柜仓',
assignmentVersion: 7, canChangeReceivingWarehouse: true, receivingWarehouseLockReason: null,
inboundCodeCount: 15, missingInboundCodeCount: 0, planCount: 10, plannedInboundCodeCount: 10,
pendingPlanCount: 5, plannedArrivalAt: '2026-09-01T08:00:00', allPlansReady: false,
pendingPlanCount: 5, resourcePendingPlanCount: 0, plannedArrivalAt: '2026-09-01T08:00:00', allPlansReady: false,
blockingReason: '存在5票尚未生成有效入库计划',
}
const fbaWarehouse = {
@@ -398,12 +398,13 @@ describe('LastMileOrdersView pending order and container conversion', () => {
expect(wrapper.text().indexOf('CONT-15')).toBeLessThan(wrapper.text().indexOf('CONT-NULL'))
})
it('keeps an all-plans-ready cabinet visible and allows only the server-authorized warehouse change', async () => {
it('keeps an all-plans-ready cabinet available when its real pallets are still pending', async () => {
const ready = {
...summary,
planCount: summary.inboundCodeCount,
plannedInboundCodeCount: summary.inboundCodeCount,
pendingPlanCount: 0,
resourcePendingPlanCount: 1,
allPlansReady: true,
blockingReason: null,
}
@@ -412,7 +413,8 @@ describe('LastMileOrdersView pending order and container conversion', () => {
await openHiddenContainerWorkbench(wrapper)
expect(wrapper.text()).toContain('CONT-15')
expect(wrapper.text()).toContain('0个入仓码待生成计划')
expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(true)
expect(wrapper.text()).toContain('1 票待补真实托盘')
expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(false)
expect((button(wrapper, '修改接柜仓')!.element as HTMLButtonElement).disabled).toBe(false)
})
@@ -246,13 +246,12 @@ function inboundPlanStatusLabel(value: unknown) {
} as Record<string, string>)[code] || (code ? '未知状态' : '—')
}
function canGenerateContainerPlans(container: ContainerPlanProgressSummaryDto) {
return Boolean(!container.allPlansReady
&& container.containerNo
return Boolean(container.containerNo
&& container.overseasWarehouseId
&& container.overseasWarehouseCode
&& container.overseasWarehouseName
&& container.assignmentVersion >= 0
&& container.pendingPlanCount > 0)
&& (container.pendingPlanCount > 0 || container.resourcePendingPlanCount > 0))
}
function containerSnapshotBlockReason(container: ContainerPlanProgressSummaryDto) {
if (!container.containerNo) return container.blockingReason || '来源柜真实集装箱号缺失、格式无效或存在漂移'
@@ -772,6 +771,7 @@ onMounted(() => { void load() })
</span>
<span class="container-workbench-card__facts">
<span>共 {{ container.inboundCodeCount }} 个入仓码</span>
<span v-if="container.resourcePendingPlanCount">{{ container.resourcePendingPlanCount }} 票待补真实托盘</span>
</span>
<span class="container-workbench-card__actions">
<el-button class="container-workbench-card__detail" plain @click="openContainerDetail(container)">查看详情</el-button>