From 05c827fea632f004821cc746ba73880769fab7cd Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 14 七月 2025 10:06:43 +0800
Subject: [PATCH] gx1868 日期选择和排班患者查询条件,默认显示当天的已排班患者

---
 src/views/home/components/patient_file.vue |  234 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 184 insertions(+), 50 deletions(-)

diff --git a/src/views/home/components/patient_file.vue b/src/views/home/components/patient_file.vue
index bbfa684..b8bff9f 100644
--- a/src/views/home/components/patient_file.vue
+++ b/src/views/home/components/patient_file.vue
@@ -8,7 +8,7 @@
                     </el-icon> <span> &nbsp; 服务套餐</span>
                 </div>
                 <div>
-                    <el-form  :inline="true" class="demo-form-inline">
+                    <el-form  :inline="true" class="demo-form-inline" size="small">
                         <el-form-item label="基础服务:">
                             <el-radio-group class="elradiozdi" :disabled="state.formdispl" v-model="state.taochan.基础服务">
                                 <el-radio value="是">是</el-radio>
@@ -17,12 +17,12 @@
                         </el-form-item>
                         <el-form-item label="自购套餐:" >
                             <el-row>
-                                <el-col span='12'>
+                                <el-col :span='12'>
                                     <el-input v-model="state.taochan.自购几月" :disabled="state.formdispl" placeholder="购买多少个月">
                                         <template #append>月</template>
                                     </el-input>
                                 </el-col>
-                                <el-col span='12'>
+                                <el-col :span='12'>
                                     <el-input v-model="state.taochan.多少元套餐" :disabled="state.formdispl" placeholder="套餐金额">
                                         <template #append>元</template>
                                     </el-input>
@@ -31,10 +31,10 @@
                         </el-form-item>
                         <el-form-item label="自购产品名称">
                             <el-row>
-                                <el-col span='12'>
+                                <el-col :span='12'>
                                     <el-input v-model="state.taochan.产品名称" :disabled="state.formdispl" placeholder="产品名称"></el-input>
                                 </el-col>
-                                <el-col span='12'>
+                                <el-col :span='12'>
                                     <el-input v-model="state.taochan.自购多少盒" :disabled="state.formdispl" placeholder="数量">
                                         <template #append>盒</template>
                                     </el-input>
@@ -71,27 +71,38 @@
                                     </el-icon>
                                 </span>
                             </td>
-                            <td>干体重:<span>{{ state.patientData.干体重 }} (kg)</span></td>
+                            <td>干体重:<span>{{ state.patientData.干体重 }} (kg)</span>
+                                <el-icon :size="14" color="#409EFF" @click="state.gtzshow=true">
+                                    <Calendar />
+                                </el-icon>
+                            </td>
 
 
                         </tr>
                         <tr>
-                            <td colspan="2">证件号:{{ patientsInfo.patientIdentityNo }}</td>
-                            <td>透析龄:<span v-if="patientsInfo.medHistoryStatByMonth">{{
-            patientsInfo.medHistoryStatByMonth }}
-                                    (月)</span></td>
+                            <td colspan="2">证件号:{{ state.patientData.证件号 }}</td>
+                            <td>透析龄:<span>{{透析年龄}}</span></td>
                             <td>最近体重:<span>{{ state.patientData.上一次透前体重 }} (kg)</span></td>
                             <td>BMI:<span>{{ BMI }}</span></td>
 
                         </tr>
                         <tr>
-                            <td>电话号码:{{ patientsInfo.patientTelNo }}</td>
-                            <td>家属电话:{{ patientsInfo.patientTelNoRelative }}</td>
-                            <td colspan="3">家庭地址:{{ patientsInfo.patientAddress }}</td>
+                            <td>电话号码:{{ state.patientData.电话号码 }}</td>
+                            <td>家属电话:{{ state.patientData.亲属手机号 }}</td>
+                            <td colspan="3">家庭地址:{{ state.patientData.家庭住址 }}</td>
 
                         </tr>
                         <tr>
                             <td colspan="5">患者诊断:{{ state.patientData.诊断 }}</td>
+                        </tr>
+                        <tr>
+                            <td colspan="5">外院出院诊断:{{ state.patientData.出院诊断 }} 
+                                <span>
+                                    <el-icon :size="14" color="#409EFF" @click="updateZD">
+                                        <Edit />
+                                    </el-icon>
+                                </span>
+                                </td>
                         </tr>
                     </table>
                 </div>
@@ -100,40 +111,91 @@
                 <div class="clearfix">
                     <el-icon size="16" color="#409efc">
                         <CreditCard />
-                    </el-icon> <span> &nbsp; 最新生化数据</span>
+                    </el-icon> <span> &nbsp; 最新生化数据 <span style="color: #606266; font-size: 80%;font-weight: 200;">(90天以内的)</span></span>
                 </div>
