fix check null POI

This commit is contained in:
Warunee Tamkoo 2025-06-13 11:24:09 +07:00
parent e3684e6507
commit 183294a3b9
3 changed files with 94 additions and 3 deletions

View file

@ -306,10 +306,15 @@ function validateForm() {
}
}
const mapRef = ref<InstanceType<typeof MapCheck> | null>(null)
const timeChickin = ref<string>('') //,
/** function ยืนยันการลงเวลาเข้า - ออก*/
async function confirm() {
if (!formLocation.POI || formLocation.POI === '') {
mapRef.value?.requestLocationPermission()
return
}
showLoader()
const isLocation = workplace.value === 'in-place' //*true , false
const locationName = workplace.value === 'in-place' ? '' : useLocation.value
@ -349,6 +354,12 @@ async function confirm() {
}
async function getCheck() {
console.log('getCheck')
if (!formLocation.POI || formLocation.POI === '') {
mapRef.value?.requestLocationPermission()
return
}
showLoader()
await http
.get(config.API.checkoutCheck)
@ -434,6 +445,7 @@ onMounted(async () => {
// await fetchCheckTime()
updateClock()
startChecking() // status #1
mapRef.value?.requestLocationPermission()
})
</script>
@ -498,6 +510,7 @@ onMounted(async () => {
<div class="col-12">
<MapCheck
v-if="$q.screen.gt.xs"
ref="mapRef"
@update:location="updateLocation"
/>
</div>
@ -661,7 +674,7 @@ onMounted(async () => {
</div>
<div class="col-12" v-if="$q.screen.xs">
<MapCheck @update:location="updateLocation" />
<MapCheck ref="mapRef" @update:location="updateLocation" />
</div>
</div>
<!-- กรอกขอม หนามอถ -->
@ -975,6 +988,7 @@ onMounted(async () => {
</q-card>
</q-dialog>
</template>
<style scoped>
.q-card.cardImg:hover {
border: 1px solid #02a998 !important;