lighter 2 лет назад
Родитель
Сommit
865400eadf

+ 41 - 55
src/views/hospital-service/appointment/Appointment.vue

@@ -14,67 +14,53 @@
   </window-size>
 </template>
 
-<script>
+<script setup>
 import store from '../../../store'
 import { onMounted, reactive } from 'vue'
 import { getAllDepartments } from '../../../api/appointment'
 import router from '../../../router'
 import Cookies from 'js-cookie'
-import {showToast} from "vant";
-export default {
-  name: 'Appointment',
-  setup() {
-    const treeHeight = store.state.windowSize.h - 45 + 'px'
-    const data = reactive({
-      activeIndex: '',
-      activeCode: '',
-      depts: [],
-      children: [],
-      showPopup: false,
-    })
-    if (Cookies.get('activeIndex')) {
-      data.activeIndex = Cookies.get('activeIndex')
-    }
-    const onConfirm = (val) => {
-      let id = val.selectedOptions[0].id
-      let text = val.selectedOptions[0].text
-      Cookies.set('appointmentDeptCode', id)
-      Cookies.set('appointmentDeptName', text)
-      router.push('/selectDoctorAndDate/' + id + '/' + text + '/no')
-    }
 
-    const onCancel = () => {
-      data.showPopup = false
-      data.activeCode = ''
-    }
-    const handleSelectNav = (val) => {
-      Cookies.set('activeIndex', val)
-    }
-    const handleSelectDept = (val) => {
-      if (val.children) {
-        data.children = val.children
-        data.children.forEach(item => item.value = item.id)
-        data.showPopup = true
-      } else {
-        Cookies.set('appointmentDeptCode', val.id)
-        Cookies.set('appointmentDeptName', val.text)
-        router.push('/selectDoctorAndDate/' + val.id + '/' + val.text + '/no')
-      }
-    }
-    onMounted(() => {
-      getAllDepartments().then((res) => {
-        data.depts = res
-      })
-    })
+const treeHeight = store.state.windowSize.h - 45 + 'px'
+const data = reactive({
+  activeIndex: '',
+  activeCode: '',
+  depts: [],
+  children: [],
+  showPopup: false,
+})
+if (Cookies.get('activeIndex')) {
+  data.activeIndex = Cookies.get('activeIndex')
+}
+const onConfirm = (val) => {
+  let id = val.selectedOptions[0].id
+  let text = val.selectedOptions[0].text
+  Cookies.set('appointmentDeptCode', id)
+  Cookies.set('appointmentDeptName', text)
+  router.push('/selectDoctorAndDate/' + id + '/' + text + '/no')
+}
 
-    return {
-      treeHeight,
-      handleSelectNav,
-      handleSelectDept,
-      data,
-      onConfirm,
-      onCancel,
-    }
-  },
+const onCancel = () => {
+  data.showPopup = false
+  data.activeCode = ''
+}
+const handleSelectNav = (val) => {
+  Cookies.set('activeIndex', val)
+}
+const handleSelectDept = (val) => {
+  if (val.children) {
+    data.children = val.children
+    data.children.forEach(item => item.value = item.id)
+    data.showPopup = true
+  } else {
+    Cookies.set('appointmentDeptCode', val.id)
+    Cookies.set('appointmentDeptName', val.text)
+    router.push('/selectDoctorAndDate/' + val.id + '/' + val.text + '/no')
+  }
 }
+onMounted(() => {
+  getAllDepartments().then((res) => {
+    data.depts = res
+  })
+})
 </script>

+ 62 - 76
src/views/hospital-service/appointment/AppointmentConfirm.vue

@@ -54,90 +54,76 @@
     </window-size>
 </template>
 
-<script>
+<script setup>
 import store from '../../../store'
 import {computed, onMounted, ref, watchEffect} from 'vue'
 import {checkAppointmentRequirements, getGhFee} from '../../../api/appointment'
 import router from '../../../router'
 import {showConfirmDialog, showToast} from 'vant'
 
-export default {
-    name: 'AppointConfirm',
-    setup() {
-        const appointment = store.state.appointmentInfo
-        const patientCards = computed(() => {
-            return store.state.patientCards
-        })
-        watchEffect(() => {
-            patientCards.value.forEach((item) => {
-                if (item.isDefault === 1) {
-                    appointment.patientId = item.patientId
-                }
-            })
-        })
-        const showAddCard = computed(() => {
-            return patientCards.value.length < 5
-        })
-        const addCardText = computed(() => {
-            return '还可添加' + (5 - patientCards.value.length) + '人'
-        })
-        const changePatient = (patientId) => {
-            appointment.patientId = patientId
-            fetchGhFee()
-        }
-        const confirmAppointment = () => {
-            checkAppointmentRequirements(appointment.patientId, appointment.deptCode).then(() => {
-                patientCards.value.forEach((item) => {
-                    if (item.patientId === appointment.patientId) {
-                        appointment.patientName = item.name
-                    }
-                })
-              showConfirmDialog({
-                    title: '温馨提示',
-                    message: '超过预约日期未就诊,不予退号、换号、转科,敬请谅解。',
-                    confirmButtonText: '确认挂号',
-                    cancelButtonText: '取消挂号'
-                }).then(() => {
-                    store.commit('SET_APPOINTMENTINFO', appointment)
-                    router.push('/payAppointmentFee')
-                }).catch(() => {
-                })
-            })
-        }
-
-        const disableGhBtn = ref(true)
+const appointment = store.state.appointmentInfo
+const patientCards = computed(() => {
+  return store.state.patientCards
+})
+watchEffect(() => {
+  patientCards.value.forEach((item) => {
+    if (item.isDefault === 1) {
+      appointment.patientId = item.patientId
+    }
+  })
+})
+const showAddCard = computed(() => {
+  return patientCards.value.length < 5
+})
+const addCardText = computed(() => {
+  return '还可添加' + (5 - patientCards.value.length) + '人'
+})
+const changePatient = (patientId) => {
+  appointment.patientId = patientId
+  fetchGhFee()
+}
+const confirmAppointment = () => {
+  checkAppointmentRequirements(appointment.patientId, appointment.deptCode).then(() => {
+    patientCards.value.forEach((item) => {
+      if (item.patientId === appointment.patientId) {
+        appointment.patientName = item.name
+      }
+    })
+    showConfirmDialog({
+      title: '温馨提示',
+      message: '超过预约日期未就诊,不予退号、换号、转科,敬请谅解。',
+      confirmButtonText: '确认挂号',
+      cancelButtonText: '取消挂号'
+    }).then(() => {
+      store.commit('SET_APPOINTMENTINFO', appointment)
+      router.push('/payAppointmentFee')
+    }).catch(() => {
+    })
+  })
+}
 
-        const fetchGhFee = () => {
-            getGhFee(appointment)
-                .then((res) => {
-                    appointment.fee = res.fee
-                    disableGhBtn.value = false
-                    if (res.message) {
-                      showToast({
-                            message: res.message,
-                            position: 'top',
-                            duration: 3000,
-                        })
-                    }
-                })
-                .catch(() => {
-                    appointment.fee = '获取失败'
-                    disableGhBtn.value = true
-                })
-        }
+const disableGhBtn = ref(true)
 
-        onMounted(() => {
-            fetchGhFee()
-        })
-        return {
-            appointment,
-            patientCards,
-            showAddCard,
-            addCardText,
-            confirmAppointment,
-            disableGhBtn,
-            changePatient,
+const fetchGhFee = () => {
+  getGhFee(appointment)
+      .then((res) => {
+        appointment.fee = res.fee
+        disableGhBtn.value = false
+        if (res.message) {
+          showToast({
+            message: res.message,
+            position: 'top',
+            duration: 3000,
+          })
         }
-    },
+      })
+      .catch(() => {
+        appointment.fee = '获取失败'
+        disableGhBtn.value = true
+      })
 }
+
+onMounted(() => {
+  fetchGhFee()
+})
 </script>

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

@@ -26,7 +26,7 @@
       </div>
     </div>
     <div class="m-input" style="padding: 0 6px; margin-bottom: 20px">
-      您对医院还有么建议与意见吗?
+      您对医院还有么建议与意见吗?
       <input type="text" v-model="answer.suggestion" style="width: 100%">
     </div>
     <van-button type="primary" block :disabled="disableSubmitButton" @click="submitAnswer">提交</van-button>

+ 0 - 19
src/views/hospital-service/assessments/Covid19Assessment.vue

@@ -5,25 +5,6 @@
     <van-field v-model="answer.name" type="text" label="姓名" disabled />
     <van-field v-model="answer.idcard" type="text" label="身份证" disabled />
     <van-field v-model="answer.phone" type="tel" label="电话" placeholder="请输入手机号" />
-    <!-- <van-field
-      readonly
-      clickable
-      v-model="answer.idcard"
-      type="text"
-      label="身份证"
-      placeholder="请输入身份证"
-      @click="answer.showIdKeyboard = true"
-    /> -->
-    <!-- <van-number-keyboard
-      v-model="answer.idcard"
-      title="身份证键盘"
-      theme="custom"
-      :show="answer.showIdKeyboard"
-      :extra-key="['X', '清空']"
-      close-button-text="完成"
-      @blur="answer.showIdKeyboard = false"
-      @input="onInputIdcard"
-    /> -->
     <van-field
       readonly
       clickable