From 8d11e11a86bbfe84ea4156bd68e865bb2986e9bd Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 18 十一月 2024 11:18:21 +0800
Subject: [PATCH] 领用界面 自动叫号控制
---
src/views/ecg/appointment/CheckItemPanel.vue | 45 ++++++++++++++++++++++++++++++++++++++-------
1 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/src/views/ecg/appointment/CheckItemPanel.vue b/src/views/ecg/appointment/CheckItemPanel.vue
index 58dd1ff..8fe2bd4 100644
--- a/src/views/ecg/appointment/CheckItemPanel.vue
+++ b/src/views/ecg/appointment/CheckItemPanel.vue
@@ -4,6 +4,7 @@
import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment";
import {dateFormatter2, formatDate} from "@/utils/formatTime";
import {formatTimeslot} from "@/utils/formatter";
+import {isCurrentDay} from "@/utils/dateUtil";
defineComponent({
name: 'CheckItemPanel'
@@ -19,12 +20,42 @@
const checkTypeStore = useCheckTypeStore();
const _confirmAppointment = async () => {
- const data = await AppointmentApi.confirmAppointment(props.appointment)
- ElNotification({
- title: '娓╅Θ鎻愮ず',
- message: data,
- type: 'warning'
- })
+ if (!isCurrentDay(props.appointment.bookDate)) {
+ ElMessageBox.confirm(
+ '闈炲綋澶╅绾﹂」锛岀‘瀹氳浠婂ぉ妫�鏌ュ悧锛�',
+ 'Warning',
+ {
+ confirmButtonText: '濂界殑',
+ cancelButtonText: '涓嶇敤',
+ type: 'warning',
+ }
+ )
+ .then(async () => {
+ ElMessage({
+ type: 'success',
+ message: 'Delete completed',
+ })
+ const data = await AppointmentApi.confirmAppointmentVip(props.appointment)
+ ElNotification({
+ title: '娓╅Θ鎻愮ず',
+ message: data,
+ type: 'warning'
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: 'Delete canceled',
+ })
+ })
+ } else {
+ const data = await AppointmentApi.confirmAppointment(props.appointment)
+ ElNotification({
+ title: '娓╅Θ鎻愮ず',
+ message: data,
+ type: 'warning'
+ })
+ }
}
</script>
@@ -35,7 +66,7 @@
<div>{{formatDate(appointment.bookDate, 'YYYY-MM-DD')}}</div>
<div>{{formatTimeslot(appointment.bookTimeslot)}}</div>
<el-divider/>
- <el-button type="primary" @click="_confirmAppointment"><Icon icon="ep:refresh" class="mr-5px" /> 鎺掗槦 </el-button>
+ <el-button :type="isCurrentDay(appointment.bookDate)?'primary':'warning'" @click="_confirmAppointment"><Icon icon="ep:refresh" class="mr-5px" /> 鎺掗槦 </el-button>
</el-card>
</template>
--
Gitblit v1.9.3