From 11e11933cc7699567aa3253b85ee02d99dbe64b7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 1 Dec 2023 17:44:35 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20=20filte?= =?UTF-8?q?r=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=E0=B8=AA=E0=B8=96=E0=B8=B4=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/3_Report/DetailReport.vue | 198 ++++++++++++------ src/modules/09_leave/views/ReportMain.vue | 21 +- 2 files changed, 150 insertions(+), 69 deletions(-) diff --git a/src/modules/09_leave/components/3_Report/DetailReport.vue b/src/modules/09_leave/components/3_Report/DetailReport.vue index 6a80c059c..7086336b6 100644 --- a/src/modules/09_leave/components/3_Report/DetailReport.vue +++ b/src/modules/09_leave/components/3_Report/DetailReport.vue @@ -17,12 +17,8 @@ const { messageError, showLoader, hideLoader, date2Thai, monthYear2Thai } = const typeReport = route.params.type.toString(); const titleReport = computed(() => { const title = - typeReport === "daily" - ? "รายงานสรุปบันทึกการลงเวลาปฏิบัติงานเป็นรายวัน" - : typeReport === "monthly" - ? "รายงานสรุปบันทึกการลงเวลาปฏิบัติงานเป็นรายเดือน" - : typeReport === "yearly" - ? "รายงานสรุปบันทึกการลงเวลาปฏิบัติงานเป็นรายปี" + typeReport === "time-records" + ? "รายงานสรุปบันทึกการลงเวลาปฏิบัติงาน" : typeReport === "leaveday" ? "บัญชีแสดงวันลา" : ""; @@ -37,25 +33,56 @@ const dateMonth = ref({ const year = ref(new Date().getFullYear()); const dateStart = ref(new Date()); const dateEnd = ref(new Date()); -const employeeClass = ref(""); +const employeeClass = ref("employee"); +const yearType = ref("fullyear"); +const filterType = ref("daily"); function monthYearThai(val: DataDateMonthObject) { if (val == null) return ""; else return monthYear2Thai(val.month, val.year); } +const filterTypeMain = ref([ + { id: "daily", name: "รายวัน" }, + { id: "monthly", name: "รายเดือน" }, + { id: "yearly", name: "รายปี" }, +]); const employeeClassMain = ref([ { id: "employee", name: "ข้าราชการ" }, { id: "perm", name: "ลูกจ้างประจำ" }, ]); +const yearTypeOptionMain = ref([ + { id: "fullyear", name: "รายปี" }, + { id: "halfyear", name: "ครึ่งปี" }, +]); const employeeClassOption = ref(employeeClassMain.value); +const yearTypeOptionOption = ref(yearTypeOptionMain.value); +const filterTypeOption = ref(filterTypeMain.value); -function filterFnOptions(val: any, update: Function) { - update(() => { - employeeClassOption.value = employeeClassMain.value.filter( - (v: DataOption) => v.name.indexOf(val) > -1 - ); - }); +function filterFnOptions(val: any, update: Function, type: string) { + switch (type) { + case "filterType": + update(() => { + filterTypeOption.value = filterTypeMain.value.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); + break; + case "employeeClass": + update(() => { + employeeClassOption.value = employeeClassMain.value.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); + break; + case "yearType": + update(() => { + yearTypeOptionOption.value = yearTypeOptionMain.value.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); + break; + } } const splitterModel = ref(14); @@ -99,7 +126,87 @@ function backHistory() {
-
+
+ + +
+ +
+ + +
+
+ + +
+ + +
+ + +
แสดงรายงาน
+
+
+ + +