From d18da8992544bb99ca9e7c4f83159e66cbff3871 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Wed, 19 Aug 2026 00:00:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(inbound):=20PENDING=20=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E4=B8=8D=E5=86=8D=E5=BC=BA=E5=88=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=94=B6=E8=B4=A7=E5=8D=95=E4=B8=8E=E6=98=8E=E7=BB=86?= =?UTF-8?q?=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 允许导入:items 可传 receiving_detail_id 走绑定模式(预占收货明细), 也可不传走非绑定模式(数量受计划数量限制) - 绑定模式下 space_id/明细可用数量校验统一由 _addSingleItem 处理 --- app/service/systems/inbound_direct_log.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/service/systems/inbound_direct_log.js b/app/service/systems/inbound_direct_log.js index 49556a1..77d6cc4 100644 --- a/app/service/systems/inbound_direct_log.js +++ b/app/service/systems/inbound_direct_log.js @@ -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;