diff --git a/backend/app/services/order_service.py b/backend/app/services/order_service.py index d7d0c97..42f4bbe 100644 --- a/backend/app/services/order_service.py +++ b/backend/app/services/order_service.py @@ -131,10 +131,11 @@ class OrderService: try: result = pricing_engine.calculate_for_order_item(rule, user_inputs, product_attrs) - # 不覆盖前端传入的 cost_price,只填充快照字段用于展示 item_copy = dict(item) - # 填充快照字段 + # 使用定价引擎计算的 cost_price(包含单位换算、公式计算、附加费) snapshot = result.get("item_snapshot", {}) + if snapshot.get("cost_price") is not None: + item_copy["cost_price"] = snapshot["cost_price"] if snapshot.get("pricing_type"): item_copy["pricing_type"] = snapshot["pricing_type"] if result.get("area_sqm"):