From 34ec336308da8fcd8e306ad1d39aaad7c933f77b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 08 十一月 2024 18:17:37 +0800
Subject: [PATCH] update
---
src/views/ecg/appointment/CheckItemPanel.vue | 3 ++-
src/utils/dateUtil.ts | 5 +++++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/utils/dateUtil.ts b/src/utils/dateUtil.ts
index 06026cf..fd26f8f 100644
--- a/src/utils/dateUtil.ts
+++ b/src/utils/dateUtil.ts
@@ -33,4 +33,9 @@
return today.diff(birthday, 'year');
}
+export function isCurrentDay( _date: Date) {
+ const today = dayjs(new Date());
+ return today.isSame( dayjs(_date), 'day' )
+}
+
export const dateUtil = dayjs
diff --git a/src/views/ecg/appointment/CheckItemPanel.vue b/src/views/ecg/appointment/CheckItemPanel.vue
index 58dd1ff..aff0120 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'
@@ -35,7 +36,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