-                <div>
-                    <el-row :gutter="10" v-if="state.listData.length">
-                        <el-col :xs="8" :sm="8" :md="6" :lg="6" :xl="4" v-for="(item, key) in state.listData"
-                            :key="key">
-                            <div class="itemLis" v-if="item?.item_result">
-                                <div class="title">
-                                    {{ key }}
-                                </div>
-                                <div class="itemRes">
-                                    <div class="itemResDtile">
-                                        <div style="text-align: center;width: 100%;">
-                                            {{ item?.item_name }}
-                                        </div>
-                                        <div>
-                                            {{ item?.item_result }}<span class="tdate">{{ item?.item_result_unit
-                                                }}</span>
+                <el-scrollbar :height="(tableHeight-820)+'px'">
+                    <div>
+                        <el-row :gutter="10" v-if="state.listData.length">
+                            <el-col :xs="8" :sm="8" :md="6" :lg="6" :xl="4" v-for="(item, key) in state.listData"
+                                :key="key">
+                                <div class="itemLis" v-if="item?.item_result">
+                                    <!-- <div class="title">
+                                        {{ key }}
+                                    </div> -->
+                                    <div class="itemRes">
+                                        <div class="itemResDtile">
+                                            <div style="text-align: center;width: 100%;">
+                                                {{ item?.item_name }}
+                                            </div>
+                                            <div>
+                                              <span style="font-weight: 600;" :style="{ color:item.item_result_flag==='d'?'#67C23A':'#F56C6C'}">{{ item?.item_result }}</span> 
+                                             <span class="tdate">{{ item?.item_result_unit
+                                                    }}</span>
+                                            </div>
                                         </div>
                                     </div>
-                                </div>
-                                <div class="tdate">
-                                    {{ item?.sample_date_str }}
+                                    <div class="tdate">
+                                        {{ item?.sample_date_str }}
+                                    </div>
+
                                 </div>
 
-                            </div>
-
-                        </el-col>
-                    </el-row>
+                            </el-col>
+                        </el-row>
+                    </div>
+                </el-scrollbar>
+            </el-card>
+            <el-card class="box-card" style="margin-top:10px;">
+                <div class="clearfix">
+                    <el-icon size="16" color="#409efc">
+                        <CreditCard />
+                    </el-icon> <span> &nbsp; 最近营养筛查评估 <span style="color: #606266; font-size: 80%;font-weight: 200;">(90天以内的)</span></span>
                 </div>
+                <el-scrollbar :height="(tableHeight-820)+'px'">
+                    <div>
+                        <el-row :gutter="10" v-if="state.营养筛查历史表.length">
+                            <el-col :xs="8" :sm="8" :md="6" :lg="6" :xl="4" v-for="(item, key) in state.营养筛查历史表"
+                                :key="key">
+                                <div class="itemLis">
+                                    <div class="title">
+                                        {{ item?.结果.表名 }}
+                                    </div>
+                                    <div class="itemRes">
+                                        <div class="itemResDtile">
+                                           
+                                            <div>
+                                              <span style="font-weight: 600;" :style="{ color:item?.结果.结果.color}">{{ item?.结果.结果.label }}</span> 
+                                                <span class="tdate"> 得分:{{ item?.结果.结果.value}}</span>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="tdate">
+                                        {{ item?.surveryTime }}
+                                    </div>
+
+                                </div>
+
+                            </el-col>
+                        </el-row>
+                    </div>
+                </el-scrollbar>
             </el-card>
 
         </div>
         <el-empty v-else description="无数据,请先选择患者"></el-empty>
+        <el-dialog v-model="state.gtzshow" title="干体重历史调整记录" width="800px">
+            <el-table  :data="state.gtztableData" height="300" >
+                    <el-table-column align="center" prop="createTime"  label="时间"  width="180" />  
+                    <el-table-column align="center" prop="pureWeight" label="干体重"  />
+                    <el-table-column align="center" label="启用时间">
+                        <template #default="scope">
+                            <span v-if="scope.row.enableRecordTime">{{scope.row.enableRecordTime.substring(0,11)}}</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column align="center" prop="remark"  label="备注" />
+                  
+                </el-table>
+        </el-dialog>
     </div>
 
 </template>
@@ -143,7 +205,8 @@
 import { usePatientsInfo } from '/@/stores/patientsInfo';
 import { useUserInfo } from '/@/stores/userInfo';
 import { computed, onMounted, reactive } from 'vue';
-import { getPatData, getLisResults, update ,updateNurtion,listNurtion,AddNurtion} from '/@/api/Patients';
+import { getPatData, getLisResults, update ,updateNurtion,listNurtion,AddNurtion,getDryWeightList} from '/@/api/Patients';
+import {list} from '/@/api/tiaochabiao/index'
 import { userInfo } from 'os';
 import { Search ,Edit,Check} from '@element-plus/icons-vue'
 import dayjs from 'dayjs';
