修复智能装柜订单状态多选
This commit is contained in:
@@ -280,7 +280,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
expect(wrapper.text()).toContain('MSCU-DG')
|
||||
const containerRequestCount = vi.mocked(listSmartLoadingWorkbenchContainers).mock.calls.length
|
||||
|
||||
wrapper.findComponent(QueryToolbar).vm.$emit('search', { warehouseId: '18', customerId: '', inboundCode: '', createdRange: [], orderStatus: '' })
|
||||
wrapper.findComponent(QueryToolbar).vm.$emit('search', { warehouseId: '18', customerId: '', inboundCode: '', createdRange: [], orderStatuses: [] })
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.text()).toContain('MSCU-DG')
|
||||
@@ -307,7 +307,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
await flushPromises()
|
||||
const containerRequestCount = vi.mocked(listSmartLoadingWorkbenchContainers).mock.calls.length
|
||||
|
||||
wrapper.findComponent(QueryToolbar).vm.$emit('search', { warehouseId: '18', customerId: '', inboundCode: '', createdRange: [], orderStatus: '' })
|
||||
wrapper.findComponent(QueryToolbar).vm.$emit('search', { warehouseId: '18', customerId: '', inboundCode: '', createdRange: [], orderStatuses: [] })
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.find('.channel-tags .el-checkbox-button.is-checked').text()).toBe('美森正班')
|
||||
@@ -338,7 +338,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
const containerRequestCount = vi.mocked(listSmartLoadingWorkbenchContainers).mock.calls.length
|
||||
|
||||
wrapper.findComponent(QueryToolbar).vm.$emit('search', {
|
||||
warehouseId: '', customerId: '', inboundCode: 'NYEXX2609030002', createdRange: [], orderStatus: '',
|
||||
warehouseId: '', customerId: '', inboundCode: 'NYEXX2609030002', createdRange: [], orderStatuses: [],
|
||||
})
|
||||
await flushPromises()
|
||||
|
||||
@@ -363,7 +363,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
expect(source).toContain(': candidate.availablePackageCount')
|
||||
})
|
||||
|
||||
it('filters candidates by expected arrival range and order status', async () => {
|
||||
it('filters candidates by creation range and multiple order statuses', async () => {
|
||||
vi.mocked(listSmartLoadingCandidates)
|
||||
.mockResolvedValueOnce(candidatePage([
|
||||
{ ...candidate, inboundId: '51', inboundCode: 'IN-MATCH', orderStatusSnapshot: 'WAIT_SPLIT', expectedArrivalAt: '2026-09-11T08:00:00' },
|
||||
@@ -376,7 +376,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
const containerRequestCount = vi.mocked(listSmartLoadingWorkbenchContainers).mock.calls.length
|
||||
|
||||
wrapper.getComponent(QueryToolbar).vm.$emit('search', {
|
||||
customerId: '', inboundCode: '', orderStatus: 'WAIT_SPLIT', createdRange: ['2026-09-10', '2026-09-12'],
|
||||
customerId: '', inboundCode: '', orderStatuses: ['WAIT_SPLIT', 'LOADING'], createdRange: ['2026-09-10', '2026-09-12'],
|
||||
})
|
||||
await flushPromises()
|
||||
|
||||
@@ -384,7 +384,7 @@ describe('GlobalSmartLoadingView', () => {
|
||||
expect(candidates).toContain('IN-MATCH')
|
||||
expect(candidates).not.toContain('IN-WRONG-STATUS')
|
||||
expect(candidates).not.toContain('IN-WRONG-DATE')
|
||||
expect(listSmartLoadingCandidates).toHaveBeenLastCalledWith({ channelGroupCodes: ['MATSON_CLX'], createdStart: '2026-09-10', createdEnd: '2026-09-12', orderStatus: 'WAIT_SPLIT', page: 1, size: 20 })
|
||||
expect(listSmartLoadingCandidates).toHaveBeenLastCalledWith({ channelGroupCodes: ['MATSON_CLX'], createdStart: '2026-09-10', createdEnd: '2026-09-12', orderStatuses: ['WAIT_SPLIT', 'LOADING'], page: 1, size: 20 })
|
||||
expect(listSmartLoadingWorkbenchContainers).toHaveBeenCalledTimes(containerRequestCount)
|
||||
expect(listSmartLoadingWorkbenchContainers).toHaveBeenLastCalledWith({ channelGroupCodes: ['MATSON_CLX'], page: 1, size: 200 })
|
||||
})
|
||||
@@ -520,16 +520,16 @@ describe('GlobalSmartLoadingView', () => {
|
||||
const wrapper = mount(GlobalSmartLoadingView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
const fields = wrapper.findComponent(QueryToolbar).props('fields') as Array<{ key: string; options?: Array<{ label: string; value: string }> }>
|
||||
expect(fields.map((field) => field.key)).toEqual(['warehouseId', 'customerId', 'inboundCode', 'createdRange', 'orderStatus'])
|
||||
const fields = wrapper.findComponent(QueryToolbar).props('fields') as Array<{ key: string; options?: Array<{ label: string; value: string }>; props?: Record<string, unknown> }>
|
||||
expect(fields.map((field) => field.key)).toEqual(['warehouseId', 'customerId', 'inboundCode', 'createdRange', 'orderStatuses'])
|
||||
expect(fields.find((field) => field.key === 'warehouseId')?.options).toEqual([{ label: '义乌仓', value: '8' }])
|
||||
expect(fields.find((field) => field.key === 'orderStatus')?.options).toEqual([
|
||||
{ value: '', label: '全部' },
|
||||
expect(fields.find((field) => field.key === 'orderStatuses')?.options).toEqual([
|
||||
{ value: 'PENDING_REVIEW', label: '待审核' },
|
||||
{ value: 'WAIT_MEASURE', label: '待测量数据' },
|
||||
{ value: 'WAIT_SPLIT', label: '待分柜' },
|
||||
{ value: 'LOADING', label: '装柜中' },
|
||||
])
|
||||
expect(fields.find((field) => field.key === 'orderStatuses')?.props).toMatchObject({ multiple: true, collapseTags: true, maxCollapseTags: 2 })
|
||||
expect(source).not.toContain('目的仓')
|
||||
|
||||
expect(wrapper.text()).not.toContain('税率')
|
||||
|
||||
Reference in New Issue
Block a user