fix(dispatch): 展示审核预约时间并简化装车确认
This commit is contained in:
@@ -52,6 +52,17 @@ async function render(action: DispatchAction, operation?: 'ROUTE', files = false
|
||||
function field(wrapper: Pick<VueWrapper, 'findAllComponents'>, label: string) { return wrapper.findAllComponents({ name: 'ElFormItem' }).find(item => item.props('label') === label)! }
|
||||
|
||||
describe('dispatch workflow native layout', () => {
|
||||
it.each(['DISPATCH_REVIEW', 'LOADING_REVIEW'] as const)('blocks %s approval for missing appointment but keeps rejection available', async action => {
|
||||
vi.mocked(api.getDispatch).mockResolvedValue(detail({ actions: { ...actions, [action]: { allowed: true, blockCode: 'APPROVAL_BLOCKED', blockReason: '预约收货时间尚未确认' } } }))
|
||||
const wrapper = mount(DispatchWorkflowDialog, { attachTo: document.body, props: { modelValue: true, dispatchNo: 'PC/1', action }, global: { plugins: [ElementPlus] } }); await flushPromises()
|
||||
const dialog = wrapper.getComponent(AppDialog)
|
||||
expect(dialog.text()).toContain('预约收货时间尚未确认')
|
||||
expect(dialog.text()).toContain('北京时间')
|
||||
expect(dialog.findAll('button').find(button => button.text() === '审核通过')!.attributes('disabled')).toBeDefined()
|
||||
await dialog.get('textarea').setValue('请客服补齐预约时间')
|
||||
await dialog.findAll('button').find(button => button.text() === '驳回')!.trigger('click'); await flushPromises()
|
||||
expect(action === 'DISPATCH_REVIEW' ? api.reviewDispatch : api.reviewDispatchLoading).toHaveBeenCalledWith('PC/1', expect.objectContaining({ decision: 'REJECTED', reason: '请客服补齐预约时间' }))
|
||||
})
|
||||
it('submits all edited resources, dates and zero version through the continuous fullscreen form', async () => {
|
||||
const { dialog } = await render('EDIT')
|
||||
expect(dialog.props('title')).toBe('维护车辆 · PC/1')
|
||||
@@ -210,10 +221,11 @@ describe('dispatch workflow native layout', () => {
|
||||
expect(api.getDispatchItems).not.toHaveBeenCalled()
|
||||
expect(api.listDispatchCandidates).not.toHaveBeenCalled()
|
||||
})
|
||||
it('keeps references separate from real loading measurements and submits the exact manifest', async () => {
|
||||
it('confirms the scanned load in a compact dialog without measurement inputs', async () => {
|
||||
const { dialog } = await render('LOADING_COMPLETE')
|
||||
expect(dialog.get('[aria-label="确认装车完成"]').findAllComponents({ name: 'ElInputNumber' })).toHaveLength(0)
|
||||
await dialog.get('button[aria-label="展开全屏"]').trigger('click'); await flushPromises()
|
||||
expect(dialog.props('width')).toBe('560px')
|
||||
expect(dialog.text()).not.toContain('测量依据')
|
||||
dialog.vm.$emit('confirm'); await flushPromises()
|
||||
expect(api.completeDispatchLoading).toHaveBeenCalledExactlyOnceWith('PC/1', { recordVersion: 0, idempotencyKey: expect.any(String), manifestHash: 'manifest', remark: '真实备注' })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user