feat(审核): 支持逐行通过/驳回(部分同意)
用户要求:每行商品可单独驳回;部分同意 = 只处理选中的行。 - approve/reject 接 included_supplier_sku_codes:只处理选中行,其余保持待审 - 全部处理完才终态;有通过⇒已通过(被驳回行记 rejected_codes),全驳回⇒已驳回 - 明细行新增「驳回」按钮(按我方 SKU);通过/驳回都支持传选中行 - 测试:后端 34 passed、面板 7 passed
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user