fix(报价单): 商品新增写价改走报价单编辑链路
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

单里已有该商品只改价格,保留单位/成本价/加价率/历史名称快照;没有则新增一行。append-items 改走 applyQuoteSheetEditAndRequestDeliveryReview,价格类变更与报价单页编辑一样发起配送商销售价确认;前端不再传 cost_price 避免清零,旧入口已删除。
This commit is contained in:
雨天
2026-10-22 12:44:11 +08:00
parent 7c514f48b3
commit a255c4eccf
7 changed files with 260 additions and 37 deletions
@@ -629,9 +629,9 @@ router.post('/quote/sheets/:code/append-items', authMiddleware, async (req: Auth
const ctx = await getWorkflowCtx(req);
const operatingBranch = readOperatingBranchCode(req);
requireWorkflowPermission(ctx, ['customer_manage', 'order_manage', 'order_entry']);
const { appendSkuPricesToQuoteSheet } = await import('../../../services/quoteSheetService');
const { appendSkuPricesAndRequestDeliveryReview } = await import('../../../services/quoteSheetEditService');
const items = Array.isArray(req.body?.items) ? req.body.items : [];
const data = await appendSkuPricesToQuoteSheet({
const result = await appendSkuPricesAndRequestDeliveryReview({
quoteSheetCode: req.params.code,
items: items.map((item: any) => ({
sku_code: String(item.sku_code || ''),
@@ -644,8 +644,9 @@ router.post('/quote/sheets/:code/append-items', authMiddleware, async (req: Auth
})),
ctx,
operatingBranchCode: operatingBranch,
requestedBy: req.userId || null,
});
return res.json({ data });
return res.json({ data: result.data, delivery_handoff: result.delivery_handoff });
} catch (error: any) {
return res.status(error?.status || 500).json({ error: 'server_error', error_description: error?.message || '写入报价单失败' });
}