From 344ecd4424047551abedb1417427e93c7f031222 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 20 Nov 2024 17:21:35 +0700 Subject: [PATCH] =?UTF-8?q?fix=20report=20=E0=B9=82=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=20?= =?UTF-8?q?=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CardProfile.vue | 4 +-- src/components/Dialogs/PopupPersonalNew.vue | 10 ++++-- .../05_placement/interface/index/Main.ts | 5 ++- .../components/TreeTable.vue | 32 +++++++++---------- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index cefd8967a..00eb02094 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -36,12 +36,12 @@ const modalPersonal = ref(false); const profileId = ref(""); -function fetchDataProfile(data: DataProfile) { +async function fetchDataProfile(data: DataProfile) { if (data.profileId) { fetchCheckAvatar(data.profileId); } profile.id = data.profileId; - profile.fullName = `${data.prefix ?? ""}${data.firstName ?? ""} ${ + profile.fullName = `${data.rank ? data.rank : data.prefix ?? ""}${data.firstName ?? ""} ${ data.lastName ?? "" } `; diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index ca0761734..02ff81390 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -104,7 +104,11 @@ async function fetchInformation(id: string) { ) .then(async (res) => { const data = await res.data.result; - imformation.prefix = data.prefix ? data.prefix : "-"; + imformation.prefix = data.rank + ? data.rank + : data.prefix + ? data.prefix + : "-"; imformation.citizenId = data.citizenId ? data.citizenId : "-"; imformation.firstName = data.firstName ? data.firstName : "-"; imformation.lastName = data.lastName ? data.lastName : "-"; @@ -112,7 +116,9 @@ async function fetchInformation(id: string) { imformation.age = data.birthDate ? calculateAge(data.birthDate) : "-"; imformation.gender = data.gender ?? "-"; - avatar.fullname = `${data.prefix}${data.firstName} ${data.lastName}`; + avatar.fullname = `${data.rank ? data.rank : data.prefix}${ + data.firstName + } ${data.lastName}`; avatar.position = data.position ? data.position : "-"; if (data.avatarName) { diff --git a/src/modules/05_placement/interface/index/Main.ts b/src/modules/05_placement/interface/index/Main.ts index fd2827982..82cfc0073 100644 --- a/src/modules/05_placement/interface/index/Main.ts +++ b/src/modules/05_placement/interface/index/Main.ts @@ -260,6 +260,7 @@ interface DataProfile { status: string; positionType?: string; positionLevel?: string; + rank: string; } interface tableType { @@ -376,8 +377,6 @@ interface DataPermissions { tab7: TabPermissions; } - - export type { DataOption, DataOptionInsignia, @@ -407,7 +406,7 @@ export type { AppointTopic, AppointTopicMain, DataPermissions, - TabPermissions + TabPermissions, }; export { AddressDataDefualt, FamilyDataDefualt }; diff --git a/src/modules/16_positionEmployee/components/TreeTable.vue b/src/modules/16_positionEmployee/components/TreeTable.vue index 05acee25c..df9228308 100644 --- a/src/modules/16_positionEmployee/components/TreeTable.vue +++ b/src/modules/16_positionEmployee/components/TreeTable.vue @@ -106,7 +106,7 @@ const listMenu = ref([ const documentItems = ref([ { name: "รายงานสรุปจำนวนกรอบอัตรากำลังของลูกจ้างประจำกรุงเทพมหานคร", - val: "report4", + val: "report4-employee", }, ]); @@ -338,21 +338,21 @@ function getSummary() { /** function DownloadReport*/ async function onClickDownloadReport(val: string, name: string) { // รอ API - // showLoader(); - // await http - // .get(config.API.orgReport(val) + `/${orgRootId.value}`) - // .then(async (res) => { - // const data = res.data.result; - // if (data) { - // await genreport(data, name); - // } - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(() => { - // hideLoader(); - // }); + showLoader(); + await http + .get(config.API.orgReport(val) + `/${treeId.value}`) + .then(async (res) => { + const data = res.data.result; + if (data) { + await genreport(data, name); + } + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } const pagination = ref({