diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java index 6d39727c..6aa58de6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java @@ -53,7 +53,7 @@ public class DoctorStationAdviceController { @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(value = "categoryCode", required = false) String categoryCode) { return R.ok(iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, - adviceDefinitionIdParamList, organizationId, pageNo, pageSize, Whether.NO.getValue(), adviceTypes, null, categoryCode)); + adviceDefinitionIdParamList, organizationId, pageNo, pageSize, null, adviceTypes, null, categoryCode)); } /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationChineseMedicalController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationChineseMedicalController.java index 5864da78..ac97cfc0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationChineseMedicalController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationChineseMedicalController.java @@ -118,7 +118,7 @@ public class DoctorStationChineseMedicalController { organizationId = SecurityUtils.getLoginUser().getOrgId(); } return R.ok(iDoctorStationChineseMedicalAppService.getTcmAdviceBaseInfo(adviceBaseDto, searchKey, locationId, - adviceDefinitionIdParamList, organizationId, pageNo, pageSize, Whether.NO.getValue())); + adviceDefinitionIdParamList, organizationId, pageNo, pageSize, null)); } /** diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java index 0d548de3..47a075ea 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java @@ -198,6 +198,7 @@ public class AdviceBaseDto { /** * 所属科室 */ + @JsonSerialize(using = ToStringSerializer.class) private Long orgId; /** diff --git a/openhis-ui-vue3/src/views/basicmanage/ordersCombination/components/prescriptionlist.vue b/openhis-ui-vue3/src/views/basicmanage/ordersCombination/components/prescriptionlist.vue index cf338672..48d343a2 100644 --- a/openhis-ui-vue3/src/views/basicmanage/ordersCombination/components/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/basicmanage/ordersCombination/components/prescriptionlist.vue @@ -819,7 +819,8 @@ function selectAdviceBase(key, row) { combinationList.value[rowIndex.value].positionName = stock.locationName; } } else { - combinationList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId; + // 🔧 修复执行科室逻辑:优先使用项目维护的所属科室(row.orgId),其次使用positionId + combinationList.value[rowIndex.value].orgId = row.orgId || JSON.parse(JSON.stringify(row)).positionId; combinationList.value[rowIndex.value].unitPrice = row.priceList[0].price; } expandOrder.value = [key]; diff --git a/openhis-ui-vue3/src/views/clinicmanagement/bargain/component/prescriptionlist.vue b/openhis-ui-vue3/src/views/clinicmanagement/bargain/component/prescriptionlist.vue index aa662dca..9101399f 100644 --- a/openhis-ui-vue3/src/views/clinicmanagement/bargain/component/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/clinicmanagement/bargain/component/prescriptionlist.vue @@ -702,7 +702,14 @@ async function selectAdviceBase(key, row) { }; // 后续字段处理保持原样 - prescriptionList.value[rowIndex.value].orgId = undefined; + // 🔧 修复执行科室逻辑:诊疗项目优先使用项目维护的所属科室(row.orgId) + // 如果所属科室为空,则回退到患者当前所在科室 + if (row.adviceType === 3 && row.orgId) { + // 项目有所属科室,直接使用 + prescriptionList.value[rowIndex.value].orgId = row.orgId; + } else { + prescriptionList.value[rowIndex.value].orgId = undefined; + } prescriptionList.value[rowIndex.value].dose = undefined; prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value; prescriptionList.value[rowIndex.value].doseUnitCode = 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 bb239650..8d02ead1 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -3305,8 +3305,9 @@ function syncGroupFields(row) { } // 同步执行科室 - if (row.positionId || row.orgId) { - prescriptionList.value[rowIndex.value].orgId = row.positionId || row.orgId; + if (row.orgId || row.positionId) { + // 🔧 修复:优先使用项目所属科室(orgId),其次positionId + prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId; } // 同步皮试标记 @@ -3390,9 +3391,8 @@ function setValue(row) { showPopover: false, // 确保查询框关闭 }; console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText); - // 🔧 Bug #218 修复:保留组套中的值,不要强制设为undefined - // 只有当值未定义时才使用默认值 - prescriptionList.value[rowIndex.value].orgId = row.positionId || row.orgId; + // 🔧 修复执行科室逻辑:优先使用项目维护的所属科室(row.orgId),其次使用positionId,最后回退到患者科室 + prescriptionList.value[rowIndex.value].orgId = row.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; @@ -3619,8 +3619,8 @@ function handleSaveGroup(orderGroupList) { unitCode: item.unitCode, unitCode_dictText: item.unitCodeName || '', statusEnum: 1, - // 🔧 Bug #218 修复:优先使用 item.positionId,其次使用 orderDetailInfos.positionId - orgId: item.positionId || item.orderDetailInfos?.positionId || mergedDetail.positionId, + // 🔧 修复执行科室逻辑:优先使用 orgId(所属科室),其次 positionId + orgId: item.orderDetailInfos?.orgId || mergedDetail.orgId || item.positionId || item.orderDetailInfos?.positionId || mergedDetail.positionId, dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1', conditionId: conditionId.value, conditionDefinitionId: conditionDefinitionId.value, diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue index 1249c2e6..4834dbb8 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue @@ -395,11 +395,12 @@ clearable v-model="row.orgId" style="width: 200px" - :data="config.organization" + :data="orgTreeData" :props="{ value: 'id', label: 'name', children: 'children' }" value-key="id" check-strictly default-expand-all + :fallback-option="orgFallbackOption" @change="handleOrgChange" placeholder="请选择执行科室" /> @@ -422,7 +423,7 @@