chenyc
2024-08-20 7b5531fccfc16406e303c337526424e40d960f1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<template>
    <div class="dietarySurvey-home">
        <div v-if="patientsInfo.id">
            <el-card class="box-card">
                <div  class="clearfix">
                    <span>患者基本信息</span> 
                </div>
                <div>
                    <table class="gridtable">
                        <tr>
                            <td>姓名:{{patientsInfo.patientName}}</td>
                            <td>年龄:{{patientsInfo.age}}</td>
                            <td>性别:{{patientsInfo.patientGenderText}}</td>
                            <td>身高:{{patientsInfo.patientHeight}}</td>
                            <td>干体重:{{state.patientData.干体重}}</td>
                            
                        </tr>
                        <tr>
                            <td>透析龄:{{patientsInfo.dialysisAge}}</td>
                          
                            
                            <td colspan="4">患者诊断:{{state.patientData.诊断}}</td>
                        </tr>
                        <tr>
                            <td >电话号码:{{patientsInfo.mobile}}</td>
                            <td colspan="2">家庭地址:{{patientsInfo.patientAddress}}</td>
                            <td colspan="2">证件号:{{patientsInfo.patientIdentityNo}}</td>
                        </tr>
                    </table>
                  
                </div>
            </el-card>
            
        </div>
        <el-empty v-else description="无数据,请先选择患者"></el-empty>
    </div>
 
</template>
 
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { usePatientsInfo } from '/@/stores/patientsInfo';
import { computed, reactive } from 'vue';
import { getPatData } from '/@/api/Patients';
const storesPat = usePatientsInfo();
const { patientsInfo } = storeToRefs(storesPat);
const props = defineProps(['tableHeight'])
const state = reactive({
    tableData: [],
    loading: false,
    patientData:{
        姓名:'',
        干体重:'',
        证件号:"",
        诊断:'',
        身高:''
    }
})
const tableHe = computed(() => {
    return props.tableHeight - 130
})
// 第一步:定义子组件里面的方法
const getData = (str: string) => {
    console.log("患者档案子组件获取显示数据!" + str);
    console.log(props.tableHeight)
    var pam = {
        patCode: patientsInfo.value.code,
    }
    state.loading = true
    getPatData(pam).then(re=>{
        console.log(re.data)
        state.patientData=re.data
    })
}
 
// 第二步:暴露方法
defineExpose({ getData })
</script>
 
<style  lang="scss">
 .gridtable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #666666;border-collapse: collapse;width: 100%;}
 
.gridtable th {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;}
 
.gridtable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;}
</style>