fix(inbound): PENDING 状态上架不再强制绑定收货单与明细 ID
- 允许导入:items 可传 receiving_detail_id 走绑定模式(预占收货明细), 也可不传走非绑定模式(数量受计划数量限制) - 绑定模式下 space_id/明细可用数量校验统一由 _addSingleItem 处理
This commit is contained in:
parent
864351977b
commit
d18da89925
@ -638,17 +638,9 @@ class InboundDirectLogService extends Service {
|
||||
return { code: 400, message: '入库单已绑定收货单且状态为 CREATED,请先审核后再进行上架操作', data: null };
|
||||
}
|
||||
|
||||
// PENDING 状态校验
|
||||
if (entryOrder.order_status === 'PENDING') {
|
||||
if (!hasReceivingBindings) {
|
||||
return { code: 400, message: '入库单未绑定收货单,无法上架', data: null };
|
||||
}
|
||||
for (const item of items) {
|
||||
if (!item.receiving_detail_id) {
|
||||
return { code: 400, message: '随机入库需要选定收货单明细提交,缺少 receiving_detail_id', data: null };
|
||||
}
|
||||
}
|
||||
}
|
||||
// PENDING 状态:允许导入。items 可传 receiving_detail_id 走绑定模式(预占收货明细),
|
||||
// 也可不传走非绑定模式(数量受计划数量限制),不再强制绑定收货单、不再强制传收货单 ID;
|
||||
// 绑定模式下的 space_id/明细可用数量等校验由 _addSingleItem 统一处理。
|
||||
|
||||
// 批量模式下用事务包裹,任一失败整批回退
|
||||
const useTransaction = isBatch;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user