diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index df298f387..31ee811d9 100755 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -3326,9 +3326,13 @@ function syncGroupFields(row) { } // 同步执行科室 + // 🔧 Bug #455: 诊疗类医嘱(adviceType=3)不使用项目配置的执行科室, + // 避免配置ID不在机构树中导致显示原始ID,保持患者就诊科室即可 if (row.orgId || row.positionId) { - // 🔧 修复:优先使用项目所属科室(orgId),其次positionId - prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId; + if (Number(row.adviceType) != 3) { + // 🔧 修复:优先使用项目所属科室(orgId),其次positionId + prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId; + } } // 同步皮试标记 @@ -3412,8 +3416,11 @@ async function setValue(row) { showPopover: false, // 确保查询框关闭 }; console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText); - // 🔧 Bug #455: 执行科室默认逻辑:使用positionId(诊疗执行科室配置) → 患者就诊科室,不再使用row.orgId(项目所属科室) - prescriptionList.value[rowIndex.value].orgId = row.positionId || props.patientInfo?.orgId; + // 🔧 Bug #455: 诊疗医嘱(adviceType=3)的执行科室默认使用患者就诊科室, + // 不使用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].quantity = row.quantity || 1; prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value;