From 028255207627f5207a0e4f942003aabeed4db99b Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 01 十一月 2022 15:50:27 +0800
Subject: [PATCH] 新增透析方案

---
 src/views/home/index.vue   |    8 ++
 src/views/record/index.vue |  154 ++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 140 insertions(+), 22 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 366bd30..929f9e5 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -124,7 +124,7 @@
   <script lang="ts" setup>
     import { onMounted,ref,computed,watch } from 'vue'
     import { userInfoStore } from '@/stores/userInfo'
-    import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem } from 'vant'
+    import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem, Toast } from 'vant'
     import {useRouter} from 'vue-router'
     import meun1 from './assets/meun1.png'
     import meun2 from './assets/meun2.png'
@@ -144,7 +144,11 @@
     }
     const topath=(url:string)=>{
         console.log('sss')
-        router.push(url)
+        if (url==='/report'){
+            Toast('此功能暂未开通')
+        } else {
+            router.push(url)
+        }
     }
     const patientInfo=computed(() => {
         return userInfo.patient
diff --git a/src/views/record/index.vue b/src/views/record/index.vue
index a968ca3..a816c2e 100644
--- a/src/views/record/index.vue
+++ b/src/views/record/index.vue
@@ -9,6 +9,8 @@
         <div>
             <van-calendar
                 color="#769AFF"
+                :min-date="minDate"
+                @month-show="monthShow"
                 :poppable="false"
                 :show-confirm="false"
                 @select="selectData"
@@ -17,41 +19,48 @@
                 :style="{ height: '400px' }"
             />
         </div>
-        <div class="listdiv">
+        <van-loading v-if="loand" size="24" />
+        <div class="listdiv" v-else>
             <div class="listrow">
                 <van-row>
                     <van-row class="lable">
                         <van-col span="8">
                             <span style="color: #777777;">状态:</span>
-                            <span style="color: #769AFF;">透析完成</span>
+                            <span v-if="pageInfo.medState === 0" style="color: #769AFF;">未签到</span>
+                            <span v-if="pageInfo.medState === 1" style="color: #769AFF;">已签到</span>
+                            <span v-if="pageInfo.medState === 2" style="color: #769AFF;">透析中</span>
+                            <span v-if="pageInfo.medState === 3" style="color: #769AFF;">已检查</span>
+                            <span v-if="pageInfo.medState === 4" style="color: #769AFF;">已归档</span>
                         </van-col>
                         <van-col span="8">
                             <span style="color: #777777;">上机:</span>
-                            <span style="color: #769AFF;">8:00</span>
+                            <span style="color: #769AFF;">{{pageInfo.detailForPatientMedStartTime}}</span>
                         </van-col>
                         <van-col span="8">
                             <span style="color: #777777;">下机:</span>
-                            <span style="color: #769AFF;">12:00</span>
+                            <span style="color: #769AFF;">{{pageInfo.detailForPatientMedEndTime}}</span>
                         </van-col>
                     </van-row>
                     <van-row class="lable">
                         <van-col span="8">
                             <span style="color: #777777;">班次:</span>
-                            <span style="color: #769AFF;">上午</span>
+                            <span v-if="pageInfo.scheduleTimeSlot === 0" style="color: #769AFF;">上午</span>
+                            <span v-if="pageInfo.scheduleTimeSlot === 1" style="color: #769AFF;">下午</span>
+                            <span v-if="pageInfo.scheduleTimeSlot === 2" style="color: #769AFF;">晚上午</span>
                         </van-col>
                         <van-col span="8">
                             <span style="color: #777777;">机号:</span>
-                            <span style="color: #769AFF;">12</span>
+                            <span style="color: #769AFF;">{{pageInfo.deviceInfo.deviceName}}</span>
                         </van-col>
                         <van-col span="8">
                             <span style="color: #777777;">模式:</span>
-                            <span style="color: #769AFF;">HD</span>
+                            <span style="color: #769AFF;">{{pageInfo.schemeName}}</span>
                         </van-col>
                     </van-row>
                     <van-row class="lable2">
                         <van-col span="8">
                             <span style="color: #777777;">次数:</span>
-                            <span style="color: #769AFF;">65</span>
+                            <span style="color: #769AFF;">{{pageInfo.detailForPatientMedCount}}</span>
                         </van-col>
                         <van-col span="8">
                             <span style="color: #777777;">本次费用:</span>
@@ -61,41 +70,146 @@
                 </van-row>
                 <van-row class="item">
                     <van-col span="12">干体重:</van-col>
-                    <van-col span="12" style="text-align: right; color: #769AFF ;">78.6(kg)</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.pureWeight}}(kg)</van-col>
                 </van-row>
                 <van-row class="item">
                     <van-col span="12">衣物重:</van-col>
