Fix Bug #455: 门诊医生站-医嘱:开立诊疗医嘱时执行科室默认获取逻辑有误且显示为原始ID
根因修复: 1. 默认科室逻辑错误:row.orgId来自wor_activity_definition.org_id(项目所属科室),不是执行科室。 改为优先使用positionId(adm_organization_location配置的执行科室),回退到患者就诊科室。 2. 显示为原始ID:getOrgList()为异步调用但未await,导致findOrgNameById执行时organization树未加载。 将setValue改为async函数并await getOrgList(),确保科室名称解析时数据已就绪。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3346,7 +3346,7 @@ function syncGroupFields(row) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setValue(row) {
|
async function setValue(row) {
|
||||||
unitCodeList.value = [];
|
unitCodeList.value = [];
|
||||||
unitCodeList.value.push({ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' });
|
unitCodeList.value.push({ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' });
|
||||||
|
|
||||||
@@ -3398,8 +3398,8 @@ function setValue(row) {
|
|||||||
showPopover: false, // 确保查询框关闭
|
showPopover: false, // 确保查询框关闭
|
||||||
};
|
};
|
||||||
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
||||||
// 🔧 修复执行科室逻辑:优先使用项目维护的所属科室(row.orgId),其次使用positionId,最后回退到患者科室
|
// 🔧 Bug #455: 执行科室默认逻辑:使用positionId(诊疗执行科室配置) → 患者就诊科室,不再使用row.orgId(项目所属科室)
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId || props.patientInfo?.orgId;
|
prescriptionList.value[rowIndex.value].orgId = row.positionId || props.patientInfo?.orgId;
|
||||||
prescriptionList.value[rowIndex.value].dose = row.dose || row.doseQuantity;
|
prescriptionList.value[rowIndex.value].dose = row.dose || row.doseQuantity;
|
||||||
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
|
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
|
||||||
prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value;
|
prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value;
|
||||||
@@ -3518,7 +3518,7 @@ function setValue(row) {
|
|||||||
prescriptionList.value[rowIndex.value].positionId = finalLocationId;
|
prescriptionList.value[rowIndex.value].positionId = finalLocationId;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getOrgList();
|
await getOrgList();
|
||||||
// 会诊类型(adviceType == 5)和诊疗类型(adviceType == 3)的处理
|
// 会诊类型(adviceType == 5)和诊疗类型(adviceType == 3)的处理
|
||||||
if (row.adviceType == 5) {
|
if (row.adviceType == 5) {
|
||||||
// 会诊类型:设置默认值
|
// 会诊类型:设置默认值
|
||||||
|
|||||||
Reference in New Issue
Block a user