diff --git a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java index a30cd54c..a36d518a 100755 --- a/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java @@ -1,6 +1,7 @@ package com.core.framework.config; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java index abdf1e1b..658724a8 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java @@ -215,7 +215,10 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi if (surgery != null) { surgery.setStatusEnum(1); // 1 = 已排期 surgery.setUpdateTime(new Date()); - + // Bug #558: 手术安排时同步写入手术室确认时间和确认人 + surgery.setOperatingRoomConfirmTime(new Date()); + surgery.setOperatingRoomConfirmUser(loginUser.getUsername()); + // 填充缺失的申请科室和主刀医生名称 fillSurgeryMissingNames(surgery); diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index cd4daada..ace8cdda 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -198,7 +198,7 @@ v-model="scope.row.adviceName" placeholder="请选择项目" @input="handleChange" - @click="handleFocus(scope.row, scope.$index)" + @focus="handleFocus(scope.row, scope.$index)" @keyup.enter.stop="handleFocus(scope.row, scope.$index)" @keydown=" (e) => { @@ -900,31 +900,16 @@ function handleDiagnosisChange(item) { function handleFocus(row, index) { rowIndex.value = index; row.showPopover = true; + // Bug #555: handleFocus 只负责开 popover 和初始化查询参数,搜索由 handleChange 统一处理 + // 避免异步 refresh 用旧闭包 searchKey 覆盖 handleChange 的搜索结果 const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; - // 用 adviceType + categoryCode 组合查找匹配的选项 - const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType; - const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); - // If the row has an explicit adviceType (saved/existing row), use its own categoryCode. - // If no type is selected (new row), use empty string for global search across all categories. - const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType != null ? (row.categoryCode || '') : ''); - const searchKey = row.adviceName || ''; - - nextTick(() => { - nextTick(() => { - const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[index] : adviceTableRef.value; - if (tableRef && tableRef.refresh) { - tableRef.refresh(adviceType, categoryCode, searchKey); - } else { - // fallback: 如果双重 nextTick 仍未挂载,延迟 100ms 再试 - setTimeout(() => { - const tableRef2 = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[index] : adviceTableRef.value; - if (tableRef2 && tableRef2.refresh) { - tableRef2.refresh(adviceType, categoryCode, searchKey); - } - }, 100); - } - }); - }); + let categoryCode = ''; + if (row.adviceType !== undefined) { + const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType; + const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); + categoryCode = selectedItem ? selectedItem.categoryCode : (row.categoryCode || ''); + } + adviceQueryParams.value = { adviceType, categoryCode, searchKey: '' }; } function handleBlur(row) { @@ -933,20 +918,24 @@ function handleBlur(row) { function handleChange(value) { adviceQueryParams.value.searchKey = value; - // 搜索词变化时,调用当前行子组件的 refresh 方法 - const index = rowIndex.value; - if (index >= 0) { - const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[index] : adviceTableRef.value; - if (tableRef && tableRef.refresh) { - const row = filterPrescriptionList.value[index]; - const adviceType = row?.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; - // 用 adviceType + categoryCode 组合查找匹配的选项 + // @focus 已先于 @input 执行,rowIndex 必定有效 + const currentIndex = rowIndex.value; + if (currentIndex < 0) return; + const row = filterPrescriptionList.value[currentIndex]; + // popover 被 blur 关闭后,用户继续输入时自行打开 + if (!row.showPopover) { + row.showPopover = true; + } + const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[currentIndex] : adviceTableRef.value; + if (tableRef && tableRef.refresh) { + const adviceType = row?.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; + let categoryCode = ''; + if (row?.adviceType !== undefined) { const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType; const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); - // 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行 - const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : ''); - tableRef.refresh(adviceType, categoryCode, value); + categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || ''); } + tableRef.refresh(adviceType, categoryCode, value); } }