优化
This commit is contained in:
@@ -36,11 +36,10 @@ test('quantity is explicit, integral and source bounded; wrong target cannot wri
|
||||
test('all action needs confirmation and rescanning clears quantity and target', async () => {
|
||||
for (const confirm of [false, true]) { const { value } = setup(confirm); value.verifyReturnCarton('BOX-A'); await value.fillAllReturn(value.current.items[0]); assert.equal(value.bulkQuantities['1'], confirm ? '4' : undefined); value.verifyReturnCarton('BOX-B'); assert.deepEqual(value.bulkQuantities, {}); assert.deepEqual(value.returnTargetLabels, {}) }
|
||||
})
|
||||
test('normal return SKU requires source and explicit SKU pieces before server scan', async () => {
|
||||
test('normal return SKU rejects incomplete approved target before server scan', async () => {
|
||||
const { value, errors } = setup(); const item = { ...value.current.items[0], operationType: 'SKU_LABEL', expectedPackages: 1, skuItems: [{ skuCode: 'SKU', newSkuCode: 'TARGET', quantity: 3 }] }
|
||||
value.current.items = [item]; value.pendingSkuRows = [{ item, sku: item.skuItems[0], index: 0 }]
|
||||
await value.submitSku('SKU'); assert.match(errors.pop(), /先扫描/)
|
||||
value.verifyReturnCarton('BOX-A'); value.quickSku = 'SKU'; await value.commitSku(value.pendingSkuRows[0]); assert.match(errors.pop(), /实际件数/)
|
||||
item.skuItems[0].newSkuCode = ''; value.quickSku = 'SKU'; await value.commitSku(value.pendingSkuRows[0]); assert.match(errors.pop(), /申请件数缺失/)
|
||||
})
|
||||
test('packing uses SKU pieces instead of box count and preserves both sources', () => {
|
||||
const task = { items: [{ returnCartonId: '1', cartonMark: 'A', operationType: 'SKU_LABEL', expectedPackages: 1, returnQuantity: 8, skuItems: [{ skuCode: 'SKU', quantity: 3 }] }, { returnCartonId: '2', cartonMark: 'B', operationType: 'SKU_LABEL', expectedPackages: 1, returnQuantity: 2, skuItems: [{ skuCode: 'SKU', quantity: 2 }] }] }
|
||||
|
||||
Reference in New Issue
Block a user