浏览代码

挂号时添加号别提示

lighter 1 年之前
父节点
当前提交
56942b4883
共有 1 个文件被更改,包括 19 次插入2 次删除
  1. 19 2
      src/views/hospital-service/appointment/SelectDoctorAndDate.vue

+ 19 - 2
src/views/hospital-service/appointment/SelectDoctorAndDate.vue

@@ -37,7 +37,7 @@
         <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)">
+        <van-cell center is-link @click="handleClickDoctor(item)">
           <template #icon>
             <van-image
                 style="width: 44.11px; height: 60.36px"
@@ -66,6 +66,7 @@ import { getOneWeekText, getNextSevenDate } from '../../../utils/date'
 import { onMounted, reactive } from 'vue'
 import { getSourcesByDate, getDoctorSources } from '../../../api/appointment'
 import store from '../../../store'
+import {showConfirmDialog} from "vant";
 
 const screenSize = store.state.screenSize
 const labelStyle = {
@@ -116,10 +117,26 @@ const handleClickDate = (index, isFromMounted) => {
     }
   })
 }
-const toDoctorArangement = (val) => {
+const handleClickDoctor = (val) => {
+  if (val.isrubric === '1') {
+    showConfirmDialog({
+      title: '温馨提示',
+      message: val.rubricTxt
+    }).then(() => {
+      toAppointment(val)
+    }).catch(() => {
+      console.log('cancel choose doctor')
+    })
+  } else {
+    toAppointment(val)
+  }
+}
+
+function toAppointment(val) {
   const to = '/doctorArrangement/' + data.dateSelected + '/' + deptCode + '/' + val.doctorCode
   router.push(to)
 }
+
 onMounted(() => {
   const param = {
     start: data.nextSevenDate[0].fullDate,