Fix Bug #455: 门诊医生站-医嘱:开立诊疗医嘱时执行科室默认获取逻辑有误且显示为原始ID
根因分析: - setValue函数对所有类型统一设置orgId=row.positionId - 诊疗项目(adviceType=3)的positionId来自adm_organization_location配置表 - 当配置ID不在当前机构树中时,findOrgNameById返回空,el-tree-select显示原始ID - 后续if(!orgId)判断因已有值而不触发回退到患者就诊科室 修复方案: - 诊疗类型(adviceType=3)跳过positionId赋值,使用患者就诊科室作为默认执行科室 - 同时修复syncGroupFields中会覆盖orgId的问题 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3326,9 +3326,13 @@ function syncGroupFields(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 同步执行科室
|
// 同步执行科室
|
||||||
|
// 🔧 Bug #455: 诊疗类医嘱(adviceType=3)不使用项目配置的执行科室,
|
||||||
|
// 避免配置ID不在机构树中导致显示原始ID,保持患者就诊科室即可
|
||||||
if (row.orgId || row.positionId) {
|
if (row.orgId || row.positionId) {
|
||||||
// 🔧 修复:优先使用项目所属科室(orgId),其次positionId
|
if (Number(row.adviceType) != 3) {
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId;
|
// 🔧 修复:优先使用项目所属科室(orgId),其次positionId
|
||||||
|
prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同步皮试标记
|
// 同步皮试标记
|
||||||
@@ -3412,8 +3416,11 @@ async 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);
|
||||||
// 🔧 Bug #455: 执行科室默认逻辑:使用positionId(诊疗执行科室配置) → 患者就诊科室,不再使用row.orgId(项目所属科室)
|
// 🔧 Bug #455: 诊疗医嘱(adviceType=3)的执行科室默认使用患者就诊科室,
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.positionId || props.patientInfo?.orgId;
|
// 不使用positionId(诊疗目录配置的执行科室),避免配置ID不在机构树中导致显示原始ID
|
||||||
|
if (Number(row.adviceType) != 3) {
|
||||||
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user