166 收费工作站-》住院登记:待登记入院TAB页点击【登记】按钮无响应。

This commit is contained in:
liuliu
2026-03-12 13:17:18 +08:00
parent cf3f971741
commit effcdfbbe6

View File

@@ -29,16 +29,16 @@
<el-table-column prop="patientName" align="center" label="患者姓名" />
<el-table-column prop="genderEnum_enumText" label="性别" align="center" />
<el-table-column label="年龄" align="center">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
<el-table-column prop="requestTime" align="center" label="申请时间" />
<el-table-column prop="sourceName" align="center" label="申请来源" />
<el-table-column prop="wardName" align="center" label="入院病区" />
<el-table-column fixed="right" align="center" label="操作" width="88">
<el-table-column fixed="right" align="center" label="操作" width="120">
<template #default="scope">
<el-button type="primary" link @click="doRegistering(scope.row)"> 登记 </el-button>
<el-button type="primary" link @click.stop="doRegistering(scope.row)"> 登记 </el-button>
</template>
</el-table-column>
</el-table>
@@ -68,10 +68,11 @@
<script setup>
import PatientRegister from './patientRegister.vue';
import {getAdmissionPage, getInHospitalInfo, getPatientBasicInfo} from './api';
import { ElMessage } from 'element-plus';
const emits = defineEmits(['okList']);
const total = ref();
const total = ref(0);
const patient = ref({});
const inHospitalInfo = ref({});
const noFile = ref(false);
@@ -79,34 +80,84 @@ const registrationType = ref(true);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: undefined,
registeredFlag: '0',
searchKey: '',
registeredFlag: '0',
});
const treatHospitalizedData = ref([]);
const doRegistering = (row) => {
if (row == 'no-file') {
patientRegisterVisible.value = true;
noFile.value = true;
inHospitalInfo.value = {};
} else {
getPatientBasicInfo(row.patientId).then((res) => {
patient.value = res.data;
});
getInHospitalInfo(row.encounterId).then((res) => {
inHospitalInfo.value = res.data;
const patientRegisterVisible = ref(false);
// 修改后的 doRegistering 函数
const doRegistering = async (row) => {
try {
// 区分 'no-file' 字符串和对象
if (typeof row === 'string' && row === 'no-file') {
patientRegisterVisible.value = true;
noFile.value = true;
inHospitalInfo.value = {};
patient.value = {};
return;
}
// 确保 row 是对象且包含必要属性
if (!row || typeof row !== 'object') {
ElMessage.error('无效的行数据');
return;
}
const { patientId, encounterId } = row;
// 检查必要字段是否存在
if (patientId === undefined || patientId === null || patientId === '') {
ElMessage.error('患者 ID 不存在');
return;
}
if (encounterId === undefined || encounterId === null || encounterId === '') {
ElMessage.error('就诊 ID 不存在');
return;
}
// 获取患者基本信息
const patientRes = await getPatientBasicInfo(patientId);
if (patientRes.data) {
patient.value = patientRes.data;
} else {
ElMessage.warning('未获取到患者信息');
return;
}
// 获取住院信息
const inHospitalRes = await getInHospitalInfo(encounterId);
if (inHospitalRes.code === 200 && inHospitalRes.data) {
inHospitalInfo.value = inHospitalRes.data;
patientRegisterVisible.value = true;
noFile.value = false;
});
ElMessage.success('加载成功');
} else {
ElMessage.error(inHospitalRes.msg || '未获取到住院信息');
}
} catch (error) {
ElMessage.error('登记失败:' + (error.message || '未知错误'));
}
};
const getList = () => {
getAdmissionPage(queryParams.value).then((res) => {
treatHospitalizedData.value = res.data.records;
total.value = res.data.total;
});
treatHospitalizedData.value = res.data?.records || [];
total.value = res.data?.total || 0;
}).catch(err => console.error('获取列表失败', err));
};
/** 搜索按钮操作 */
@@ -119,14 +170,11 @@ function resetQuery() {
queryParams.value = {
pageNo: 1,
pageSize: 10,
searchKey: undefined,
registeredFlag: '0',
searchKey: '',
registeredFlag: '0',
};
getList();
}
const patientRegisterVisible = ref(false);
const patientYbRegisterVisible = ref(false);
const patientRegisterOK = () => {
patientRegisterVisible.value = false;
@@ -136,10 +184,10 @@ const patientRegisterOK = () => {
};
const cancelAct = () => {
getList();
patientRegisterVisible.value = false;
};
// 页面加载时获取数据
getList();
</script>
<style lang="scss" scoped>