From 96c603327ee9dc8e01e2ba40096987a25fe85651 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 24 Apr 2026 17:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../consumer/prescription/order_list.vue | 23 ++++++++++++++++--- .../logic/tcm/PrescriptionOrderLogic.php | 2 ++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/admin/src/views/consumer/prescription/order_list.vue b/admin/src/views/consumer/prescription/order_list.vue index ff94a944..ea89b4e8 100644 --- a/admin/src/views/consumer/prescription/order_list.vue +++ b/admin/src/views/consumer/prescription/order_list.vue @@ -1809,9 +1809,18 @@ ¥{{ ((gancaoPreviewData.fee?.lis_cost || 0) ).toFixed(2) }} - - ¥{{ calculateTotalFee(gancaoPreviewData.fee) }} - +
+ + ¥{{ calculateTotalFee(gancaoPreviewData.fee) }} + +
+ 占订单总金额: + + {{ gancaoFeePercentOfOrderAmount(gancaoPreviewData.fee, gancaoPreviewData.amount) }} + + %(预报价 ÷ 订单金额 × 100) +
+
@@ -3272,6 +3281,14 @@ function calculateTotalFee(fee: any) { return (mCost + procesCost + lisCost).toFixed(2) } +/** 预报价合计 ÷ 本单总金额 × 100 */ +function gancaoFeePercentOfOrderAmount(fee: any, orderAmount: unknown) { + const total = parseFloat(calculateTotalFee(fee)) || 0 + const amt = Number(orderAmount) || 0 + if (amt <= 0) return '—' + return ((total / amt) * 100).toFixed(2) +} + // 计算单剂量(所有药材用量总和) function calculateSingleDoseWeight(mList: any[]) { if (!Array.isArray(mList) || mList.length === 0) return '0' diff --git a/server/app/adminapi/logic/tcm/PrescriptionOrderLogic.php b/server/app/adminapi/logic/tcm/PrescriptionOrderLogic.php index 5feec47f..7e8f22e2 100644 --- a/server/app/adminapi/logic/tcm/PrescriptionOrderLogic.php +++ b/server/app/adminapi/logic/tcm/PrescriptionOrderLogic.php @@ -2117,6 +2117,8 @@ class PrescriptionOrderLogic 'result' => $result, 'order_no' => (string) $order->order_no, 'dose_count' => (int) ($orderArr['dose_count'] ?? $rx['dose_count'] ?? 0), + /** 本业务订单金额(与甘草预报价合计对比占比用) */ + 'amount' => round((float) ($order->amount ?? 0), 2), ]; }