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

用户要求:每行商品可单独驳回;部分同意 = 只处理选中的行。
- approve/reject 接 included_supplier_sku_codes:只处理选中行,其余保持待审
- 全部处理完才终态;有通过⇒已通过(被驳回行记 rejected_codes),全驳回⇒已驳回
- 明细行新增「驳回」按钮(按我方 SKU);通过/驳回都支持传选中行
- 测试:后端 34 passed、面板 7 passed
This commit is contained in:
Ubuntu
2026-10-19 14:22:38 +08:00
parent e5bd52de33
commit dd57b0286b
8 changed files with 227 additions and 11 deletions
@@ -416,8 +416,17 @@ router.post('/quote/price-proposals/:id/approve', authMiddleware, async (req: Au
ctx,
operatingBranchCode: readOperatingBranchCode(req),
reviewedBy: req.userId || null,
includedSupplierSkuCodes: Array.isArray(req.body?.included_supplier_sku_codes)
? req.body.included_supplier_sku_codes
: null,
});
return res.json({
data: result.proposal,
applied: result.applied,
receipt_sent: result.receiptSent,
partial: result.partial ?? false,
remaining: result.remaining ?? 0,
});
return res.json({ data: result.proposal, applied: result.applied, receipt_sent: result.receiptSent });
} catch (error: any) {
return res.status(error?.status || 500).json({
error: error?.code || 'server_error',
@@ -440,8 +449,16 @@ router.post('/quote/price-proposals/:id/reject', authMiddleware, async (req: Aut
ctx,
operatingBranchCode: readOperatingBranchCode(req),
reviewedBy: req.userId || null,
includedSupplierSkuCodes: Array.isArray(req.body?.included_supplier_sku_codes)
? req.body.included_supplier_sku_codes
: null,
});
return res.json({
data: result.proposal,
receipt_sent: result.receiptSent,
partial: result.partial ?? false,
remaining: result.remaining ?? 0,
});
return res.json({ data: result.proposal, receipt_sent: result.receiptSent });
} catch (error: any) {
return res.status(error?.status || 500).json({
error: error?.code || 'server_error',