feat(订单列表): 抵扣批次按钮改为立即重跑库存抵扣
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

- 状态行库存抵扣仍打开批次明细
- 操作列库存抵扣立即重跑并刷新,覆盖我方录单
- 非主系统单只重算本单 cover,不重新分配供应商
- 独立进货单仍禁止抵扣
This commit is contained in:
Ubuntu
2026-10-26 16:54:13 +08:00
parent 05b81348c4
commit db0cbb0fd9
4 changed files with 38 additions and 26 deletions
@@ -847,6 +847,12 @@ router.post('/orders/:orderCode/inventory-offset', authMiddleware, async (req: A
branchCode,
orderStatus: Number(order.order_status) || 0,
});
if (outcome.kind === 'independent_inbound') {
return res.status(400).json({
error: 'independent_inbound_no_offset',
error_description: '独立进货单不能用库存抵扣',
});
}
if (outcome.kind === 'not_main_system_order') {
return res.status(400).json({
error: 'not_main_system_order',