Merge branch 'develop' into setthawut
# Conflicts: # src/views/HomeView.vue
This commit is contained in:
commit
06c7083eff
6 changed files with 82 additions and 44 deletions
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue