From ed0d84b45c466763e231e4effcb6e3a60ab03a68 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 12 Feb 2026 10:57:01 +0700 Subject: [PATCH] fix(salary):report [emp-08 ,go1] rootID === ancestorDNA --- .../13_salary/components/04_salaryLists/TabMain.vue | 3 ++- .../components/05_salaryListsEmployee/TabMain.vue | 3 ++- src/modules/13_salary/interface/index/Main.ts | 1 + src/modules/13_salary/views/04_salaryLists.vue | 10 +++++++++- src/modules/13_salary/views/05_salaryListsEmployee.vue | 9 +++++++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/modules/13_salary/components/04_salaryLists/TabMain.vue b/src/modules/13_salary/components/04_salaryLists/TabMain.vue index ac12d597f..5da8f0b3d 100644 --- a/src/modules/13_salary/components/04_salaryLists/TabMain.vue +++ b/src/modules/13_salary/components/04_salaryLists/TabMain.vue @@ -40,6 +40,7 @@ const props = defineProps({ roundFilter: { type: Object, require: true }, snapShot: { type: String, require: true }, revisionId: { type: String, require: true }, + ancestorDNA: { type: String, require: true }, }); const total = ref(0); @@ -350,7 +351,7 @@ function onClickDownload(data: DataOption, type: string = "xlsx") { data.id === "go1" ? `${props?.roundFilter?.year}-03-31` : `${props?.roundFilter?.year}-09-30`, - nodeId: props.rootId, + nodeId: data.id === "go1" ? props.ancestorDNA : props.rootId, isRetirement: data.id === "go2-01" ? true : undefined, revisionId: props.revisionId, }; diff --git a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue index aad9c683f..e4f00a7cc 100644 --- a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue +++ b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue @@ -41,6 +41,7 @@ const props = defineProps({ roundFilter: { type: Object, require: true }, snapShot: { type: String, require: true }, revisionId: { type: String, require: true }, + ancestorDNA: { type: String, require: true }, }); const splitterModel = ref(13); @@ -325,7 +326,7 @@ async function onClickDownload(data: DataOption, type: string = "xlsx") { data.id === "emp-08" ? `${props?.roundFilter?.year}-03-31` : `${props?.roundFilter?.year}-09-30`, - nodeId: props.rootId, + nodeId: data.id === "emp-08" ? props.ancestorDNA : props.rootId, revisionId: props.revisionId, }; await http diff --git a/src/modules/13_salary/interface/index/Main.ts b/src/modules/13_salary/interface/index/Main.ts index d9a2de8ca..d66a45f56 100644 --- a/src/modules/13_salary/interface/index/Main.ts +++ b/src/modules/13_salary/interface/index/Main.ts @@ -4,6 +4,7 @@ interface DataOption { type?: string; typeName?: string; keyId?: string; + ancestorDNA?: string; } interface DataOptionShort { diff --git a/src/modules/13_salary/views/04_salaryLists.vue b/src/modules/13_salary/views/04_salaryLists.vue index 9644131ca..74f569ff7 100644 --- a/src/modules/13_salary/views/04_salaryLists.vue +++ b/src/modules/13_salary/views/04_salaryLists.vue @@ -89,6 +89,13 @@ const commandTypeCodeArray = computed(() => { } }); +const ancestorDNA = computed(() => { + return ( + agencyOptionsMain.value.find((e) => e.id === agencyFilter.value) + ?.ancestorDNA || "" + ); +}); + /** function เรียกข้อมูลรอบการขึ้นเงินเดือน*/ async function getRound() { showLoader(); @@ -209,6 +216,7 @@ async function getAgency(id: string) { data.map((x: DataAgency) => ({ id: x.id, name: x.orgRootName, + ancestorDNA: x.ancestorDNA, })) ); agencyOptions.value = agencyOptionsMain.value; @@ -562,7 +570,6 @@ onMounted(async () => { @update:model-value="onChangeSnap" :disable="!isDisable" /> - { :round-filter="roundFilter" :snap-shot="snapFilter" :revision-id="roundFilter.revisionId" + :ancestorDNA="ancestorDNA" />
diff --git a/src/modules/13_salary/views/05_salaryListsEmployee.vue b/src/modules/13_salary/views/05_salaryListsEmployee.vue index 3c7a395c0..2976ef755 100644 --- a/src/modules/13_salary/views/05_salaryListsEmployee.vue +++ b/src/modules/13_salary/views/05_salaryListsEmployee.vue @@ -88,6 +88,13 @@ const commandTypeCodeArray = computed(() => { } }); +const ancestorDNA = computed(() => { + return ( + agencyOptionsMain.value.find((e) => e.id === agencyFilter.value) + ?.ancestorDNA || "" + ); +}); + /** * function เรียกข้อมูลรอบการขึ้นค่าจ้าง */ @@ -205,6 +212,7 @@ async function getAgency(id: string) { data.map((x: DataAgency) => ({ id: x.id, name: x.orgRootName, + ancestorDNA: x.ancestorDNA, })) ); agencyOptions.value = agencyOptionsMain.value; @@ -563,6 +571,7 @@ onMounted(async () => { :round-filter="roundFilter" :snap-shot="snapFilter" :revision-id="roundFilter.revisionId" + :ancestorDNA="ancestorDNA" />