袁伟杰:V2.0.003 采购入库扫码

This commit is contained in:
yuan
2026-05-14 16:48:09 +08:00
parent 7f84bbca79
commit 7859af83b2
24 changed files with 3479 additions and 62 deletions

View File

@@ -7,6 +7,8 @@ export interface ScanItem {
productId: number
count: number
orderItemId?: number
batchNo?: string
locationCode?: string
}
/**
@@ -40,11 +42,13 @@ export function normalizeCameraScanResult(result?: { result?: string } | null):
* 注意事项:订单约束场景若不带订单行编号,会把不同订单行的同一产品错误合并。
*/
export function buildScanMergeKey(item: ScanItem, withOrderConstraint = false): string {
const segments = [item.warehouseId, item.productId]
const segments = [String(item.warehouseId), String(item.productId)]
// 订单约束扫码时需要把订单明细编号带入合并键,避免不同订单行误合并。
if (withOrderConstraint) {
segments.push(item.orderItemId || 0)
segments.push(String(item.orderItemId || 0))
segments.push(item.batchNo || '')
segments.push(item.locationCode || '')
}
return segments.join(':')