diff --git a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue index 05d74322..d39c2cce 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue @@ -283,9 +283,10 @@ function handleGetPrescription() { exeStatus: props.exeStatus, requestStatus: props.requestStatus, }).then((res) => { - // try { + try { + const records = res?.data?.records || []; // 根据encounterId分组 - const groupedPrescriptions = res.data.records.reduce((groups, prescription) => { + const groupedPrescriptions = records.reduce((groups, prescription) => { // 获取当前医嘱全部执行频次 let rate; let times; @@ -430,19 +431,26 @@ function handleGetPrescription() { // 将分组结果转换为数组形式 prescriptionList.value = Object.values(groupedPrescriptions); - loading.value = false; // 默认选中全部行 nextTick(() => { defaultSelectAllRows(); }); - // } catch { - // loading.value = false; - // } + } catch (error) { + console.error('医嘱执行-获取处方列表数据处理失败:', error); + prescriptionList.value = []; + } finally { + loading.value = false; + } + }).catch((error) => { + console.error('医嘱执行-获取处方列表接口失败:', error); + prescriptionList.value = []; + loading.value = false; }); chooseAll.value = false; } else { prescriptionList.value = []; selectedRowIds.value.clear(); + loading.value = false; // proxy.$message.warning('请选择患者'); } }