From 8b77710c190517b4a5a33b0099958656ce9f3adf Mon Sep 17 00:00:00 2001 From: chenqi Date: Sun, 21 Jun 2026 14:26:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(emr):=20=E4=BF=AE=E5=A4=8D=E4=BF=AE?= =?UTF-8?q?=E8=AE=A2=E5=8E=86=E5=8F=B2=E9=A1=B5=E9=9D=A2=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 清理空参数,避免传递空字符串 - 添加调试日志 - 兼容多种返回数据格式 --- .../src/views/emr/revision-history/index.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/healthlink-his-ui/src/views/emr/revision-history/index.vue b/healthlink-his-ui/src/views/emr/revision-history/index.vue index 9bc398712..8f16f2e57 100644 --- a/healthlink-his-ui/src/views/emr/revision-history/index.vue +++ b/healthlink-his-ui/src/views/emr/revision-history/index.vue @@ -131,11 +131,26 @@ import {ref,onMounted} from 'vue' import {useRoute} from 'vue-router' import {getRevisionPage} from './api' +import {ElMessage} from 'element-plus' const route=useRoute() const tableData=ref([]);const total=ref(0) -const q=ref({pageNo:1,pageSize:20,emrId:'',operatorName:''}) +const q=ref({pageNo:1,pageSize:20,emrId:null,operatorName:''}) const detailVisible=ref(false);const detail=ref({}) -const loadData=async()=>{const r=await getRevisionPage(q.value);tableData.value=r.data?.records||[];total.value=r.data?.total||0} +const loadData=async()=>{ + try{ + // 清理空参数 + const params={pageNo:q.value.pageNo,pageSize:q.value.pageSize} + if(q.value.emrId) params.emrId=q.value.emrId + if(q.value.operatorName) params.operatorName=q.value.operatorName + const r=await getRevisionPage(params) + console.log('修订历史响应:',r) + tableData.value=r.data?.records||r.data||[] + total.value=r.data?.total||tableData.value.length + }catch(e){ + console.error('加载失败:',e) + ElMessage.error('加载失败') + } +} const viewDetail=(row)=>{detail.value=row;detailVisible.value=true} onMounted(()=>{ if(route.query.emrId){q.value.emrId=route.query.emrId}