This commit is contained in:
Your Name
2026-04-24 17:01:47 +08:00
parent 5d7b1e97fd
commit 96c603327e
2 changed files with 22 additions and 3 deletions
@@ -1809,9 +1809,18 @@
<span class="text-lg font-semibold text-green-600">¥{{ ((gancaoPreviewData.fee?.lis_cost || 0) ).toFixed(2) }}</span>
</el-descriptions-item>
<el-descriptions-item label="总计">
<span class="text-xl font-bold text-red-600">
¥{{ calculateTotalFee(gancaoPreviewData.fee) }}
</span>
<div>
<span class="text-xl font-bold text-red-600">
¥{{ calculateTotalFee(gancaoPreviewData.fee) }}
</span>
<div class="text-sm text-gray-500 mt-1.5" v-perms="['prescription.order/finance']">
占订单总金额
<span class="font-medium text-gray-700">
{{ gancaoFeePercentOfOrderAmount(gancaoPreviewData.fee, gancaoPreviewData.amount) }}
</span>
<span v-if="gancaoPreviewData.amount > 0">%预报价 ÷ 订单金额 × 100</span>
</div>
</div>
</el-descriptions-item>
</el-descriptions>
</el-card>
@@ -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'
@@ -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),
];
}