门诊医生站患者病历打不开 不显示数据问题

This commit is contained in:
2025-12-16 17:12:21 +08:00
parent 3188ca5752
commit 633cf2c17f
5 changed files with 288 additions and 186 deletions

View File

@@ -26,21 +26,21 @@ import Layout from '@/layout'
// 公共路由 - 所有用户均可访问的路由 // 公共路由 - 所有用户均可访问的路由
export const constantRoutes = [ export const constantRoutes = [
// 门诊医生站路由 // 门诊医生站路由
// { {
// path: '/doctorstation', path: '/doctorstation',
// component: Layout, component: Layout,
// redirect: '/doctorstation', redirect: '/doctorstation',
// name: 'DoctorStation', name: 'DoctorStation',
// meta: { title: '门诊医生站', icon: 'doctorstation' }, meta: { title: '门诊医生站', icon: 'doctorstation' },
// children: [ children: [
// { {
// path: '', path: '',
// component: () => import('@/views/doctorstation/index.vue'), component: () => import('@/views/doctorstation/index.vue'),
// name: 'DoctorStationIndex', name: 'DoctorStationIndex',
// meta: { title: '门诊医生站', icon: 'doctorstation' } meta: { title: '门诊医生站', icon: 'doctorstation' }
// } }
// ] ]
// }, },
// 重定向路由 // 重定向路由
{ {
path: '/redirect', path: '/redirect',
@@ -101,167 +101,167 @@ export const constantRoutes = [
] ]
}, },
// 套餐管理相关路由 - 添加到公共路由确保始终可用 // 套餐管理相关路由 - 添加到公共路由确保始终可用
// { {
// path: '/maintainSystem/Inspection/PackageManagement', path: '/maintainSystem/Inspection/PackageManagement',
// component: Layout, component: Layout,
// hidden: true, hidden: true,
// children: [ children: [
// { {
// path: '', path: '',
// component: () => import('@/views/maintainSystem/Inspection/PackageManagement.vue'), component: () => import('@/views/maintainSystem/Inspection/PackageManagement.vue'),
// name: 'DirectPackageManagement', name: 'DirectPackageManagement',
// meta: { title: '套餐管理' } meta: { title: '套餐管理' }
// } }
// ] ]
// }, },
// 预约管理直接访问路由 - 兼容外部系统访问 // 预约管理直接访问路由 - 兼容外部系统访问
// { {
// path: '/reservationRecord2/appoinmentmanage', path: '/reservationRecord2/appoinmentmanage',
// component: Layout, component: Layout,
// hidden: true, hidden: true,
// children: [ children: [
// { {
// path: '', path: '',
// component: () => import('@/views/appoinmentmanage/clinicRoom/index.vue'), component: () => import('@/views/appoinmentmanage/clinicRoom/index.vue'),
// name: 'DirectClinicRoom', name: 'DirectClinicRoom',
// meta: { title: '门诊出诊医生诊室设置' } meta: { title: '门诊出诊医生诊室设置' }
// } }
// ] ]
// } }
] ]
// 动态路由 - 基于用户权限动态加载的路由 // 动态路由 - 基于用户权限动态加载的路由
export const dynamicRoutes = [ export const dynamicRoutes = [
// 基础管理路由 // 基础管理路由
// { {
// path: '/basicmanage', path: '/basicmanage',
// component: Layout, component: Layout,
// redirect: '/basicmanage/invoice-management', redirect: '/basicmanage/invoice-management',
// name: 'BasicManage', name: 'BasicManage',
// meta: { title: '基础管理', icon: 'component' }, meta: { title: '基础管理', icon: 'component' },
// children: [ children: [
// { {
// path: 'invoice-management', path: 'invoice-management',
// component: () => import('@/views/basicmanage/InvoiceManagement/index.vue'), component: () => import('@/views/basicmanage/InvoiceManagement/index.vue'),
// name: 'invoice-management', name: 'invoice-management',
// meta: { title: '发票管理' } meta: { title: '发票管理' }
// } }
// ] ]
// }, },
// 兼容系统业务管理路径的发票管理路由 // 兼容系统业务管理路径的发票管理路由
// { {
// path: '/system/ywgz', path: '/system/ywgz',
// component: Layout, component: Layout,
// redirect: '/system/ywgz/InvoiceManagement', redirect: '/system/ywgz/InvoiceManagement',
// hidden: true, hidden: true,
// children: [ children: [
// { {
// path: 'InvoiceManagement', path: 'InvoiceManagement',
// component: () => import('@/views/basicmanage/InvoiceManagement/index.vue'), component: () => import('@/views/basicmanage/InvoiceManagement/index.vue'),
// name: 'SystemInvoiceManagement', name: 'SystemInvoiceManagement',
// meta: { title: '发票管理' } meta: { title: '发票管理' }
// } }
// ] ]
// }, },
// 维护系统路由 // 维护系统路由
// { {
// path: '/maintainSystem', path: '/maintainSystem',
// component: Layout, component: Layout,
// redirect: '/maintainSystem/chargeConfig', redirect: '/maintainSystem/chargeConfig',
// name: 'MaintainSystem', name: 'MaintainSystem',
// meta: { title: '维护系统', icon: 'system' }, meta: { title: '维护系统', icon: 'system' },
// children: [ children: [
// { {
// path: '', path: '',
// redirect: 'chargeConfig', redirect: 'chargeConfig',
// name: 'MaintainSystemIndex' // 添加名称以解决警告 name: 'MaintainSystemIndex' // 添加名称以解决警告
// }, },
// { {
// path: 'chargeConfig', // 收费配置路由 path: 'chargeConfig', // 收费配置路由
// component: () => import('@/views/maintainSystem/chargeConfig/index.vue'), component: () => import('@/views/maintainSystem/chargeConfig/index.vue'),
// name: 'ChargeConfig', name: 'ChargeConfig',
// meta: { title: '挂号收费系统参数维护', icon: 'config', permissions: ['maintainSystem:chargeConfig:list'] } meta: { title: '挂号收费系统参数维护', icon: 'config', permissions: ['maintainSystem:chargeConfig:list'] }
// }, },
// { {
// path: 'Inspection', // 检验管理路由 path: 'Inspection', // 检验管理路由
// component: () => import('@/views/maintainSystem/Inspection/index.vue'), component: () => import('@/views/maintainSystem/Inspection/index.vue'),
// name: 'Inspection', name: 'Inspection',
// meta: { title: '检验管理', icon: 'inspection' }, meta: { title: '检验管理', icon: 'inspection' },
// children: [ children: [
// { {
// path: 'PackageManagement', // 套餐管理路由 path: 'PackageManagement', // 套餐管理路由
// component: () => import('@/views/maintainSystem/Inspection/PackageManagement.vue'), component: () => import('@/views/maintainSystem/Inspection/PackageManagement.vue'),
// name: 'PackageManagement', name: 'PackageManagement',
// meta: { title: '套餐管理' } meta: { title: '套餐管理' }
// } }
// ] ]
// } }
// ] ]
// }, },
// 系统管理路由 // 系统管理路由
// { {
// path: '/system', path: '/system',
// component: Layout, component: Layout,
// redirect: '/system/user', redirect: '/system/user',
// name: 'System', name: 'System',
// meta: { title: '系统管理', icon: 'system' }, meta: { title: '系统管理', icon: 'system' },
// children: [ children: [
// { {
// path: 'user', // 用户管理路由 path: 'user', // 用户管理路由
// component: () => import('@/views/system/user/index.vue'), component: () => import('@/views/system/user/index.vue'),
// name: 'User', name: 'User',
// meta: { title: '用户管理', icon: 'user', permissions: ['system:user:list'] } meta: { title: '用户管理', icon: 'user', permissions: ['system:user:list'] }
// }, },
// { {
// path: 'role', // 角色管理路由 path: 'role', // 角色管理路由
// component: () => import('@/views/system/role/index.vue'), component: () => import('@/views/system/role/index.vue'),
// name: 'Role', name: 'Role',
// meta: { title: '角色管理', icon: 'role', permissions: ['system:role:list'] } meta: { title: '角色管理', icon: 'role', permissions: ['system:role:list'] }
// }, },
// { {
// path: 'menu', // 菜单管理路由 path: 'menu', // 菜单管理路由
// component: () => import('@/views/system/menu/index.vue'), component: () => import('@/views/system/menu/index.vue'),
// name: 'Menu', name: 'Menu',
// meta: { title: '菜单管理', icon: 'menu', permissions: ['system:menu:list'] } meta: { title: '菜单管理', icon: 'menu', permissions: ['system:menu:list'] }
// }, },
// { {
// path: 'dept', // 部门管理路由 path: 'dept', // 部门管理路由
// component: () => import('@/views/system/dept/index.vue'), component: () => import('@/views/system/dept/index.vue'),
// name: 'Dept', name: 'Dept',
// meta: { title: '部门管理', icon: 'dept', permissions: ['system:dept:list'] } meta: { title: '部门管理', icon: 'dept', permissions: ['system:dept:list'] }
// }, },
// { {
// path: 'post', // 岗位管理路由 path: 'post', // 岗位管理路由
// component: () => import('@/views/system/post/index.vue'), component: () => import('@/views/system/post/index.vue'),
// name: 'Post', name: 'Post',
// meta: { title: '岗位管理', icon: 'post', permissions: ['system:post:list'] } meta: { title: '岗位管理', icon: 'post', permissions: ['system:post:list'] }
// }, },
// { {
// path: 'dict', // 字典管理路由 path: 'dict', // 字典管理路由
// component: () => import('@/views/system/dict/index.vue'), component: () => import('@/views/system/dict/index.vue'),
// name: 'Dict', name: 'Dict',
// meta: { title: '字典管理', icon: 'dict', permissions: ['system:dict:list'] } meta: { title: '字典管理', icon: 'dict', permissions: ['system:dict:list'] }
// }, },
// { {
// path: 'config', // 参数配置路由 path: 'config', // 参数配置路由
// component: () => import('@/views/system/config/index.vue'), component: () => import('@/views/system/config/index.vue'),
// name: 'Config', name: 'Config',
// meta: { title: '参数配置', icon: 'config', permissions: ['system:config:list'] } meta: { title: '参数配置', icon: 'config', permissions: ['system:config:list'] }
// }, },
// { {
// path: 'notice', // 通知公告路由 path: 'notice', // 通知公告路由
// component: () => import('@/views/system/notice/index.vue'), component: () => import('@/views/system/notice/index.vue'),
// name: 'Notice', name: 'Notice',
// meta: { title: '通知公告', icon: 'notice', permissions: ['system:notice:list'] } meta: { title: '通知公告', icon: 'notice', permissions: ['system:notice:list'] }
// }, },
// { {
// path: 'tenant', // 租户管理路由 path: 'tenant', // 租户管理路由
// component: () => import('@/views/system/tenant/index.vue'), component: () => import('@/views/system/tenant/index.vue'),
// name: 'Tenant', name: 'Tenant',
// meta: { title: '租户管理', icon: 'tenant', permissions: ['system:tenant:list'] } meta: { title: '租户管理', icon: 'tenant', permissions: ['system:tenant:list'] }
// } }
// ] ]
// }, },
// 租户用户设置路由 // 租户用户设置路由
{ {
path: '/system/tenant-user', path: '/system/tenant-user',

View File

@@ -219,6 +219,7 @@ const templateName = ref('');
// 事件 // 事件
const emits = defineEmits(['save']); const emits = defineEmits(['save']);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
console.log('EMR组件初始化proxy:', proxy);
// 监听表单变化 // 监听表单变化
watch( watch(
@@ -325,18 +326,109 @@ function cancel() {
// 暴露方法给父组件 // 暴露方法给父组件
defineExpose({ defineExpose({
getDetail(encounterId) { getDetail(encounterId) {
getEmrDetail(encounterId).then((res) => { console.log('开始获取病历详情encounterId:', encounterId);
if (res.data) {
// 立即初始化form.value为空对象确保页面有内容显示
form.value = {};
// 检查API函数是否存在
if (typeof getEmrDetail !== 'function') {
console.error('getEmrDetail函数未定义');
if (proxy) {
proxy.$modal.msgError('获取病历详情失败API函数未定义');
}
return;
}
// 添加超时处理,防止请求一直挂起
const timeoutPromise = new Promise((_, reject) => {
setTimeout(() => {
reject(new Error('获取病历详情请求超时'));
}, 10000); // 10秒超时
});
// 使用Promise.race处理正常请求和超时
Promise.race([getEmrDetail(encounterId), timeoutPromise])
.then((res) => {
console.log('获取病历详情成功,返回完整数据:', JSON.stringify(res, null, 2));
// 检查响应是否有效
if (!res) {
console.error('API返回结果为空');
if (proxy) {
proxy.$modal.msgError('获取病历详情失败API返回结果为空');
}
return;
}
console.log('res存在类型:', typeof res);
console.log('res的属性:', Object.keys(res));
// 检查响应码
if (res.code !== 200) {
console.error('API返回错误代码:', res.code);
if (proxy) {
proxy.$modal.msgError('获取病历详情失败:' + (res.msg || '未知错误'));
}
return;
}
// 检查数据是否存在
if (!res.data) {
console.log('res.data为空使用默认值');
return;
}
console.log('res.data存在类型:', typeof res.data);
console.log('res.data的属性:', Object.keys(res.data));
// 处理contextJson
try { try {
form.value = JSON.parse(res.data.contextJson) || {}; if (res.data.contextJson) {
console.log('contextJson存在值:', res.data.contextJson);
console.log('contextJson类型:', typeof res.data.contextJson);
// 检查contextJson类型
if (typeof res.data.contextJson === 'string') {
// 尝试解析JSON字符串
const parsedData = JSON.parse(res.data.contextJson);
// 确保解析结果是对象
if (typeof parsedData === 'object' && parsedData !== null) {
form.value = parsedData;
console.log('解析后的病历数据:', JSON.stringify(form.value, null, 2));
} else {
form.value = {};
console.error('contextJson解析结果不是有效对象:', parsedData);
}
} else if (typeof res.data.contextJson === 'object') {
// 如果已经是对象,直接使用
form.value = res.data.contextJson;
console.log('直接使用contextJson作为对象:', JSON.stringify(form.value, null, 2));
} else {
form.value = {};
console.error('contextJson类型无效:', typeof res.data.contextJson);
}
} else {
console.log('contextJson为空使用默认值');
}
} catch (e) { } catch (e) {
form.value = {}; form.value = {};
console.error('病历数据解析失败:', e);
console.error('解析失败的contextJson值:', res.data.contextJson);
if (proxy) {
proxy.$modal.msgError('病历数据解析失败');
}
} }
emits('save', true); emits('save', true);
} else { })
form.value = {}; .catch((error) => {
} // 处理API调用失败或超时的情况
}); console.error('获取病历详情失败:', error);
if (proxy) {
proxy.$modal.msgError('获取病历详情失败:' + (error.message || '未知错误'));
}
});
}, },
addEmr addEmr
}); });

View File

@@ -1493,6 +1493,7 @@ const { proxy } = getCurrentInstance();
const inputRefs = ref({}); // 存储输入框实例,格式: { rowIndex: { fieldName: el } } const inputRefs = ref({}); // 存储输入框实例,格式: { rowIndex: { fieldName: el } }
const requiredProps = ref([]); // 存储必填项 prop 顺序 const requiredProps = ref([]); // 存储必填项 prop 顺序
const totalAmount = ref(0); const totalAmount = ref(0);
const groupMarkers = ref([]); // 存储分组标记,用于显示层级关系
const { method_code, unit_code, rate_code, distribution_category_code, drord_doctor_type } = proxy.useDict( const { method_code, unit_code, rate_code, distribution_category_code, drord_doctor_type } = proxy.useDict(
'method_code', 'method_code',
'unit_code', 'unit_code',

View File

@@ -20,16 +20,16 @@
<el-icon <el-icon
class="delete-icon" class="delete-icon"
title="删除处方单" title="删除处方单"
@click="handleDeletePrescriptionClick(index)" @click="handleDeletePrescriptionClick(pIndex)"
:class="{ 'disabled-icon': isPrescriptionDeletable(index) !== true }" :class="{ 'disabled-icon': isPrescriptionDeletable(pIndex) !== true }"
style="font-size: 20px !important; margin-left: 10px; color: #f56c6c" style="font-size: 20px !important; margin-left: 10px; color: #f56c6c"
> >
<minus /> <minus />
</el-icon> </el-icon>
</div> </div>
<div class="summary"> <div class="summary">
<span class="summary-item">药品数: {{ getPrescriptionMedicineCount(index) }}</span> <span class="summary-item">药品数: {{ getPrescriptionMedicineCount(pIndex) }}</span>
<span class="summary-item">总价: ¥ {{ getPrescriptionTotalPrice(index) }}</span> <span class="summary-item">总价: ¥ {{ getPrescriptionTotalPrice(pIndex) }}</span>
</div> </div>
</div> </div>
<div> <div>
@@ -570,7 +570,10 @@ function getList() {
} }
function getListInfo(addNewRow) { function getListInfo(addNewRow) {
isAdding.value = false; // 确保isAdding变量存在
if (typeof isAdding !== 'undefined') {
isAdding.value = false;
}
// 确保有患者信息 // 确保有患者信息
if (!props.patientInfo || !props.patientInfo.encounterId) { if (!props.patientInfo || !props.patientInfo.encounterId) {
@@ -650,7 +653,7 @@ function getDiagnosisInfo() {
}); });
}); });
} }
// 默认选择第一个诊断 // 默认选择第一个诊断
if (diagnosisList.value.length > 0) { if (diagnosisList.value.length > 0) {
const firstDiagnosis = diagnosisList.value[0]; const firstDiagnosis = diagnosisList.value[0];
tcmPrescriptionList.value.forEach((prescription) => { tcmPrescriptionList.value.forEach((prescription) => {

View File

@@ -426,11 +426,17 @@ function handleCardClick(item, index) {
} }
activeTab.value = 'emr'; activeTab.value = 'emr';
nextTick(() => { nextTick(() => {
prescriptionRef.value.getListInfo(); // 确保所有组件引用都已初始化
tcmRef.value.getListInfo(); if (prescriptionRef.value) prescriptionRef.value.getListInfo();
diagnosisRef.value.getList(); if (tcmRef.value) tcmRef.value.getListInfo();
eprescriptionRef.value.getList(); if (diagnosisRef.value) diagnosisRef.value.getList();
emrRef.value.getDetail(item.encounterId); if (eprescriptionRef.value) eprescriptionRef.value.getList();
if (emrRef.value) {
emrRef.value.getDetail(item.encounterId);
} else {
console.error('emr组件未正确初始化');
proxy.$modal.msgError('病历组件加载失败,请刷新页面重试');
}
setTimeout(() => { setTimeout(() => {
loading.value = false; loading.value = false;
}, 200); }, 200);