diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index c6ec1dc18..ba8cff83d 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -94,12 +94,14 @@ export default { orgProfileEmp: `${orgEmployeePos}/profile`, orgSearchProfileEmp: `${orgProfile}-employee/search`, - orgProfileById: (id: string, type: string) => `${orgProfile}${type}/${id}`, + orgProfileById: (id: string, type: string) => + `${orgProfile}${type}/admin/${id}`, orgDeceasedProfile: `${orgPos}/profile/search`, // orgCheckAvatar: (id: string) => `${orgProfile}/avatar/profileId/${id}`, + orgCheckAvatarCard: (path: string) => `${organization}/${path}`, //noPernission changePosition: `${organization}/placement/change-position`, changePositionById: `${organization}/placement/change-position/profile-all`, diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 93ce13e62..d2e3de68a 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -128,6 +128,8 @@ export default { `${registryNew}${type}/discipline/${disciplineId}`, profileNewDisciplineHisByDisciplineId: (disciplineId: string, type: string) => `${registryNew}${type}/discipline/history/${disciplineId}`, + disciplineListCard: (profileId: string, type: string) => + `${registryNew}${type}/discipline/admin/${profileId}`, // noPermission // ปฏิบัติราชการพิเศษ profileNewDuty: (type: string) => `${registryNew}${type}/duty`, @@ -144,6 +146,8 @@ export default { `${registryNew}${type}/government/${id}`, profileNewGovernmentHistory: (id: string, type: string) => `${registryNew}${type}/government/history/${id}`, + profileNewGovernmentCard: (id: string, type: string) => + `${registryNew}${type}/government/admin/${id}`, // noPermission //การลา profileNewLeave: (type: string) => `${registryNew}${type}/leave`, @@ -153,6 +157,8 @@ export default { `${registryNew}${type}/leave/history/${id}`, profileCheckDate: () => `${env.API_URI}/leave/user/check`, profileNewLeaveType: () => `${env.API_URI}/leave/type`, + leaveListCard: (id: string, type: string) => + `${registryNew}${type}/leave/admin/${id}`, //noPermission /** ตำแหน่งเงินเดือน*/ profileSalaryNew: (type: string) => `${registryNew}${type}/salary`, @@ -162,6 +168,8 @@ export default { `${registryNew}${type}/salary/history/${profileId}`, profileSalarySwapNew: (type: string, id: string, type2: string) => `${registryNew}${type2}/salary/swap/${type}/${id}`, + salaryListCard: (id: string, type: string) => + `${registryNew}${type}/salary/admin/${id}`, //noPermission // ประวัติการเปลี่ยนชื่อ-นามสกุล profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`, diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index 2576a9247..f798c1628 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -73,7 +73,11 @@ function fetchDataProfile(data: DataProfile) { } function fetchCheckAvatar(id: string) { - http.get(config.API.orgCheckAvatar(id)).then((res) => { + const path = + props.type === "employee" + ? `profile-employee/avatar/profileEmployeeId-admin/${id}` + : `profile/avatar/profileId-admin/${id}`; + http.get(config.API.orgCheckAvatarCard(path)).then((res) => { const data = res.data.result; if (data.avatarName) { fetchProfile(id, data.avatarName); @@ -101,10 +105,10 @@ function onclickViewinfo() { watch( () => props.data, - () => { - const dataMain = props.data as DataProfile; + async () => { + const dataMain = (await props.data) as DataProfile; profileId.value = dataMain.profileId; - fetchDataProfile(dataMain); + await fetchDataProfile(dataMain); } ); diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index a917080ea..a5ce956cc 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -4,6 +4,7 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import { useRouter, useRoute } from "vue-router"; +import { checkPermissionGet } from "@/utils/permissions"; /** importType*/ import type { PersonalImformation } from "@/components/information/interface/response/Information"; @@ -101,8 +102,8 @@ async function fetchInformation(id: string) { `${empType.value == "employee" ? `-${empType.value}` : ""}` ) ) - .then((res) => { - const data = res.data.result; + .then(async (res) => { + const data = await res.data.result; imformation.prefix = data.prefix ? data.prefix : "-"; imformation.citizenId = data.citizenId ? data.citizenId : "-"; imformation.firstName = data.firstName ? data.firstName : "-"; @@ -115,7 +116,7 @@ async function fetchInformation(id: string) { avatar.position = data.position ? data.position : "-"; if (data.avatarName) { - fetchProfile(data.id as string, data.avatarName); + await fetchProfile(data.id as string, data.avatarName); } else { avatar.avatar = ""; } @@ -136,13 +137,13 @@ async function fetchProfileGov(id: string) { showLoader(); await http .get( - config.API.profileNewGovernmentById( + config.API.profileNewGovernmentCard( id, `${empType.value == "employee" ? `-${empType.value}` : ""}` ) ) - .then((res) => { - const data = res.data.result; + .then(async (res) => { + const data = await res.data.result; goverment.oc = data.org !== "" ? data.org : "-"; goverment.posNo = data.posMasterNo !== "" ? data.posMasterNo : "-"; goverment.position = data.position !== "" ? data.position : "-"; @@ -183,8 +184,10 @@ watch( ? "employee" : "officer"; - fetchInformation(props.id); - fetchProfileGov(props.id); + await Promise.all([ + fetchInformation(props.id), + fetchProfileGov(props.id), + ]); } } } @@ -197,14 +200,10 @@ watch(modal, (newValue) => { }); async function fetchProfile(id: string, avatarName: string) { - showLoader(); await http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) .then(async (res) => { avatar.avatar = await res.data.downloadUrl; - }) - .finally(() => { - hideLoader(); }); } @@ -259,6 +258,11 @@ async function fetchProfile(id: string, avatarName: string) {
{ mode, formFilter, labelOption, - nodeData + nodeData, }; }); diff --git a/src/modules/04_registryPerson/views/list.vue b/src/modules/04_registryPerson/views/list.vue index 0efa3d10c..5c1ca07d8 100644 --- a/src/modules/04_registryPerson/views/list.vue +++ b/src/modules/04_registryPerson/views/list.vue @@ -143,9 +143,9 @@ function fetchDataPerson() { queryParams.type = empType.value; } - if (nodeData.node !== null && nodeData.nodeId !== null) { - queryParams.node = nodeData.node; - queryParams.nodeId = nodeData.nodeId; + if (store.nodeData.node !== null && store.nodeData.nodeId !== null) { + queryParams.node = store.nodeData.node; + queryParams.nodeId = store.nodeData.nodeId; } http .get( @@ -256,12 +256,14 @@ async function selectType() { : "เลือกหน่วยงาน"; } else { // แต่ถ้าประเภทเดิมระบบจะใช้ filter เดิมที่เคยค้นหาไว้ + if ( store.formFilter.keyword != "" || store.labelOption.posType != "ทั้งหมด" || store.labelOption.posLevel != "ทั้งหมด" || - store.formFilter.isShowRetire != null || - store.formFilter.isProbation != null + store.formFilter.isShowRetire || + store.formFilter.isProbation || + store.nodeData.nodeId != null ) { store.formFilter.page = 1; fetchDataPerson(); diff --git a/src/modules/05_placement/components/Transfer/transferRegistry.vue b/src/modules/05_placement/components/Transfer/transferRegistry.vue index bfb31fd1b..61ae20540 100644 --- a/src/modules/05_placement/components/Transfer/transferRegistry.vue +++ b/src/modules/05_placement/components/Transfer/transferRegistry.vue @@ -325,7 +325,9 @@ onMounted(async () => { /> รายละเอียดการขอโอนของ{{ responseData.fullname }}
+ + + + + + + - - { + .then(async (res) => { const data = res.data.result; fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`; position.value = data.position; + if (data.avatarName) { - fetchProfile(data.id as string, data.avatarName); + await fetchProfile(data.id as string, data.avatarName); } }) .catch((err) => { @@ -133,7 +135,15 @@ watch(
{{ position }}
-
+ +
([ function fetchListDiscipline() { showLoader(); http - .get( - config.API.profileNewDisciplineByProfileId( - profileId.value, - employeeClass.value - ) - ) + .get(config.API.disciplineListCard(profileId.value, employeeClass.value)) .then((res) => { rows.value = res.data.result; }) diff --git a/src/modules/13_salary/components/InfoLeave.vue b/src/modules/13_salary/components/InfoLeave.vue index edcdf1846..022788bad 100644 --- a/src/modules/13_salary/components/InfoLeave.vue +++ b/src/modules/13_salary/components/InfoLeave.vue @@ -105,7 +105,7 @@ const visibleColumns = ref([ function fetchListSalary() { showLoader(); http - .get(config.API.profileNewLeaveById(profileId.value, employeeClass.value)) + .get(config.API.leaveListCard(profileId.value, employeeClass.value)) .then((res) => { rows.value = res.data.result; }) @@ -203,7 +203,7 @@ onMounted(() => {