优化
This commit is contained in:
@@ -307,9 +307,9 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
|
||||
it.each([
|
||||
[[], ['查看'], false],
|
||||
[['inbound-order:create'], ['查看', '生成入库计划'], false],
|
||||
[['last-mile-order:edit'], ['查看', '人工修改节点'], false],
|
||||
[['inbound-order:create', 'last-mile-order:edit'], ['查看', '生成入库计划', '人工修改节点'], false],
|
||||
[['inbound-order:create'], ['查看', '入库'], false],
|
||||
[['last-mile-order:edit'], ['查看', '修改节点'], false],
|
||||
[['inbound-order:create', 'last-mile-order:edit'], ['查看', '入库', '修改节点'], false],
|
||||
])('only collapses row actions above three for %j', async (allowed, labels, overflow) => {
|
||||
canAccess.mockImplementation(code => allowed.some(action => code === 'platform:overseas-warehouse:' + action))
|
||||
vi.mocked(listLastMileOrders).mockResolvedValue({ records: [{ id: 'order-1', customerId, orderNo: 'LM-1', currentStatus: 'PENDING_ASSIGNMENT', orderType: 'FIRST_LEG' }], page: 1, size: 10, total: 1, pages: 1 })
|
||||
@@ -469,11 +469,11 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
const wrapper = await mountView()
|
||||
const actions = wrapper.get('.el-table__body-wrapper .row-actions')
|
||||
expect(actions.text()).toContain('查看')
|
||||
expect(actions.text()).not.toContain('生成入库计划')
|
||||
expect(actions.text()).not.toContain('入库')
|
||||
expect(actions.text()).not.toContain('暂扣订单')
|
||||
|
||||
await selectRows(wrapper, [(wrapper.findComponent(DataTable).props('data') as object[])[0]])
|
||||
expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(true)
|
||||
expect((button(wrapper, '入库')!.element as HTMLButtonElement).disabled).toBe(true)
|
||||
})
|
||||
|
||||
it('keeps the original pending order table and does not render a view switch or container table', async () => {
|
||||
@@ -481,7 +481,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
expect(wrapper.text()).toContain('尾程单号')
|
||||
expect(wrapper.text()).toContain('海外仓')
|
||||
expect(wrapper.text()).toContain('转仓')
|
||||
expect(wrapper.text()).toContain('生成入库计划')
|
||||
expect(wrapper.text()).toContain('入库')
|
||||
expect(wrapper.text()).toContain('按柜批量生成')
|
||||
expect(wrapper.text()).not.toContain('按订单')
|
||||
expect(wrapper.text()).not.toContain('待分配整柜')
|
||||
@@ -545,7 +545,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
it('opens the required single-order inbound-plan form without invoking the cabinet conversion', async () => {
|
||||
const wrapper = await openPending()
|
||||
await selectRows(wrapper, [selectedRow()])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('计划入库仓')
|
||||
expect(document.body.textContent).toContain('预计到仓时间')
|
||||
@@ -572,7 +572,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
it('shows cabinet-frozen facts but never sends arrival time or per-order warehouse overrides', async () => {
|
||||
const wrapper = await openPending()
|
||||
await selectRows(wrapper, [selectedRow()])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
const confirm = [...document.body.querySelectorAll('button')]
|
||||
.find((item) => item.textContent?.includes('保存并生成入库单')) as HTMLButtonElement
|
||||
@@ -598,7 +598,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
orderTypeCode: 'ONE_CLICK_DROPSHIP',
|
||||
currentStatusCode: 'PENDING_ASSIGNMENT',
|
||||
})])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
expect(getContainerInboundPlanPreview).not.toHaveBeenCalled()
|
||||
@@ -610,7 +610,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
it('blocks manual plan creation when the cabinet has no frozen expected arrival time', async () => {
|
||||
const wrapper = await openPending()
|
||||
await selectRows(wrapper, [selectedRow({ estimatedWarehouseAt: '', warehouseEta: '—' })])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
const confirm = [...document.body.querySelectorAll('button')]
|
||||
@@ -634,7 +634,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
} as never)
|
||||
const wrapper = await openPending()
|
||||
await selectRows(wrapper, [selectedRow({ orderTypeCode: 'ONE_CLICK_DROPSHIP', pallets: 2 })])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
const palletInput = wrapper.find('.command-form').findComponent({ name: 'ElInputNumber' })
|
||||
@@ -944,7 +944,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
it('starts cabinet plan generation directly from the workbench card', async () => {
|
||||
const wrapper = await mountView()
|
||||
await openHiddenContainerWorkbench(wrapper)
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await button(wrapper, '入库')!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('头程已有 4 个托盘码,海外仓补充 1 个,最终生成 5 个托盘')
|
||||
expect(document.body.textContent).toContain('头程已有 4 托 / 海外仓补充 1 托')
|
||||
@@ -974,7 +974,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
await openHiddenContainerWorkbench(wrapper)
|
||||
|
||||
expect(wrapper.text()).toContain('柜内接柜仓业务快照不一致')
|
||||
expect((button(wrapper, '生成入库计划')!.element as HTMLButtonElement).disabled).toBe(true)
|
||||
expect((button(wrapper, '入库')!.element as HTMLButtonElement).disabled).toBe(true)
|
||||
await wrapper.get('.container-workbench-card__detail').trigger('click')
|
||||
await flushPromises()
|
||||
expect(getContainerPlanProgress).toHaveBeenCalledWith(bookingId)
|
||||
@@ -1183,7 +1183,7 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
const wrapper = await mountView()
|
||||
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('生成入库计划')
|
||||
expect(actions.text()).not.toContain('入库')
|
||||
const packing = actions.findAll('button').find(action => action.text().includes('创建退货合箱计划(1)'))!
|
||||
await packing.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
Reference in New Issue
Block a user