ปรับ ลงเวลา 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
|
||||
.get(config.API.msgNotificate)
|
||||
.then((res) => {
|
||||
const response = res.data.result
|
||||
const list: notiType[] = []
|
||||
response.map((e: any) => {
|
||||
list.push({
|
||||
id: e.id,
|
||||
sender:
|
||||
e.createdFullName == '' || e.createdFullName == null
|
||||
? 'เจ้าหน้าที่'[0]
|
||||
: e.createdFullName[0],
|
||||
body: e.body ?? '',
|
||||
timereceive: new Date(e.receiveDate),
|
||||
})
|
||||
})
|
||||
notiList.value = list
|
||||
// const response = res.data.result
|
||||
// const list: notiType[] = []
|
||||
// response.map((e: any) => {
|
||||
// list.push({
|
||||
// id: e.id,
|
||||
// sender:
|
||||
// e.createdFullName == '' || e.createdFullName == null
|
||||
// ? 'เจ้าหน้าที่'[0]
|
||||
// : e.createdFullName[0],
|
||||
// body: e.body ?? '',
|
||||
// timereceive: new Date(e.receiveDate),
|
||||
// })
|
||||
// })
|
||||
// notiList.value = list
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err)
|
||||
|
|
@ -299,6 +299,12 @@ function onClickLogout() {
|
|||
})
|
||||
}
|
||||
|
||||
function updateWorkplace() {
|
||||
if (workplace.value === 'in-place') {
|
||||
useLocation.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
// class
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
|
|
@ -325,7 +331,7 @@ onMounted(async () => {
|
|||
<q-card flat class="row col-12 cardNone">
|
||||
<div :class="getClass(stetusCheckin)">
|
||||
<q-toolbar class="text-primary">
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
icon="history"
|
||||
unelevated
|
||||
rounded
|
||||
|
|
@ -335,14 +341,14 @@ onMounted(async () => {
|
|||
:label="$q.screen.gt.xs ? 'ประวัติการลงเวลา' : ''"
|
||||
:class="$q.screen.gt.xs ? 'q-px-md' : ''"
|
||||
@click="router.push('/history')"
|
||||
/>
|
||||
/> -->
|
||||
<q-toolbar-title>
|
||||
<span class="text-white text-body1 text-weight-bold text-center">
|
||||
<span v-if="stetusCheckin">ลงเวลาเข้างาน</span>
|
||||
<span v-else>ลงเวลาออกงาน</span>
|
||||
</span>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
round
|
||||
dense
|
||||
flat
|
||||
|
|
@ -402,8 +408,8 @@ onMounted(async () => {
|
|||
<q-separator color="grey-2" />
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn round dense flat size="13px" class="q-mx-md">
|
||||
</q-btn> -->
|
||||
<!-- <q-btn round dense flat size="13px" class="q-mx-md">
|
||||
<q-icon name="account_circle" size="24px" color="white" />
|
||||
<q-menu>
|
||||
<div class="q-pa-md" style="max-width: 500px">
|
||||
|
|
@ -431,121 +437,8 @@ onMounted(async () => {
|
|||
</q-list>
|
||||
</div>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-btn> -->
|
||||
</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 class="col-12 q-pa-md text-grey-9">
|
||||
<div class="col-12 row justify-center">
|
||||
|
|
@ -658,6 +551,7 @@ onMounted(async () => {
|
|||
unchecked-icon="panorama_fish_eye"
|
||||
val="in-place"
|
||||
label="ในสถานที่"
|
||||
@update:model-value="updateWorkplace"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="workplace"
|
||||
|
|
@ -665,6 +559,7 @@ onMounted(async () => {
|
|||
unchecked-icon="panorama_fish_eye"
|
||||
val="off-site"
|
||||
label="นอกสถานที่"
|
||||
@update:model-value="updateWorkplace"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -825,4 +720,4 @@ onMounted(async () => {
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue