Browse Source

优化代码;挂号页面添加科室简介;门诊满意度调查需要选择不满意的原因。

lighter 2 years ago
parent
commit
fbbeee93a2

+ 2 - 2
src/App.vue

@@ -16,7 +16,7 @@ import { checkPatientId } from './utils/check-patient-id'
 export default {
   name: 'App',
   setup() {
-    store.commit('SET_WINDOWSIZE', getWindowSize())
+    store.commit('SET_SCREENSIZE', getScreenSize())
     const loading = computed(() => {
       return store.state.loading
     })
@@ -27,7 +27,7 @@ export default {
   },
 }
 
-function getWindowSize() {
+function getScreenSize() {
   const w = window.innerWidth
   const h = window.innerHeight
   const width = w + 'px'

+ 2 - 2
src/components/appointment-management-branch/index.vue

@@ -35,9 +35,9 @@ export default {
   setup(props) {
     const showEmpty = ref(true)
     const store = useStore()
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const boxWrapper = {
-      height: windowSize.h - 100 + 'px',
+      height: screenSize.h - 100 + 'px',
       marginTop: '3px',
       overflowY: 'auto'
     }

+ 1 - 1
src/components/window-size/index.js

@@ -1,7 +1,7 @@
 import WindowSize from './index.vue'
 
 WindowSize.install = (app) => {
-  app.component(WindowSize.name, WindowSize)
+  app.component('WindowSize', WindowSize)
 }
 
 export default WindowSize

+ 18 - 24
src/components/window-size/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :style="windowSize">
+  <div :style="screenSize">
     <back-nav v-show="showBackNav"></back-nav>
     <div :style="bodyStyle">
       <slot></slot>
@@ -7,31 +7,25 @@
   </div>
 </template>
 
-<script>
+<script setup>
 import store from '../../store'
-export default {
-  name: 'WindowSize',
-  props: {
-    showBackNav: {
-      type: Boolean,
-      default: true,
-    },
-    offset: {
-      type: Number,
-      default: 0,
-    },
+import BackNav from "../back-nav/index.vue";
+
+const props = defineProps({
+  showBackNav: {
+    type: Boolean,
+    default: true,
   },
-  setup(props) {
-    const windowSize = store.state.windowSize
-    windowSize.height = windowSize.h - props.offset + 'px'
-    const bodyStyle = {
-      height: windowSize.h - props.offset - 45 + 'px',
-      overflowY: 'auto',
-    }
-    return {
-      windowSize,
-      bodyStyle,
-    }
+  offset: {
+    type: Number,
+    default: 0,
   },
+})
+
+const screenSize = store.state.screenSize
+screenSize.height = screenSize.h - props.offset + 'px'
+const bodyStyle = {
+  height: screenSize.h - props.offset - 45 + 'px',
+  overflowY: 'auto',
 }
 </script>

+ 4 - 4
src/store/index.js

@@ -3,7 +3,7 @@ import { createStore } from 'vuex'
 export default createStore({
   state: {
     loading: false,
-    windowSize: {
+    screenSize: {
       width: 0,
       height: 0,
     },
@@ -25,7 +25,7 @@ export default createStore({
   },
   mutations: {
     SET_LOADING: (state, payload) => (state.loading = payload),
-    SET_WINDOWSIZE: (state, payload) => (state.windowSize = payload),
+    SET_SCREENSIZE: (state, payload) => (state.screenSize = payload),
     SET_PATIENTCARDS: (state, payload) => (state.patientCards = payload),
     SET_HOMEPAGEDOCTORS: (state, payload) => (state.homePageDoctors = payload),
     SET_APPOINTMENTINFO: (state, payload) => (state.appointmentInfo = payload),
@@ -46,8 +46,8 @@ export default createStore({
     SET_LOADING({ commit }, payload) {
       commit('SET_LOADING', payload)
     },
-    SET_WINDOWSIZE({ commit }, payload) {
-      commit('SET_WINDOWSIZE', payload)
+    SET_SCREENSIZE({ commit }, payload) {
+      commit('SET_SCREENSIZE', payload)
     },
     SET_PATIENTCARDS({ commit }, payload) {
       commit('SET_PATIENTCARDS', payload)

+ 1 - 1
src/views/hospital-info/HospitalIntroduction.vue

@@ -78,6 +78,6 @@ const showRoute = () => {
 }
 
 onMounted(() => {
-  mScroll.height = store.state.windowSize.h - 250 - headDiv.value.offsetHeight + 'px'
+  mScroll.height = store.state.screenSize.h - 250 - headDiv.value.offsetHeight + 'px'
 })
 </script>

+ 4 - 4
src/views/hospital-service/HospitalServiceHome.vue

@@ -168,14 +168,14 @@ import {showDialog} from "vant";
 
 export default {
   setup() {
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const swipeStyle = {
       width: '90%',
       marginLeft: '5%',
       marginTop: '5px',
-      height: windowSize.h - 460 + 'px',
-      h: windowSize.h - 460,
-      w: windowSize.w * 0.9,
+      height: screenSize.h - 460 + 'px',
+      h: screenSize.h - 460,
+      w: screenSize.w * 0.9,
     }
 
     const swipeRowStyle = {

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

@@ -21,7 +21,7 @@ import { getAllDepartments } from '../../../api/appointment'
 import router from '../../../router'
 import Cookies from 'js-cookie'
 
-const treeHeight = store.state.windowSize.h - 45 + 'px'
+const treeHeight = store.state.screenSize.h - 45 + 'px'
 const data = reactive({
   activeIndex: '',
   activeCode: '',

+ 99 - 98
src/views/hospital-service/appointment/SelectDoctorAndDate.vue

@@ -22,117 +22,118 @@
         </van-badge>
       </van-grid-item>
     </van-grid>
-    <div style="height: 5px"></div>
-    <van-tag type="primary" plain style="margin-left: 5px">{{ data.dateSelected }}</van-tag>
-    <div style="height: 5px"></div>
-    <div v-for="(item, index) in data.doctorSources" :key="index">
-      <van-cell center is-link @click="toDoctorArangement(item)">
-        <template #icon>
-          <van-image
-            style="width: 44.11px; height: 60.36px"
-            round
-            fit="cover"
-            :src="'data:image/png;base64,' + item.portrait"
-          />&nbsp;
-        </template>
-        <template #title>
+    <div v-if="data.deptDescription">
+      <p style="padding: 8px 12px 2px 12px; font-size: 14px; background: white">
+        科室简介
+        <div style="margin-top:6px;border-bottom: 1px solid lightgray"></div>
+      </p>
+      <p style="padding: 4px 12px; font-size: 13px;">
+        <span v-html="data.deptDescription"></span>
+      </p>
+    </div>
+    <div style=" background: white; margin-top: 12px">
+      <p style="padding: 8px 12px 2px 12px; font-size: 14px;">
+        当班医生<van-tag type="primary" plain style="margin-left: 5px">{{ data.dateSelected }}</van-tag>
+        <div style="margin-top:6px;border-bottom: 1px solid lightgray"></div>
+      </p>
+      <div v-for="(item, index) in data.doctorSources" :key="index">
+        <van-cell center is-link @click="toDoctorArangement(item)">
+          <template #icon>
+            <van-image
+                style="width: 44.11px; height: 60.36px"
+                round
+                fit="cover"
+                :src="'data:image/png;base64,' + item.portrait"
+            />&nbsp;
+          </template>
+          <template #title>
             <span>{{item.doctorName}} | {{item.chargeType}}</span>
             <span v-if="item.isP4Request" style="color: red">(夜间)</span>
-        </template>
-        <template #label>
-          <div :style="labelStyle" v-show="item.introduction">{{ item.introduction }}</div>
-        </template>
-      </van-cell>
+          </template>
+          <template #label>
+            <div :style="labelStyle" v-show="item.introduction">{{ item.introduction }}</div>
+          </template>
+        </van-cell>
+      </div>
     </div>
     <van-empty :image="empty" description="暂未获取到医生数据" v-show="data.doctorSources.length === 0" />
   </window-size>
 </template>
 
-<script>
+<script setup>
 import empty from '../../../assets/empty.png'
 import { useRouter } from 'vue-router'
 import { getOneWeekText, getNextSevenDate } from '../../../utils/date'
 import { onMounted, reactive } from 'vue'
 import { getSourcesByDate, getDoctorSources } from '../../../api/appointment'
 import store from '../../../store'
-export default {
-  name: 'SelectDoctorAndDate',
-  setup() {
-    const windowSize = store.state.windowSize
-    const labelStyle = {
-      width: windowSize.w - 100 + 'px',
-      overflow: 'hidden',
-      textOverflow: 'ellipsis',
-      whiteSpace: 'nowrap',
-    }
-    const router = useRouter()
-    const deptCode = router.currentRoute.value.params.deptCode
-    const nightClinic = router.currentRoute.value.params.nightClinic
-    const data = reactive({
-      currentIndex: 0,
-      oneWeekText: getOneWeekText(),
-      nextSevenDate: getNextSevenDate(),
-      nextSevenDaySources: new Array(7).fill({}),
-      doctorSources: [],
-      dateSelected: '',
-    })
-    const getType = (index) => {
-      return index === data.currentIndex ? 'primary' : 'default'
-    }
-    const hasSource = (index) => {
-      return data.nextSevenDaySources[index] === 1 ? '有' : '无'
-    }
-    const badgeColor = (index) => {
-      return data.nextSevenDaySources[index] === 1 ? 'green' : 'red'
-    }
-    const disabledBtn = (index) => {
-      return data.nextSevenDaySources[index] === 0
-    }
-    const handleClickDate = (index, isFromMounted) => {
-      data.currentIndex = index
-      data.dateSelected = data.nextSevenDate[index].fullDate
-      const param = {
-        date: data.dateSelected,
-        deptCode: deptCode,
-        nightClinic: nightClinic === 'yes'
-      }
-      getDoctorSources(param).then((res) => {
-          data.doctorSources = res
-        }).catch(() => {
-          data.doctorSources = []
-          if (isFromMounted && index < 6) {
-            handleClickDate(++index, isFromMounted)
-          }
-        })
-    }
-    const toDoctorArangement = (val) => {
-      const to = '/doctorArrangement/' + data.dateSelected + '/' + deptCode + '/' + val.doctorCode
-      router.push(to)
-    }
-    onMounted(() => {
-      const param = {
-        start: data.nextSevenDate[0].fullDate,
-        end: data.nextSevenDate[6].fullDate,
-        dept: deptCode,
-        nightClinic: nightClinic === 'yes'
-      }
-      getSourcesByDate(param).then((res) => {
-        data.nextSevenDaySources = res
-        handleClickDate(0, true)
-      })
-    })
-    return {
-      empty,
-      deptCode,
-      handleClickDate,
-      getType,
-      data,
-      hasSource,
-      disabledBtn,
-      badgeColor,
-      labelStyle,
-      toDoctorArangement,
+
+const screenSize = store.state.screenSize
+const labelStyle = {
+  width: screenSize.w - 100 + 'px',
+  overflow: 'hidden',
+  textOverflow: 'ellipsis',
+  whiteSpace: 'nowrap',
+}
+const router = useRouter()
+const deptCode = router.currentRoute.value.params.deptCode
+const nightClinic = router.currentRoute.value.params.nightClinic
+const data = reactive({
+  currentIndex: 0,
+  oneWeekText: getOneWeekText(),
+  nextSevenDate: getNextSevenDate(),
+  nextSevenDaySources: new Array(7).fill({}),
+  doctorSources: [],
+  dateSelected: '',
+  deptDescription: null,
+  activeCollapse: ['1']
+})
+const getType = (index) => {
+  return index === data.currentIndex ? 'primary' : 'default'
+}
+const hasSource = (index) => {
+  return data.nextSevenDaySources[index] === 1 ? '有' : '无'
+}
+const badgeColor = (index) => {
+  return data.nextSevenDaySources[index] === 1 ? 'green' : 'red'
+}
+const disabledBtn = (index) => {
+  return data.nextSevenDaySources[index] === 0
+}
+const handleClickDate = (index, isFromMounted) => {
+  data.currentIndex = index
+  data.dateSelected = data.nextSevenDate[index].fullDate
+  const param = {
+    date: data.dateSelected,
+    deptCode: deptCode,
+    nightClinic: nightClinic === 'yes'
+  }
+  getDoctorSources(param).then((res) => {
+    data.doctorSources = res
+  }).catch(() => {
+    data.doctorSources = []
+    if (isFromMounted && index < 6) {
+      handleClickDate(++index, isFromMounted)
     }
-  },
+  })
 }
+const toDoctorArangement = (val) => {
+  const to = '/doctorArrangement/' + data.dateSelected + '/' + deptCode + '/' + val.doctorCode
+  router.push(to)
+}
+onMounted(() => {
+  const param = {
+    start: data.nextSevenDate[0].fullDate,
+    end: data.nextSevenDate[6].fullDate,
+    dept: deptCode,
+    nightClinic: nightClinic === 'yes'
+  }
+  getSourcesByDate(param).then((res) => {
+    data.nextSevenDaySources = res.sources
+    if (res.description) {
+      data.deptDescription = res.description.replaceAll('\r\n', '<br/>')
+    }
+    handleClickDate(0, true)
+  })
+})
 </script>

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

@@ -23,7 +23,7 @@ import Cookies from 'js-cookie'
 export default {
     name: 'ChooseDepartment',
     setup() {
-        const treeHeight = store.state.windowSize.h - 45 + 'px'
+        const treeHeight = store.state.screenSize.h - 45 + 'px'
         const data = reactive({
             activeIndex: '',
             activeCode: '',

+ 29 - 1
src/views/hospital-service/assessments/ClinicSatisfiedAssessment.vue

@@ -35,7 +35,7 @@
 <script setup>
 import {reactive, ref} from "vue";
 import {submitClinicSatisfiedAssessment} from '../../../api/assessments'
-import {showDialog} from "vant";
+import {showDialog, showToast} from "vant";
 import {useRouter} from "vue-router";
 
 const router = useRouter()
@@ -83,6 +83,11 @@ const checkboxOptions2 = [
 ]
 
 const submitAnswer = () => {
+  for (let i = 0; i < keyList.length; i++) {
+    if (!validAnswer(i)) {
+      return
+    }
+  }
   submitClinicSatisfiedAssessment(answer).then(res => {
     disableSubmitButton.value = true
     showDialog({
@@ -91,12 +96,35 @@ const submitAnswer = () => {
     })
   })
 }
+
+const keyList = [
+  {key1: 'item1', key2: 'item2Arr', key3: 'item2Input'},
+  {key1: 'item3', key2: 'item4Arr', key3: 'item4Input'},
+  {key1: 'item5', key2: 'item6Arr', key3: 'item6Input'},
+  {key1: 'item7', key2: 'item8Arr', key3: 'item8Input'},
+  {key1: 'item9', key2: 'item10Arr', key3: 'item10Input'},
+  {key1: 'item11', key2: 'item12Arr', key3: 'item12Input'},
+  {key1: 'item13', key2: 'item14Arr', key3: 'item14Input'}
+]
+const validAnswer = (index) => {
+  let keyObj = keyList[index]
+  if (answer[keyObj.key1] === 'B' && !answer[keyObj.key2] && !answer[keyObj.key3]) {
+    showToast({
+      message: `请补充或者勾选【${index + 1}-2】中您不满意的原因。`,
+      position: 'top',
+      duration: 3000,
+    })
+    return false
+  }
+  return true
+}
 </script>
 
 <style scoped>
 .m-input {
   margin-top: 6px;
 }
+
 .m-input > input {
   border: none;
   width: 80%;

+ 1 - 1
src/views/hospital-service/assessments/DepressionAssessment.vue

@@ -74,7 +74,7 @@ export default {
       padding: '0 15px',
     })
     onMounted(() => {
-      radioStyle.height = store.state.windowSize.h - 107 - explain.value.offsetHeight + 'px'
+      radioStyle.height = store.state.screenSize.h - 107 - explain.value.offsetHeight + 'px'
       const patientId = router.currentRoute.value.params.patientId
       if (patientId !== ':patientId') {
         answer.patientId = patientId

+ 1 - 1
src/views/hospital-service/check-exam/CheckExamIndex.vue

@@ -37,7 +37,7 @@ export default {
     const router = useRouter()
     const patientId = router.currentRoute.value.params.patientId
     const scrollStyle = {
-      height: store.state.windowSize.h - 125 + 'px',
+      height: store.state.screenSize.h - 125 + 'px',
       overflowY: 'auto',
     }
     const date = ref('')

+ 2 - 2
src/views/hospital-service/health-cart/BookableExaminations.vue

@@ -26,10 +26,10 @@ import { getPatientNameByPatientId } from '../../../utils/check-patient-id'
 import store from '../../../store'
 export default {
   setup() {
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const scrollStyle = {
       marginTop: '4px',
-      height: windowSize.h - 140 + 'px',
+      height: screenSize.h - 140 + 'px',
       overflowY: 'auto',
     }
     const currentPage = ref(1)

+ 2 - 2
src/views/hospital-service/health-cart/SelectBookDate.vue

@@ -45,9 +45,9 @@ import store from '../../../store'
 
 export default {
   setup() {
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const scrollStyle = {
-      height: windowSize.h - 190 + 'px',
+      height: screenSize.h - 190 + 'px',
       overflowY: 'auto',
     }
     const bookItem = store.state.currentBook

+ 1 - 1
src/views/hospital-service/inpatient-service/ZyFeeDetail.vue

@@ -58,7 +58,7 @@ export default {
   name: 'ZyFeeDetail',
   setup() {
     const scrollStyle = {
-      height: store.state.windowSize.h - 208 + 'px',
+      height: store.state.screenSize.h - 208 + 'px',
       overflowY: 'scroll',
     }
     const router = useRouter()

+ 1 - 1
src/views/hospital-service/physical-exam/PhysicalExamIndex.vue

@@ -32,7 +32,7 @@ const router: object = useRouter();
 const patientId: string | RouteParamValue[] = router.currentRoute.value.params.patientId;
 
 const listBoxStyle: object = {
-  height: store.state.windowSize.h - 100 + 'px',
+  height: store.state.screenSize.h - 100 + 'px',
   overflowY: 'scroll'
 }
 

+ 1 - 1
src/views/hospital-service/query-price/QueryItemPrice.vue

@@ -39,7 +39,7 @@ export default {
   setup() {
 
     const scrollStyle = {
-      height: store.state.windowSize.h - 170 + 'px',
+      height: store.state.screenSize.h - 170 + 'px',
       overflowY: 'scroll',
     }
 

+ 1 - 1
src/views/hospital-service/query-price/QueryMedicinePrice.vue

@@ -39,7 +39,7 @@ export default {
   setup() {
 
     const scrollStyle = {
-      height: store.state.windowSize.h - 170 + 'px',
+      height: store.state.screenSize.h - 170 + 'px',
       overflowY: 'scroll',
     }
 

+ 3 - 3
src/views/mine/patient-id-cards/CreatePatientCard.vue

@@ -83,13 +83,13 @@ import { resize } from '../../../utils/image'
 import {setStoreCards} from "../../../utils/pat-card";
 export default {
   setup() {
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const uploadWidth = {
       margin: '10px 60px',
-      width: windowSize.w - 120 + 'px',
+      width: screenSize.w - 120 + 'px',
     }
     const uploadHeight = {
-      height: ((windowSize.w - 120) / 3) * 2 + 'px',
+      height: ((screenSize.w - 120) / 3) * 2 + 'px',
     }
     const fileList = ref([])
     const disableUpload = computed(() => {

+ 2 - 2
src/views/mine/patient-id-cards/PatientCardInfo.vue

@@ -48,9 +48,9 @@ import {setStoreCards} from "../../../utils/pat-card";
 export default {
   name: 'PatientCardInfo',
   setup() {
-    const windowSize = store.state.windowSize
+    const screenSize = store.state.screenSize
     const qrMargin = {
-      marginLeft: (windowSize.w - 164) / 2 + 'px',
+      marginLeft: (screenSize.w - 164) / 2 + 'px',
     }
 
     const router = useRouter()