支持私人地址人工报价及海外入库托盘打印和短少确认

This commit is contained in:
2026-11-04 14:11:26 +08:00
parent 84dd9dcbb4
commit 20bde6c72d
11 changed files with 292 additions and 22 deletions
@@ -51,6 +51,17 @@ describe('入库短少确认', () => {
access.can.mockReturnValue(false)
const wrapper = render(); expect(wrapper.find('button').exists()).toBe(false); wrapper.unmount()
})
it('allows ordinary overseas carton shortage confirmation with the same versioned payload', async () => {
const wrapper = render(detail({ lines: [{ id: '3', orderId: '2', fbaWarehouseCode: null, requiredPackageCount: 21, plannedPalletCount: 2 }] }))
await wrapper.get('button').trigger('click')
await wrapper.get('textarea').setValue('逐箱核对短少1箱')
await wrapper.get('[data-confirm]').trigger('click'); await flushPromises()
expect(confirmInboundShortage).toHaveBeenCalledWith('IP-1', expect.objectContaining({
expectedPackageCount: 21, receivedPackageCount: 20, reason: '逐箱核对短少1箱',
}), expect.any(String))
expect(wrapper.emitted('refresh')).toHaveLength(1)
wrapper.unmount()
})
it.each([{ status: 'PARTIAL_INBOUND' }, { pickedPackageCount: 21 }, { pickedPackageCount: 22 }, { pickedPackageCount: 0 }, { version: undefined }, { orderType: 'ONE_CLICK_DROPSHIP' }])('rejects ineligible facts %o', (overrides) => {
const wrapper = render(detail(overrides)); expect(wrapper.find('button').exists()).toBe(false); wrapper.unmount()
})
@@ -22,7 +22,7 @@ const shortage = computed(() => (expected.value ?? 0) - (received.value ?? 0))
const eligible = computed(() => access.can(overseasWarehousePermissions.inboundOrderEdit)
&& props.detail.status === 'PENDING_RECONCILIATION' && props.detail.version != null
&& props.detail.orderType !== 'ONE_CLICK_DROPSHIP' && props.detail.lines.length > 0
&& props.detail.lines.every(line => !!line.fbaWarehouseCode)
&& (props.detail.lines.every(line => !!line.fbaWarehouseCode) || props.detail.lines.every(line => !line.fbaWarehouseCode))
&& expected.value != null && received.value != null && received.value > 0 && shortage.value > 0)
function show() {