Compare commits
2 Commits
92ce2d10a1
...
c012974fd0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c012974fd0 | ||
|
|
5a83ff2aca |
@@ -631,6 +631,12 @@ function getListInfo(addNewRow) {
|
|||||||
handleAddPrescription();
|
handleAddPrescription();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error('处方列表加载失败:', err);
|
||||||
|
// 🔧 Bug #405 修复:列表加载失败时,确保所有行被锁定(isEdit=false)
|
||||||
|
// 防止行永久处于可编辑状态
|
||||||
|
prescriptionList.value.forEach(item => { item.isEdit = false; });
|
||||||
|
loadingInstance.close();
|
||||||
});
|
});
|
||||||
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
||||||
contractList.value = res.data;
|
contractList.value = res.data;
|
||||||
@@ -1443,6 +1449,12 @@ function handleSaveBatch() {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
|
// 🔧 Bug #405 修复:保存失败时也锁定行,防止行永久处于可编辑状态
|
||||||
|
filterPrescriptionList.value.forEach(item => {
|
||||||
|
if (item.statusEnum == 1 && !item.requestId) {
|
||||||
|
item.isEdit = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1571,17 +1583,21 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
||||||
const mergedDetail = item.mergedDetail || {
|
const mergedDetail = item.mergedDetail || {
|
||||||
...(item.orderDetailInfos || {}),
|
...(item.orderDetailInfos || {}),
|
||||||
adviceName: item.orderDetailInfos?.adviceName || item.orderDefinitionName || '未知项目',
|
adviceName: item.orderDefinitionName || item.orderDetailInfos?.adviceName || '未知项目',
|
||||||
adviceType: item.orderDetailInfos?.adviceType,
|
adviceType: item.orderDetailInfos?.adviceType,
|
||||||
adviceDefinitionId: item.orderDefinitionId || item.orderDetailInfos?.adviceDefinitionId,
|
adviceDefinitionId: item.orderDefinitionId || item.orderDetailInfos?.adviceDefinitionId,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
unitCode: item.unitCode || item.orderDetailInfos?.unitCode,
|
unitCode: item.unitCode || item.orderDetailInfos?.unitCode,
|
||||||
unitCodeName: item.unitCodeName,
|
unitCodeName: item.unitCodeName,
|
||||||
dose: item.dose || item.orderDetailInfos?.dose,
|
// 🔧 Bug #403 修复:dose/doseQuantity/dispensePerDuration 需用 null 检查,
|
||||||
|
// 避免组套中值为 null 时回退到医嘱库的 orderDetailInfos
|
||||||
|
dose: item.dose !== undefined && item.dose !== null ? item.dose : item.orderDetailInfos?.dose,
|
||||||
rateCode: item.rateCode || item.orderDetailInfos?.rateCode,
|
rateCode: item.rateCode || item.orderDetailInfos?.rateCode,
|
||||||
methodCode: item.methodCode || item.orderDetailInfos?.methodCode,
|
methodCode: item.methodCode || item.orderDetailInfos?.methodCode,
|
||||||
dispensePerDuration: item.dispensePerDuration || item.orderDetailInfos?.dispensePerDuration,
|
dispensePerDuration: item.dispensePerDuration !== undefined && item.dispensePerDuration !== null
|
||||||
doseQuantity: item.doseQuantity,
|
? item.dispensePerDuration : item.orderDetailInfos?.dispensePerDuration,
|
||||||
|
doseQuantity: item.doseQuantity !== undefined && item.doseQuantity !== null
|
||||||
|
? item.doseQuantity : item.orderDetailInfos?.doseQuantity,
|
||||||
inventoryList: item.orderDetailInfos?.inventoryList || [],
|
inventoryList: item.orderDetailInfos?.inventoryList || [],
|
||||||
priceList: item.orderDetailInfos?.priceList || [],
|
priceList: item.orderDetailInfos?.priceList || [],
|
||||||
partPercent: item.orderDetailInfos?.partPercent || 1,
|
partPercent: item.orderDetailInfos?.partPercent || 1,
|
||||||
@@ -1600,20 +1616,21 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
setValue(mergedDetail);
|
setValue(mergedDetail);
|
||||||
|
|
||||||
// 创建新的处方项目
|
// 创建新的处方项目
|
||||||
|
// 🔧 Bug #403 修复:关键字段使用 null-safe 回退到 mergedDetail(已由 setValue 填充完整数据)
|
||||||
const newRow = {
|
const newRow = {
|
||||||
...prescriptionList.value[rowIndex.value],
|
...prescriptionList.value[rowIndex.value],
|
||||||
patientId: patientInfo.value.patientId,
|
patientId: patientInfo.value.patientId,
|
||||||
encounterId: patientInfo.value.encounterId,
|
encounterId: patientInfo.value.encounterId,
|
||||||
accountId: accountId.value,
|
accountId: accountId.value,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity ?? mergedDetail.quantity,
|
||||||
methodCode: item.methodCode,
|
methodCode: item.methodCode ?? mergedDetail.methodCode,
|
||||||
rateCode: item.rateCode,
|
rateCode: item.rateCode ?? mergedDetail.rateCode,
|
||||||
dispensePerDuration: item.dispensePerDuration,
|
dispensePerDuration: item.dispensePerDuration ?? mergedDetail.dispensePerDuration,
|
||||||
dose: item.dose,
|
dose: item.dose ?? mergedDetail.dose,
|
||||||
doseQuantity: item.doseQuantity,
|
doseQuantity: item.doseQuantity ?? mergedDetail.doseQuantity,
|
||||||
executeNum: 1,
|
executeNum: 1,
|
||||||
unitCode: item.unitCode,
|
unitCode: item.unitCode ?? mergedDetail.unitCode,
|
||||||
unitCode_dictText: item.unitCodeName || '',
|
unitCode_dictText: item.unitCodeName || mergedDetail.unitCodeName || '',
|
||||||
statusEnum: 1,
|
statusEnum: 1,
|
||||||
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||||
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
||||||
|
|||||||
Reference in New Issue
Block a user