This commit is contained in:
parent
8b5461a7d2
commit
2596af0ab2
|
@ -250,6 +250,57 @@ const deleteByIdsUser = () => {
|
|||
ElMessage.info('取消删除');
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户病历信息
|
||||
const getUserRecord = async (id) => {
|
||||
try {
|
||||
const response = await axiosInstance.get(`/user/${id}/record`);
|
||||
console.log(response.data);
|
||||
if (response.data) {
|
||||
console.log(response.data);
|
||||
const medicalRecordInfo = response.data;
|
||||
showMedicalRecordInfo(medicalRecordInfo);
|
||||
} else {
|
||||
ElMessage.error('没有病历信息可供显示');
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMessage = error.response && error.response.data ? error.response.data.message : error.message;
|
||||
ElMessage.error(errorMessage);
|
||||
}
|
||||
};
|
||||
const showMedicalRecordInfo = (record) => {
|
||||
if (!record) {
|
||||
console.error('No record provided');
|
||||
return;
|
||||
}
|
||||
|
||||
// 格式化信息字符串
|
||||
const info = `
|
||||
<strong>体检信息:</strong><br>
|
||||
体检ID:${record.checkupId}<br>
|
||||
主档案ID:${record.id}<br>
|
||||
体重状态:${record.weightStatus}<br>
|
||||
血型:${record.bloodType}<br>
|
||||
慢性病:${record.chronicDiseases || '无'}<br>
|
||||
身高:${record.height} cm<br>
|
||||
体重:${record.weight} kg<br>
|
||||
心率:${record.heartRate} 次/分钟<br>
|
||||
体温:${record.temperature} °C<br>
|
||||
血氧饱和度:${record.oxygenSaturation}%<br>
|
||||
血压:${record.bloodPressure}<br>
|
||||
血糖水平:${record.glucoseLevel} mmol/L<br>
|
||||
脉搏:${record.pulse} 次/分钟<br>
|
||||
体检日期:${record.checkupDate}<br>
|
||||
`;
|
||||
|
||||
// 显示信息
|
||||
ElMessageBox.alert(info, '病历信息', {
|
||||
confirmButtonText: '确定',
|
||||
dangerouslyUseHTMLString: true, // 允许HTML字符串
|
||||
// 不需要 callback,因为弹窗会自动关闭
|
||||
});
|
||||
};
|
||||
|
||||
const getUserTreatment = async (id) => {
|
||||
try {
|
||||
const response = await axiosInstance.get(`/user/${id}/treatment`);
|
||||
|
@ -312,7 +363,8 @@ const showTreatmentInfo = (info) => {
|
|||
<template #default="{ row }">
|
||||
<el-button :icon="Edit" circle plain type="primary" @click="updateEcho(row)"></el-button>
|
||||
<el-button :icon="Delete" circle plain type="danger" @click="deleteUser(row)"></el-button>
|
||||
<el-button type="success" round @click="getUserTreatment(row.id);">治疗方案</el-button>
|
||||
<el-button icon="Folder" circle plain type="success" round @click="getUserTreatment(row.id);"></el-button>
|
||||
<el-button icon="List" circle plain type="info" round @click="getUserRecord(row.id);"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
|
@ -463,7 +515,9 @@ h2 {
|
|||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.el-button+.el-button {
|
||||
margin-left: 0px;
|
||||
}
|
||||
.box {
|
||||
transform: translateX(100%);
|
||||
/**右移元素**/
|
||||
|
|
Loading…
Reference in New Issue