|
|
@@ -28,7 +28,7 @@
|
|
|
<van-cell-group>
|
|
|
<div v-for="item in patientCards" :key="item.patientId">
|
|
|
<van-cell center icon="user-o" :label="item.patientId" clickable
|
|
|
- @click="changePatient(item.patientId)">
|
|
|
+ @click="changePatient(item)">
|
|
|
<template #title>
|
|
|
<span class="custom-title">{{ item.name }}</span>
|
|
|
|
|
|
@@ -56,6 +56,7 @@
|
|
|
import store from '@/store'
|
|
|
import {computed, onMounted, ref} from 'vue'
|
|
|
import {checkAppointmentRequirements, getGhFee} from '@/api/appointment'
|
|
|
+import {getGenderCodeFromIdCard, getAgeFromIdCard} from '@/utils/identityCard'
|
|
|
import router from '@/router'
|
|
|
import {showConfirmDialog, showToast} from 'vant'
|
|
|
import Cookies from 'js-cookie'
|
|
|
@@ -66,8 +67,9 @@ const patientCards = computed(() => {
|
|
|
return store.state.patientCards
|
|
|
})
|
|
|
|
|
|
-const changePatient = (patientId) => {
|
|
|
- appointment.patientId = patientId
|
|
|
+const changePatient = (val) => {
|
|
|
+ appointment.patientId = val.patientId
|
|
|
+ appointment.social = val.social
|
|
|
queryAppointmentCost()
|
|
|
}
|
|
|
|
|
|
@@ -88,8 +90,47 @@ const queryAppointmentCost = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const confirmAppointmentValidate = () => {
|
|
|
+ let sex = getGenderCodeFromIdCard()
|
|
|
+ let age = getAgeFromIdCard()
|
|
|
+ //校验男性挂妇产科/校验成年挂儿科
|
|
|
+ return validateSexForWomanClass(appointment.classCode,sex) && validateAgeForChildClass(appointment.classCode,age)
|
|
|
+}
|
|
|
+//校验男性挂妇产科
|
|
|
+const validateSexForWomanClass = (classCode,sex) => {
|
|
|
+ if (classCode == "04" || classCode == "05") {
|
|
|
+ if (sex != 2) {
|
|
|
+ showToast({
|
|
|
+ message: '男性病人无法在妇产科就诊,请重新挂号',
|
|
|
+ position: 'top'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+//校验成年挂儿科
|
|
|
+const validateAgeForChildClass = (classCode,age) => {
|
|
|
+ if (classCode == "03") {
|
|
|
+ if (age > 17) {
|
|
|
+ showToast({
|
|
|
+ message: '已满18周岁成人无法在儿科就诊,请重新挂号',
|
|
|
+ position: 'top'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
const confirmAppointment = () => {
|
|
|
- const message = appointment.ampm === '夜间门诊'
|
|
|
+ if (confirmAppointmentValidate) {
|
|
|
+ const message = appointment.ampm === '夜间门诊'
|
|
|
? '夜间门诊就诊时间为17:30-21:00,如您疼痛难忍或病情紧急,请至一楼急诊科就诊。'
|
|
|
: '实际看诊序号以至分诊台到诊登记为准。当天未就诊,不予退号、换号、转科,敬请谅解。'
|
|
|
checkAppointmentRequirements(appointment.patientId, appointment.deptCode).then(() => {
|
|
|
@@ -103,6 +144,8 @@ const confirmAppointment = () => {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
})
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function fetchPatientName() {
|