xiaochan 1 anno fa
parent
commit
9bf36bf792

+ 48 - 30
src/views/view/patient360/comp/InfoView.vue

@@ -7,49 +7,67 @@
       <span>
           ({{ patInfo.sexName }}  {{ patInfo.age }} )
       </span>
+
     </div>
-    <div style="flex: 1;overflow: auto">
-      <div :class="[ns.e('medicalTrackList')]">
-        <template v-for="(item , index) in patInfo.medicalTrackList">
-          <div :class="[ns.e('item'), ns.is('activation' , currentUid === item.uid)]"
-               @click.stop="handleQueryData(item )">
-            <div :class="ns.e('dept_name')"> {{ item.deptName }}</div>
-            <div>
-              <div :class="ns.e('outOrHosp')">
-                {{ outOrHospName(item.outOrHosp) }}
-              </div>
-            </div>
-            <div
-                v-if="item.outOrHosp === 2"
-            >
+    <div style="flex: 1;width: 0 ">
+      <div>
+        <el-radio-group v-model="grouping">
+          <el-radio-button :label="0">全部({{ patInfo.medicalTrackList.length }})</el-radio-button>
+          <el-radio-button :label="1">门诊({{ medicalTrackGrouping.mz }})</el-radio-button>
+          <el-radio-button :label="2">住院({{ medicalTrackGrouping.zy }})</el-radio-button>
+        </el-radio-group>
+      </div>
+      <div>
+        <div :class="[ns.e('medicalTrackList')]" style="overflow: auto">
+          <template v-for="(item , index) in medicalTrackComp">
+            <div :class="[ns.e('item'), ns.is('activation' , currentUid === item.uid)]"
+                 @click.stop="handleQueryData(item )">
+              <div :class="ns.e('dept_name')"> {{ item.deptName }}</div>
               <div>
-                {{ formatDate(item.admissDate) }}
+                <div :class="ns.e('outOrHosp')">
+                  {{ outOrHospName(item.outOrHosp) }}
+                </div>
               </div>
-              <div>
-                |
+              <div
+                  v-if="item.outOrHosp === 2"
+              >
+                <div>
+                  {{ formatDate(item.admissDate) }}
+                </div>
+                <div>
+                  |
+                </div>
+                <div>
+                  {{ formatDate(item.disDate) }}
+                </div>
               </div>
-              <div>
-                {{ formatDate(item.disDate) }}
+              <div v-else>
+                {{ item.date }}
               </div>
             </div>
-            <div v-else>
-              {{ item.date }}
-            </div>
-          </div>
-          <div
-              v-if="index < patInfo.medicalTrackList.length - 1"
-              :class="[ns.e('divider_line')]"
-          />
-        </template>
+            <div
+                v-if="index < patInfo.medicalTrackList.length - 1"
+                :class="[ns.e('divider_line')]"
+            />
+          </template>
+        </div>
       </div>
-
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
-import {patInfo, ns, handleQueryData, currentUid} from "@/views/view/patient360/src";
+import {
+  patInfo,
+  ns,
+  handleQueryData,
+  currentUid,
+  grouping,
+  medicalTrackComp,
+  medicalTrackGrouping
+} from "@/views/view/patient360/src";
 import {formatDateToStr, DATEFORMAT} from "@/utils/moment-utils";
+import {ElRadioGroup, ElRadioButton} from "element-plus";
 
 function formatDate(date) {
   return formatDateToStr(date ?? new Date(), DATEFORMAT.DATE)

+ 1 - 0
src/views/view/patient360/patient360.scss

@@ -20,6 +20,7 @@
       .cy-patient360__medicalTrackList {
         display: flex;
         align-items: center;
+        width: 100%;
 
         .cy-patient360__item {
           padding: 10px 16px;

+ 31 - 8
src/views/view/patient360/src/Patient360.vue

@@ -14,7 +14,7 @@
 import router from "@/router";
 import request from "@/utils/request-v2";
 import InfoView from "@/views/view/patient360/comp/InfoView.vue";
-import {patInfo, ns, outOrHosp, handleQueryData} from "@/views/view/patient360/src/index";
+import {patInfo, ns, outOrHosp, handleQueryData, medicalTrackGrouping} from "@/views/view/patient360/src/index";
 import '../patient360.scss'
 import ViewHospMain from "@/views/view/patient360/hospComp/ViewHospMain.vue";
 import ViewOutPatient from "@/views/view/patient360/out-patient-comp/ViewOutPatient.vue";
@@ -28,18 +28,41 @@ function getMedicalTrack(patientId: string, outOrHosp: 1 | 2) {
   })
 }
 
+function getMedicalTrackFunc(patNo: string, outOrHosp: 1 | 2) {
+  getMedicalTrack(patNo, outOrHosp).then(res => {
+    patInfo.value = res
+
+    patInfo.value.medicalTrackList.forEach((item) => {
+      if (item.outOrHosp === 1) {
+        medicalTrackGrouping.value.mz++
+      } else if (item.outOrHosp === 2) {
+        medicalTrackGrouping.value.zy++
+      }
+    })
+
+  }).catch(() => {
+    medicalTrackGrouping.value.mz = 0
+    medicalTrackGrouping.value.zy = 0
+    patInfo.value = {
+      inpatientNo: '',
+      mzNo: '',
+      name: '',
+      sex: '',
+      age: '',
+      sexName: '',
+      socialNo: '',
+      medicalTrackList: [],
+    }
+  })
+}
+
 onMounted(() => {
   if (router.currentRoute.value.query.inpatientNo) {
-    getMedicalTrack(router.currentRoute.value.query.inpatientNo as string, 2).then(res => {
-      patInfo.value = res
-    })
+    getMedicalTrackFunc(router.currentRoute.value.query.inpatientNo as string, 2)
   }
   if (router.currentRoute.value.query.outPatientNo) {
-    getMedicalTrack(router.currentRoute.value.query.outPatientNo as string, 1).then(res => {
-      patInfo.value = res
-    })
+    getMedicalTrackFunc(router.currentRoute.value.query.outPatientNo as string, 1)
   }
-
 })
 </script>
 

+ 17 - 0
src/views/view/patient360/src/index.ts

@@ -2,6 +2,7 @@ import {Ref, ref} from 'vue';
 import {useCyNamespace} from "@/utils/xiaochan-element-plus";
 import hosp from "./hosp";
 import {handleOutPatient} from "@/views/view/patient360/src/outPatient";
+import XEUtils from "xe-utils";
 
 export interface MedicalTrack {
     date: string;
@@ -45,6 +46,22 @@ export const patInfo: Ref<PatientInfo360> = ref({
     socialNo: '',
     medicalTrackList: [],
 })
+
+export const grouping = ref(0)
+export const medicalTrackGrouping = ref({
+    mz: 0,
+    zy: 0
+})
+
+export const medicalTrackComp = computed(() => {
+    return XEUtils.filter(patInfo.value.medicalTrackList, (item) => {
+        if (grouping.value === 0) {
+            return true;
+        }
+        return item.outOrHosp === grouping.value
+    })
+})
+
 export const ns = useCyNamespace('patient360')
 
 export const currentUid = ref<string>('')