@@ -158,6 +221,8 @@
 const { userInfos } = storeToRefs(stores);
 const props = defineProps(['tableHeight'])
 const state = reactive({
+    gtztableData:[],
+    gtzshow:false,
     formdispl:true,// 表单是否编辑
     // 患者套餐表
     taochanId:0,
@@ -176,9 +241,13 @@
         证件号: "",
         诊断: '',
         身高: '',
-        上一次透前体重: ''
+        上一次透前体重: '',
+        出院诊断:'',
+        '透析龄(月)':''
     },
-    listData: <any>{}
+    // 最近检验数据
+    listData: <any>{},
+    营养筛查历史表:<any>[]
 })
 const tableHe = computed(() => {
     return props.tableHeight - 130
@@ -206,6 +275,30 @@
             state.loading = false
         })
     }
+}
+const updateZD=()=>{
+    ElMessageBox.prompt('请输入你要编辑的外院出院诊断', '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        inputValue: state.patientData.出院诊断,
+    })
+        .then(({ value }) => {
+            const params = {
+                id: patientsInfo.value.id,
+                outDiagnoseFromPrevHospital: value
+            }
+            update(params).then(re => {
+                getPatData({ patCode: patientsInfo.value.code, }).then(res => {
+                    state.patientData = res.data
+                })
+            })
+        })
+        .catch(() => {
+            ElMessage({
+                type: 'info',
+                message: '取消修改',
+            })
+        })
 }
 /**打开修改身高 */
 const updateSg = () => {
@@ -240,6 +333,15 @@
         return ''
     }
 })
+const 透析年龄=computed(() => {
+    if (state.patientData['透析龄(月)']) {
+        const nian=Math.floor(Number(state.patientData['透析龄(月)']) / 12)===0?'':Math.floor(Number(state.patientData['透析龄(月)']) / 12)+'年'
+        const yue=(Number(state.patientData['透析龄(月)']) % 12)===0?'':Number(state.patientData['透析龄(月)']) % 12+'月'
+        return  nian +yue
+    } else {
+        return ''
+    }
+})
 // 第一步:定义子组件里面的方法
 const getData = async (str: string) => {
     var pam = {
@@ -248,7 +350,7 @@
     const pam2 = {
         clientCode: userInfos.value.clientCode,
         patCode: patientsInfo.value.code,
-        date1: dayjs().add(-30, 'day').format('YYYY-MM-DD'),
+        date1: dayjs().add(-90, 'day').format('YYYY-MM-DD'),
         date2: dayjs().format('YYYY-MM-DD'),
     }
     const pas3={
@@ -256,15 +358,40 @@
         size: 0,
         wherecondition:`patient_code='${patientsInfo.value.code}'`,
     }
+    const pasm={
+        page: 0,
+        size: 0,
+        wherecondition:`survery_form_type=1 and patient_code='${patientsInfo.value.code}'`,
+        ordercondition: 'survery_time desc'
+    }
+    pasm.wherecondition+=` and survery_time BETWEEN '${dayjs().add(-90, 'day').format('YYYY-MM-DD')} 00:00:00' AND '${dayjs().format('YYYY-MM-DD')} 23:59:59'`
+    
     try {
         state.loading = true
-        const [res1, res2,res3] = await Promise.all([
+        getGtzList()
+        const [res1, res2,res3,res4] = await Promise.all([
             getPatData(pam),
             getLisResults(pam2),
-            listNurtion(pas3)
+            listNurtion(pas3),
+            list(pasm) //查询评估表
         ])
         state.patientData = res1.data
-        state.listData = res2.data
+        state.listData=[]
+        console.log('赋值患者信息',state.patientData)
+        // 赛选异常的值
+        res2.data.forEach(e=>{
+            if(e.item_result_flag!=='z'){
+                state.listData.push(e)
+            }
+        })
+        state.营养筛查历史表=[]
+        state.营养筛查历史表=res4.data.list.map(e=>{
+            e.结果=JSON.parse(e.surveryJsonBody)
+            return e
+        })
+        console.log(state.营养筛查历史表)
+        console.log('--------------------')
+        // state.listData = res2.data
         if(res3.data?.list.length>=1){
             const row=res3.data.list[0]
             console.log('taochanshuju----',row)
@@ -289,6 +416,17 @@
     }
 
 }
+const getGtzList=()=>{
+    var data = {
+    wherecondition: `patient_code = '${patientsInfo.value.code}'`,
+    ordercondition: 'create_time desc'
+    }
+    getDryWeightList(data).then((res:any) => {
+        state.gtztableData = res.data.list
+    }).finally(()=>{
+        
+    })
+}
 // 刷新套餐
 const getlistNurtion=()=>{
     const pas3={
@@ -306,15 +444,11 @@
         }
     })
 }
+
 onMounted(() => {
     // console.log(dayjs().add(-7, 'day').format('YYYY-MM-DD'),'---shan')
 })
-const formatResKeys = (obj: Object) => {
-    return Object.keys(obj).filter((k) => k !== '标本日期');
-};
-const formatResKeysDate = (obj: Object) => {
-    return Object.keys(obj).filter((k) => k === '标本日期');
-};
+
 
 // 第二步:暴露方法
 defineExpose({ getData })

--
Gitblit v1.8.0