This commit is contained in:
2026-10-09 18:03:34 +08:00
parent 88dc4852c6
commit ebaa265993
7 changed files with 56 additions and 86 deletions
@@ -30,7 +30,8 @@ import LastMileOrdersView from './LastMileOrdersView.vue'
const canAccess = vi.hoisted(() => vi.fn<(permissionCode: string) => boolean>(() => true))
vi.mock('@/core/access/accessPreview', () => ({ useAccessPreviewStore: () => ({ can: canAccess }) }))
vi.mock('@/shared/downloadCsv', () => ({ saveCsv: vi.fn() }))
vi.mock('vue-router', () => ({ useRouter: () => ({ push: vi.fn() }) }))
const routerPush = vi.hoisted(() => vi.fn())
vi.mock('vue-router', () => ({ useRouter: () => ({ push: routerPush }) }))
vi.mock('@/modules/warehouses', () => ({ listAllPlatformWarehouses: vi.fn() }))
vi.mock('../api/lastMileOrders', () => ({
listLastMileOrders: vi.fn(), listContainerPlanProgress: vi.fn(), getContainerPlanProgress: vi.fn(),
@@ -1179,13 +1180,12 @@ describe('LastMileOrdersView pending order and container conversion', () => {
it('keeps the return packing entry and excludes return orders from manual inbound generation', async () => {
const wrapper = await mountView()
await selectRows(wrapper, [selectedRow({ orderTypeCode: 'RETURN_RELABEL', currentStatusCode: 'IN_WAREHOUSE', sourceOrderNo: 'RETURN-1' })])
await selectRows(wrapper, [selectedRow({ orderTypeCode: 'RETURN_RELABEL', currentStatusCode: 'INBOUND_COMPLETED', sourceOrderNo: 'RETURN-1' })])
const actions = wrapper.get('.data-table__business-actions')
expect(actions.text()).not.toContain('生成入库计划')
const packing = actions.findAll('button').find(action => action.text().includes('创建退货合箱计划(1)'))!
await packing.trigger('click')
await flushPromises()
const dialog = wrapper.findAllComponents(AppDialog).find(candidate => candidate.props('title') === '退货合箱计划')!
expect(dialog.props('modelValue')).toBe(true)
expect(routerPush).toHaveBeenCalledWith({ name: 'overseas-return-inventory', query: expect.objectContaining({ packing: '1', returnNos: 'RETURN-1' }) })
})
})