bug 555 558

This commit is contained in:
Ranyunqiao
2026-05-20 11:04:33 +08:00
parent 31d9098b37
commit 62c5674233
3 changed files with 30 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
package com.core.framework.config; package com.core.framework.config;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;

View File

@@ -215,7 +215,10 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi
if (surgery != null) { if (surgery != null) {
surgery.setStatusEnum(1); // 1 = 已排期 surgery.setStatusEnum(1); // 1 = 已排期
surgery.setUpdateTime(new Date()); surgery.setUpdateTime(new Date());
// Bug #558: 手术安排时同步写入手术室确认时间和确认人
surgery.setOperatingRoomConfirmTime(new Date());
surgery.setOperatingRoomConfirmUser(loginUser.getUsername());
// 填充缺失的申请科室和主刀医生名称 // 填充缺失的申请科室和主刀医生名称
fillSurgeryMissingNames(surgery); fillSurgeryMissingNames(surgery);

View File

@@ -198,7 +198,7 @@
v-model="scope.row.adviceName" v-model="scope.row.adviceName"
placeholder="请选择项目" placeholder="请选择项目"
@input="handleChange" @input="handleChange"
@click="handleFocus(scope.row, scope.$index)" @focus="handleFocus(scope.row, scope.$index)"
@keyup.enter.stop="handleFocus(scope.row, scope.$index)" @keyup.enter.stop="handleFocus(scope.row, scope.$index)"
@keydown=" @keydown="
(e) => { (e) => {
@@ -896,31 +896,16 @@ function handleDiagnosisChange(item) {
function handleFocus(row, index) { function handleFocus(row, index) {
rowIndex.value = index; rowIndex.value = index;
row.showPopover = true; row.showPopover = true;
// Bug #555: handleFocus 只负责开 popover 和初始化查询参数,搜索由 handleChange 统一处理
// 避免异步 refresh 用旧闭包 searchKey 覆盖 handleChange 的搜索结果
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
// 用 adviceType + categoryCode 组合查找匹配的选项 let categoryCode = '';
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType; if (row.adviceType !== undefined) {
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
// If the row has an explicit adviceType (saved/existing row), use its own categoryCode. const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
// If no type is selected (new row), use empty string for global search across all categories. categoryCode = selectedItem ? selectedItem.categoryCode : (row.categoryCode || '');
const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType != null ? (row.categoryCode || '') : ''); }
const searchKey = row.adviceName || ''; adviceQueryParams.value = { adviceType, categoryCode, searchKey: '' };
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);
}
});
});
} }
function handleBlur(row) { function handleBlur(row) {
@@ -929,20 +914,24 @@ function handleBlur(row) {
function handleChange(value) { function handleChange(value) {
adviceQueryParams.value.searchKey = value; adviceQueryParams.value.searchKey = value;
// 搜索词变化时,调用当前行子组件的 refresh 方法 // @focus 已先于 @input 执行rowIndex 必定有效
const index = rowIndex.value; const currentIndex = rowIndex.value;
if (index >= 0) { if (currentIndex < 0) return;
const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[index] : adviceTableRef.value; const row = filterPrescriptionList.value[currentIndex];
if (tableRef && tableRef.refresh) { // popover 被 blur 关闭后,用户继续输入时自行打开
const row = filterPrescriptionList.value[index]; if (!row.showPopover) {
const adviceType = row?.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; row.showPopover = true;
// 用 adviceType + categoryCode 组合查找匹配的选项 }
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 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); const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
// 修复Bug #486当行没有显式选择医嘱类型时不传categoryCode让搜索在全药库中进行 categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
tableRef.refresh(adviceType, categoryCode, value);
} }
tableRef.refresh(adviceType, categoryCode, value);
} }
} }