fix(报价单): 商品新增写价改走报价单编辑链路
单里已有该商品只改价格,保留单位/成本价/加价率/历史名称快照;没有则新增一行。append-items 改走 applyQuoteSheetEditAndRequestDeliveryReview,价格类变更与报价单页编辑一样发起配送商销售价确认;前端不再传 cost_price 避免清零,旧入口已删除。
This commit is contained in:
@@ -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 || '写入报价单失败' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user