fix check null POI
This commit is contained in:
parent
e3684e6507
commit
183294a3b9
3 changed files with 94 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue