Fix Bug #502: 【住院护士站-汇总发药申请】顶部医嘱类型(长期/临时)过滤按钮点击无响应

根因:子组件未 watch 父组件传递的 therapyEnum prop 变化,
导致父组件调用 handleGetPrescription 时,子组件可能仍使用旧的 prop 值。

修复:在 prescriptionList.vue 和 summaryMedicineList.vue 中增加
watch 监听 props.therapyEnum 变化,自动触发 handleGetPrescription 刷新列表。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-17 16:00:12 +08:00
parent b06ac654eb
commit 90948b4a20
2 changed files with 12 additions and 2 deletions

View File

@@ -166,7 +166,7 @@
import {getPrescriptionList, medicineSummary} from './api';
import {patientInfoList} from '../../components/store/patient.js';
import {formatDateStr} from '@/utils/index';
import {getCurrentInstance, ref} from 'vue';
import {getCurrentInstance, ref, watch} from 'vue';
import useUserStore from '@/store/modules/user';
const activeNames = ref([]);
@@ -273,6 +273,11 @@ function handleGetPrescription() {
}
}
// 监听医嘱类型筛选条件变化,自动刷新列表
watch(() => props.therapyEnum, () => {
handleGetPrescription();
});
function handleMedicineSummary() {
let paramList = getSelectRows();
if (!paramList || paramList.length === 0) {

View File

@@ -50,7 +50,7 @@
<script setup>
import {getMedicineSummary, getMedicineSummaryDetail} from './api';
import {patientInfoList} from '../../components/store/patient.js';
import {getCurrentInstance, ref} from 'vue';
import {getCurrentInstance, ref, watch} from 'vue';
const medicineSummaryFormList = ref([]);
const medicineSummaryFormDetails = ref([]);
@@ -86,6 +86,11 @@ function handleGetPrescription() {
});
}
// 监听医嘱类型筛选条件变化,自动刷新列表
watch(() => props.therapyEnum, () => {
handleGetPrescription();
});
// 获取发药单详情
function getDetail(row) {
getMedicineSummaryDetail({ summaryNo: row.busNo }).then((res) => {