This commit is contained in:
2026-10-14 13:53:15 +08:00
parent e7411eb03f
commit cb38114db9
2 changed files with 15 additions and 1 deletions
@@ -110,6 +110,19 @@ it('does not submit a physical pallet fallback when its actual plan source ident
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 () => {
vi.mocked(listDispatchDrafts).mockResolvedValue([twoGroups])
vi.mocked(listDispatchCandidates).mockResolvedValue([plan, secondPlan, thirdPlan, returned])
@@ -330,7 +330,8 @@ async function submit() {
ElMessage.warning('草稿中存在重复托盘或无效装车容器,请核对分组;原草稿已保留')
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())) {
ElMessage.warning('所选托盘来源标识缺失,请重新加载核对;原草稿已保留')
return