fix: isDisabledCheckTime

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-19 13:06:53 +07:00
parent 15b77b3d0a
commit 6010c6ff59

View file

@ -26,7 +26,7 @@ const statusCheckin = ref<boolean>(true) // สถานะเวลา เข
const checkDate = ref<boolean | null>(null)
const msgCheckTime = ref<string>('') //
const isDisabledCheckTime = ref<boolean | null>(null) //
const isDisabledCheckTime = ref<boolean>(true) //
const isErr = ref<boolean | null>(null) //
const endTimeAfternoon = ref<string>('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"
>
<q-skeleton type="text" width="100%" height="50px" />
<q-skeleton width="100%" height="50px" />
</div>
<div v-else :class="getClass(statusCheckin)" class="gt-xs">
<div class="col">
@ -662,9 +658,7 @@ watch(
<div
v-if="!cameraIsOn && img == null"
class="preview-placeholder"
@click="
() => isDisabledCheckTime === false && openCamera()
"
@click="() => !isDisabledCheckTime && openCamera()"
>
<div class="text-center">
<q-icon
@ -745,7 +739,7 @@ watch(
<!-- กรอกขอม หนามอถ -->
<div class="col-12 row q-col-gutter-y-md" v-if="$q.screen.xs">
<div class="col-12" v-if="isDisabledCheckTime === false">
<div class="col-12" v-if="!isDisabledCheckTime">
<q-card
flat
bordered
@ -824,7 +818,7 @@ watch(
<!-- กรอกขอม หนามอถ -->
<div
v-if="isDisabledCheckTime === false"
v-if="!isDisabledCheckTime"
class="col-xs-12 col-sm-12 items-center gt-xs"
>
<q-card
@ -907,7 +901,7 @@ watch(
</div>
<div
v-if="isDisabledCheckTime === false"
v-if="!isDisabledCheckTime"
class="col-xs-12 col-sm-12 gt-xs"
>
<q-card
@ -974,10 +968,7 @@ watch(
</div>
</div>
<div
v-if="isDisabledCheckTime === true && $q.screen.gt.xs"
class="col-12"
>
<div v-if="isDisabledCheckTime && $q.screen.gt.xs" class="col-12">
<q-separator />
<div class="text-red q-pa-md">*{{ msgCheckTime }}</div>
</div>
@ -1051,7 +1042,7 @@ watch(
<!-- footer หนามอถ-->
<q-footer reveal v-if="$q.screen.xs" class="bg-grey-2">
<q-separator />
<div v-if="isDisabledCheckTime === false" class="col-12 q-pa-md">
<div v-if="!isDisabledCheckTime" class="col-12 q-pa-md">
<p
:class="
$q.screen.gt.xs