Merge branch 'develop' into setthawut

# Conflicts:
#	src/views/HomeView.vue
This commit is contained in:
setthawutttty 2025-03-20 13:13:44 +07:00
commit 06c7083eff
6 changed files with 82 additions and 44 deletions

View file

@ -17,8 +17,8 @@ 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 statusCheckin = ref<boolean>(true) // ,
const msgCheckTime = ref<string>('') //
const isDisabledCheckTime = ref<boolean>(false) //
@ -31,7 +31,7 @@ async function fetchCheckTime() {
.get(config.API.checkTime())
.then(async (res) => {
const data = await res.data.result
stetusCheckin.value = data.checkInId ? false : true
statusCheckin.value = data.checkInId ? false : true
checkInId.value = data.checkInId ? data.checkInId : ''
})
.catch((err) => {
@ -103,7 +103,7 @@ const model = ref<string>('') // สถานที่ทำงาน
//
const options = ref<string[]>([
'ปฏิบัติงานที่บ้าน',
'ลืมลงเวลาปฏิบัติงาน',
// '',
'ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่',
'ขออนุญาตออกนอกสถานที่',
'อื่นๆ',
@ -189,9 +189,9 @@ function validateForm() {
}
}
if (hasError.every((result) => result === true)) {
if (stetusCheckin.value == false) {
if (statusCheckin.value == false) {
getCheck()
} else if (stetusCheckin.value) {
} else if (statusCheckin.value) {
confirm()
}
}
@ -268,8 +268,8 @@ async function getCheck() {
/** ปิด popup แสดงการลงเวลา*/
async function onClickConfirm() {
showLoader()
if (!stetusCheckin.value) {
stetusCheckin.value = true
if (!statusCheckin.value) {
statusCheckin.value = true
}
// await fetchCheckTime()
@ -289,19 +289,19 @@ function updateWorkplace() {
/**
* เทนร class นหล
* @param val stetusCheckin
* @param val statusCheckin
*/
const getClass = (val: boolean) => {
return {
'bg-primary text-white col-12 row items-center q-px-md q-py-sm ': val,
'bg-red-9 text-white col-12 row items-center q-px-md q-py-sm ': !val,
'bg-red-8 text-white col-12 row items-center q-px-md q-py-sm ': !val,
}
}
const getClassXS = (val: boolean) => {
return {
'bg-topIn text-white q-pa-lg col-12 row': val,
'bg-topOut text-white q-pa-lg col-12 row': !val,
'text-white q-pa-lg col-12 row bg-primary': val,
'text-white q-pa-lg col-12 row bg-red-8': !val,
}
}
const inQueue = ref<boolean>(false)
@ -367,22 +367,18 @@ onMounted(async () => {
"
>
<!-- <q-header elevated class="bg-purple"> -->
<div :class="getClass(stetusCheckin)" class="gt-xs">
<div :class="getClass(statusCheckin)" class="gt-xs">
<div class="col">
<div class="row col-12 justify-center q-py-sm text-subtitle1">
<!-- <strong v-if="stetusCheckin" style="font-size: 1rem">
ลงเวลาเขางาน
</strong> -->
<!-- <strong v-else style="font-size: 1rem">ลงเวลาออกงาน</strong> -->
<strong v-if="!stetusCheckin && inQueue">
<strong v-if="!statusCheckin && inQueue">
ลงเวลาออกงาน (ระบบกำลงประมวลผล)
</strong>
<strong v-else-if="stetusCheckin && inQueue">
<strong v-else-if="statusCheckin && inQueue">
ลงเวลาเขางาน (ระบบกำลงประมวลผล)
</strong>
<strong v-else-if="stetusCheckin && !inQueue">
<strong v-else-if="statusCheckin && !inQueue">
ลงเวลาเขางาน
</strong>
@ -701,8 +697,10 @@ onMounted(async () => {
*หมายเหต คลกลงเวลาเขางานแลวระบบจะลงเวลาทนท
</p>
<q-btn
:label="stetusCheckin ? 'ลงเวลาเข้างาน' : 'ลงเวลาออกงาน'"
:color="img == null ? 'grey-6' : 'primary'"
:label="statusCheckin ? 'ลงเวลาเข้างาน' : 'ลงเวลาออกงาน'"
:color="
img == null ? 'grey-6' : statusCheckin ? 'primary' : 'red-8'
"
push
size="18px"
:class="$q.screen.gt.xs ? 'q-px-md' : 'full-width q-pa-sm'"
@ -725,23 +723,23 @@ onMounted(async () => {
<!-- top page sticky หนามอถ-->
<q-page-sticky expand position="top" v-if="$q.screen.xs">
<div :class="getClassXS(stetusCheckin)">
<div :class="getClassXS(statusCheckin)">
<div class="col">
<div class="row col-12 justify-right items-center text-body1">
<strong v-if="!stetusCheckin && inQueue">
<div class="row col-12 justify-right items-center text-subtitle1">
<strong v-if="!statusCheckin && inQueue">
ลงเวลาออกงาน (ระบบกำลงประมวลผล)
</strong>
<strong v-else-if="stetusCheckin && inQueue">
<strong v-else-if="statusCheckin && inQueue">
ลงเวลาเขางาน (ระบบกำลงประมวลผล)
</strong>
<strong v-else-if="stetusCheckin && !inQueue"> ลงเวลาเขางาน </strong>
<strong v-else-if="statusCheckin && !inQueue"> ลงเวลาเขางาน </strong>
<strong v-else> ลงเวลาออกงาน </strong>
</div>
<div
class="text-white text-body2 row col-12"
class="text-white text-subtitle1 row col-12"
style="line-height: 1.5rem"
>
{{ date2Thai(Thai) }}
@ -781,8 +779,8 @@ onMounted(async () => {
*หมายเหต คลกลงเวลาเขางานแลวระบบจะลงเวลาทนท
</p>
<q-btn
:label="stetusCheckin ? 'ลงเวลาเข้างาน' : 'ลงเวลาออกงาน'"
:color="img == null ? 'grey-6' : 'primary'"
:label="statusCheckin ? 'ลงเวลาเข้างาน' : 'ลงเวลาออกงาน'"
:color="img == null ? 'grey-6' : statusCheckin ? 'primary' : 'red-8'"
push
size="18px"
:class="$q.screen.gt.xs ? 'q-px-md' : 'full-width q-pa-sm'"
@ -800,20 +798,27 @@ onMounted(async () => {
<!-- แสดงการลงเวลา -->
<q-dialog v-model="modalTime" persistent>
<q-card class="full-width cardNone">
<div :class="getClass(stetusCheckin)">
<div class="col-12 row items-center q-px-md q-py-sm bg-grey-2">
<div class="text-body1 text-center col-12 text-weight-bold">
<span v-if="stetusCheckin">ลงเวลาเข้างานของคุณ</span>
<span v-if="statusCheckin">ลงเวลาเข้างานของคุณ</span>
<span v-else>ลงเวลาออกงานของคุณ</span>
</div>
</div>
<q-card-section class="row col-12 justify-center">
<div class="bg-grey-2 rounded-borders q-pa-md col-11">
<div class="col-12 text-subtitle1 text-center text-weight-medium">
<div
class="rounded-borders q-pa-md col-11"
:class="statusCheckin ? 'bg-primary' : 'bg-red-8'"
>
<div
class="col-12 text-subtitle1 text-center text-white text-weight-medium"
>
{{ date2Thai(Thai) }}
</div>
<div class="row col-12 justify-center q-pt-sm">
<div class="text-h3 text-weight-bold"></div>
<div class="text-h3 text-weight-bold">{{ timeChickin }}</div>
<!-- <div class="text-h3 text-white text-weight-bold"></div> -->
<div class="text-h3 text-white text-weight-bold">
{{ timeChickin }}
</div>
</div>
</div>
<div class="col-12 text-center row q-pt-md">