diff --git a/src/modules/02_users/views/01_user.vue b/src/modules/02_users/views/01_user.vue index d5727f4a..80c6c9e5 100644 --- a/src/modules/02_users/views/01_user.vue +++ b/src/modules/02_users/views/01_user.vue @@ -464,9 +464,9 @@ function checkhideBtnAction(keycloakID: string) { * ดึงข้อมูลรายชื่อผู้ใช้งาน */ onMounted(async () => { + await fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token.role || []; - await fetchOrganizationActive(); }); diff --git a/src/modules/02_users/views/03_permissionsView.vue b/src/modules/02_users/views/03_permissionsView.vue index ca1b5412..4d05e2ff 100644 --- a/src/modules/02_users/views/03_permissionsView.vue +++ b/src/modules/02_users/views/03_permissionsView.vue @@ -295,6 +295,45 @@ async function fetchDataTree(id: string) { const isSuperAdmin = tokenParsedData.value.includes("SUPER_ADMIN"); if (!isSuperAdmin) { nodes.value = []; + } else { + nodes.value = [ + { + labelName: "หน่วยงานทั้งหมด", + orgCode: "", + orgLevel: 0, + orgName: "", + orgRevisionId: "", + orgRootName: "", + orgTreeCode: "", + orgTreeFax: "", + orgTreeId: "", + orgTreeName: "หน่วยงานทั้งหมด", + orgTreeOrder: 0, + orgTreePhoneEx: "", + orgTreePhoneIn: "", + orgTreeRank: "", + orgTreeRankSub: "", + orgTreeShortName: "", + responsibility: "", + totalPosition: 0, + totalPositionCurrentUse: 0, + totalPositionCurrentVacant: 0, + totalPositionNextUse: 0, + totalPositionNextVacant: 0, + totalRootPosition: 0, + totalRootPositionCurrentUse: 0, + totalRootPositionCurrentVacant: 0, + totalRootPositionNextUse: 0, + totalRootPositionNextVacant: 0, + children: [] as NodeTree[], + isOfficer: false, + orgRootDnaId: "", + orgChild1DnaId: "", + orgChild2DnaId: "", + orgChild3DnaId: "", + orgChild4DnaId: "", + }, + ]; } showLoader(); await http @@ -322,7 +361,7 @@ async function fetchDataTree(id: string) { async function fetchDataTable( id: string | null, revisionId: string, - level: number, + level: number ) { showLoader(); reqMaster.id = id === "" ? null : id; @@ -398,7 +437,7 @@ function onDeleteRole(id: string) { await fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type, + reqMaster.type ); success($q, "ลบข้อมูลสำเร็จ"); }) @@ -410,7 +449,7 @@ function onDeleteRole(id: string) { }); }, "ยืนยันการลบสิทธิ์", - "ต้องการยืนยันการลบสิทธิ์นี้หรือไม่ ?", + "ต้องการยืนยันการลบสิทธิ์นี้หรือไม่ ?" ); } @@ -443,7 +482,7 @@ watch( reqMaster.revisionId = ""; filter.value = ""; await fetchDataTree(id); - }, + } ); /** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/ @@ -474,9 +513,9 @@ function checkhideBtnAction(current_holderId: string) { } onMounted(async () => { + fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token.role || []; - await fetchOrganizationActive(); }); @@ -649,7 +688,7 @@ onMounted(async () => { fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type, + reqMaster.type ) " > @@ -736,7 +775,7 @@ onMounted(async () => { onOpenModalPersonal( store.typeOrganizational === 'draft' ? props.row.profileIdNextHolder - : props.row.profileIdCurrentHolder, + : props.row.profileIdCurrentHolder ) " > @@ -896,7 +935,7 @@ onMounted(async () => { fetchDataTable( reqMaster.id, reqMaster.revisionId, - reqMaster.type, + reqMaster.type ) " > diff --git a/src/modules/02_users/views/04_roleOrganization.vue b/src/modules/02_users/views/04_roleOrganization.vue index 5c3cbba1..cdc5c406 100644 --- a/src/modules/02_users/views/04_roleOrganization.vue +++ b/src/modules/02_users/views/04_roleOrganization.vue @@ -235,14 +235,14 @@ watch( () => qureyBody.pageSize, () => { fetchListPerson(true); - }, + } ); /** hook ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(async () => { + await fetchOrg(); // ดึงข้อมูลโครงสร้าง const token = await tokenParsed(); tokenParsedData.value = token?.role || []; - await fetchOrg(); // ดึงข้อมูลโครงสร้าง }); diff --git a/src/modules/02_users/views/05_responsIbilities.vue b/src/modules/02_users/views/05_responsIbilities.vue index a8ba096b..70e0bd21 100644 --- a/src/modules/02_users/views/05_responsIbilities.vue +++ b/src/modules/02_users/views/05_responsIbilities.vue @@ -437,9 +437,9 @@ watch( ); onMounted(async () => { + fetchOrganizationActive(); const token = await tokenParsed(); tokenParsedData.value = token?.role || []; - await fetchOrganizationActive(); }); diff --git a/src/modules/02_users/views/06_rolePositionSalary.vue b/src/modules/02_users/views/06_rolePositionSalary.vue index 2bf4dc93..ee0d4346 100644 --- a/src/modules/02_users/views/06_rolePositionSalary.vue +++ b/src/modules/02_users/views/06_rolePositionSalary.vue @@ -288,9 +288,9 @@ watch( /** hook ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(async () => { + await fatchOrg(); // ดึงข้อมูลโครงสร้าง const token = await tokenParsed(); tokenParsedData.value = token?.role || []; - await fatchOrg(); // ดึงข้อมูลโครงสร้าง });