From a3dce8de60624511ae6766d9c20adb8a05d70620 Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 19 Jan 2026 23:18:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(inhospitalnurse):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BD=8F=E9=99=A2=E6=8A=A4=E5=A3=AB=E7=AB=99=E6=82=A3=E8=80=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=92=8C=E5=BA=8A=E4=BD=8D=E5=88=86=E9=85=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除住院参与者更新失败时的异常返回,改为静默处理 - 更新床位分配提示信息,为用户提供更清晰的操作指导 - 实现实施科室下拉选择器的远程搜索功能,提升大数据量下的用户体验 - 添加节点切换时的未保存数据确认提醒,防止数据丢失 - 优化实施科室管理页面的选项过滤和加载状态管理 --- .../impl/ATDManageAppServiceImpl.java | 7 +-- .../basicmanage/implementDepartment/index.vue | 60 ++++++++++++++++--- .../inOut/components/bedAllocation.vue | 6 +- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java index c99a1604..5a5e4509 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java @@ -293,11 +293,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { if (admissionPatientInfoDto.getPriorityEnum() != null) { // 更新患者病情 encounterService.updatePriorityEnumById(encounterId, admissionPatientInfoDto.getPriorityEnum()); - // 将之前的住院参与者更新为已完成 - Integer result = encounterParticipantService.updateEncounterParticipantsStatus(encounterId); - if (result == 0) { - return R.fail("患者信息更新失败,请联系管理员"); - } + // 将之前的住院参与者更新为已完成(如果存在的话) + encounterParticipantService.updateEncounterParticipantsStatus(encounterId); // 更新住院参与者 // 住院医生 encounterParticipantService.creatEncounterParticipants(encounterId, startTime, diff --git a/openhis-ui-vue3/src/views/basicmanage/implementDepartment/index.vue b/openhis-ui-vue3/src/views/basicmanage/implementDepartment/index.vue index 69dc396e..ad3c574a 100644 --- a/openhis-ui-vue3/src/views/basicmanage/implementDepartment/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/implementDepartment/index.vue @@ -81,15 +81,15 @@ v-model="scope.row.activityDefinitionId" filterable remote - reserve-keyword - placeholder="请选择" - remote-show-suffix + :remote-method="(query) => handleRemoteQuery(query, scope.row)" + :loading="scope.row.loading" + placeholder="请输入并搜索项目" style="width: 400px; max-width: 500px" :class="{ 'error-border': scope.row.error }" clearable > { + if (!row.hasOwnProperty('filteredOptions')) { + row.filteredOptions = allImplementDepartmentList.value.slice(0, 100); // 限制为前100个 + row.loading = false; + } + }); + loading.value = false; }); } @@ -253,6 +262,26 @@ function handleSelectionChange(selection) { single.value = selection.length != 1; multiple.value = !selection.length; } +// 远程搜索处理函数 +function handleRemoteQuery(query, row) { + if (query !== '') { + // 设置加载状态 + row.loading = true; + // 模拟异步延迟 + setTimeout(() => { + // 过滤选项 + row.filteredOptions = allImplementDepartmentList.value.filter(item => { + return item.label.toLowerCase().includes(query.toLowerCase()) || + item.value.toLowerCase().includes(query.toLowerCase()); + }); + row.loading = false; + }, 300); // 300ms 延迟,模拟网络请求 + } else { + // 如果查询为空,显示所有选项(但限制数量以提高性能) + row.filteredOptions = allImplementDepartmentList.value.slice(0, 100); // 限制为前100个 + } +} + // 新增项目 function handleAddItem() { if (data.isAdding) { @@ -262,9 +291,11 @@ function handleAddItem() { const newRow = { startTime: '00:00:00', endTime: '23:59:59', + loading: false, // 添加加载状态 + filteredOptions: allImplementDepartmentList.value.slice(0, 100), // 初始化过滤选项,限制数量 }; catagoryList.value.push(newRow); - total.value = organization.value.length; + total.value = catagoryList.value.length; // 修正:使用实际数据列表长度,而不是组织结构长度 data.isAdding = true; // 设置标志位为 true,表示有未保存的 } // 批量添加 @@ -272,6 +303,7 @@ function handleBacthAddItem() { // 批量添加显示对话框 bacthAddItemDialogVisible.value = true; } + // 检验 编辑或 保存数据 function handleBlur(row, index) { let hasError = false; @@ -344,9 +376,23 @@ function deleteSelectedRows(row) { } /** 节点单击事件 */ function handleNodeClick(res, node) { - // 新增按钮是否 disable - data.isAdding = false; + // 检查是否有未保存的数据 + if (data.isAdding) { + proxy.$modal.confirm('当前有未保存的数据,切换节点将丢失未保存的数据,是否继续?').then(() => { + // 确认切换,重置状态 + data.isAdding = false; + continueHandleNodeClick(node); + }).catch(() => { + // 取消切换,保持当前状态 + return; + }); + } else { + continueHandleNodeClick(node); + } +} +// 实际的节点点击处理逻辑 +function continueHandleNodeClick(node) { // 新增按钮是否 disable if (node.parent === null || node.level === 1) { isAddDisable.value = true; diff --git a/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/bedAllocation.vue b/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/bedAllocation.vue index d453267f..1d7650f8 100644 --- a/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/bedAllocation.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/bedAllocation.vue @@ -371,8 +371,9 @@ const handleTransferInOk = async () => { // 单击患者卡片事件 - 直接触发入科选床界面 function handleCardClick(item: any, index: number) { if (item.encounterStatus == 2) { + // 显示提示信息,指导用户如何分配床位 ElMessage({ - message: '请分配病床!', + message: '该患者尚未分配病床,请通过拖拽操作将患者分配到右侧床位', type: 'warning', grouping: true, showClose: true, @@ -390,8 +391,9 @@ function handleCardClick(item: any, index: number) { // 双击患者卡片事件 - 保持原有逻辑 function handleCardDblClick(item: any) { if (item.encounterStatus == 2) { + // 显示提示信息,指导用户如何分配床位 ElMessage({ - message: '请分配病床!', + message: '该患者尚未分配病床,请通过拖拽操作将患者分配到右侧床位', type: 'warning', grouping: true, showClose: true,