From e3fb686d629b78704c4b323e7b19741d023c06df Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 5 Feb 2025 18:03:34 +0700 Subject: [PATCH] fix --- .../components/probation/MainProbation.vue | 1 + .../05_placement/interface/response/Probation.ts | 1 + src/modules/05_placement/views/09_reportMain.vue | 13 ++++++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 77c234b4e..0f872bbd6 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -342,6 +342,7 @@ function addPersonalData(data: ResProfileProbation) { child2: data.orgChild2, child3: data.orgChild3, child4: data.orgChild4, + rootDna: data.rootDna, }); // ถ้าการเพิ่มข้อมูลสำเร็จ, อัปเดตสถานะของข้อมูล diff --git a/src/modules/05_placement/interface/response/Probation.ts b/src/modules/05_placement/interface/response/Probation.ts index acd70a9ad..2fe4c39c3 100644 --- a/src/modules/05_placement/interface/response/Probation.ts +++ b/src/modules/05_placement/interface/response/Probation.ts @@ -42,6 +42,7 @@ interface ResProfileProbation { rank: string; refCommandNo: string; root: string; + rootDna: string; } export type { ResListProbation, ResProfileProbation }; diff --git a/src/modules/05_placement/views/09_reportMain.vue b/src/modules/05_placement/views/09_reportMain.vue index 4004a450c..2282983dc 100644 --- a/src/modules/05_placement/views/09_reportMain.vue +++ b/src/modules/05_placement/views/09_reportMain.vue @@ -72,6 +72,7 @@ const pdfSrc = ref(); /** tree*/ const filterTree = ref(""); const nodeId = ref(""); +const orgTreeDnaId = ref(""); const nodeLevel = ref(0); const node = ref([]); const expanded = ref([]); @@ -87,9 +88,10 @@ function onUpdateYear(val: number) { reportType.value && fetchDataReport(); } -function onSelectedNode(id: string, level: number) { +function onSelectedNode(id: string, level: number, orgDnaId: string) { nodeId.value = id; nodeLevel.value = level; + orgTreeDnaId.value = orgDnaId; reportType.value && fetchDataReport(); } @@ -99,7 +101,8 @@ function fetchDataReport() { } isLoadPDF.value = true; const queryParams = { - nodeId: nodeId.value, + nodeId: + reportType.value.type === "probation" ? orgTreeDnaId.value : nodeId.value, node: nodeLevel.value, startDate: dateToISO(dateStart.value), endDate: dateToISO(dateEnd.value), @@ -348,7 +351,11 @@ onMounted(() => {