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:
@@ -872,7 +872,7 @@
|
|||||||
|
|
||||||
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
SELECT
|
SELECT DISTINCT ON (t1.ID)
|
||||||
t1.ID AS advice_definition_id,
|
t1.ID AS advice_definition_id,
|
||||||
t1.NAME AS advice_name,
|
t1.NAME AS advice_name,
|
||||||
t1.org_id AS org_id,
|
t1.org_id AS org_id,
|
||||||
@@ -892,12 +892,12 @@
|
|||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY t1.name ASC
|
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 检查项目专用分页查询:仅查检查(23) + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
<!-- 检查项目专用分页查询:仅查检查(23) + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
SELECT
|
SELECT DISTINCT ON (t1.ID)
|
||||||
t1.ID AS advice_definition_id,
|
t1.ID AS advice_definition_id,
|
||||||
t1.NAME AS advice_name,
|
t1.NAME AS advice_name,
|
||||||
t1.org_id AS org_id,
|
t1.org_id AS org_id,
|
||||||
@@ -917,7 +917,7 @@
|
|||||||
<if test="searchKey != null and searchKey != ''">
|
<if test="searchKey != null and searchKey != ''">
|
||||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY t1.name ASC
|
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -128,7 +128,7 @@ const emits = defineEmits(['submitOk']);
|
|||||||
const props = defineProps({});
|
const props = defineProps({});
|
||||||
const state = reactive({});
|
const state = reactive({});
|
||||||
const applicationListAll = ref();
|
const applicationListAll = ref();
|
||||||
const applicationList = ref();
|
const applicationList = ref([]);
|
||||||
const orgOptions = ref([]); // 科室选项
|
const orgOptions = ref([]); // 科室选项
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
const mapToTransferItem = (item) => {
|
const mapToTransferItem = (item) => {
|
||||||
@@ -174,7 +174,9 @@ const loadPage = (key) => {
|
|||||||
dbTotal.value = res.data.total || 0;
|
dbTotal.value = res.data.total || 0;
|
||||||
const records = res.data.records;
|
const records = res.data.records;
|
||||||
applicationListAll.value = records;
|
applicationListAll.value = records;
|
||||||
applicationList.value = records.map(mapToTransferItem);
|
applicationList.value = records
|
||||||
|
.filter(item => item.adviceDefinitionId != null)
|
||||||
|
.map(mapToTransferItem);
|
||||||
// 仅在无搜索时缓存
|
// 仅在无搜索时缓存
|
||||||
if (!key) {
|
if (!key) {
|
||||||
surgeryRecordsCache = records;
|
surgeryRecordsCache = records;
|
||||||
|
|||||||
Reference in New Issue
Block a user