diff --git a/src/modules/09_leave/components/3_Report/DetailReport.vue b/src/modules/09_leave/components/3_Report/DetailReport.vue index 2483038c7..a9bc15dae 100644 --- a/src/modules/09_leave/components/3_Report/DetailReport.vue +++ b/src/modules/09_leave/components/3_Report/DetailReport.vue @@ -47,7 +47,7 @@ const dateMonth = ref({ }); const year = ref(new Date().getFullYear()); const dateStart = ref(new Date(year.value, 9, 1)); -const dateEnd = ref(new Date(year.value, 8, 30)); +const dateEnd = ref(new Date(year.value + 1, 8, 30)); const employeeClass = ref("employee"); const yearType = ref("FULL"); const filterType = ref("daily"); @@ -155,8 +155,7 @@ async function fetchLeaveday( showLoader(); const body = { - type: year, - year: 2024, + type: year === "FULL" ? "FULL" : "HAFT", startDate: dateToISO(startDate), endDate: dateToISO(endDate), }; @@ -274,13 +273,13 @@ async function genReportXLSX(data: any) { async function updateLeaveday() { if (yearType.value === "FULL") { dateStart.value = new Date(year.value, 9, 1); - dateEnd.value = new Date(year.value, 8, 30); + dateEnd.value = new Date(year.value + 1, 8, 30); } else if (yearType.value === "FIRSTHAFT") { dateStart.value = new Date(year.value, 9, 1); - dateEnd.value = new Date(year.value, 2, 31); + dateEnd.value = new Date(year.value + 1, 2, 31); } else if (yearType.value === "SECONDHAFT") { - dateStart.value = new Date(year.value, 3, 1); - dateEnd.value = new Date(year.value, 8, 30); + dateStart.value = new Date(year.value + 1, 2, 31); + dateEnd.value = new Date(year.value + 1, 8, 30); } fetchLeaveday(