Merge branch 'develop' into devTee

# Conflicts:
#	src/modules/09_leave/components/2_Leave/DetailLeave.vue
This commit is contained in:
setthawutttty 2023-11-03 18:01:38 +07:00
commit 5d34c40b41
11 changed files with 257 additions and 148 deletions

View file

@ -15,30 +15,34 @@ onMounted(() => {
});
// API
function fecthLeaveList() {
const data: DataRows = [
const data = [
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลาป่วย",
name: "นายกัณฐิมา กาฬสินธ์ุ",
Date: "",
status: "1",
Date: "2023-11-03",
status: "NEW",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลากิจส่วนตัว",
name: "นายนครชัย วันดี",
Date: "",
status: "3",
Date: "2023-11-01",
status: "APPROVE",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลากิจส่วนตัว",
name: "นายกัณฐิมา กาฬสินธ์ุ",
Date: "",
status: "2",
Date: "2023-11-02",
status: "PENDING",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลาป่วย",
name: "นายปิยรมย์ ศิริธาราฟ",
Date: "",
status: "2",
Date: "2023-11-01",
status: "PENDING",
},
];
fetchList(data); // stores
@ -52,65 +56,9 @@ function changTab() {
<template>
<div class="toptitle text-dark col-12 row items-center">รายการลา</div>
<div>
<!-- <q-card flat bordered class="col-12 q-mt-sm"> -->
<q-card bordered flat>
<q-tabs
v-model="leaveStore.tab"
dense
align="left"
inline-label
class="rounded-borders"
indicator-color="primary"
active-bg-color="teal-1"
active-class="text-primary"
>
<q-tab
@click="changTab"
name="1"
label="รายการลาที่อยู่ระหว่างดำเนินการ"
>
<q-badge
color="grey-4"
:class="
leaveStore.tab == '1'
? 'q-px-sm text-weight-medium text-primary q-ml-xl bg-teal-1'
: 'q-px-sm text-weight-medium text-black q-ml-xl'
"
:label="leaveStore.amounttab1"
rounded
/>
</q-tab>
<q-tab @click="changTab" name="2" label="รายการลาทั้งหมด">
<q-badge
color="grey-4"
:class="
leaveStore.tab == '2'
? 'q-px-sm text-weight-medium text-primary q-ml-xl bg-teal-1'
: 'q-px-sm text-weight-medium text-black q-ml-xl'
"
:label="leaveStore.amounttab2"
rounded
/>
</q-tab>
</q-tabs>
<q-separator />
<q-tab-panels v-model="leaveStore.tab" animated>
<q-tab-panel name="1">
<!-- <TableList1 /> -->
<ToolBar />
<TableList />
</q-tab-panel>
<q-tab-panel name="2">
<!-- <TabList2Vue /> -->
<ToolBar />
<TableList />
</q-tab-panel>
</q-tab-panels>
<!-- </q-card> -->
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<ToolBar />
<TableList />
</q-card>
</div>
</template>
<style scoped></style>

View file

@ -3,7 +3,6 @@ import { onMounted, ref, useAttrs } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import Table from "@/modules/09_leave/components/4_specialTime/Table.vue";
import { useSpecialTimeStore } from "@/modules/09_leave/stores/SpecialTimeStore";
import DialogReason from "@/components/Dialogs/PopupReason.vue";
@ -14,11 +13,6 @@ const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const { hideLoader, monthYear2Thai } = mixin;
const filter = ref<string>(""); //search data table
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
const attrs = ref<any>(useAttrs());
const modalUnapprove = ref(false);
const pagination = ref({
// sortBy: "desc",
@ -53,38 +47,51 @@ const resetFilter = () => {
onMounted(async () => {
fecthList([
{
id: "00000000-0000-0000-0000-000000000000",
fullname: "นางสาวณัฐกา ชมสิน",
date: "2023-10-30",
date: "2023-11-01 08:54",
dateFix: "2023-10-30",
type: "Checkin",
reason: "ลืม",
unapprove: "1",
approve: "0",
timeStamp: " 08:00 น.",
startTimeMorning: "08:00",
endTimeMorning: "12:00",
startTimeAfternoon: "08:00",
endTimeAfternoon: "12:00",
status: "PENDING",
},
{
id: "00000000-0000-0000-0000-000000000000",
fullname: "นางสาวรัชภรณ์ ภักดี",
date: "2023-10-30",
dateFix: "2023-10-30",
type: "Checkin",
reason: "ลืม",
unapprove: "1",
approve: "0",
timeStamp: " 08:00 น.",
date: "2023-10-30 08:55",
dateFix: "2023-10-29",
startTimeMorning: "08:00",
endTimeMorning: "12:00",
startTimeAfternoon: null,
endTimeAfternoon: null,
status: "APPROVE",
},
{
id: "00000000-0000-0000-0000-000000000000",
fullname: "นางสาวภาพรรณ ลออ",
date: "2023-10-30",
date: "2023-10-31 18:54",
dateFix: "2023-10-30",
type: "Checkin",
reason: "ลืม",
unapprove: "1",
approve: "0",
timeStamp: " 08:00 น.",
startTimeMorning: null,
endTimeMorning: null,
startTimeAfternoon: "13:00",
endTimeAfternoon: "16:30",
status: "REJECT",
},
]);
await hideLoader();
});
const selectedDate = ref<string>("");
const dateMonth = ref<any>({
month: new Date().getMonth(),
year: new Date().getFullYear(),
});
const monthYearThai = (val: any) => {
if (val == null) return "";
else return monthYear2Thai(val.month, val.year);
};
</script>
<template>
@ -92,8 +99,139 @@ onMounted(async () => {
รายการลงเวลากรณเศษ
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div>
<Table
<div class="row col-12 q-col-gutter-sm q-mb-sm">
<div class="q-gutter-sm">
<datepicker
v-model="selectedDate"
:locale="'th'"
autoApply
month-picker
:enableTimePicker="false"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:model-value="monthYearThai(dateMonth)"
dense
outlined
hide-bottom-space
style="width: 130px"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-space />
<q-input
class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="dataSpecialTime.visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="dataSpecialTime.columns"
option-value="name"
options-cover
style="min-width: 150px"
class="col-xs-12 col-sm-3 col-md-2"
/>
</div>
<div class="col-12">
<d-table
:columns="dataSpecialTime.columns"
:rows="dataSpecialTime.rows"
:filter="filterKeyword"
row-key="tb-list"
flat
bordered
:paging="true"
dense
v-model:pagination="pagination"
:visible-columns="dataSpecialTime.visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.status == 'PENDING'"
color="orange"
class="q-px-md"
dense
unelevated
@click="unapprove(props.row.fullname)"
>ไมอน</q-btn
>
<q-btn
v-if="props.row.status == 'PENDING'"
color="primary"
class="q-px-md q-ml-sm"
dense
unelevated
>อน</q-btn
>
<q-badge v-if="props.row.status == 'APPROVE'" rounded outline color="green" label="อนุมัติ" />
<q-badge v-if="props.row.status == 'REJECT'" rounded outline color="red" label="ไม่อนุมัติ" />
</q-td>
</q-tr>
</template>
</d-table>
<!-- <Table
style="max-height: 80vh"
:rows="dataSpecialTime.rows"
:columns="dataSpecialTime.columns"
@ -120,6 +258,7 @@ onMounted(async () => {
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.status == 'PENDING'"
color="orange"
class="q-px-md"
dense
@ -130,14 +269,19 @@ onMounted(async () => {
<span>{{ props.row.unapprove }}</span>
</q-td>
<q-td auto-width>
<q-btn color="primary" class="q-px-md" dense unelevated
<q-btn
v-if="props.row.status == 'PENDING'"
color="primary"
class="q-px-md"
dense
unelevated
>อน</q-btn
>
<span>{{ props.row.approve }}</span>
</q-td>
</q-tr>
</template>
</Table>
</Table> -->
</div>
</q-card>
<DialogReason