Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-01-18 17:01:56 +07:00
commit dcab2e0908
25 changed files with 1253 additions and 1208 deletions

View file

@ -38,10 +38,10 @@ const props = defineProps({
});
const loadingBtn = ref<boolean>(true);
const filterType = ref<string>("daily");
const filterType = ref<string>("DAY");
const filterTypeMain = ref<DataOption[]>([
{ id: "daily", name: "รายวัน" },
{ id: "monthly", name: "รายเดือน" },
{ id: "DAY", name: "รายวัน" },
{ id: "MONTH", name: "รายเดือน" },
]);
const filterTypeOption = ref<DataOption[]>(filterTypeMain.value);
const date = ref<Date>(new Date());
@ -54,9 +54,9 @@ const detailReport = ref<any>();
/** function อัปเดทรายงานสถิติการลา*/
async function updateFilterType() {
filterType.value === "daily"
filterType.value === "DAY"
? updateDte()
: filterType.value === "monthly"
: filterType.value === "MONTH"
? updateMonth()
: false;
}
@ -66,6 +66,7 @@ async function updateDte() {
const body = {
startDate: dateToISO(date.value),
endDate: dateToISO(date.value),
type: filterType.value,
};
fetchReportTimeRecords(body);
}
@ -80,6 +81,7 @@ async function updateMonth() {
const body = {
startDate: dateToISO(firstDay),
endDate: dateToISO(lastDay),
type: filterType.value,
};
fetchReportTimeRecords(body);
}
@ -133,7 +135,7 @@ async function genReportXLSX(data: any) {
},
responseType: "blob",
})
.then(async (res) => {
.then((res) => {
const blob = new Blob([res.data]);
downloadReport(blob, "xlsx");
})
@ -165,7 +167,7 @@ function monthYearThai(val: DataDateMonthObject) {
watch(
() => props.modal,
() => {
filterType.value = "daily";
filterType.value = "DAY";
date.value = new Date();
props.modal && updateFilterType();
}
@ -192,11 +194,11 @@ watch(
map-options
option-label="name"
option-value="id"
use-input
@update:model-value="updateFilterType"
@filter="(inputValue: any,
doneFn: Function) => filterFnOptions(inputValue, doneFn,)"
><template v-slot:no-option>
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
@ -205,7 +207,7 @@ watch(
</template>
</q-select>
</div>
<div class="q-pr-xs col-4" v-if="filterType === 'daily'">
<div class="q-pr-xs col-4" v-if="filterType === 'DAY'">
<datepicker
menu-class-name="modalfix"
v-model="date"
@ -241,7 +243,7 @@ watch(
</template>
</datepicker>
</div>
<div class="q-pr-xs col-4" v-if="filterType === 'monthly'">
<div class="q-pr-xs col-4" v-if="filterType === 'MONTH'">
<datepicker
v-model="dateMonth"
:locale="'th'"

View file

@ -43,14 +43,14 @@ const detailReport = ref<any>();
/** function อัปเดทบัญชีแสดงวันลา */
async function updateLeaveday() {
if (yearType.value === "FULL") {
dateStart.value = new Date(year.value, 9, 1);
dateEnd.value = new Date(year.value + 1, 8, 30);
dateStart.value = new Date(year.value - 1, 9, 1);
dateEnd.value = new Date(year.value, 8, 30);
} else if (yearType.value === "FIRSTHAFT") {
dateStart.value = new Date(year.value, 9, 1);
dateEnd.value = new Date(year.value + 1, 2, 31);
dateStart.value = new Date(year.value - 1, 9, 1);
dateEnd.value = new Date(year.value, 2, 31);
} else if (yearType.value === "SECONDHAFT") {
dateStart.value = new Date(year.value + 1, 3, 1);
dateEnd.value = new Date(year.value + 1, 8, 30);
dateStart.value = new Date(year.value, 3, 1);
dateEnd.value = new Date(year.value, 8, 30);
}
fetchLeaveday(