This commit is contained in:
2026-10-16 16:53:09 +08:00
parent 5c43a820aa
commit d4225ff5a1
4 changed files with 24 additions and 4 deletions
@@ -251,3 +251,13 @@ test('count payload carries forecast version for stale snapshot rejection',async
scope.countWarehouseTransferCartons=async(no,request)=>{payload=request;throw new Error('offline')}
await value.confirmCartons();assert.equal(payload.forecastPackageCount,1);assert.equal(payload.boxes[0].cartonMark,'BOX1')
})
test('新增预报箱无SKU绑定时恢复为可编辑箱,保留已有草稿', () => {
const { value } = setup()
value.selected.cartons.push({ cartonMark: 'NEW-UNBOUND', cartonIndex: 2, status: 'EXPECTED', transferItemId: null })
value.selected.packageCount = 2
value.restoreCartons()
const added = value.cartonBoxes.find(box => box.cartonMark === 'NEW-UNBOUND')
assert.ok(added)
assert.ok(value.declaredSkuCodes.includes(added.items[0].skuCode))
})
@@ -115,3 +115,13 @@ test('copy previous matching SKU skips other SKUs and preserves the target palle
ctx.cartonBoxes[2].items[0].quantity = 9
assert.equal(ctx.cartonBoxes[0].items[0].quantity, 12)
})
test('预报箱可调整原SKU,新增无绑定箱也可清点', () => {
const ctx = context(); const current = { ...box('B', 4), cartonMark: 'FORECAST-1', transferItemId: '1' }
assert.equal(ctx.validCartonSkuLines(current), true)
current.transferItemId = null
assert.equal(ctx.validCartonSkuLines(current), true)
current.items[0].skuCode = 'OTHER'
assert.equal(ctx.validCartonSkuLines(current), false)
assert.doesNotMatch(source, /:lock-first-sku="Boolean\(box.cartonMark\)"/)
})