เพิ่ม field typr รายงานสถิติการลงเวลา

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-18 10:29:37 +07:00
parent 915df2cc92
commit 60d67f2720

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'"