ปรับ ลงเวลา checkin
This commit is contained in:
parent
e0cfab5181
commit
61b5c4bdb1
1 changed files with 29 additions and 134 deletions
|
|
@ -61,20 +61,20 @@ async function fetchNotifications() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.msgNotificate)
|
.get(config.API.msgNotificate)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const response = res.data.result
|
// const response = res.data.result
|
||||||
const list: notiType[] = []
|
// const list: notiType[] = []
|
||||||
response.map((e: any) => {
|
// response.map((e: any) => {
|
||||||
list.push({
|
// list.push({
|
||||||
id: e.id,
|
// id: e.id,
|
||||||
sender:
|
// sender:
|
||||||
e.createdFullName == '' || e.createdFullName == null
|
// e.createdFullName == '' || e.createdFullName == null
|
||||||
? 'เจ้าหน้าที่'[0]
|
// ? 'เจ้าหน้าที่'[0]
|
||||||
: e.createdFullName[0],
|
// : e.createdFullName[0],
|
||||||
body: e.body ?? '',
|
// body: e.body ?? '',
|
||||||
timereceive: new Date(e.receiveDate),
|
// timereceive: new Date(e.receiveDate),
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
notiList.value = list
|
// notiList.value = list
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err)
|
messageError($q, err)
|
||||||
|
|
@ -299,6 +299,12 @@ function onClickLogout() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateWorkplace() {
|
||||||
|
if (workplace.value === 'in-place') {
|
||||||
|
useLocation.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// class
|
// class
|
||||||
const getClass = (val: boolean) => {
|
const getClass = (val: boolean) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -325,7 +331,7 @@ onMounted(async () => {
|
||||||
<q-card flat class="row col-12 cardNone">
|
<q-card flat class="row col-12 cardNone">
|
||||||
<div :class="getClass(stetusCheckin)">
|
<div :class="getClass(stetusCheckin)">
|
||||||
<q-toolbar class="text-primary">
|
<q-toolbar class="text-primary">
|
||||||
<q-btn
|
<!-- <q-btn
|
||||||
icon="history"
|
icon="history"
|
||||||
unelevated
|
unelevated
|
||||||
rounded
|
rounded
|
||||||
|
|
@ -335,14 +341,14 @@ onMounted(async () => {
|
||||||
:label="$q.screen.gt.xs ? 'ประวัติการลงเวลา' : ''"
|
:label="$q.screen.gt.xs ? 'ประวัติการลงเวลา' : ''"
|
||||||
:class="$q.screen.gt.xs ? 'q-px-md' : ''"
|
:class="$q.screen.gt.xs ? 'q-px-md' : ''"
|
||||||
@click="router.push('/history')"
|
@click="router.push('/history')"
|
||||||
/>
|
/> -->
|
||||||
<q-toolbar-title>
|
<q-toolbar-title>
|
||||||
<span class="text-white text-body1 text-weight-bold text-center">
|
<span class="text-white text-body1 text-weight-bold text-center">
|
||||||
<span v-if="stetusCheckin">ลงเวลาเข้างาน</span>
|
<span v-if="stetusCheckin">ลงเวลาเข้างาน</span>
|
||||||
<span v-else>ลงเวลาออกงาน</span>
|
<span v-else>ลงเวลาออกงาน</span>
|
||||||
</span>
|
</span>
|
||||||
</q-toolbar-title>
|
</q-toolbar-title>
|
||||||
<q-btn
|
<!-- <q-btn
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
|
|
@ -402,8 +408,8 @@ onMounted(async () => {
|
||||||
<q-separator color="grey-2" />
|
<q-separator color="grey-2" />
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
<q-btn round dense flat size="13px" class="q-mx-md">
|
<!-- <q-btn round dense flat size="13px" class="q-mx-md">
|
||||||
<q-icon name="account_circle" size="24px" color="white" />
|
<q-icon name="account_circle" size="24px" color="white" />
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<div class="q-pa-md" style="max-width: 500px">
|
<div class="q-pa-md" style="max-width: 500px">
|
||||||
|
|
@ -431,121 +437,8 @@ onMounted(async () => {
|
||||||
</q-list>
|
</q-list>
|
||||||
</div>
|
</div>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<!-- <div class="col-2">
|
|
||||||
<q-btn
|
|
||||||
icon="history"
|
|
||||||
unelevated
|
|
||||||
rounded
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
color="white"
|
|
||||||
:label="$q.screen.gt.xs ? 'ประวัติการลงเวลา' : ''"
|
|
||||||
:class="$q.screen.gt.xs ? 'q-px-md' : ''"
|
|
||||||
@click="router.push('/history')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<!-- <span class="text-body1 text-weight-bold col-6 text-center">
|
|
||||||
<span v-if="stetusCheckin">ลงเวลาเข้างาน</span>
|
|
||||||
<span v-else>ลงเวลาออกงาน</span>
|
|
||||||
</span> -->
|
|
||||||
<!-- <div class="col-4 text-right">
|
|
||||||
<q-btn
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
size="13px"
|
|
||||||
class="q-mx-md"
|
|
||||||
:disable="notiList.length === 0"
|
|
||||||
>
|
|
||||||
<q-icon name="notifications" size="24px" color="white" />
|
|
||||||
|
|
||||||
<q-badge
|
|
||||||
rounded
|
|
||||||
v-show="notiList.length > 0"
|
|
||||||
color="negative"
|
|
||||||
text-color="white"
|
|
||||||
floating
|
|
||||||
>{{ notiList.length }}</q-badge
|
|
||||||
>
|
|
||||||
<q-menu v-model="notiTrigger" max-width="480px" :offset="[0, 10]">
|
|
||||||
<div class="q-px-md q-py-sm row col-12 items-center">
|
|
||||||
<div class="text-subtitle1 text-weight-medium">
|
|
||||||
การแจ้งเตือน
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<q-list
|
|
||||||
style="min-width: 300px"
|
|
||||||
v-for="n in notiList"
|
|
||||||
:key="n.id"
|
|
||||||
>
|
|
||||||
<q-item v-ripple class="mytry q-py-xs" dense>
|
|
||||||
<q-item-section avatar top style="min-width: 40px">
|
|
||||||
<q-avatar color="primary" size="22px" text-color="white">
|
|
||||||
<span class="text-weight-medium text-uppercase">{{
|
|
||||||
n.sender
|
|
||||||
}}</span>
|
|
||||||
</q-avatar>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>
|
|
||||||
<q-item-label caption class="text-black">{{
|
|
||||||
n.body
|
|
||||||
}}</q-item-label>
|
|
||||||
<q-item-label
|
|
||||||
caption
|
|
||||||
class="row items-center text-grey-7"
|
|
||||||
>{{ date2Thai(n.timereceive) }}</q-item-label
|
|
||||||
>
|
|
||||||
</q-item-section>
|
|
||||||
<q-btn
|
|
||||||
size="sm"
|
|
||||||
unelevated
|
|
||||||
dense
|
|
||||||
icon="mdi-close"
|
|
||||||
class="mybtn q-mx-xs"
|
|
||||||
@click="onClickDelete(n.id)"
|
|
||||||
></q-btn>
|
|
||||||
</q-item>
|
|
||||||
<q-separator color="grey-2" />
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
<q-btn
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
icon="account_circle"
|
|
||||||
style="font-size: 16px"
|
|
||||||
>
|
|
||||||
<q-menu>
|
|
||||||
<div class="q-pa-md" style="max-width: 500px">
|
|
||||||
<q-list>
|
|
||||||
<q-item>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon color="primary" name="account_circle" />
|
|
||||||
</q-item-section>
|
|
||||||
|
|
||||||
<q-item-section>{{ fullName }}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-item class="text-center">
|
|
||||||
<q-item-section>
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn
|
|
||||||
color="primary"
|
|
||||||
label="ออกจากระบบ"
|
|
||||||
push
|
|
||||||
size="sm"
|
|
||||||
@click="onClickLogout"
|
|
||||||
/></q-item-label>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</div> </q-menu
|
|
||||||
></q-btn>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-pa-md text-grey-9">
|
<div class="col-12 q-pa-md text-grey-9">
|
||||||
<div class="col-12 row justify-center">
|
<div class="col-12 row justify-center">
|
||||||
|
|
@ -658,6 +551,7 @@ onMounted(async () => {
|
||||||
unchecked-icon="panorama_fish_eye"
|
unchecked-icon="panorama_fish_eye"
|
||||||
val="in-place"
|
val="in-place"
|
||||||
label="ในสถานที่"
|
label="ในสถานที่"
|
||||||
|
@update:model-value="updateWorkplace"
|
||||||
/>
|
/>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-model="workplace"
|
v-model="workplace"
|
||||||
|
|
@ -665,6 +559,7 @@ onMounted(async () => {
|
||||||
unchecked-icon="panorama_fish_eye"
|
unchecked-icon="panorama_fish_eye"
|
||||||
val="off-site"
|
val="off-site"
|
||||||
label="นอกสถานที่"
|
label="นอกสถานที่"
|
||||||
|
@update:model-value="updateWorkplace"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -825,4 +720,4 @@ onMounted(async () => {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue