Fix Bug #472: 住院医生工作站-手术申请单:勾选手术项目无效,导致无法正常开立医嘱

根因:getSurgeryPage SQL 的 LEFT JOIN 在价格表存在多条记录时产生重复行,
导致 el-transfer 中出现相同 key 的条目,Vue diff 算法无法正确追踪选中状态

修复:
- SQL 添加 DISTINCT ON (t1.ID) 去重(与旧版 getAdviceBaseInfo 一致)
- 前端 applicationList 初始化为空数组 + 过滤空 adviceDefinitionId
- 同步修复 getExaminationPage 的相同问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-16 14:28:18 +08:00
parent 02b9dc8725
commit 5f5d1c548a
2 changed files with 8 additions and 6 deletions

View File

@@ -128,7 +128,7 @@ const emits = defineEmits(['submitOk']);
const props = defineProps({});
const state = reactive({});
const applicationListAll = ref();
const applicationList = ref();
const applicationList = ref([]);
const orgOptions = ref([]); // 科室选项
const loading = ref(false); // 加载状态
const mapToTransferItem = (item) => {
@@ -174,7 +174,9 @@ const loadPage = (key) => {
dbTotal.value = res.data.total || 0;
const records = res.data.records;
applicationListAll.value = records;
applicationList.value = records.map(mapToTransferItem);
applicationList.value = records
.filter(item => item.adviceDefinitionId != null)
.map(mapToTransferItem);
// 仅在无搜索时缓存
if (!key) {
surgeryRecordsCache = records;