Browse Source

完成查看全院查看电子病历

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
1af53bea90

+ 7 - 0
src/api/zhu-yuan-yi-sheng/emr-patient.js

@@ -102,3 +102,10 @@ export function getExtractDataElement(patNo, times) {
         params: {patNo, times}
     })
 }
+
+export function getEmrAllWardsApi() {
+    return request({
+        url: url + 'getAllWards',
+        method: 'get',
+    })
+}

+ 12 - 2
src/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-collapse class="collapse" v-model="collapse">
+  <el-collapse class="collapse" v-model="collapse" @change="collapseChange" accordion>
     <el-collapse-item title="患者信息" name="1">
       <div class="header" style="border: 0;color: #000000">
         <div class="box">
@@ -78,7 +78,6 @@
       </div>
     </el-collapse-item>
   </el-collapse>
-
 </template>
 
 <script setup name="HuanZheXinXi">
@@ -93,6 +92,8 @@ const props = defineProps({
   }
 })
 
+const emit = defineEmits(['isShow'])
+
 const collapse = ref("0")
 
 const queryPatientInfoClick = () => {
@@ -107,6 +108,15 @@ const companyFunc = (val, company) => {
   }
 }
 
+const collapseChange = async () => {
+  let height = collapse.value === '1' ? 100 : 22
+  emit('isShow', collapse.value === '1', height)
+}
+
+onMounted(() => {
+  collapseChange()
+})
+
 </script>
 
 <style lang="scss" scoped>

+ 121 - 0
src/components/zhu-yuan-yi-sheng/emr/EmrPatientList.vue

