fix(doctorstation): 修复处方列表和医嘱处理中的多个问题

- 修复耗材和诊疗类型在setValue后总金额未正确计算的问题
- 修复耗材类型没有价格列表时的默认值处理逻辑
- 修复组套中positionId被医嘱库信息覆盖的问题
- 修复删除耗材医嘱时费用项不存在导致的异常
- 修复处方位置ID查询中组织ID为空时的回退逻辑
This commit is contained in:
2026-03-23 16:29:17 +08:00
parent b5cf685b13
commit 4d2a321999
3 changed files with 52 additions and 9 deletions

View File

@@ -1902,6 +1902,13 @@ function selectAdviceBase(key, row) {
setValue(row);
// 🔧 Bug #220 修复确保在setValue之后重新计算耗材类型的总金额
// 耗材(adviceType=4)和诊疗(adviceType=3)需要重新计算以确保显示正确
const currentRow = prescriptionList.value[rowIndex.value];
if (currentRow && (currentRow.adviceType == 3 || currentRow.adviceType == 4)) {
calculateTotalPrice(currentRow, rowIndex.value);
}
// 确保在setValue之后再次设置showPopover为false防止被覆盖
prescriptionList.value[rowIndex.value].showPopover = false;
@@ -3035,8 +3042,20 @@ function setValue(row) {
const finalLocationId = row.positionId || props.patientInfo.orgId;
prescriptionList.value[rowIndex.value].locationId = finalLocationId;
prescriptionList.value[rowIndex.value].positionId = finalLocationId;
}
} else {
// 🔧 Bug #220 修复耗材类型没有priceList时的默认处理
console.warn('耗材价格列表为空:', row.adviceName || '未知耗材');
prescriptionList.value[rowIndex.value].unitPrice = 0;
prescriptionList.value[rowIndex.value].unitTempPrice = 0;
prescriptionList.value[rowIndex.value].minUnitPrice = 0;
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
prescriptionList.value[rowIndex.value].totalPrice = 0;
prescriptionList.value[rowIndex.value].positionName = row.positionName || '';
const finalLocationId = row.positionId || props.patientInfo.orgId;
prescriptionList.value[rowIndex.value].locationId = finalLocationId;
prescriptionList.value[rowIndex.value].positionId = finalLocationId;
}
} else {
getOrgList();
// 会诊类型adviceType == 5和诊疗类型adviceType == 3的处理
if (row.adviceType == 5) {
@@ -3771,7 +3790,9 @@ async function checkOrderGroupAvailability(detailList) {
// 🔧 Bug Fix: 将医嘱库信息保存到 item 中,供后续使用
item.orderDetailInfos = adviceInfo;
item.adviceType = adviceInfo.adviceType;
item.positionId = adviceInfo.positionId;
// 🔧 Bug #218 修复保留组套中维护的positionId如果组套中没有则使用医嘱库的
// 检查收费项目(adviceType=3)的科室应该从组套数据中获取
item.positionId = item.positionId || adviceInfo.positionId;
if (adviceInfo.adviceType != 3) {
if (!adviceInfo.positionId) {