Fix Bug #502: 【住院护士站-汇总发药申请】顶部医嘱类型(长期/临时)过滤按钮点击无响应
根因:父组件 index.vue 中 therapyEnum 变量未声明为 ref,且未通过 props 传递给子组件 prescriptionList.vue, 导致点击"长期/临时"按钮时数据流断裂,子组件 API 调用始终使用本地未变化的 therapyEnum 值。 修复: 1. index.vue 新增 const therapyEnum = ref(undefined) 2. index.vue 新增 handleTherapyChange() 调用 handleGetPrescription() 刷新列表 3. index.vue 将 therapyEnum 作为 prop 传入 PrescriptionList 4. prescriptionList.vue 将本地 therapyEnum ref 改为 props 接收
This commit is contained in:
@@ -174,7 +174,6 @@ const activeNames = ref([]);
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const prescriptionList = ref([]);
|
const prescriptionList = ref([]);
|
||||||
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59');
|
||||||
const therapyEnum = ref(undefined);
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const chooseAll = ref(false);
|
const chooseAll = ref(false);
|
||||||
@@ -190,6 +189,10 @@ const props = defineProps({
|
|||||||
deadline: {
|
deadline: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
therapyEnum: {
|
||||||
|
type: Number,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleGetPrescription() {
|
function handleGetPrescription() {
|
||||||
@@ -200,7 +203,7 @@ function handleGetPrescription() {
|
|||||||
encounterIds: encounterIds,
|
encounterIds: encounterIds,
|
||||||
pageSize: 10000,
|
pageSize: 10000,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
therapyEnum: therapyEnum.value,
|
therapyEnum: props.therapyEnum,
|
||||||
exeStatus: props.exeStatus,
|
exeStatus: props.exeStatus,
|
||||||
requestStatus: props.requestStatus,
|
requestStatus: props.requestStatus,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
:clearable="false"
|
:clearable="false"
|
||||||
@change="handleGetPrescription"
|
@change="handleGetPrescription"
|
||||||
/>
|
/>
|
||||||
<el-radio-group v-model="therapyEnum" class="ml20" @change="handleRadioChange">
|
<el-radio-group v-model="therapyEnum" class="ml20" @change="handleTherapyChange">
|
||||||
<el-radio :value="undefined">全部</el-radio>
|
<el-radio :value="undefined">全部</el-radio>
|
||||||
<el-radio :value="1">长期</el-radio>
|
<el-radio :value="1">长期</el-radio>
|
||||||
<el-radio :value="2">临时</el-radio>
|
<el-radio :value="2">临时</el-radio>
|
||||||
@@ -79,6 +79,7 @@
|
|||||||
:exeStatus="exeStatus"
|
:exeStatus="exeStatus"
|
||||||
:requestStatus="requestStatus"
|
:requestStatus="requestStatus"
|
||||||
:deadline="deadline"
|
:deadline="deadline"
|
||||||
|
:therapyEnum="therapyEnum"
|
||||||
/>
|
/>
|
||||||
<SummaryMedicineList v-else />
|
<SummaryMedicineList v-else />
|
||||||
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
||||||
@@ -120,6 +121,7 @@ const requestStatus = ref(RequestStatus.COMPLETED);
|
|||||||
const chooseAll = ref(false);
|
const chooseAll = ref(false);
|
||||||
const drugType = ref('1');
|
const drugType = ref('1');
|
||||||
const isDetails = ref('1');
|
const isDetails = ref('1');
|
||||||
|
const therapyEnum = ref(undefined);
|
||||||
|
|
||||||
// 存储子组件引用的对象
|
// 存储子组件引用的对象
|
||||||
const prescriptionRefs = ref();
|
const prescriptionRefs = ref();
|
||||||
@@ -175,6 +177,10 @@ function handleRadioChange(value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleTherapyChange() {
|
||||||
|
handleGetPrescription();
|
||||||
|
}
|
||||||
|
|
||||||
function handleExecute() {
|
function handleExecute() {
|
||||||
proxy.$refs['prescriptionRefs'].handleMedicineSummary();
|
proxy.$refs['prescriptionRefs'].handleMedicineSummary();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user