Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -36,9 +36,9 @@
|
|||||||
<el-table-column prop="requestTime" align="center" label="申请时间" />
|
<el-table-column prop="requestTime" align="center" label="申请时间" />
|
||||||
<el-table-column prop="sourceName" align="center" label="申请来源" />
|
<el-table-column prop="sourceName" align="center" label="申请来源" />
|
||||||
<el-table-column prop="wardName" 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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -68,10 +68,11 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import PatientRegister from './patientRegister.vue';
|
import PatientRegister from './patientRegister.vue';
|
||||||
import {getAdmissionPage, getInHospitalInfo, getPatientBasicInfo} from './api';
|
import {getAdmissionPage, getInHospitalInfo, getPatientBasicInfo} from './api';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
const emits = defineEmits(['okList']);
|
const emits = defineEmits(['okList']);
|
||||||
|
|
||||||
const total = ref();
|
const total = ref(0);
|
||||||
const patient = ref({});
|
const patient = ref({});
|
||||||
const inHospitalInfo = ref({});
|
const inHospitalInfo = ref({});
|
||||||
const noFile = ref(false);
|
const noFile = ref(false);
|
||||||
@@ -79,34 +80,84 @@ const registrationType = ref(true);
|
|||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
searchKey: undefined,
|
|
||||||
registeredFlag: '0',
|
|
||||||
searchKey: '',
|
searchKey: '',
|
||||||
|
registeredFlag: '0',
|
||||||
});
|
});
|
||||||
|
|
||||||
const treatHospitalizedData = ref([]);
|
const treatHospitalizedData = ref([]);
|
||||||
const doRegistering = (row) => {
|
const patientRegisterVisible = ref(false);
|
||||||
if (row == 'no-file') {
|
|
||||||
|
// 修改后的 doRegistering 函数
|
||||||
|
const doRegistering = async (row) => {
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 区分 'no-file' 字符串和对象
|
||||||
|
if (typeof row === 'string' && row === 'no-file') {
|
||||||
patientRegisterVisible.value = true;
|
patientRegisterVisible.value = true;
|
||||||
noFile.value = true;
|
noFile.value = true;
|
||||||
inHospitalInfo.value = {};
|
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 {
|
} else {
|
||||||
getPatientBasicInfo(row.patientId).then((res) => {
|
|
||||||
patient.value = res.data;
|
ElMessage.warning('未获取到患者信息');
|
||||||
});
|
return;
|
||||||
getInHospitalInfo(row.encounterId).then((res) => {
|
}
|
||||||
inHospitalInfo.value = res.data;
|
|
||||||
|
// 获取住院信息
|
||||||
|
|
||||||
|
const inHospitalRes = await getInHospitalInfo(encounterId);
|
||||||
|
|
||||||
|
if (inHospitalRes.code === 200 && inHospitalRes.data) {
|
||||||
|
inHospitalInfo.value = inHospitalRes.data;
|
||||||
patientRegisterVisible.value = true;
|
patientRegisterVisible.value = true;
|
||||||
noFile.value = false;
|
noFile.value = false;
|
||||||
});
|
ElMessage.success('加载成功');
|
||||||
|
} else {
|
||||||
|
|
||||||
|
ElMessage.error(inHospitalRes.msg || '未获取到住院信息');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
ElMessage.error('登记失败:' + (error.message || '未知错误'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getAdmissionPage(queryParams.value).then((res) => {
|
getAdmissionPage(queryParams.value).then((res) => {
|
||||||
treatHospitalizedData.value = res.data.records;
|
treatHospitalizedData.value = res.data?.records || [];
|
||||||
total.value = res.data.total;
|
total.value = res.data?.total || 0;
|
||||||
});
|
}).catch(err => console.error('获取列表失败', err));
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@@ -119,14 +170,11 @@ function resetQuery() {
|
|||||||
queryParams.value = {
|
queryParams.value = {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
searchKey: undefined,
|
|
||||||
registeredFlag: '0',
|
|
||||||
searchKey: '',
|
searchKey: '',
|
||||||
|
registeredFlag: '0',
|
||||||
};
|
};
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
const patientRegisterVisible = ref(false);
|
|
||||||
const patientYbRegisterVisible = ref(false);
|
|
||||||
|
|
||||||
const patientRegisterOK = () => {
|
const patientRegisterOK = () => {
|
||||||
patientRegisterVisible.value = false;
|
patientRegisterVisible.value = false;
|
||||||
@@ -136,10 +184,10 @@ const patientRegisterOK = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cancelAct = () => {
|
const cancelAct = () => {
|
||||||
getList();
|
|
||||||
patientRegisterVisible.value = false;
|
patientRegisterVisible.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 页面加载时获取数据
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user