เพิ่ม API
This commit is contained in:
parent
01f0087beb
commit
71771b4b51
2 changed files with 37 additions and 3 deletions
|
|
@ -14,5 +14,7 @@ export default {
|
|||
`${urlFile}/file/${name}/${group}/${id}/${fileName}`,
|
||||
|
||||
changePassword:`${orgKeycloak}/user/change-password`,
|
||||
resetPassword:`${orgKeycloak}/user/reset-password`
|
||||
resetPassword:`${orgKeycloak}/user/reset-password`,
|
||||
|
||||
checkoutCheck:`${leave}/user/checkout-check`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,12 @@ import type { FormRef } from '@/interface/response/checkin'
|
|||
import MapCheck from '@/components/AscGISMap.vue'
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin
|
||||
const { date2Thai, showLoader, hideLoader, messageError, dialogConfirm } = mixin
|
||||
const $q = useQuasar()
|
||||
|
||||
const modalTime = ref<boolean>(false) // Dailog ลงเวลาเข้างานของคุณ
|
||||
const stetusCheckin = ref<boolean>(true) // สถานะเวลา เข้า,ออก
|
||||
const checkStatus = ref<string>('')
|
||||
|
||||
const msgCheckTime = ref<string>('') // ข้อความแจ้งเตือน
|
||||
const isDisabledCheckTime = ref<boolean>(false) // ข้อความแจ้งเตือน
|
||||
|
|
@ -188,7 +189,11 @@ function validateForm() {
|
|||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
confirm()
|
||||
if (stetusCheckin.value == false) {
|
||||
getCheck()
|
||||
} else if (stetusCheckin.value) {
|
||||
confirm()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -233,6 +238,33 @@ async function confirm() {
|
|||
})
|
||||
}
|
||||
|
||||
async function getCheck() {
|
||||
showLoader()
|
||||
await http
|
||||
.get(config.API.checkoutCheck)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.status
|
||||
checkStatus.value = data.toLocaleUpperCase()
|
||||
if (checkStatus.value == 'ABSENT') {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
confirm()
|
||||
},
|
||||
'หากลงเวลาออกเวลานี้สถานะการเข้างานของคุณจะเป็นขาดราชการ',
|
||||
'ยืนยันการลงเวลาออก?'
|
||||
)
|
||||
} else if (checkStatus.value == 'NORMAL') {
|
||||
confirm()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
/** ปิด popup แสดงการลงเวลา*/
|
||||
async function onClickConfirm() {
|
||||
showLoader()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue