diff --git a/src/api/12_evaluatePersonal/api.evaluate.ts b/src/api/12_evaluatePersonal/api.evaluate.ts index 90b218f74..493c62a2c 100644 --- a/src/api/12_evaluatePersonal/api.evaluate.ts +++ b/src/api/12_evaluatePersonal/api.evaluate.ts @@ -9,6 +9,7 @@ export default { evaluationMain: () => `${evaluation}`, evaluateGetDetail: (id: string) => `${evaluation}/admin/check-spec/${id}`, + evaluateGetReport: (id: string) => `${evaluation}/report/check-spec-report/${id}`, evaluateGetStep: (id: string) => `${evaluation}/check/admin/${id}`, meeting: () => `${evaluation}/meeting`, diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts index 9074e5cb8..d82276464 100644 --- a/src/api/registry/api.profile.ts +++ b/src/api/registry/api.profile.ts @@ -7,6 +7,7 @@ const report = `${env.API_REPORT_URI}/report/profile/`; const organizationRoot = `${env.API_URI}/profile/organization/list/root`; const registryNew = `${env.API_URI}/org/profile/`; +const avatarNew = `${env.API_URI}/org/profile`; export default { /** * api สังกัด ทะเบียนประวัติเงินเดือน @@ -219,4 +220,5 @@ export default { `${profile}search/new-page/oc/${id}/officer?page=${page}&pageSize=${pageSize}`, orgProfileAvatar: `${registryNew}avatar`, + orgProfileAvatarbyType:(type:string)=> `${avatarNew}${type}/avatar`, }; diff --git a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue index e0550404a..bf0cff16a 100644 --- a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue +++ b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue @@ -274,7 +274,10 @@ function onClickHistory() { .get(config.API.informationHistoryEmployee(profileId.value)) .then((res) => { const data = res.data.result; - rows.value = data; + rows.value = data.sort( + (a: any, b: any) => + new Date(b.lastUpdatedAt).getTime() - new Date(a.lastUpdatedAt).getTime() + ); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 55ff17669..97cccd13e 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -142,8 +142,9 @@ function imageActive(n: any) { function uploadImg() { http - .post(config.API.orgProfileAvatar, { - profileId: profileId.value, + .post(config.API.orgProfileAvatarbyType(empType.value), { + profileId: empType.value == "" ? profileId.value : undefined, + profileEmployeeId: empType.value !== "" ? profileId.value : undefined, }) .then((res) => { fileName.value = res.data.result.avatarName; diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue index e7eb2548b..017944173 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue @@ -80,37 +80,22 @@ async function onClickDowloadFile( fileName: string ) { showLoader(); - const data = Object.assign( - { fullName: profile.value == null ? "" : profile.value.fullName }, - { position: profile.value == null ? "" : profile.value.position }, - { positionLevel: profile.value == null ? "" : profile.value.positionLevel }, - { posNo: profile.value == null ? "" : profile.value.posNo }, - { oc: profile.value == null ? "" : profile.value.oc }, - { - birthDate: - profile.value == null ? "" : date2Thai(profile.value.birthDate), - }, - { govAge: profile.value == null ? "" : profile.value.govAge }, - { - positionLevelNew: - profile.value == null - ? "" - : profile.value.type == "EXPERT" - ? "ชำนาญการ" - : "ชำนาญการพิเศษ", - }, - tp === "EV1_005" || tp === "EV1_007" - ? { organizationName: "หน่วยงาน" } - : null, - tp === "EV1_007" ? { positionName: "ประเภทตำแหน่ง" } : null, - tp === "EV1_007" ? { positionLeaveName: "ระดับตำแหน่ง" } : null - ); - const body = { - template: tp, - reportName: templateName, - data: data, - }; - await genReport(body, fileName); + await http + .get(config.API.evaluateGetReport(id.value)) + .then(async (res) => { + const data = res.data.result; + const body = { + template: tp, + reportName: templateName, + data: data, + }; + await genReport(body, fileName); + hideLoader(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); } /** function เปิด popup ติดต่อผู้ขอประเมิน */ diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue index 96343f55d..24e746be8 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue @@ -64,33 +64,22 @@ async function onClickDowloadFile( fileName: string ) { showLoader(); - const data = Object.assign( - { fullName: profile.value == null ? "" : profile.value.fullName }, - { position: profile.value == null ? "" : profile.value.position }, - { positionLevel: profile.value == null ? "" : profile.value.positionLevel }, - { posNo: profile.value == null ? "" : profile.value.posNo }, - { oc: profile.value == null ? "" : profile.value.oc }, - { - birthDate: - profile.value == null ? "" : date2Thai(profile.value.birthDate), - }, - { govAge: profile.value == null ? "" : profile.value.govAge }, - { - positionLevelNew: - profile.value == null - ? "" - : profile.value.type == "EXPERT" - ? "ชำนาญการ" - : "ชำนาญการพิเศษ", - } - ); - - const body = { - template: tp, - reportName: templateName, - data: data, - }; - await genReport(body, fileName); + await http + .get(config.API.evaluateGetReport(id.value)) + .then(async (res) => { + const data = res.data.result; + const body = { + template: tp, + reportName: templateName, + data: data, + }; + await genReport(body, fileName); + hideLoader(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); } /**