优化
This commit is contained in:
@@ -58,14 +58,14 @@ test('delete only changes actual draft and preserves forecast; additions keep th
|
||||
test('draft reload preserves deletions, including an empty actual list', () => {
|
||||
const ctx = context()
|
||||
ctx.selected.cartons = [{ cartonMark: 'BOX1', transferItemId: '1', status: 'EXPECTED' }, { cartonMark: 'BOX2', transferItemId: '2', status: 'EXPECTED' }]
|
||||
let saved = { boxes: [{ ...box('B'), cartonMark: 'BOX2', transferItemId: '2' }], discrepancyReason: '少到一箱' }
|
||||
let saved = { forecastMarks: ['BOX1','BOX2'], boxes: [{ ...box('B'), cartonMark: 'BOX2', transferItemId: '2' }], discrepancyReason: '少到一箱' }
|
||||
globalThis.uni = { getStorageSync: () => saved }
|
||||
try {
|
||||
ctx.restoreCartons()
|
||||
assert.equal(ctx.cartonBoxes.length, 1)
|
||||
assert.equal(ctx.cartonBoxes[0].cartonMark, 'BOX2')
|
||||
assert.equal(ctx.countDiscrepancyReason, '少到一箱')
|
||||
saved = { boxes: [], discrepancyReason: '重新录入' }
|
||||
saved = { forecastMarks: ['BOX1','BOX2'], boxes: [], discrepancyReason: '重新录入' }
|
||||
ctx.restoreCartons()
|
||||
assert.equal(ctx.cartonBoxes.length, 0)
|
||||
assert.equal(ctx.selected.cartons.length, 2)
|
||||
@@ -93,7 +93,7 @@ test('100 same SKU cartons accept two distinct specification groups and independ
|
||||
assert.equal(ctx.palletSummary(ctx.pallets[1]).cartonCount, 40)
|
||||
assert.equal(ctx.cartonQuantity, 1040)
|
||||
assert.equal(ctx.totalWeight, '580.00')
|
||||
assert.equal(ctx.totalVolume, '3.840000')
|
||||
assert.equal(ctx.totalVolume, '3.840')
|
||||
assert.equal(ctx.cartonCountReady, true)
|
||||
ctx.cartonBoxes[0].items[0].quantity = 11
|
||||
ctx.cartonBoxes[0].weight = 6
|
||||
|
||||
Reference in New Issue
Block a user