Browse Source

添加夜间门诊模块

lighter 2 years ago
parent
commit
6a676cc0b1

+ 7 - 0
src/api/appointment.js

@@ -7,6 +7,13 @@ export function getAllDepartments() {
   })
 }
 
+export function getAllNightDepartments() {
+  return request({
+    url: '/appointment/getAllNightDepartments',
+    method: 'get',
+  })
+}
+
 export function getSourcesByDate(data) {
   return request({
     url: '/appointment/getSourcesByDate',

BIN
src/assets/hospital-service/night-clinic.png


+ 6 - 1
src/router/index.js

@@ -56,7 +56,12 @@ export const constantRoutes = [
     meta: { title: '预约挂号' },
   },
   {
-    path: '/selectDoctorAndDate/:deptCode/:deptName',
+    path: '/nightClinic',
+    component: () => import('../views/hospital-service/appointment/night-clinic/ChooseDepartment.vue'),
+    meta: { title: '夜间门诊' },
+  },
+  {
+    path: '/selectDoctorAndDate/:deptCode/:deptName/:nightClinic',
     component: () => import('../views/hospital-service/appointment/SelectDoctorAndDate.vue'),
     meta: { title: '' },
   },

+ 10 - 7
src/views/hospital-service/HospitalServiceHome.vue

@@ -51,6 +51,10 @@
                     <img src="../../assets/hospital-service/yuyueguahao.png"/>
                     <div class="icon-label">预约挂号</div>
                 </van-col>
+                <van-col span="6" @click="routeTo('/nightClinic')">
+                    <img src="../../assets/hospital-service/night-clinic.png"/>
+                    <div class="icon-label">夜间门诊</div>
+                </van-col>
                 <van-col span="6" @click="routeTo(filterPath('/unPaidList/', '/selectPayPatient'))">
                     <img src="../../assets/hospital-service/menzhenjiaofei.png"/>
                     <div class="icon-label">门诊缴费</div>
@@ -59,13 +63,13 @@
                     <img src="../../assets/hospital-service/baogaochaxun.png"/>
                     <div class="icon-label">报告查询</div>
                 </van-col>
+            </van-row>
+            <div style="height: 10px"></div>
+            <van-row gutter="5">
                 <van-col span="6" @click="routeTo(filterPath('/inPatientService/', '/selectInpatientCard'))">
                     <img src="../../assets/hospital-service/zhuyuanfuwu.png"/>
                     <div class="icon-label">住院服务</div>
                 </van-col>
-            </van-row>
-            <div style="height: 10px"></div>
-            <van-row gutter="5">
                 <van-col span="6" @click="routeTo(filterPath('/assessments/', '/selectAssessmentPatient'))">
                     <img src="../../assets/hospital-service/wenjuandiaocha.png"/>
                     <div class="icon-label">问卷调查</div>
@@ -78,14 +82,13 @@
                     <img src="../../assets/hospital-service/gouwuche.png"/>
                     <div class="icon-label">自助预约</div>
                 </van-col>
-
+            </van-row>
+            <div style="height: 10px"></div>
+            <van-row gutter="5">
                 <van-col span="6" @click="routeTo('/onlineConsult')">
                     <img src="../../assets/hospital-service/online-consult.png"/>
                     <div class="icon-label">在线咨询</div>
                 </van-col>
-            </van-row>
-            <div style="height: 10px"></div>
-            <van-row gutter="5">
                 <van-col span="6" @click="routeTo('/selectTargetPatient')">
                     <img src="../../assets/hospital-service/appointmentmanagement.png"/>
                     <div class="icon-label">挂号管理</div>

+ 2 - 2
src/views/hospital-service/appointment/Appointment.vue

@@ -46,7 +46,7 @@ export default {
       }
       Cookies.set('appointmentDeptCode', id)
       Cookies.set('appointmentDeptName', text)
-      router.push('/selectDoctorAndDate/' + id + '/' + text)
+      router.push('/selectDoctorAndDate/' + id + '/' + text + '/no')
     }
     const onCancel = () => {
       data.showPopup = false
@@ -62,7 +62,7 @@ export default {
       } else {
         Cookies.set('appointmentDeptCode', val.id)
         Cookies.set('appointmentDeptName', val.text)
-        router.push('/selectDoctorAndDate/' + val.id + '/' + val.text)
+        router.push('/selectDoctorAndDate/' + val.id + '/' + val.text + '/no')
       }
     }
     onMounted(() => {

+ 3 - 0
src/views/hospital-service/appointment/SelectDoctorAndDate.vue

@@ -71,6 +71,7 @@ export default {
     }
     const router = useRouter()
     const deptCode = router.currentRoute.value.params.deptCode
+    const nightClinic = router.currentRoute.value.params.nightClinic
     const data = reactive({
       currentIndex: 0,
       oneWeekText: getOneWeekText(),
@@ -102,6 +103,7 @@ export default {
       const param = {
         date: data.dateSelected,
         deptCode: deptCode,
+        nightClinic: nightClinic === 'yes'
       }
       getDoctorSources(param).then((res) => {
           data.doctorSources = res
@@ -125,6 +127,7 @@ export default {
         start: data.nextSevenDate[0].fullDate,
         end: data.nextSevenDate[6].fullDate,
         dept: deptCode,
+        nightClinic: nightClinic === 'yes'
       }
       getSourcesByDate(param).then((res) => {
         data.nextSevenDaySources = res

+ 84 - 0
src/views/hospital-service/appointment/night-clinic/ChooseDepartment.vue

@@ -0,0 +1,84 @@
+<template>
+    <window-size>
+        <van-tree-select
+                v-model:active-id="data.activeCode"
+                v-model:main-active-index="data.activeIndex"
+                :height="treeHeight"
+                :items="data.depts"
+                @click-nav="handleSelectNav"
+                @click-item="handleSelectDept"
+        />
+        <van-popup v-model:show="data.showPopup" position="bottom" :style="{ height: '50%' }">
+            <van-picker title="选择子科室" :columns="data.children" @confirm="onConfirm" @cancel="onCancel" />
+        </van-popup>
+    </window-size>
+</template>
+
+<script>
+import store from '../../../../store'
+import { onMounted, reactive } from 'vue'
+import { getAllNightDepartments } from '../../../../api/appointment.js'
+import router from '../../../../router'
+import Cookies from 'js-cookie'
+export default {
+    name: 'ChooseDepartment',
+    setup() {
+        const treeHeight = store.state.windowSize.h - 45 + 'px'
+        const data = reactive({
+            activeIndex: '',
+            activeCode: '',
+            depts: [],
+            children: [],
+            showPopup: false,
+        })
+        if (Cookies.get('activeNightIndex')) {
+            data.activeIndex = Cookies.get('activeNightIndex')
+        }
+        const onConfirm = (val) => {
+            let id = ''
+            let text = ''
+            if (val instanceof Array) {
+                id = val[0].id
+                text = val[0].text
+            } else {
+                id = val.id
+                text = val.text
+            }
+            Cookies.set('appointmentDeptCode', id)
+            Cookies.set('appointmentDeptName', text)
+            router.push('/selectDoctorAndDate/' + id + '/' + text + '/yes')
+        }
+        const onCancel = () => {
+            data.showPopup = false
+            data.activeCode = ''
+        }
+        const handleSelectNav = (val) => {
+            Cookies.set('activeNightIndex', val)
+        }
+        const handleSelectDept = (val) => {
+            if (val.children) {
+                data.children = val.children
+                data.showPopup = true
+            } else {
+                Cookies.set('appointmentDeptCode', val.id)
+                Cookies.set('appointmentDeptName', val.text)
+                router.push('/selectDoctorAndDate/' + val.id + '/' + val.text + '/yes')
+            }
+        }
+        onMounted(() => {
+            getAllNightDepartments().then((res) => {
+                data.depts = res
+            })
+        })
+
+        return {
+            treeHeight,
+            handleSelectNav,
+            handleSelectDept,
+            data,
+            onConfirm,
+            onCancel,
+        }
+    },
+}
+</script>