修复bug
This commit is contained in:
@@ -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) {
|
||||||
// 这里需要根据实际的业务逻辑来计算
|
// 这里需要根据实际的业务逻辑来计算
|
||||||
|
|||||||
Reference in New Issue
Block a user