This commit is contained in:
2026-09-02 14:39:34 +08:00
parent 0708b4a262
commit 637b202559
20 changed files with 370 additions and 113 deletions
@@ -175,42 +175,48 @@ describe('LastMileOrdersView pending order and container conversion', () => {
expect(wrapper.text()).toContain(`trace-${code}`)
})
it('loads the cabinet tab from server progress, shows the total and preserves server arrival ordering', async () => {
it('renders pending 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 completed = { ...summary, sourceContainerBookingId: '2092873463568597003', containerNo: 'CONT-DONE', plannedInboundCodeCount: 15, pendingPlanCount: 0, allPlansReady: true }
vi.mocked(listContainerPlanProgress).mockResolvedValueOnce({ records: [completed, summary, nullArrival], page: 1, size: 10, total: 3, pages: 1 })
const wrapper = await mountView()
const containerTab = wrapper.findAll('.el-radio-button').find((item) => item.text().startsWith('柜子'))
await containerTab!.trigger('click')
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('已有 15 / 缺 0')
expect(wrapper.text()).toContain('已生成10个计划,剩余5个未操作')
expect(wrapper.text()).toContain('未就绪')
expect(wrapper.text()).toContain('存在5票尚未生成有效入库计划')
expect(wrapper.text()).toContain('柜子工作台(2)')
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()).not.toContain('CONT-DONE')
expect(wrapper.text()).toContain('2 个柜待处理')
expect(wrapper.text().indexOf('CONT-15')).toBeLessThan(wrapper.text().indexOf('CONT-NULL'))
})
it('uses independent cabinet pagination and loads a compact long-id detail drawer', async () => {
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()
const containerTab = wrapper.findAll('.el-radio-button').find((item) => item.text().startsWith('柜子'))
await containerTab!.trigger('click')
await flushPromises()
const pageTwo = wrapper.find('button[aria-label="第 2 页"]')
await pageTwo.trigger('click')
const pagination = wrapper.findComponent({ name: 'ElPagination' })
pagination.vm.$emit('current-change', 2)
await flushPromises()
expect(listContainerPlanProgress).toHaveBeenLastCalledWith(expect.objectContaining({ page: 2, size: 10 }))
const viewButtons = wrapper.findAll('button').filter((item) => item.text() === '查看')
const viewButton = viewButtons[viewButtons.length - 1]
await viewButton!.trigger('click')
await wrapper.get('.container-workbench-card').trigger('click')
await flushPromises()
expect(getContainerPlanProgress).toHaveBeenCalledWith(bookingId)
expect(document.body.textContent).toContain('柜级入库计划详情')
expect(document.body.textContent).toContain('柜子详情 · CONT-15')
expect(document.body.textContent).toContain('LMO-1')
expect(document.body.textContent).toContain('IN-1')
expect(document.body.textContent).toContain('LIP-1')
expect(document.body.querySelector('.el-dialog')).not.toBeNull()
expect(document.body.querySelector('.el-drawer')).toBeNull()
})
it('loads only active FBA master data and submits exact string fields for a cross-customer transfer', async () => {