-                    <van-col span="12" style="text-align: right; color: #769AFF ;">0.6(kg)</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientClothesWeight}}(kg)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透前称重:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientPreWeight}}(kg)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透后称重:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientAfterWeight}}(kg)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透前血压:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientPreBP}}(mmHg)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透前心率:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientPrePulse}}(次/分)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透后血压:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientAfterBP}}(mmHg)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">透后心率:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientAfterPulse}}(次/分)</van-col>
+                </van-row>
+                <van-row class="item">
+                    <van-col span="12">抗凝剂:</van-col>
+                    <van-col span="12" style="text-align: right; color: #769AFF ;">{{pageInfo.detailForPatientKNJ}}</van-col>
                 </van-row>
             </div>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
-    // import {ref,reactive,watchEffect,watch} from 'vue'
+    import {ref,reactive,watchEffect,watch} from 'vue'
+    import {ajaxPost} from '@/utils/axios'
     import { Calendar as vanCalendar } from 'vant'
     import {useRouter} from 'vue-router'
+    import { userInfoStore } from '@/stores/userInfo'
+    const userInfo = userInfoStore()
     const router=useRouter()
-    const selectData=(data:any)=>{
-        console.log(data)
+    const loand=ref(false)
+    const pageInfo=ref({pureWeight:'',
+                        detailForPatientAfterBP: '',
+                        detailForPatientAfterPulse: '',
+                        detailForPatientAfterWeight:'',
+                        detailForPatientPreBP: '',
+                        detailForPatientPrePulse: '',
+                        detailForPatientPreWeight:'',
+                        detailForPatientKNJ:'',
+                        detailForPatientClothesWeight:'',
+                        schemeName:'',medState:0,detailForPatientMedCount:0,deviceInfo:{deviceName:''},scheduleTimeSlot:0,detailForPatientMedEndTime:'',detailForPatientMedStartTime:''})
+    const day=new Date()
+    const Year = day.getFullYear()
+    const minDate=ref( new Date(Date.parse(Year+'-01-01'.replace(/-/g,   '/'))))
+    const selectDate=ref([{y:2000,m:1,d:1,type:'',code:'',id:0,timeSlot:1}])
+    const selectData=(day:any)=>{
+        const y=day.getFullYear()
+        const m = day.getMonth() + 1
+        const d = day.getDate()
+        const x=selectDate.value.findIndex(e=>{return e.y===y&&e.m===m&&e.d===d})
+        console.log(selectDate.value[x],'找到了')
+        getDetail(selectDate.value[x].id)
+
     }
     const fanhui=()=>{
         router.go(-1)
     }
+    const getPaiban=(date:Date)=>{
+        const y=date.getFullYear()
+        const m= date.getMonth()+1
+        const pagedata={
+            patientCode:userInfo.patient.patientInfo.code,
+            year:y,
+            month:m,
+        }
+        ajaxPost('/patient/hemo/med/record/listByPatient',pagedata).then((re:any)=>{
+            console.log(re)
+            re.forEach((element:any) => {
+                const dey=element.scheduleDate.split('-')
+                // 不能添加重复的
+                const x=selectDate.value.findIndex(e=>{return e.code===element.code})
+                if (x===-1){
+                    selectDate.value.push({
+                        y:Number(dey[0]),
+                        m:Number(dey[1]),
+                        d:Number(dey[2].substring(0,2)),
+                        type:'o',
+                        timeSlot:element.scheduleTimeSlot,
+                        code:element.code,
+                        id:element.id
+
+                    })
+                }
+
+            })
+            selectDate.value= selectDate.value.sort((a,b)=>{
+                return a.id-b.id
+            })
+            console.log(selectDate.value)
+        })
+    }
+    const monthShow=(month:any)=>{
+        console.log(month)
+        getPaiban(month.date)
+    }
     const formatter=(day:any)=>{
+        const year=day.date.getFullYear()
         const month = day.date.getMonth() + 1
         const date = day.date.getDate()
-        if (month === 9) {
-            if (date === 24) {
-                day.bottomInfo='8:30'
-                day.className='recordclass'
-            } else if (date === 27) {
-                day.bottomInfo='13:00'
-                day.className='recordclass'
+        const index= selectDate.value.findIndex(el=>{return el.y===year&&el.m===month&&el.d===date})
+        if (index>0){
+            day.type='selected'
+            if (selectDate.value[index].timeSlot===0){
+                day.bottomInfo='上午'
+            }
+            else if (selectDate.value[index].timeSlot===1){
+                day.bottomInfo='上午'
+            }
+            else {
+                day.bottomInfo='晚上'
             }
         }
         return day
     }
+    const getDetail=(id:any)=>{
+        loand.value=true
+        ajaxPost('/patient/hemo/med/record/detail',`id=${id}`).then((re:any)=>{
+            console.log(re)
+            pageInfo.value=re
+            loand.value=false
+        }).finally(()=>{
+            loand.value=false
+        })
+    }
 </script>
 <style lang="scss">
     .recordclass{

--
Gitblit v1.8.0