优化
This commit is contained in:
@@ -110,6 +110,19 @@ it('does not submit a physical pallet fallback when its actual plan source ident
|
|||||||
wrapper.unmount()
|
wrapper.unmount()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('submits relabel physical pallet identity without requiring an inbound plan pallet', async () => {
|
||||||
|
vi.mocked(listDispatchDrafts).mockResolvedValue([{ draftToken: 'relabel-draft', containers: [
|
||||||
|
{ id: 'container', capacity: 30, palletIds: ['101'] },
|
||||||
|
] }])
|
||||||
|
vi.mocked(listDispatchCandidates).mockResolvedValue([{ ...plan, planPalletId: null, sourceStage: 'RELABEL', orderRefs: 'RL-1' }])
|
||||||
|
vi.mocked(preArrangeDispatch).mockResolvedValue({ id: '1', dispatchNo: 'DS-1' })
|
||||||
|
const wrapper = mountDraft(); await flushPromises(); await submitDraft(wrapper)
|
||||||
|
expect(preArrangeDispatch).toHaveBeenCalledExactlyOnceWith({ planPalletIds: ['101'], returnReceiptIds: [], relabelNo: 'RL-1' })
|
||||||
|
expect(preArrangeDraftDispatch).not.toHaveBeenCalled()
|
||||||
|
expect(wrapper.emitted('created')).toHaveLength(1)
|
||||||
|
wrapper.unmount()
|
||||||
|
})
|
||||||
|
|
||||||
it('does not send a second batch while the original command is pending', async () => {
|
it('does not send a second batch while the original command is pending', async () => {
|
||||||
vi.mocked(listDispatchDrafts).mockResolvedValue([twoGroups])
|
vi.mocked(listDispatchDrafts).mockResolvedValue([twoGroups])
|
||||||
vi.mocked(listDispatchCandidates).mockResolvedValue([plan, secondPlan, thirdPlan, returned])
|
vi.mocked(listDispatchCandidates).mockResolvedValue([plan, secondPlan, thirdPlan, returned])
|
||||||
|
|||||||
@@ -330,7 +330,8 @@ async function submit() {
|
|||||||
ElMessage.warning('草稿中存在重复托盘或无效装车容器,请核对分组;原草稿已保留')
|
ElMessage.warning('草稿中存在重复托盘或无效装车容器,请核对分组;原草稿已保留')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (assigned.value.some(item => item.sourceType === 'RETURN_RECEIPT'
|
if (assigned.value.some(item => item.sourceStage === 'RELABEL'
|
||||||
|
? !String(item.warehousePalletId || '').trim() : item.sourceType === 'RETURN_RECEIPT'
|
||||||
? !String(item.returnReceiptId || '').trim() : !String(item.planPalletId || '').trim())) {
|
? !String(item.returnReceiptId || '').trim() : !String(item.planPalletId || '').trim())) {
|
||||||
ElMessage.warning('所选托盘来源标识缺失,请重新加载核对;原草稿已保留')
|
ElMessage.warning('所选托盘来源标识缺失,请重新加载核对;原草稿已保留')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user