ソースを参照

优化自助开单直达项目

lighter 1 年間 前
コミット
82e6ae2368

+ 15 - 0
src/api/bookable.js

@@ -1,5 +1,20 @@
 import request from '../utils/request'
 
+export function getDirectBookableItems() {
+  return request({
+    url: '/bookable/getDirectBookableItems',
+    method: 'get',
+  })
+}
+
+export function applyDirectBookableItem(data) {
+  return request({
+    url: '/bookable/applyDirectBookableItem',
+    method: 'post',
+    data
+  })
+}
+
 export function getBookableData(tableName) {
   return request({
     url: '/bookable/getBookableData',

+ 0 - 17
src/api/order-covid-exam.js

@@ -1,17 +0,0 @@
-import request from '../utils/request'
-
-export function selectValidRegForCovidExam(patNo) {
-  return request({
-    url: '/orderCovid/selectValidRegForCovidExam',
-    method: 'get',
-    params: { patNo},
-  })
-}
-
-export function savePrescription(patientId, type) {
-  return request({
-    url: '/orderCovid/savePrescription',
-    method: 'get',
-    params: { patientId, type },
-  })
-}

+ 0 - 31
src/router/index.js

@@ -143,22 +143,6 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/physical-exam/PhysicalExamIndex.vue'),
     meta: { title: '体检报告' },
   },
-  {
-    path: '/selectCovidVaccinatePatient',
-    component: () => import('../views/hospital-service/covid-vaccinate/SelectCovidVaccinatePatient.vue'),
-    meta: { title: '选择患者' },
-  },
-  {
-    path: '/covidVaccinate/:patientId?',
-    component: () => import('../views/hospital-service/covid-vaccinate/CovidVaccinate.vue'),
-    meta: { title: '选择新冠疫苗' },
-  },
-  {
-    path: '/excuteAppointment/:patientId?/:vaccinateCode/:vaccinateName/:vaccinateFactory',
-    name: 'excuteAppointment',
-    component: () => import('../views/hospital-service/covid-vaccinate/ExcuteAppointment.vue'),
-    meta: { title: '新冠接种预约' },
-  },
   {
     path: '/selectInpatientCard',
     component: () => import('../views/hospital-service/inpatient-service/SelectInpatientCard.vue'),
@@ -211,21 +195,6 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/health-cart/ResignOrRefund.vue'),
     meta: { title: '未成功的预约' },
   },
-  {
-    path: '/selectCovidBranch/:patientId',
-    component: () => import('../views/hospital-service/covid-exam/SelectCovidBranch.vue'),
-    meta: { title: '新冠肺炎核酸检测' },
-  },
-  {
-    path: '/checkCovidExamResult/:patientId',
-    component: () => import('../views/hospital-service/covid-exam/CheckExamResult.vue'),
-    meta: { title: '查询新冠核酸检测结果' },
-  },
-  {
-    path: '/selectOrderCovidPatient',
-    component: () => import('../views/hospital-service/covid-exam/SelectPatientCard.vue'),
-    meta: { title: '选择就诊卡' },
-  },
   {
     path: '/selectAppointmentRecordPatient',
     component: () => import('../views/mine/appointment-record/SelectPatientCard.vue'),

+ 0 - 9
src/views/hospital-service/HospitalServiceHome.vue

@@ -251,14 +251,6 @@ export default {
       router.push(val)
     }
 
-    const toVaccinateAppointment = () => {
-      if (cards.value.length === 1) {
-        window.open('http://www.hnthyy.cn:8080/covidVaccinate/' + cards.value[0].patientId, '_self')
-      } else {
-        router.push('/selectCovidVaccinatePatient')
-      }
-    }
-
     // 前往医保电子凭证
     const toybdzpz = () => {
       store.commit('SET_LOADING', true)
@@ -324,7 +316,6 @@ export default {
       specialtyStyle,
       defaultPatientId,
       routeTo,
-      toVaccinateAppointment,
       loadingStyle,
       loading,
       toybdzpz,

+ 31 - 47
src/views/hospital-service/appointment/PayAppointmentFee.vue

@@ -42,59 +42,43 @@
   </window-size>
 </template>
 
-<script>
+<script setup>
 import store from '../../../store'
 import { reactive } from 'vue'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { wxPay } from '../../../utils/wx-pay'
 import { showToast } from 'vant'
 import router from '../../../router'
-import {savePrescription} from "../../../api/order-covid-exam";
-export default {
-  name: 'PayAppointmentFee',
-  setup() {
-    const data = reactive({
-      disablePayButton: false,
-      appointment: store.state.appointmentInfo,
+
+const data = reactive({
+  disablePayButton: false,
+  appointment: store.state.appointmentInfo,
+})
+const countDownFinish = () => {
+  data.disablePayButton = true
+}
+const pay = () => {
+  const param = {
+    body: '挂号费',
+    orderType: 1,
+    totalFee: data.appointment.fee,
+    openId: getLocalOpenId(),
+    patientId: data.appointment.patientId,
+    mzyRequestId: data.appointment.mzyRequestId,
+    apTime: data.appointment.apTime
+  }
+  wxPay(param).then((result) => {
+    showToast({
+      message: result,
+      position: 'top'
+    })
+    router.push('/hospitalService');
+  }).catch((result) => {
+    showToast({
+      message: result,
+      position: 'top'
     })
-    const countDownFinish = () => {
-      data.disablePayButton = true
-    }
-    const pay = () => {
-      const param = {
-        body: '挂号费',
-        orderType: 1,
-        totalFee: data.appointment.fee,
-        openId: getLocalOpenId(),
-        patientId: data.appointment.patientId,
-        mzyRequestId: data.appointment.mzyRequestId,
-        apTime: data.appointment.apTime
-      }
-      wxPay(param).then((result) => {
-        showToast({
-          message: result,
-          position: 'top'
-        })
-        if (data.appointment.extra === 'covid19-exam') {
-          savePrescription(data.appointment.patientId, 1).then(() => {
-            router.push(`/unPaidList/${data.appointment.patientId}`)
-          })
-        } else {
-          router.push('/hospitalService');
-        }
-      }).catch((result) => {
-        showToast({
-          message: result,
-          position: 'top'
-        })
-        router.push('/hospitalService')
-      })
-    }
-    return {
-      data,
-      countDownFinish,
-      pay,
-    }
-  },
+    router.push('/hospitalService')
+  })
 }
 </script>

+ 2 - 23
src/views/hospital-service/assessments/Covid19Assessment.vue

@@ -72,7 +72,6 @@ import { assessmentItems } from '../../../data/index'
 import { getDate } from '../../../utils/date'
 import { getPatientInfo, submitCovidAssessment } from '../../../api/assessments'
 import { validateCovid19Answer } from '../../../utils/validate'
-import { savePrescription } from '../../../api/order-covid-exam'
 import { showDialog } from 'vant'
 import allArea from '../../../utils/area'
 import { useRouter } from 'vue-router'
@@ -121,7 +120,7 @@ export default {
 
     const mFocus = ref(null)
     watchEffect(() => {
-      if (answer.temperature == 2) {
+      if (answer.temperature === 2) {
         setTimeout(() => {
           mFocus.value.focus()
         }, 100)
@@ -147,27 +146,7 @@ export default {
             title: '提示',
             message: '提交成功!',
           }).then(() => {
-            if (answer.patientId && from.value !== '') {
-              if (from.value === 'register') {
-                if (res && res.length > 1) {
-                  showDialog({
-                    title: '提示',
-                    message: res,
-                  }).then(() => {
-                    router.push('/appointment')
-                  })
-                } else {
-                  router.push('/payAppointmentFee')
-                }
-              } else if (from.value.startsWith('covidExam_')) {
-                let type = from.value.split('_')[1]
-                savePrescription(answer.patientId, type).then(() => {
-                  router.push(`/unPaidList/${answer.patientId}`)
-                })
-              }
-            } else {
-              router.go(-1)
-            }
+            router.go(-1)
           })
         })
       } else {

+ 0 - 80
src/views/hospital-service/covid-exam/CheckExamResult.vue

@@ -1,80 +0,0 @@
-<template>
-  <window-size>
-    <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号" clearable>
-      <template #button>
-        <van-button size="small" type="primary" @click="startQuery">查询</van-button>
-      </template>
-    </van-field>
-    <div style="height: 5px"></div>
-    <div v-for="(item, index) in covidExamIndexes" :key="index">
-      <van-cell
-        :title="item.aply_CTNT"
-        :label="item.ordr_CREATE_DATE"
-        :value="filterType(item.patient_TYPE, item.ptnt_ID)"
-        is-link
-        center
-        :to="'/checkExamDetail/' + item.ordr_ID + '/' + item.ptnt_ID + '/' + item.patient_TYPE"
-      ></van-cell>
-    </div>
-  </window-size>
-</template>
-
-<script>
-import { onMounted, ref } from 'vue'
-import { checkCovidExamIndexBySocialNo } from '../../../api/check-exam'
-import { showToast } from 'vant'
-import { useRouter } from 'vue-router'
-import { getPatientInfo } from '../../../api/assessments'
-import { computed } from '@vue/reactivity'
-import store from '../../../store'
-
-export default {
-  setup() {
-    const router = useRouter()
-    const patientId = router.currentRoute.value.params.patientId
-    const socialNo = ref(null)
-    const covidExamIndexes = computed(() => {
-      return store.state.covidExamIndexes
-    })
-    const startQuery = () => {
-      if (!socialNo.value) {
-        showToast({
-          message: '请输入正确的身份证号码',
-          position: 'top',
-        });
-      } else {
-        checkCovidExamIndexBySocialNo(socialNo.value).then((res) => {
-          store.commit('SET_COVIDEXAMIDCARD', socialNo.value)
-          store.commit('SET_COVIDEXAMINDEXES', res)
-        })
-      }
-    }
-    onMounted(() => {
-      if (covidExamIndexes.value.length === 0) {
-        getPatientInfo(patientId).then((res) => {
-          socialNo.value = res.idcard
-        })
-      } else {
-        socialNo.value = store.state.covidExamIdCard
-      }
-    })
-    return {
-      socialNo,
-      covidExamIndexes,
-      startQuery,
-      filterType,
-    }
-  },
-}
-
-function filterType(val, no) {
-  if (val === '0') {
-    return '门诊号:' + no
-  } else if (val === '1') {
-    return '住院号:' + no
-  } else if (val === '3') {
-    return '体检号:' + no
-  }
-  return ''
-}
-</script>

+ 0 - 46
src/views/hospital-service/covid-exam/SelectCovidBranch.vue

@@ -1,46 +0,0 @@
-<template>
-  <window-size>
-    <van-cell is-link @click="handleClickExamOption(1)">
-      <template #title>
-        核酸检测(单人单管)
-      </template>
-    </van-cell>
-    <van-cell title="新型冠状病毒抗原检测" is-link @click="handleClickExamOption(2)"></van-cell>
-    <van-cell title="查询检测结果" is-link :to="'/checkCovidExamResult/' + patientId"></van-cell>
-    <van-dialog v-model:show="showTips" title="核酸检测须知">
-      <div style="padding: 12px">
-        <div>1、接种新冠疫苗后72小时方可进行核酸采样。</div>
-        <div>2、混检仅在8:00 - 24:00对绿码人员开放。</div>
-        <div>3、黄码人员请进行单人单管采样。</div>
-      </div>
-    </van-dialog>
-  </window-size>
-</template>
-
-<script>
-import {useRouter} from 'vue-router'
-import {savePrescription} from '../../../api/order-covid-exam'
-import {ref} from 'vue'
-
-export default {
-  setup() {
-    const showTips = ref(false)
-    const router = useRouter()
-    const patientId = router.currentRoute.value.params.patientId
-    const timeLimit = ref({})
-
-    const handleClickExamOption = (flag) => {
-      savePrescription(patientId, flag).then(() => {
-        router.push(`/unPaidList/${patientId}`)
-      })
-    }
-
-    return {
-      patientId,
-      showTips,
-      timeLimit,
-      handleClickExamOption,
-    }
-  },
-}
-</script>

+ 0 - 5
src/views/hospital-service/covid-exam/SelectPatientCard.vue

@@ -1,5 +0,0 @@
-<template>
-  <window-size>
-    <select-card to="selectCovidBranch"></select-card>
-  </window-size>
-</template>

+ 0 - 80
src/views/hospital-service/covid-vaccinate/CovidVaccinate.vue

@@ -1,80 +0,0 @@
-<template>
-  <window-size>
-    <van-empty v-if="showEmpty" van-empty description="暂无可以预约的新冠疫苗"></van-empty>
-    <div v-else>
-      <div v-for="item in covidVaccinates" :key="item.vaccinateCode">
-        <van-cell
-          center
-          :title="item.vaccinateName"
-          :label="item.vaccinateFactory"
-          @click="toCovidVaccinateAppointment(item)"
-        >
-          <template #right-icon>
-            <span v-html="hasSource(item.minLeftNum)"></span>
-          </template>
-        </van-cell>
-      </div>
-    </div>
-  </window-size>
-</template>
-
-<script>
-import router from '../../../router'
-import { computed, onMounted, ref } from 'vue'
-import { selectVaccinates } from '../../../api/covid-vaccinate'
-import { showConfirmDialog, showToast } from 'vant'
-export default {
-  setup() {
-    let patientId = router.currentRoute.value.params.patientId
-    const covidVaccinates = ref([])
-    const showEmpty = computed(() => {
-      return covidVaccinates.value.length === 0
-    })
-    const hasSource = (num) => {
-      return num > 0 ? '<span style="color: green">余' + num + '</span>' : '<span style="color: red">无</span>'
-    }
-    const toCovidVaccinateAppointment = (item) => {
-      if (item.minLeftNum < 1) {
-        showToast({
-          message: '该疫苗已无库存,暂时无法预约,敬请谅解。',
-          position: 'top',
-        });
-        return
-      }
-      showConfirmDialog({
-        title: '温馨提示',
-        message: item.bookTip,
-        messageAlign: 'left',
-        confirmButtonText: '继续预约',
-        cancelButtonText: '重选疫苗',
-      }).then(() => {
-        router.push({
-          name: 'excuteAppointment',
-          params: {
-            patientId: patientId,
-            vaccinateCode: item.vaccinateCode,
-            vaccinateName: item.vaccinateName,
-            vaccinateFactory: item.vaccinateFactory,
-          },
-        })
-      }).catch(() => {})
-    }
-
-    onMounted(() => {
-      if (!patientId) {
-        patientId = null
-      }
-      selectVaccinates().then((res) => {
-        covidVaccinates.value = res
-      })
-    })
-
-    return {
-      covidVaccinates,
-      showEmpty,
-      hasSource,
-      toCovidVaccinateAppointment,
-    }
-  },
-}
-</script>

+ 0 - 236
src/views/hospital-service/covid-vaccinate/ExcuteAppointment.vue

@@ -1,236 +0,0 @@
-<template>
-  <window-size>
-    <van-notice-bar left-icon="volume-o" text="可接种年龄为【18岁-70岁】之间。" />
-    <van-grid direction="horizontal" :column-num="7">
-      <van-grid-item v-for="item in oneWeekText" :key="item" :text="'周' + item" />
-    </van-grid>
-    <van-grid direction="horizontal" :column-num="7">
-      <van-grid-item v-for="(item, index) in nextSevenDate" :key="index">
-        <van-badge :content="hasSource(index)" :color="badgeColor(index)">
-          <van-button
-            :disabled="disabledBtn(index)"
-            :type="getType(index)"
-            size="small"
-            round
-            @click="handleClickDate(index)"
-            >{{ item.date }}</van-button
-          >
-        </van-badge>
-      </van-grid-item>
-    </van-grid>
-    <van-field v-model="vaccinate.vaccinateName" required label="疫苗名称" readonly />
-    <van-field v-model="vaccinate.vaccinateFactory" required label="疫苗厂家" readonly />
-    <van-field v-model="vaccinate.name" required type="text" label="姓名" placeholder="请输入姓名" />
-    <van-field v-model="vaccinate.phone" required type="tel" label="电话" placeholder="请输入手机号" />
-    <van-field v-model="vaccinate.socialNo" required type="tel" label="身份证" placeholder="请输入身份证号" />
-    <van-field v-model="vaccinate.corpName" required type="text" label="工作单位" placeholder="请输入工作单位" />
-    <van-field
-      v-model="jobCategoryName"
-      required
-      label="工作性质"
-      readonly
-      @click="showPickJobCategory = true"
-      placeholder="选择工作性质"
-    ></van-field>
-    <van-popup v-model:show="showPickJobCategory" position="bottom" :style="{ height: '50%' }">
-      <van-picker
-        title="工作性质"
-        :columns="jobCategories"
-        :columns-field-names="customFieldName"
-        @confirm="confirmPickJobCategory"
-      />
-    </van-popup>
-    <div style="height: 10px"></div>
-    <van-button block type="primary" @click="submit" :disabled="disabledSubmit">提交预约</van-button>
-  </window-size>
-</template>
-
-<script>
-import { computed, onMounted, reactive, ref } from 'vue'
-import router from '../../../router'
-import { getNextSevenDate, getOneWeekText } from '../../../utils/date'
-import {
-  getNextSevenDaysSources,
-  getPatientInfoAndJobCategories,
-  submitVaccinateAppointment,
-} from '../../../api/covid-vaccinate'
-import { showDialog, showToast } from 'vant'
-import { isValidIdcard, isValidPhone } from '../../../utils/validate'
-export default {
-  setup() {
-    let patientId = router.currentRoute.value.params.patientId
-    const vaccinateCode = router.currentRoute.value.params.vaccinateCode
-    const vaccinateName = router.currentRoute.value.params.vaccinateName
-    const vaccinateFactory = router.currentRoute.value.params.vaccinateFactory
-
-    const currentIndex = ref(0)
-    const oneWeekText = getOneWeekText()
-    const nextSevenDate = getNextSevenDate()
-    const nextSevenDaySources = ref([0, 0, 0, 0, 0, 0, 0])
-    const getType = (index) => {
-      return index === currentIndex.value ? 'primary' : 'default'
-    }
-    const hasSource = (index) => {
-      return nextSevenDaySources.value[index] > 0 ? nextSevenDaySources.value[index] : '无'
-    }
-    const badgeColor = (index) => {
-      return nextSevenDaySources.value[index] > 0 ? 'green' : 'red'
-    }
-    const disabledBtn = (index) => {
-      return nextSevenDaySources.value[index] < 1
-    }
-    const disabledSubmit = computed(() => {
-      return nextSevenDaySources.value[currentIndex.value] < 1
-    })
-    const handleClickDate = (index) => {
-      currentIndex.value = index
-      vaccinate.executeDate = nextSevenDate[index].fullDate
-    }
-
-    const vaccinateFactories = ref([])
-    const showPickJobCategory = ref(false)
-    const currentDate = ref(new Date())
-    const formatter = (type, val) => {
-      if (type === 'year') {
-        return val + '年'
-      }
-      if (type === 'month') {
-        return val + '月'
-      }
-      if (type === 'day') {
-        return val + '日'
-      }
-      return val
-    }
-    const jobCategoryName = ref('')
-    const jobCategories = ref([])
-    const customFieldName = {
-      code: 'code',
-      text: 'name',
-    }
-    const confirmPickJobCategory = (val) => {
-      vaccinate.jobCategory = val.selectedOptions[0].code
-      jobCategoryName.value = val.selectedOptions[0].name
-      showPickJobCategory.value = false
-    }
-    const vaccinate = reactive({
-      vaccinateCode: vaccinateCode,
-      vaccinateName: vaccinateName,
-      vaccinateFactory: vaccinateFactory,
-      patientId: '',
-      name: '',
-      phone: '',
-      socialNo: '',
-      corpName: '',
-      jobCategory: '',
-      executeDate: '',
-    })
-
-    const submit = () => {
-      if (!vaccinate.vaccinateCode || !vaccinate.vaccinateFactory) {
-        showToast({
-          message: '请选择疫苗厂家!',
-          position: 'top',
-        })
-        return
-      }
-      if (!vaccinate.name) {
-        showToast({
-          message: '请输入姓名!',
-          position: 'top',
-        })
-        return
-      }
-      if (!isValidPhone(vaccinate.phone)) {
-        showToast({
-          message: '请输入正确的手机号码',
-          position: 'top',
-        })
-        return
-      }
-      if (!isValidIdcard(vaccinate.socialNo)) {
-        showToast({
-          message: '请输入正确的身份证号码',
-          position: 'top',
-        })
-        return
-      }
-      if (!vaccinate.corpName) {
-        showToast({
-          message: '请输入工作单位,没有工作单位请填‘无’',
-          position: 'top',
-          duration: 3000,
-        })
-        return
-      }
-      if (!vaccinate.jobCategory) {
-        showToast({
-          message: '请选择工作性质,如不确定请选‘其他人员’,如无工作请选择‘家务及待业人员’',
-          position: 'top',
-          duration: 3000,
-        })
-        return
-      }
-      if (!vaccinate.executeDate) {
-        showToast({
-          message: '请选择接种日期',
-          position: 'top',
-        })
-        return
-      }
-      submitVaccinateAppointment(vaccinate).then((res) => {
-        showDialog({
-          title: '提示',
-          message: res,
-        }).then(() => {
-          router.push('/hospitalService')
-        })
-      })
-    }
-    onMounted(() => {
-      if (!patientId) {
-        patientId = ''
-      }
-      getPatientInfoAndJobCategories(patientId).then((res2) => {
-        vaccinate.patientId = res2.patientId
-        vaccinate.name = res2.name
-        vaccinate.phone = res2.phone
-        vaccinate.socialNo = res2.socialNo
-        jobCategories.value = res2.jobCategories
-        jobCategories.value.forEach(item => {
-          item.value = item.code
-        })
-        getNextSevenDaysSources(vaccinate.vaccinateCode).then((res3) => {
-          nextSevenDaySources.value = res3
-          for (let i = 0; i < 7; i++) {
-            if (res3[i] > 0) {
-              handleClickDate(i)
-              break
-            }
-          }
-        })
-      })
-    })
-    return {
-      oneWeekText,
-      nextSevenDate,
-      getType,
-      hasSource,
-      badgeColor,
-      disabledBtn,
-      handleClickDate,
-      disabledSubmit,
-      vaccinate,
-      vaccinateFactories,
-      currentDate,
-      formatter,
-      showPickJobCategory,
-      jobCategories,
-      confirmPickJobCategory,
-      customFieldName,
-      jobCategoryName,
-      submit,
-    }
-  },
-}
-</script>

+ 0 - 53
src/views/hospital-service/covid-vaccinate/SelectCovidVaccinatePatient.vue

@@ -1,53 +0,0 @@
-<template>
-  <window-size>
-    <div v-for="item in cards" :key="item.patientId">
-      <van-cell icon="user-o" :label="item.patientId" is-link @click="toVaccinate(item.patientId)">
-        <template #title>
-          <span class="custom-title">{{ item.name }}</span>
-          &nbsp;
-          <van-tag type="primary" plain v-if="item.isDefault === 1">默认</van-tag>
-        </template>
-      </van-cell>
-    </div>
-    <div style="height: 5px"></div>
-    <van-cell
-      v-if="showAddCard"
-      icon="add"
-      title="添加就诊人"
-      :label="addCardText"
-      is-link
-      to="/addElectronicHealthCard"
-    ></van-cell>
-  </window-size>
-</template>
-
-<script>
-import store from '../../../store'
-import { computed, ref } from 'vue'
-import BindCardMethod from "../../../components/bind-card-method/index.vue";
-export default {
-  components: {
-    BindCardMethod
-  },
-  setup() {
-    const cards = computed(() => {
-      return store.state.patientCards
-    })
-    const showAddCard = computed(() => {
-      return cards.value.length < 5
-    })
-    const addCardText = computed(() => {
-      return '还可添加' + (5 - cards.value.length) + '人'
-    })
-    const toVaccinate = (patientId) => {
-      window.open('http://www.hnthyy.cn:8080/covidVaccinate/' + patientId, '_self')
-    }
-    return {
-      cards,
-      showAddCard,
-      addCardText,
-      toVaccinate,
-    }
-  },
-}
-</script>

+ 42 - 55
src/views/hospital-service/health-cart/BookExam.vue

@@ -31,69 +31,56 @@
   </window-size>
 </template>
 
-<script>
+<script setup>
 import { showToast } from 'vant'
 import { getBookTip, saveBookPrescription } from '../../../api/bookable'
 import router from '../../../router'
 import store from '../../../store'
 import { computed, ref } from 'vue'
-export default {
-  setup() {
-    const bookItem = store.state.currentBook
-    const bookTips = ref([])
-    const showTips = ref(false)
 
-    const countdown = ref(0)
-    const disableFinish = computed(() => {
-      return countdown.value > 0
-    })
-    const executeCountdown = () => {
-      setTimeout(() => {
-        countdown.value--
-        if (countdown.value > 0) {
-          executeCountdown()
-        }
-      }, 1000)
-    }
-    const beforeExecuteBook = () => {
-      getBookTip(bookItem.tableName, bookItem.code).then((res) => {
-        if (res) {
-          bookTips.value = res
-          countdown.value = 15
-          showTips.value = true
-          executeCountdown()
-        } else {
-          executeBook()
-        }
-      })
-    }
-    const executeBook = () => {
-      showTips.value = false
-      saveBookPrescription(bookItem).then((res) => {
-        store.commit('SET_YJREQNO', res)
-        showToast({
-          message: '自助开单成功。',
-          position: 'top',
-        });
-        router.push('/unPaidList/' + bookItem.patientId)
-      })
-    }
-    const cancelBook = () => {
-      showTips.value = false
-      countdown.value = 0
-      router.go(-2)
+const bookItem = store.state.currentBook
+const bookTips = ref([])
+const showTips = ref(false)
+
+const countdown = ref(0)
+const disableFinish = computed(() => {
+  return countdown.value > 0
+})
+const executeCountdown = () => {
+  setTimeout(() => {
+    countdown.value--
+    if (countdown.value > 0) {
+      executeCountdown()
     }
-    return {
-      bookItem,
-      disableFinish,
-      showTips,
-      countdown,
-      bookTips,
-      executeBook,
-      beforeExecuteBook,
-      cancelBook,
+  }, 1000)
+}
+const beforeExecuteBook = () => {
+  getBookTip(bookItem.tableName, bookItem.code).then((res) => {
+    if (res) {
+      bookTips.value = res
+      countdown.value = 15
+      showTips.value = true
+      executeCountdown()
+    } else {
+      executeBook()
     }
-  },
+  })
+}
+const executeBook = () => {
+  showTips.value = false
+  saveBookPrescription(bookItem).then((res) => {
+    store.commit('SET_YJREQNO', res)
+    showToast({
+      message: '自助开单成功。',
+      position: 'top',
+    });
+    router.push('/unPaidList/' + bookItem.patientId)
+  })
+}
+const cancelBook = () => {
+  showTips.value = false
+  countdown.value = 0
+  router.go(-2)
 }
 </script>
 

+ 30 - 73
src/views/hospital-service/health-cart/ExaminationCategory.vue

@@ -2,85 +2,42 @@
   <window-size>
     <van-cell title="检查" is-link :to="'/bookableExaminations/jc/' + patientId"></van-cell>
     <van-cell title="检验" is-link :to="'/bookableExaminations/jy/' + patientId"></van-cell>
-    <van-cell title="核酸检测" is-link @click="beforeCovidExam"></van-cell>
+    <van-tag type="primary" plain style="margin: 12px 0 0 8px">热门项目</van-tag>
+    <van-cell v-for="item in bookableItems" :title="item.name" is-link @click="beforeOrderItem(item)"></van-cell>
   </window-size>
 </template>
 
-<script>
+<script setup>
 import { useRouter } from 'vue-router'
-import {showConfirmDialog, showDialog} from "vant";
-import store from "../../../store";
-import {getDoctorSources} from "../../../api/appointment.js";
-import {getTodayAndWeek} from "../../../utils/date";
-import {selectValidRegForCovidExam,savePrescription} from "../../../api/order-covid-exam";
-import {getPatientNameByPatientId} from "../../../utils/check-patient-id";
-export default {
-  setup() {
-    const router = useRouter()
-    const patientId = router.currentRoute.value.params.patientId
-    const dateAndWeek = getTodayAndWeek()
-    const beforeCovidExam = () => {
-      showConfirmDialog({
-        title: '温馨提示',
-        message: '是否确认自助下单核酸检测?',
-        confirmButtonText: '确认',
-        cancelButtonText: '取消'
-      }).then(() => {
-        savePrescription(patientId, 1).then(() => {
-          router.push(`/unPaidList/${patientId}`)
-        })
-      }).catch(() => {
-      })
-    }
+import {showConfirmDialog} from "vant";
+import {getDirectBookableItems,applyDirectBookableItem} from "../../../api/bookable";
+import {onMounted, ref} from "vue";
 
-    const getTodaySimpleClinic = () => {
-      selectValidRegForCovidExam(patientId).then(res => {
-        if (res === 0) {
-          const params = {date: dateAndWeek.today, deptCode: '3110000'}
-          getDoctorSources(params).then(res2 => {
-            simpleClinic(res2[0])
-          }).catch(() => {
-            showDialog({
-              title: '提示',
-              message: '没有获取到今日简易门诊号源,请稍后再试。',
-            }).then(() => {})
-          })
-        } else {
-          savePrescription(patientId, 1).then(() => {
-            router.push(`/unPaidList/${patientId}`)
-          })
-        }
-      })
-    }
+const router = useRouter()
+const patientId = router.currentRoute.value.params.patientId
 
-    const simpleClinic = (row) => {
-      const appointment = {
-        leftNum: row.leftNum,
-        doctorName: '自助',
-        doctorTitle: '无',
-        ampm: '全天',
-        fee: row.fee,
-        doctorCode: '99999',
-        chargeType: '简易门诊号',
-        deptCode: '3110000',
-        deptName: '简易门诊',
-        date: dateAndWeek.today,
-        week: dateAndWeek.week,
-        startTime: '00:00',
-        endTime: '00:00',
-        patientId: patientId,
-        patientName: getPatientNameByPatientId(patientId),
-        extra: 'covid19-exam',
-        mzyRequestId: row.mzyRequestId
-      }
-      store.commit('SET_APPOINTMENTINFO', appointment)
-      router.push('/payAppointmentFee')
-    }
+const bookableItems = ref([])
 
-    return {
-      patientId,
-      beforeCovidExam,
-    }
-  },
+const beforeOrderItem = (bookableItem) => {
+  showConfirmDialog({
+    title: '温馨提示',
+    message: `<span>是否确认自助下单<span style="color: orangered">${bookableItem.name}</span>?</span>`,
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    allowHtml: true
+  }).then(() => {
+    bookableItem.patientId = patientId
+    applyDirectBookableItem(bookableItem).then(() => {
+      router.push(`/unPaidList/${patientId}`)
+    })
+  }).catch(() => {
+  })
 }
+
+onMounted(() => {
+  getDirectBookableItems().then(res => {
+    bookableItems.value = res
+  })
+})
+
 </script>