|
@@ -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>
|