From 2b987bdc3dc9d403b93af6b7360b8682d51e999f Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 8 Sep 2026 11:50:32 +0800 Subject: [PATCH] fix(overseas): align all-container workbench --- .../pages/LastMileOrdersView.behavior.test.ts | 36 ++++++++++++++++--- .../pages/LastMileOrdersView.vue | 11 +++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/modules/overseas-warehouse/pages/LastMileOrdersView.behavior.test.ts b/src/modules/overseas-warehouse/pages/LastMileOrdersView.behavior.test.ts index a5d3f021..5ec6c4e2 100644 --- a/src/modules/overseas-warehouse/pages/LastMileOrdersView.behavior.test.ts +++ b/src/modules/overseas-warehouse/pages/LastMileOrdersView.behavior.test.ts @@ -281,7 +281,7 @@ describe('LastMileOrdersView pending order and container conversion', () => { expect(wrapper.text()).toContain(`trace-${code}`) }) - it('renders pending cabinets as an arrival-ordered workbench with the remaining inbound-code count', async () => { + it('renders all cabinets as an arrival-ordered workbench with the remaining inbound-code count', async () => { const nullArrival = { ...summary, sourceContainerBookingId: '2092873463568597002', containerNo: 'CONT-NULL', plannedArrivalAt: null, planCount: 0, pendingPlanCount: 15 } vi.mocked(listContainerPlanProgress).mockResolvedValueOnce({ records: [summary, nullArrival], page: 1, size: 10, total: 2, pages: 1 }) const wrapper = await mountView() @@ -290,18 +290,46 @@ describe('LastMileOrdersView pending order and container conversion', () => { await flushPromises() expect(listContainerPlanProgress).toHaveBeenLastCalledWith({ page: 1, size: 10, containerNo: undefined, createdFrom: undefined, createdTo: undefined }) expect(wrapper.text()).toContain('柜子工作台(2)') - expect(wrapper.text()).toContain('待处理柜工作台') - expect(wrapper.text()).toContain('按计划到仓时间由近到远排列') + expect(wrapper.text()).toContain('货柜工作台') + expect(wrapper.text()).toContain('按柜查看和修改海外接柜仓,并为剩余入仓码生成独立入库计划') expect(wrapper.text()).toContain('5个入仓码待生成计划') expect(wrapper.text()).toContain('共 15 个入仓码') expect(wrapper.text()).not.toContain('待补入仓码') expect(wrapper.text()).not.toContain('缺入仓码') expect(wrapper.text()).not.toContain('已生成 10 个计划') expect(wrapper.text()).not.toContain('存在5票尚未生成有效入库计划') - expect(wrapper.text()).toContain('2 个柜待处理') + expect(wrapper.text()).toContain('2 个货柜') 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 () => { + const ready = { + ...summary, + planCount: summary.inboundCodeCount, + plannedInboundCodeCount: summary.inboundCodeCount, + pendingPlanCount: 0, + allPlansReady: true, + blockingReason: null, + } + vi.mocked(listContainerPlanProgress).mockResolvedValueOnce({ records: [ready], page: 1, size: 10, total: 1, pages: 1 }) + const wrapper = await mountView() + await wrapper.findAll('.el-radio-button').find((item) => item.text().startsWith('柜子'))!.trigger('click') + await flushPromises() + expect(wrapper.text()).toContain('CONT-15') + expect(wrapper.text()).toContain('0个入仓码待生成计划') + expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(true) + expect((button(wrapper, '修改接柜仓')!.element as HTMLButtonElement).disabled).toBe(false) + }) + + it('renders the all-cabinet empty state and unit', async () => { + vi.mocked(listContainerPlanProgress).mockResolvedValueOnce({ records: [], page: 1, size: 10, total: 0, pages: 0 }) + const wrapper = await mountView() + await wrapper.findAll('.el-radio-button').find((item) => item.text().startsWith('柜子'))!.trigger('click') + await flushPromises() + expect(wrapper.text()).toContain('暂无货柜数据') + expect(wrapper.text()).not.toContain('已全部生成计划的柜不再展示') + }) + it('uses independent cabinet pagination and opens the complete long-id detail in a dialog', async () => { vi.mocked(listContainerPlanProgress).mockResolvedValue({ records: [summary], page: 1, size: 10, total: 21, pages: 3 }) const wrapper = await mountView() diff --git a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue index 2220027e..310e64bf 100644 --- a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue +++ b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue @@ -226,7 +226,8 @@ function inboundPlanStatusLabel(value: unknown) { } as Record)[code] || (code ? '未知状态' : '—') } function canGenerateContainerPlans(container: ContainerPlanProgressSummaryDto) { - return Boolean(container.containerNo + return Boolean(!container.allPlansReady + && container.containerNo && container.overseasWarehouseId && container.overseasWarehouseCode && container.overseasWarehouseName @@ -605,8 +606,8 @@ onMounted(() => { void load() })
-
待处理柜工作台按计划到仓时间由近到远排列,已全部生成计划的柜不再展示
- {{ containerTotal }} 个柜待处理 +
货柜工作台按柜查看和修改海外接柜仓,并为剩余入仓码生成独立入库计划
+ {{ containerTotal }} 个货柜
@@ -632,9 +633,9 @@ onMounted(() => { void load() })
- +
- 共 {{ containerTotal }} 个待处理柜 + 共 {{ containerTotal }} 个货柜