From 37cfa0c0538cff4b1e5101a0c5646905ca3769ec Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 6 Dec 2024 13:54:57 +0700 Subject: [PATCH] update reportcheckin --- .../09_leave/views/07_ReportCheckin.vue | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/src/modules/09_leave/views/07_ReportCheckin.vue b/src/modules/09_leave/views/07_ReportCheckin.vue index 978f86ea9..ae8fbfddd 100644 --- a/src/modules/09_leave/views/07_ReportCheckin.vue +++ b/src/modules/09_leave/views/07_ReportCheckin.vue @@ -41,6 +41,11 @@ const optionReport = ref([ { id: "1", name: "รายงานการเข้างาน" }, { id: "2", name: "รายงานการเข้างานสาย" }, ]); +const employeeClass = ref("officer"); +const employeeClassOption = ref([ + { id: "officer", name: "ข้าราชการ กทม. สามัญ" }, + { id: "employee", name: "ลูกจ้างประจำ กทม." }, +]); const filterType = ref("DAY"); const filterTypeMain = ref([ { id: "DAY", name: "รายวัน" }, @@ -92,10 +97,14 @@ async function fetchDataTree() { function onSelectedNode(id: string, level: number) { nodeId.value = id; nodeLevel.value = level; + updateFilterType(filterType.value); } /** function อัปเดทรายงานสถิติการลา*/ async function updateFilterType(type: string) { + if (!nodeId.value || !typeReport.value) { + return false; + } let body = {}; isReport.value = false; isLoadPDF.value = true; @@ -106,6 +115,8 @@ async function updateFilterType(type: string) { startDate: dateToISO(date.value), endDate: dateToISO(date.value), type: filterType.value, + nodeId: nodeId.value, + node: nodeLevel.value, }; break; @@ -117,6 +128,8 @@ async function updateFilterType(type: string) { startDate: dateToISO(startOfWeek), endDate: dateToISO(endOfWeek), type: filterType.value, + nodeId: nodeId.value, + node: nodeLevel.value, }; break; @@ -130,6 +143,8 @@ async function updateFilterType(type: string) { startDate: dateToISO(firstDay), endDate: dateToISO(lastDay), type: filterType.value, + nodeId: nodeId.value, + node: nodeLevel.value, }; break; default: @@ -146,6 +161,8 @@ async function updateFilterType(type: string) { * @param body วันเรื่มต้นและสิ้นสุด */ async function fetchReportTimeRecords(body: any) { + console.log(body); + await http .post(config.API.leaveReportTimeRecords(), body) .then(async (res) => { @@ -230,7 +247,7 @@ function monthYearThai(val: DataDateMonthObject) { else return monthYear2Thai(val.month, val.year); } -function formatWeekDisplay(week: any) { +function formatWeekDisplay(week: Date[]) { if (week) { if (!week[0] || !week[1]) return ""; return `${date2Thai(week[0])} - ${date2Thai(week[1])}`; @@ -261,22 +278,21 @@ onMounted(() => {
-
+
+ style="width: 230px" + > +
@@ -284,7 +300,7 @@ onMounted(() => { {
+
+ +
+
{