From 17b40118cedfcaa8ff77950b4215c86f1b3d8df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E9=94=A6=E6=B6=9B?= <26050301730@qq.com> Date: Thu, 20 Nov 2025 10:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doctorstation/components/tcm/tcmAdvice.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue b/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue index fb725902..24c47d7a 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue @@ -707,6 +707,21 @@ function isPrescriptionDeletable(prescriptionIndex) { return !hasChargedItems; } +// 计算处方总价 +function getPrescriptionTotalPrice(prescriptionIndex) { + const prescription = prescriptionList.value[prescriptionIndex]; + let totalPrice = 0; + if (prescription && prescription.prescriptionDetailsList) { + prescription.prescriptionDetailsList.forEach(item => { + // 使用decimal.js确保精度计算 + const quantity = new Decimal(item.minUnitQuantity || 0); + const unitPrice = new Decimal(item.unitPrice || 0); + totalPrice += quantity.mul(unitPrice).toNumber(); + }); + } + return totalPrice; +} + // 获取处方中的药品数量 function getPrescriptionMedicineCount(prescriptionIndex) { // 这里需要根据实际的业务逻辑来计算