Browse Source

为住院护士和住院医生的首页添加患者看板

lighter 3 years ago
parent
commit
cb313c7812

+ 9 - 0
src/api/dashboard/index.js

@@ -0,0 +1,9 @@
+import request from '../../utils/request'
+
+export function selectInpatientBriefs(deptCode) {
+  return request({
+    url: '/dashboard/selectInpatientBriefs',
+    method: 'get',
+    params: { deptCode },
+  })
+}

+ 63 - 29
src/components/dashboard/Inpatient.vue

@@ -1,41 +1,39 @@
 <template>
-  <div class="inpatient-wrapper">
-    <div class="top-line">
-      <div style="width: 40px">+81床</div>
-      <div style="width: 80px">
-        <img :src="maleIcon" class="sex-icon" style="margin-top: 0px" />
-        张大炮
+  <div class="inpatient-wrapper" :style="backgroundColor(brief.sickLevel)">
+    <el-tooltip :content="getSurgeryInfo(brief.surgery)" placement="top">
+      <div class="top-line">
+        <div style="width: 40px">{{ brief.bedNo }}床</div>
+        <div style="width: 80px">
+          <img :src="getGenderIcon(brief.gender)" class="sex-icon" style="margin-top: 0px" />
+          {{ brief.name }}
+        </div>
+        <div style="width: 40px">{{ brief.indays }}天</div>
       </div>
-      <div style="width: 40px">103天</div>
-    </div>
+    </el-tooltip>
     <div class="mid-line">
       <div>
         <div style="width: 60px">住院号:</div>
-        <div>0387232</div>
+        <div>{{ brief.patNo }}</div>
       </div>
       <div>
-        <div style="width: 60px">入院时间:</div>
-        <div>22-03-17 15:33</div>
+        <div style="width: 60px">出生日期:</div>
+        <div>{{ brief.birthDate }}</div>
       </div>
       <div>
-        <div style="width: 60px">管床医生:</div>
-        <div>周伟</div>
+        <div style="width: 60px">入院时间:</div>
+        <div>{{ brief.convertAdmissDate }}</div>
       </div>
       <div>
-        <div style="width: 60px">出生日期:</div>
-        <div>1987-11-09</div>
+        <div style="width: 60px">管床医生:</div>
+        <div>{{ brief.physician }}</div>
       </div>
       <div>
         <div style="width: 60px">医疗类别:</div>
-        <div>普通住院</div>
+        <div>{{ brief.medTypeName }}</div>
       </div>
       <div>
-        <div style="width: 60px">医疗费用:</div>
-        <div>¥15892.23</div>
-      </div>
-      <div>
-        <div style="width: 60px">报销金额:</div>
-        <div>¥8892.45</div>
+        <div style="width: 60px">护理级别:</div>
+        <div>{{ brief.nursingLevel }}</div>
       </div>
     </div>
   </div>
@@ -45,10 +43,42 @@
 import maleIcon from '@/assets/male-icon.png'
 import femaleIcon from '@/assets/female-icon.png'
 export default {
+  props: {
+    brief: {
+      type: Object,
+      required: true,
+    },
+  },
   setup() {
+    const getGenderIcon = (gender) => {
+      return gender === 1 ? maleIcon : femaleIcon
+    }
+    const getSurgeryInfo = (surgery) => {
+      return surgery ? '今日手术:' + surgery : '今日无手术'
+    }
+    const backgroundColor = (status) => {
+      switch (status) {
+        case 0:
+          return {
+            background: '#67C23A',
+            color: '#000000',
+          }
+        case 1:
+          return {
+            background: '#E6A23C',
+            color: '#FFFFFF',
+          }
+        case 2:
+          return {
+            background: '#F56C6C',
+            color: '#FFFFFF',
+          }
+      }
+    }
     return {
-      maleIcon,
-      femaleIcon,
+      getGenderIcon,
+      getSurgeryInfo,
+      backgroundColor,
     }
   },
 }
@@ -57,26 +87,30 @@ export default {
 <style lang="scss" scoped>
 .inpatient-wrapper {
   width: 160px;
-  height: 170px;
+  height: 152px;
   background: rgb(255, 207, 207);
-  margin: 8px 0 0 0;
+  margin: 12px 12px 0 0;
   border-radius: 4px;
   font-size: 12px !important;
-  font-weight: bold;
   .top-line {
+    border-top-left-radius: 4px;
+    border-top-right-radius: 4px;
     display: flex;
     height: 26px;
     line-height: 26px;
+    font-weight: bold;
     background: rgb(16, 102, 131);
     color: white;
+    &:hover {
+      cursor: default;
+    }
     > div {
       text-align: center;
     }
   }
   .mid-line {
     padding: 0 0 6px 4px;
-    color: black;
-    border-bottom: 1px solid white;
+    border-bottom: 1px solid rgb(255, 255, 255);
     > div {
       margin-top: 6px;
       display: flex;

+ 8 - 0
src/utils/permission.js

@@ -29,3 +29,11 @@ export function allWardsVisible() {
   }
   return false
 }
+
+export function isInpatientStaff() {
+  const roles = store.state.user.info.roles
+  if (roles) {
+    return roles.indexOf(3) > -1 || roles.indexOf(4) > -1
+  }
+  return false
+}

+ 13 - 3
src/views/dashboard/index.vue

@@ -20,9 +20,9 @@
               <MyClock :show-logo="false" size="small" />
             </div>
           </div>
-          <!-- <div style="display: flex; flex-wrap: wrap; height: 480px; overflow-y: auto">
-            <Inpatient />
-          </div> -->
+          <div style="display: flex; flex-wrap: wrap; height: 480px; overflow-y: auto">
+            <Inpatient v-for="(itm, index) in briefs" :key="index" :brief="itm" />
+          </div>
         </div>
         <!-- 右边部分 -->
         <div class="right-pane">
@@ -48,6 +48,8 @@ import { selectSystemMessages } from '../../api/messages/index'
 import { formatDate } from '../../utils/date'
 import { getUserInfo } from '@/api/settings/user-settings'
 import { genTextPortrait } from '@/utils/portrait'
+import { isInpatientStaff } from '@/utils/permission'
+import { selectInpatientBriefs } from '../../api/dashboard/index'
 import MyClock from '@/components/MyClock.vue'
 import Inpatient from '@/components/dashboard/Inpatient.vue'
 
@@ -100,15 +102,23 @@ export default {
       }, 500)
     })
 
+    const briefs = ref([])
+
     onMounted(() => {
       getUserInfo().then((res) => {
         userInfo.value = res
+        if (isInpatientStaff()) {
+          selectInpatientBriefs(res.deptCode).then((list) => {
+            briefs.value = list
+          })
+        }
       })
     })
 
     return {
       messages,
       userInfo,
+      briefs,
       errorHandler,
       fetchMoreMessages,
       makeTextPortrait,

+ 1 - 0
src/views/medical-insurance/inpatient/AdmRegistration.vue

@@ -518,6 +518,7 @@ export default {
       if (nullPatient()) {
         return
       }
+      submitPatientInfo()
       checkRegisterDate(patient.value.inpatientNo, patient.value.admissTimes).then(() => {
         selectAdmissApply(patient.value).then((res) => {
           if (null === res.status) {