From 8b6d581ddf85dc371c363bc49167a40772baddf0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 7 Jan 2026 17:21:41 +0700 Subject: [PATCH] fix:orgTreeDnaId --- src/modules/09_leave/views/06_ReportMain.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/09_leave/views/06_ReportMain.vue b/src/modules/09_leave/views/06_ReportMain.vue index 2034622be..2f1fca1c3 100644 --- a/src/modules/09_leave/views/06_ReportMain.vue +++ b/src/modules/09_leave/views/06_ReportMain.vue @@ -112,6 +112,7 @@ const nodeId = ref(""); const nodeLevel = ref(0); const node = ref([]); const expanded = ref([]); +const orgTreeDnaId = ref(""); /** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/ async function fetchDataTree() { @@ -135,6 +136,7 @@ function onSelectedNode(data: any) { nodeId.value = data.orgTreeId; nodeLevel.value = data.orgLevel; expandedModal.value = false; + orgTreeDnaId.value = data.orgTreeDnaId; updateLeaveday(); } @@ -219,6 +221,7 @@ async function fetchLeaveday( startDate: Date, endDate: Date ) { + const nodeIdVal = typeReport.value === 3 ? orgTreeDnaId.value : nodeId.value; const body = { type: year === "FULL" @@ -232,7 +235,7 @@ async function fetchLeaveday( : "WEEKLY", startDate: dateToISO(startDate), endDate: dateToISO(endDate), - nodeId: nodeId.value, + nodeId: nodeIdVal, node: nodeLevel.value, }; @@ -334,6 +337,7 @@ function filterOption(val: string, update: any, typeOp: string) { function clearData() { nodeId.value = ""; nodeLevel.value = 0; + orgTreeDnaId.value = ""; org.value = ""; typeReport.value = null; yearType.value = "FULL"; @@ -410,7 +414,7 @@ function getReport() { : "WEEKLY", startDate: dateToISO(dateStart.value), endDate: dateToISO(dateEnd.value), - nodeId: nodeId.value, + nodeId: orgTreeDnaId.value, node: nodeLevel.value, }; http