From 60d67f27209a9061708f85a477c132a57e58c813 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 18 Jan 2024 10:29:37 +0700 Subject: [PATCH 01/10] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20field=20typr=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99=E0=B8=AA=E0=B8=96=E0=B8=B4=E0=B8=95=E0=B8=B4?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Work/DialogReport.vue | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/modules/09_leave/components/1_Work/DialogReport.vue b/src/modules/09_leave/components/1_Work/DialogReport.vue index 8c7acf537..cb670d2a6 100644 --- a/src/modules/09_leave/components/1_Work/DialogReport.vue +++ b/src/modules/09_leave/components/1_Work/DialogReport.vue @@ -38,10 +38,10 @@ const props = defineProps({ }); const loadingBtn = ref(true); -const filterType = ref("daily"); +const filterType = ref("DAY"); const filterTypeMain = ref([ - { id: "daily", name: "รายวัน" }, - { id: "monthly", name: "รายเดือน" }, + { id: "DAY", name: "รายวัน" }, + { id: "MONTH", name: "รายเดือน" }, ]); const filterTypeOption = ref(filterTypeMain.value); const date = ref(new Date()); @@ -54,9 +54,9 @@ const detailReport = ref(); /** 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,)" - > - + \ No newline at end of file diff --git a/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue b/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue index 28b44173c..149c6ab01 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/Tab1.vue @@ -120,32 +120,45 @@ onMounted(async () => {