fix: lock dropship inbound plan pallet count
This commit is contained in:
@@ -287,6 +287,40 @@ describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
expect(payload).not.toHaveProperty('plannedWarehouseName')
|
||||
})
|
||||
|
||||
it('locks one-click dropship manual plans to the frozen source pallet count', async () => {
|
||||
vi.mocked(getContainerInboundPlanPreview).mockResolvedValue({
|
||||
...preview,
|
||||
sourcePalletCount: 1,
|
||||
groups: [{
|
||||
...preview.groups[0], destinationType: 'ONE_CLICK_DROPSHIP', sourcePalletCount: 1,
|
||||
orders: [{
|
||||
...preview.groups[0].orders[0], orderType: 'ONE_CLICK_DROPSHIP',
|
||||
destinationType: 'ONE_CLICK_DROPSHIP', sourcePalletCount: 1,
|
||||
targetPalletCount: 1, supplementPalletCount: 0,
|
||||
}],
|
||||
}],
|
||||
} as never)
|
||||
const wrapper = await openPending()
|
||||
await selectRows(wrapper, [selectedRow({ orderTypeCode: 'ONE_CLICK_DROPSHIP', pallets: 2 })])
|
||||
await button(wrapper, '生成入库计划')!.trigger('click')
|
||||
await flushPromises()
|
||||
|
||||
const palletInput = wrapper.find('.command-form').findComponent({ name: 'ElInputNumber' })
|
||||
expect(palletInput.props('disabled')).toBe(true)
|
||||
expect(palletInput.props('modelValue')).toBe(1)
|
||||
expect(document.body.textContent).toContain('固定按头程已封托托盘数整体入库')
|
||||
|
||||
wrapper.find('.command-form').findComponent({ name: 'ElDatePicker' })
|
||||
.vm.$emit('update:modelValue', '2026-09-08')
|
||||
await wrapper.vm.$nextTick()
|
||||
;([...document.body.querySelectorAll('button')]
|
||||
.find((item) => item.textContent?.includes('保存并生成入库单')) as HTMLButtonElement).click()
|
||||
await flushPromises()
|
||||
|
||||
expect(createManualInboundPlan).toHaveBeenCalledWith(expect.objectContaining({ palletCount: 1 }),
|
||||
expect.stringContaining('manual-inbound-plan-'))
|
||||
})
|
||||
|
||||
it('opens a cabinet selector without requiring order selection and loads server summaries only then', async () => {
|
||||
const wrapper = await openPending()
|
||||
await openContainerDialog(wrapper)
|
||||
|
||||
Reference in New Issue
Block a user