|
@@ -119,7 +119,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script setup lang="ts">
|
|
|
|
|
|
+<script setup name="MedicalRecord" lang="ts">
|
|
import {ref, onMounted, getCurrentInstance, toRefs, defineAsyncComponent} from 'vue';
|
|
import {ref, onMounted, getCurrentInstance, toRefs, defineAsyncComponent} from 'vue';
|
|
import {useRoute, useRouter} from 'vue-router';
|
|
import {useRoute, useRouter} from 'vue-router';
|
|
import {ArrowLeft} from '@element-plus/icons-vue';
|
|
import {ArrowLeft} from '@element-plus/icons-vue';
|
|
@@ -135,30 +135,26 @@ const NutriDiagnosis = defineAsyncComponent(() => import('@/views/patients/nutri
|
|
const CheckLabel = defineAsyncComponent(() => import('@/views/patients/checkLabel/index.vue'));
|
|
const CheckLabel = defineAsyncComponent(() => import('@/views/patients/checkLabel/index.vue'));
|
|
const NutritionScreeningAdd = defineAsyncComponent(() => import('@/views/patients/screening/add.vue'));
|
|
const NutritionScreeningAdd = defineAsyncComponent(() => import('@/views/patients/screening/add.vue'));
|
|
const NutritionEvaluationAdd = defineAsyncComponent(() => import('@/views/patients/evaluation/add.vue'));
|
|
const NutritionEvaluationAdd = defineAsyncComponent(() => import('@/views/patients/evaluation/add.vue'));
|
|
-
|
|
|
|
const NutritionEducation = defineAsyncComponent(() => import('@/views/patients/nutritionEducation/index.vue'));
|
|
const NutritionEducation = defineAsyncComponent(() => import('@/views/patients/nutritionEducation/index.vue'));
|
|
const NutritionSetting = defineAsyncComponent(() => import('@/views/patients/nutritionSetting/index.vue'));
|
|
const NutritionSetting = defineAsyncComponent(() => import('@/views/patients/nutritionSetting/index.vue'));
|
|
const DietTherapy = defineAsyncComponent(() => import('@/views/patients/dietTherapy/index.vue'));
|
|
const DietTherapy = defineAsyncComponent(() => import('@/views/patients/dietTherapy/index.vue'));
|
|
|
|
|
|
const componentMap = {
|
|
const componentMap = {
|
|
- medicalRecord: MedicalRecord, // “营养病例”对应MedicalRecord.vue
|
|
|
|
- checkLabel: CheckLabel, // “检查标签”对应CheckLabel.vue
|
|
|
|
|
|
+ medicalRecord: MedicalRecord,
|
|
|
|
+ checkLabel: CheckLabel,
|
|
nutritionDiagnosis: NutriDiagnosis,
|
|
nutritionDiagnosis: NutriDiagnosis,
|
|
-
|
|
|
|
nutritionScreening: NutritionScreening,
|
|
nutritionScreening: NutritionScreening,
|
|
nutritionScreeningAdd: NutritionScreeningAdd,
|
|
nutritionScreeningAdd: NutritionScreeningAdd,
|
|
nutritionEvaluation: NutritionEvaluation,
|
|
nutritionEvaluation: NutritionEvaluation,
|
|
nutritionEvaluationAdd: NutritionEvaluationAdd,
|
|
nutritionEvaluationAdd: NutritionEvaluationAdd,
|
|
-
|
|
|
|
nutritionEducation: NutritionEducation,
|
|
nutritionEducation: NutritionEducation,
|
|
nutritionSetting: NutritionSetting,
|
|
nutritionSetting: NutritionSetting,
|
|
dietTherapy: DietTherapy
|
|
dietTherapy: DietTherapy
|
|
- // ... 其它映射
|
|
|
|
};
|
|
};
|
|
-const currentComponent = ref(componentMap['medicalRecord']); // 默认显示
|
|
|
|
|
|
+const currentComponent = ref(componentMap['medicalRecord']);
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
-const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
+const {proxy} = getCurrentInstance() as any;
|
|
|
|
|
|
const activeMenu = ref('medicalRecord');
|
|
const activeMenu = ref('medicalRecord');
|
|
|
|
|
|
@@ -170,7 +166,13 @@ const patientInfo = ref({
|
|
type: '',
|
|
type: '',
|
|
deptId: '',
|
|
deptId: '',
|
|
deptName: '',
|
|
deptName: '',
|
|
- outpatientNo: ''
|
|
|
|
|
|
+ outpatientNo: '',
|
|
|
|
+ height: '',
|
|
|
|
+ weight: '',
|
|
|
|
+ bmi: '',
|
|
|
|
+ activity: '',
|
|
|
|
+
|
|
|
|
+
|
|
});
|
|
});
|
|
|
|
|
|
// 弹窗控制
|
|
// 弹窗控制
|
|
@@ -241,6 +243,7 @@ const handleNext = () => {
|
|
currentPatientIndex.value++;
|
|
currentPatientIndex.value++;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+
|
|
const handleTabChange = (tab: string) => {
|
|
const handleTabChange = (tab: string) => {
|
|
if (tab == 'wait') {
|
|
if (tab == 'wait') {
|
|
getList();
|
|
getList();
|
|
@@ -248,15 +251,14 @@ const handleTabChange = (tab: string) => {
|
|
patientList.value = [];
|
|
patientList.value = [];
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+
|
|
// 编辑按钮处理
|
|
// 编辑按钮处理
|
|
const handleEdit = async () => {
|
|
const handleEdit = async () => {
|
|
if (!patientInfo.value.id) {
|
|
if (!patientInfo.value.id) {
|
|
proxy?.$modal.msgError('请先选择患者');
|
|
proxy?.$modal.msgError('请先选择患者');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
try {
|
|
try {
|
|
- // 获取患者详细信息
|
|
|
|
const res = await getTreatmentUser(patientInfo.value.id);
|
|
const res = await getTreatmentUser(patientInfo.value.id);
|
|
editData.value = res.data;
|
|
editData.value = res.data;
|
|
showEditDialog.value = true;
|
|
showEditDialog.value = true;
|
|
@@ -272,9 +274,7 @@ const handleDetail = async () => {
|
|
proxy?.$modal.msgError('请先选择患者');
|
|
proxy?.$modal.msgError('请先选择患者');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
try {
|
|
try {
|
|
- // 获取患者详细信息
|
|
|
|
const res = await getTreatmentUser(patientInfo.value.id);
|
|
const res = await getTreatmentUser(patientInfo.value.id);
|
|
detailData.value = res.data;
|
|
detailData.value = res.data;
|
|
showDetailDialog.value = true;
|
|
showDetailDialog.value = true;
|
|
@@ -296,7 +296,6 @@ const handleEditClose = () => {
|
|
};
|
|
};
|
|
|
|
|
|
const handleEditSave = (data) => {
|
|
const handleEditSave = (data) => {
|
|
- // 可在此处调用保存API,保存后刷新列表
|
|
|
|
showEditDialog.value = false;
|
|
showEditDialog.value = false;
|
|
proxy?.$modal.msgSuccess('保存成功');
|
|
proxy?.$modal.msgSuccess('保存成功');
|
|
getList();
|
|
getList();
|
|
@@ -313,247 +312,67 @@ const getList = async () => {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10
|
|
pageSize: 10
|
|
};
|
|
};
|
|
- const currentComponent = ref(componentMap['medicalRecord']); // 默认显示
|
|
|
|
- const route = useRoute();
|
|
|
|
- const router = useRouter();
|
|
|
|
- const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
-
|
|
|
|
- const activeMenu = ref('medicalRecord');
|
|
|
|
-
|
|
|
|
- const patientInfo = ref({
|
|
|
|
- id: '',
|
|
|
|
- name: '',
|
|
|
|
- age: '',
|
|
|
|
- gender: '',
|
|
|
|
- type: '',
|
|
|
|
- deptId: '',
|
|
|
|
- deptName: '',
|
|
|
|
- outpatientNo: '',
|
|
|
|
- BMI: '',
|
|
|
|
- height: '',
|
|
|
|
- weight: '',
|
|
|
|
- activity: '',
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // 弹窗控制
|
|
|
|
- const showDetailDialog = ref(false);
|
|
|
|
- const detailData = ref({});
|
|
|
|
- const physicalActivityDict = ref([]);
|
|
|
|
-
|
|
|
|
- const showEditDialog = ref(false);
|
|
|
|
- const editData = ref({} as any);
|
|
|
|
-
|
|
|
|
- const handleSelect = (key: string, other ? : string[]) => {
|
|
|
|
- if (key == 'nutritionScreeningAdd' || key == 'nutritionEvaluationAdd') {
|
|
|
|
- activeMenu.value = key.replace('Add', '');
|
|
|
|
- } else {
|
|
|
|
- activeMenu.value = key;
|
|
|
|
- }
|
|
|
|
- currentComponent.value = componentMap[key] || null;
|
|
|
|
- patientInfo.value['other'] = other;
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const goBack = () => {
|
|
|
|
- router.back();
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const searchValue = ref('');
|
|
|
|
- const patientTab = ref('wait');
|
|
|
|
- const patientList = ref([]);
|
|
|
|
- const loading = ref(false);
|
|
|
|
-
|
|
|
|
- const currentPatientIndex = ref(0);
|
|
|
|
-
|
|
|
|
- const tableRowClassName = ({ row, rowIndex }) => {
|
|
|
|
- return rowIndex === currentPatientIndex.value ? 'current-row' : '';
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handleRowClick = (row, column, event) => {
|
|
|
|
- activeMenu.value = 'medicalRecord';
|
|
|
|
- currentComponent.value = componentMap['medicalRecord'];
|
|
|
|
- const idx = patientList.value.findIndex(item => item === row);
|
|
|
|
- patientInfo.value = row;
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- if (idx !== -1) {
|
|
|
|
- currentPatientIndex.value = idx;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handlePrev = () => {
|
|
|
|
- activeMenu.value = 'medicalRecord';
|
|
|
|
- currentComponent.value = componentMap['medicalRecord']
|
|
|
|
- if (currentPatientIndex.value > 0) {
|
|
|
|
- patientInfo.value = patientList.value[currentPatientIndex.value - 1];
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- currentPatientIndex.value--;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handleNext = () => {
|
|
|
|
- activeMenu.value = 'medicalRecord';
|
|
|
|
- currentComponent.value = componentMap['medicalRecord']
|
|
|
|
- patientInfo.value = patientList.value[currentPatientIndex.value + 1];
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- if (currentPatientIndex.value < patientList.value.length - 1) {
|
|
|
|
- currentPatientIndex.value++;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- const handleTabChange = (tab: string) => {
|
|
|
|
- if (tab == 'wait') {
|
|
|
|
- getList();
|
|
|
|
- } else {
|
|
|
|
- patientList.value = [];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ if (searchValue.value) {
|
|
|
|
+ params.searchFlag = searchValue.value;
|
|
}
|
|
}
|
|
- // 编辑按钮处理
|
|
|
|
- const handleEdit = async () => {
|
|
|
|
- if (!patientInfo.value.id) {
|
|
|
|
- proxy ?.$modal.msgError('请先选择患者');
|
|
|
|
- return;
|
|
|
|
|
|
+ const res = await listTreatmentUser(params);
|
|
|
|
+ patientList.value = (res.rows || []).map(item => ({
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: item.treatName,
|
|
|
|
+ type: item.type,
|
|
|
|
+ deptId: item.doorId,
|
|
|
|
+ deptName: item.deptName,
|
|
|
|
+ outpatientNo: item.outpatientNo,
|
|
|
|
+ gender: item.sex === '0' ? '男' : item.sex === '1' ? '女' : '',
|
|
|
|
+ age: item.age,
|
|
|
|
+ BMI: item.bmi,
|
|
|
|
+ height: item.height,
|
|
|
|
+ weight: item.weight,
|
|
|
|
+ activity: item.activity,
|
|
|
|
+ }));
|
|
|
|
+ waitingCount.value = patientList.value.length;
|
|
|
|
+ // 如果有患者数据,根据路由参数或默认选中第一个
|
|
|
|
+ if (patientList.value.length > 0) {
|
|
|
|
+ const { id } = route.query;
|
|
|
|
+ if (typeof id === 'string') {
|
|
|
|
+ const targetIndex = patientList.value.findIndex(patient => patient.id === id);
|
|
|
|
+ if (targetIndex !== -1) {
|
|
|
|
+ patientInfo.value = patientList.value[targetIndex];
|
|
|
|
+ patientInfo.value.type = typeof route.query.type === 'string' ? route.query.type : '';
|
|
|
|
+ patientInfo.value.outpatientNo = typeof route.query.outpatientNo === 'string' ? route.query.outpatientNo : '';
|
|
|
|
+ currentPatientIndex.value = targetIndex;
|
|
|
|
+ } else {
|
|
|
|
+ patientInfo.value = patientList.value[0];
|
|
|
|
+ patientInfo.value.type = typeof route.query.type === 'string' ? route.query.type : '';
|
|
|
|
+ patientInfo.value.outpatientNo = typeof route.query.outpatientNo === 'string' ? route.query.outpatientNo : '';
|
|
|
|
+ currentPatientIndex.value = 0;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- // 没有路由参数,默认选中第一个
|
|
|
|
patientInfo.value = patientList.value[0];
|
|
patientInfo.value = patientList.value[0];
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
|
|
+ patientInfo.value.type = typeof route.query.type === 'string' ? route.query.type : '';
|
|
|
|
+ patientInfo.value.outpatientNo = typeof route.query.outpatientNo === 'string' ? route.query.outpatientNo : '';
|
|
currentPatientIndex.value = 0;
|
|
currentPatientIndex.value = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ loading.value = false;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error('获取列表失败:', error);
|
|
|
|
+ loading.value = false;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
- try {
|
|
|
|
- // 获取患者详细信息
|
|
|
|
- const res = await getTreatmentUser(patientInfo.value.id);
|
|
|
|
- editData.value = res.data;
|
|
|
|
- showEditDialog.value = true;
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error('获取患者详情失败:', error);
|
|
|
|
- proxy ?.$modal.msgError('获取患者详情失败');
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- // 详情按钮处理
|
|
|
|
- const handleDetail = async () => {
|
|
|
|
- if (!patientInfo.value.id) {
|
|
|
|
- proxy ?.$modal.msgError('请先选择患者');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- // 获取患者详细信息
|
|
|
|
- const res = await getTreatmentUser(patientInfo.value.id);
|
|
|
|
- detailData.value = res.data;
|
|
|
|
- showDetailDialog.value = true;
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error('获取患者详情失败:', error);
|
|
|
|
- proxy ?.$modal.msgError('获取患者详情失败');
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- // 详情弹窗关闭处理
|
|
|
|
- const handleDetailClose = () => {
|
|
|
|
- showDetailDialog.value = false;
|
|
|
|
- detailData.value = {};
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handleEditClose = () => {
|
|
|
|
- showEditDialog.value = false;
|
|
|
|
- editData.value = {};
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handleEditSave = (data) => {
|
|
|
|
- // 可在此处调用保存API,保存后刷新列表
|
|
|
|
- showEditDialog.value = false;
|
|
|
|
- proxy ?.$modal.msgSuccess('保存成功');
|
|
|
|
- getList();
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const waitingCount = ref(0);
|
|
|
|
- const treatingCount = ref(0);
|
|
|
|
- const treatedCount = ref(0);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- const getList = async () => {
|
|
|
|
- loading.value = true;
|
|
|
|
- try {
|
|
|
|
- const params: any = {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10
|
|
|
|
- };
|
|
|
|
- if (searchValue.value) {
|
|
|
|
- params.searchFlag = searchValue.value;
|
|
|
|
- }
|
|
|
|
- const res = await listTreatmentUser(params);
|
|
|
|
-
|
|
|
|
- patientList.value = (res.rows || []).map(item => ({
|
|
|
|
- id: item.id,
|
|
|
|
- name: item.treatName,
|
|
|
|
- type: item.type, // 0: 门诊,1: 住院
|
|
|
|
- deptId: item.doorId,
|
|
|
|
- deptName: item.deptName,
|
|
|
|
- outpatientNo: item.outpatientNo,
|
|
|
|
- gender: item.sex === '0' ? '男' : item.sex === '1' ? '女' : '',
|
|
|
|
- age: item.age,
|
|
|
|
- BMI: item.bmi,
|
|
|
|
- height: item.height,
|
|
|
|
- weight: item.weight,
|
|
|
|
- activity: item.activity,
|
|
|
|
- }));
|
|
|
|
- waitingCount.value = patientList.value.length;
|
|
|
|
-
|
|
|
|
- // 如果有患者数据,根据路由参数或默认选中第一个
|
|
|
|
- if (patientList.value.length > 0) {
|
|
|
|
- const { id } = route.query;
|
|
|
|
- if (id) {
|
|
|
|
- // 查找从工作台点击进入的患者
|
|
|
|
- const targetIndex = patientList.value.findIndex(patient => patient.id === id);
|
|
|
|
- if (targetIndex !== -1) {
|
|
|
|
- patientInfo.value = patientList.value[targetIndex];
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- currentPatientIndex.value = targetIndex;
|
|
|
|
- } else {
|
|
|
|
- // 如果没找到,默认选中第一个
|
|
|
|
- patientInfo.value = patientList.value[0];
|
|
|
|
- currentPatientIndex.value = 0;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- // 没有路由参数,默认选中第一个
|
|
|
|
- patientInfo.value = patientList.value[0];
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- currentPatientIndex.value = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- loading.value = false;
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error('获取列表失败:', error);
|
|
|
|
- loading.value = false;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const handleSearch = () => {
|
|
|
|
- getList();
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+const handleSearch = () => {
|
|
|
|
+ getList();
|
|
|
|
+};
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
- // 获取体力活动字典
|
|
|
|
- const { physical_activity } = toRefs(proxy ?.useDict('physical_activity'));
|
|
|
|
- physicalActivityDict.value = physical_activity ?.value || [];
|
|
|
|
- patientInfo.value.type = route.query.type;
|
|
|
|
- patientInfo.value.outpatientNo = route.query.outpatientNo;
|
|
|
|
- getList();
|
|
|
|
- });
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
+ // 获取体力活动字典
|
|
|
|
+ const { physical_activity } = toRefs(proxy?.useDict('physical_activity'));
|
|
|
|
+ physicalActivityDict.value = physical_activity?.value || [];
|
|
|
|
+ patientInfo.value.type = typeof route.query.type === 'string' ? route.query.type : '';
|
|
|
|
+ patientInfo.value.outpatientNo = typeof route.query.outpatientNo === 'string' ? route.query.outpatientNo : '';
|
|
|
|
+ getList();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|