chenyc
2024-08-19 7ae4f8a626802bc8f027aa091046db97635da879
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<template>
    <div class="home-container layout-pd ">
        <el-row :gutter="15" >
            <el-col :span="4"  class="patTabel">
                <el-table :data="state.filterTableData" 
                stripe 
                :height="state.tableHeight.left"
                size="default"
                highlight-current-row
                @current-change="handleCurrentChange"
                style="width: 100%">
                    <el-table-column>
                        <template #header>
                            <div class="home-title">
                                    <el-avatar shape="square" style="width: 16px; height: 16px;background-color: #ffffff;margin-right: 10px;margin-left: 10px;" fit="contain" :src="huanzheliebiao" />
                          
                                    <div class="titleHome">患者列表</div>
                            </div>
                            <el-input size="default"  @change="getPatients"  v-model="state.search" placeholder="支持模糊查询"  :prefix-icon="Search"/>
                        </template>
                        <template #default="scope">
                            <el-row>
                                <el-col :span="12">{{scope.row.patientName}}</el-col>
                                <el-col :span="6">{{scope.row.patientGenderText}}</el-col>
                                <el-col :span="6">{{scope.row.age}}</el-col>
                            </el-row>
                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
            <el-col :span="20" class="detailRight">
                <el-tabs v-model="state.activeName" class="demo-tabs" @tab-click="handleClick">
                    <el-tab-pane label="患者档案" name="患者档案">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Avatar /></el-icon>
                                <span style="margin-left: 5px">患者档案</span>
                            </span>
                        </template>
                        患者档案
                    </el-tab-pane>
                    <el-tab-pane label="生化数据" name="生化数据">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Aim /></el-icon>
                                <span style="margin-left: 5px">生化数据</span>
                            </span>
                        </template>
                        Config
                    </el-tab-pane>
                    <el-tab-pane label="用药记录" name="用药记录">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Edit /></el-icon>
                                <span style="margin-left: 5px">用药记录</span>
                            </span>
                        </template>
                        Role
                    </el-tab-pane>
                    <el-tab-pane label="历史服务" name="历史服务">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><ZoomIn /></el-icon>
                                <span style="margin-left: 5px">历史服务</span>
                            </span>
                        </template>
                        Task
                    </el-tab-pane>
                    <el-tab-pane label="膳食调查" name="膳食调查">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Notification /></el-icon>
                                <span style="margin-left: 5px">膳食调查</span>
                            </span>
                        </template>
                        Task
                    </el-tab-pane>
                    <el-tab-pane label="营养筛查评估" name="营养筛查评估">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Histogram /></el-icon>
                                <span style="margin-left: 5px">营养筛查评估</span>
                            </span>
                        </template>
                        Task
                    </el-tab-pane>
                    <el-tab-pane label="方案" name="方案">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><Grid /></el-icon>
                                <span style="margin-left: 5px">方案</span>
                            </span>
                        </template>
                        Task
                    </el-tab-pane>
                    <el-tab-pane label="随访记录" name="随访记录">
                        <template #label>
                            <span class="custom-tabs-label home-title">
                                <el-icon><ChatDotRound /></el-icon>
                                <span style="margin-left: 5px">随访记录</span>
                            </span>
                        </template>
                        Task
                    </el-tab-pane>
                </el-tabs>
            </el-col>
        </el-row>
    </div>
</template>
 
<script setup lang="ts" name="home">
import huanzheliebiao from '/@/assets/imgs/huanzheliebiao.png'
import { reactive, onMounted, ref, watch, nextTick, onActivated, markRaw } from 'vue';
import {QueryList} from '/@/api/Patients'
import { storeToRefs } from 'pinia';
import { useUserInfo } from '/@/stores/userInfo';
const stores = useUserInfo();
const { userInfos } = storeToRefs(stores);
import { ElLoading, TabsPaneContext } from 'element-plus'
import { Search } from '@element-plus/icons-vue'
interface User {
    code:string,
    patientName: string
    patientGenderText: string
    age: string
}
const currentRow=ref()
const state = reactive({
    global: {
        homeChartOne: null,
        homeChartTwo: null,
        homeCharThree: null,
        dispose: [null, '', undefined],
    } as any,
    filterTableData:[
        {
            name: '张山',
            sex: '男',
            age: '12',
        },
        {
            name: '张山二',
            sex: '男',
            age: '12',
        },
        {
            name: '王二小',
            sex: '男',
            age: '12',
        },
    ],
    activeName:'患者档案',
    tableHeight:{
        left:0,
        detailRight:0
    },
    search:''
});
onMounted(()=>{
    setTableHeight()
    getPatients()
})
const handleCurrentChange = (val: User | undefined) => {
  currentRow.value = val
}
const getPatients=()=>{
    const loading = ElLoading.service({
        lock: true,
        text: 'Loading',
        background: 'rgba(0, 0, 0, 0.7)',
    })
    var ps= {
        page: 0,
        size: 0,
        wherecondition:`client_code="${userInfos.value.clientCode}" and (patient_name like "%${state.search.toLowerCase()}%"
        OR patient_name_py like "%${state.search.toLowerCase()}%")`
    }
    QueryList(ps).then(res=>{
        console.log('----------------患者--------')
        console.log(res.data)
        state.filterTableData=res.data.list
    }).finally(e=>{
        loading.close()
    })
}
/**设置高度 */
const setTableHeight = () => {
    let height = document.documentElement.clientHeight;
    console.log('窗口高度')
    const navDom = document.querySelector('.layout-navbars-breadcrumb-index');
    if (navDom) {
        height -= navDom.scrollHeight;
    }
    state.tableHeight.detailRight=height
    state.tableHeight.left = height-77;
    // const demoFormDom = document.querySelector('.card_box_search')
 
};
/** 切换明细tabs*/
const handleClick=(tab: TabsPaneContext, event: Event)=>{
    console.log(tab, event)
}
</script>
 
<style  lang="scss">
$homeNavLengh: 8;
.home-container {
    overflow: hidden;
    .patTabel{
        .el-table th.el-table__cell {
            background-color: #6babfa; 
            color:#606266;
        }
        .el-table__body tr.current-row>td.el-table__cell{
            background: #E4F6DE;
            color: #5FCD00;
            /* height: 25px; */
            /* border: tomato solid 1px; */
         }
    }
    
}
.patTitle{
    height: 25px;
    font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
    font-weight: 500;
    font-size: 18px;
    color: #333333;
    line-height: 20px;
    letter-spacing: 1px;
    text-align: left;
    font-style: normal;
    // margin-top: -10px;
}
.home-title{
    margin-bottom: 4px;
    flex: 1;
    height: inherit;
    display: flex;
    align-items: center;
}
.detailRight{
    background-color: #ffffff;
}
 
</style>