From 35a85b085df4c76c38c76dfda74aa4527cea0b5b Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 28 二月 2025 15:57:06 +0800
Subject: [PATCH] gx

---
 src/views/home/index.vue |   90 ++++++++++++++++++++++++++++++---------------
 1 files changed, 60 insertions(+), 30 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 82a88bc..e2ec58e 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -14,12 +14,20 @@
                             </div>
                             <el-input size="default" @change="getPatients" v-model="state.search" placeholder="支持模糊查询"
                                 :prefix-icon="Search" />
+
+                            <el-row style="margin-top: 5px;">
+                                <el-col :span="10">姓名</el-col>
+                                <el-col :span="5">性别</el-col>
+                                <el-col :span="4">年龄</el-col>
+                                <el-col :span="5">床号</el-col>
+                            </el-row>
                         </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-col :span="10">{{ scope.row.patientName }}</el-col>
+                                <el-col :span="5">{{ scope.row?.patientGender===0?'男':'女' }}</el-col>
+                                <el-col :span="4">{{ scope.row.age }}</el-col>
+                                <el-col :span="5">{{ scope.row.deviceNo }}</el-col>
                             </el-row>
                         </template>
                     </el-table-column>
@@ -144,7 +152,7 @@
         </el-row>
         <div class="fixed-div" v-show="patientsInfo.patientName">
             <el-avatar :size="80" :src="patientsInfo.patientAvatarIcon" />
-            <div @click="state.isTable = false">{{ patientsInfo.patientName }}</div>
+            <div>{{ patientsInfo.patientName }}</div>
         </div>
     </div>
 </template>
@@ -152,8 +160,9 @@
 <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 { QueryList,getRecordsInToday2 } from '/@/api/Patients'
 import { storeToRefs } from 'pinia';
+import {formatDate} from '/@/utils/formatTime'
 import { useUserInfo } from '/@/stores/userInfo';
 import { usePatientsInfo } from '/@/stores/patientsInfo';
 const stores = useUserInfo();
@@ -219,25 +228,23 @@
     if (val) {
         console.log(val)
         currentRow.value = val
+        const ps={
+            id: val.patientId,
+			code: val.patientCode,
+			age: val.age,
+			patientName:val.patientName,
+			patientGenderText: val?.patientGender?'女':'男',
+			patientAvatarIcon: val?.patientAvatar,
+			clientCode:val.clientCode
+        }
         //缓存到vuex 中
-        storesPat.setPatientsInfo(val)
-        console.log(val)
+        storesPat.setPatientsInfo(ps)
         getTabsData()
     }
 }
 /**获取患者列表 */
 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()}%")`
-    }
+    // 初始化患者信息
     storesPat.setPatientsInfo({
         id: '',
         code: '',
@@ -248,13 +255,42 @@
         clientCode:''
 
     })
-    QueryList(ps).then(res => {
-        console.log('----------------患者--------')
-        console.log(res.data)
-        state.filterTableData = res.data.list
-    }).finally(() => {
-        loading.close()
+    // 患者信息查询条件
+    const pp={
+        timeSlot:3,
+        patientFrom:-1,
+        patientName:state.search.toLowerCase(),
+        orderCondition:2,
+        clientCode:userInfos.value.clientCode,
+        dateBegin:formatDate(new Date(),'YYYY-mm-dd')+ " 00:00:00",
+        dateEnd:formatDate(new Date(),'YYYY-mm-dd')+" 23:59:59"
+    }
+    const loading = ElLoading.service({
+        lock: true,
+        text: 'Loading',
+        background: 'rgba(0, 0, 0, 0.7)',
     })
+    getRecordsInToday2(pp).then(re=>{
+        console.log(re.data)
+        state.filterTableData = re.data
+    }).finally(() => {
+         loading.close()
+     })
+    
+    // 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(() => {
+    //     loading.close()
+    // })
 }
 /**设置高度 */
 const setTableHeight = () => {
@@ -301,8 +337,6 @@
 </script>
 
 <style lang="scss">
-$homeNavLengh: 8;
-
 .home-container {
     overflow: hidden;
 
@@ -371,8 +405,4 @@
     }
 }
 
-.parent {
-    display: grid;
-    grid-template-columns: minmax(150px, 20%) 1fr;
-}
 </style>

--
Gitblit v1.8.0