@@ -0,0 +1,121 @@
+<template>
+  <transition name="el-zoom-in-center">
+    <div class="drawer" ref="drawer" v-show="props.modelValue">
+      <div class="header">
+        <div>
+          <el-select-v2 v-model="currentWard" :options="allWards" @change="fetchOverviews"/>
+        </div>
+        <div @click="close" class="icon">
+          <el-icon>
+            <CloseBold/>
+          </el-icon>
+        </div>
+      </div>
+      <el-table :data="overviews"
+                :height="400"
+                highlight-current-row
+                @row-click="rowClick">
+        <el-table-column label="床" prop="bedNo" width="30"/>
+        <el-table-column label="姓名" width="70" prop="name">
+          <template #default="{row}">
+        <span>
+          {{ row.name }}
+        </span>
+            <span v-if="row.orderNoCount > 0" style="color: red">
+              {{ row.orderNoCount }}
+          </span>
+          </template>
+        </el-table-column>
+        <el-table-column label="住院号" prop="inpatientNo" width="65">
+          <template #default="{row}">
+            <div :style="{color: row.dismissOrder ===1 ? 'red' : '#19e63c'}">
+              {{ row.inpatientNo }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="性别" prop="sex" width="65">
+          <template #default="scope">
+            {{ cptSex(scope.row.sex) }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </transition>
+</template>
+
+<script setup name='EmrPatientList'>
+
+import {getOverView} from "@/api/inpatient/patient";
+import {ref} from "vue";
+import {getEmrAllWardsApi} from "@/api/zhu-yuan-yi-sheng/emr-patient";
+import {cptSex} from "@/utils/computed";
+
+const props = defineProps({
+  modelValue: {
+    type: Boolean
+  }
+})
+
+const emit = defineEmits(['rowClick', 'update:modelValue'])
+
+const allWards = ref([])
+const currentWard = ref()
+const overviews = ref([])
+
+const fetchOverviews = () => {
+  getOverView(currentWard.value).then((res) => {
+    overviews.value = res
+    console.log(res)
+  })
+}
+
+const rowClick = (val) => {
+  emit('rowClick', val)
+}
+
+const close = () => {
+  emit('update:modelValue', false)
+}
+
+const drawer = ref()
+onMounted(() => {
+  nextTick(() => {
+    const body = document.querySelector("body");
+    if (body.append) {
+      body.append(drawer.value);
+    } else {
+      body.appendChild(drawer.value);
+    }
+  })
+
+  getEmrAllWardsApi().then(res => {
+    allWards.value = res
+  })
+})
+
+</script>
+
+<style scoped lang="scss">
+.drawer {
+  width: 18vw;
+  height: 100vh;
+  border: 1px solid;
+  position: fixed;
+  top: 0;
+  background-color: white;
+  right: 0;
+}
+
+.header {
+  display: flex;
+  justify-content: space-between;
+
+  .icon {
+    cursor: pointer;
+    margin-right: 5px;
+    display: flex;
+    align-items: center;
+  }
+}
+
+</style>

+ 1 - 1
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/YzTable.vue

@@ -129,7 +129,7 @@ const header = [
     }
   },
   {
-    code: 'endTime', name: '结束时间', width: 90, func: (val) => {
+    code: 'endTime', name: '结束时间', width: 50, func: (val) => {
       return timeFomat(val.endTime)
     }
   },

+ 3 - 3
src/views/clinic/TransferInOfExpenses.vue

@@ -315,11 +315,11 @@ let mzSum = computed(() => {
 })
 //住院收费项目 金额总和
 let zySum = computed(() => {
-  let he = 0
+  let sum = 0
   zyXinXiList.value.forEach((item) => {
-    he += item.unitPrice * item.chargeQuantity
+    sum += item.unitPrice * item.chargeQuantity
   })
-  return he.toFixed(2)
+  return sum.toFixed(2)
 })
 
 const huanZheFeiYongDrawer = ref(false)

+ 1 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/EmrMain.vue

@@ -31,9 +31,7 @@
                  :inactive-value="1"/>
 
     </el-header>
-
     <el-container>
-
       <el-aside style="background-color: white">
         <emr-sidebar @nodeClick="nodeClick" ref="emrSidebarRef"
                      :max-height="maxHeight"
@@ -503,7 +501,7 @@ const courseSegmentLocking = () => {
         courseTitles.push({
           code: '查房时间',
           name: values['查房标题']?.value,
-          value: values['查房时间'].value,
+          value: values['查房时间']?.value,
           emrDocumentId: documentId,
           emrCategoryCode: categoryCode,
           jump: true

+ 47 - 16
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/Home.vue

@@ -1,19 +1,23 @@
 <template>
-  住院号:
-  <el-input v-model="query.patNo" @keydown.enter="getMaxTimes" style="width: 120px"/>
-  次数 ({{ query.maxTimes }}) :
-  <el-input-number v-model="query.times" @keydown.enter="disPatients"/>
-  <el-button @click="disPatients">出院患者</el-button>
-  <el-button @click="allPatientsInTheHospital">全院患者</el-button>
-  出院天数:{{ dischargeDays }}
-  <span style="color: red">出院七天后就无法编辑患者病历</span>
+  <div ref="headerRef">
+    住院号:
+    <el-input v-model="query.patNo" @keydown.enter="getMaxTimes" style="width: 120px"/>
+    次数 ({{ query.maxTimes }}) :
+    <el-input-number v-model="query.times" @keydown.enter="disPatients"/>
+    <el-button @click="disPatients">出院患者</el-button>
+    <el-button @click="allPatientsInTheHospital">全院患者</el-button>
+    <el-button @click="patientListDrawer = !patientListDrawer">患者列表</el-button>
+    出院天数:{{ dischargeDays }}
+    <span style="color: red">出院七天后就无法编辑患者病历</span>
+  </div>
   <div v-if="show">
     <div ref="divRef">
-      <huan-zhe-xin-xi :huan-zhe-xin-xi="patientInfo"/>
+      <huan-zhe-xin-xi :huan-zhe-xin-xi="patientInfo" @isShow="patientInfoIsShow"/>
     </div>
     <emr-main :huan-zhe-xin-xi="patientInfo"
               :max-height="maxHeight"/>
   </div>
+  <emr-patient-list @rowClick="listRowClick" v-model="patientListDrawer"/>
 </template>
 
 <script setup name='Home'>
@@ -30,17 +34,20 @@ import {
   query,
   resolveRoute
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
+import EmrPatientList from "@/components/zhu-yuan-yi-sheng/emr/EmrPatientList.vue";
 
 const divRef = ref(null)
+const headerRef = ref(null)
 // 最大高度
 let maxHeight = $ref()
 // 是否显示页面
 let show = $ref(false)
 // 获取患者信息
 let patientInfo = $ref()
-
 // 距离今天的出院天数
 let dischargeDays = $ref(0)
+//
+let patientListDrawer = $ref(false)
 
 // 获取最大住院次数
 const getMaxTimes = () => {
@@ -63,11 +70,12 @@ const disPatients = async () => {
       pat: window.btoa(te)
     }
   })
-  location.reload()
+  await routerFunc()
 }
 
 // 解析路由数据
 const routerFunc = async () => {
+  show = false
   if (router.currentRoute.value.query.pat) {
     resolveRoute(router.currentRoute.value.query.pat)
     if (query.value.state === 1) {
@@ -75,10 +83,12 @@ const routerFunc = async () => {
     } else if (query.value.state === 2) {
       await queryDisPatient()
     } else if (query.value.state === 3) {
-      await queryAllPatients()
+      await queryAllPatients(true)
+    } else if (query.value.state === 4) {
+      await queryAllPatients(false)
     }
     await nextTick()
-    maxHeight = window.innerHeight - divRef.value?.clientHeight
+
   } else {
     show = false
   }
@@ -96,7 +106,6 @@ const queryDisPatient = async () => {
   dischargeDays = subtractTime(await getServerDateApi(), patientInfo.disDate)
   // 如果患者的出院时间大于 7 天就只能看病历和打印病历了
   emrConfig.value.editor = dischargeDays < 7;
-  // emrConfig.value.editor = false;
   show = true
 }
 
@@ -113,15 +122,37 @@ const allPatientsInTheHospital = async () => {
       pat: window.btoa(te)
     }
   })
-  location.reload()
+  await routerFunc()
 }
 
 
-const queryAllPatients = async () => {
+const queryAllPatients = async (flag) => {
   patientInfo = await getPatientInfo(query.value.patNo)
   query.value.times = patientInfo.admissTimes
   query.value.maxTimes = patientInfo.admissTimes
   show = true
+  emrConfig.value.editor = flag
+}
+
+const listRowClick = async (val) => {
+  let temp = {
+    patNo: val.inpatientNo,
+    times: val.admissTimes,
+    maxTimes: val.admissTimes,
+    state: 4
+  }
+  let te = JSON.stringify(temp)
+  await router.push({
+    name: 'emrEditor',
+    query: {
+      pat: window.btoa(te)
+    }
+  })
+  await routerFunc()
+}
+
+const patientInfoIsShow = (flag, height) => {
+  maxHeight = window.innerHeight - height - 24
 }
 
 onMounted(async () => {