diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e51ba38..4aae41b 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -26,7 +26,7 @@ const statusCheckin = ref(true) // สถานะเวลา เข const checkDate = ref(null) const msgCheckTime = ref('') // ข้อความแจ้งเตือน -const isDisabledCheckTime = ref(null) // ข้อความแจ้งเตือน +const isDisabledCheckTime = ref(true) // ข้อความแจ้งเตือน const isErr = ref(null) // ข้อความแจ้งเตือน const endTimeAfternoon = ref('12:00:00') //เวลาเช็คเอาท์ตามรอบ @@ -46,14 +46,10 @@ async function fetchCheckTime(load: any = true) { statusCheckin.value = data.checkInId ? false : true checkInId.value = data.checkInId ? data.checkInId : '' endTimeAfternoon.value = data.endTimeAfternoon - isDisabledCheckTime.value = false + isDisabledCheckTime.value = isDisabledCheckTime.value ? true : false }) .catch((err) => { - if ( - err.response.status === 500 && - err.response.data.message === - 'คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป' - ) { + if (err.response.status === 500) { isErr.value = true isDisabledCheckTime.value = true msgCheckTime.value = err.response.data.message @@ -595,7 +591,7 @@ watch( class="col-12 q-pa-md items-center gt-xs" v-if="isLoadingCheckTime" > - +
@@ -662,9 +658,7 @@ watch(
-
+
-
+
*{{ msgCheckTime }}
@@ -1051,7 +1042,7 @@ watch( -
+