修复bug

This commit is contained in:
叶锦涛
2025-11-20 10:47:49 +08:00
parent d10a78e5e8
commit 17b40118ce

View File

@@ -707,6 +707,21 @@ function isPrescriptionDeletable(prescriptionIndex) {
return !hasChargedItems; 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) { function getPrescriptionMedicineCount(prescriptionIndex) {
// 这里需要根据实际的业务逻辑来计算 // 这里需要根据实际的业务逻辑来计算