fix(overseas): align all-container workbench

This commit is contained in:
2026-09-08 11:50:32 +08:00
parent 8d8df2ab81
commit 2b987bdc3d
2 changed files with 38 additions and 9 deletions
@@ -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()