From 7f5c887e297ace7a96c0451d81cd86ab3caef6cb Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 29 Apr 2024 13:24:07 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=9A=E0=B8=9A=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4=E0=B8=99=20=3D>=20tab=20?= =?UTF-8?q?=E0=B8=AD=E0=B8=B7=E0=B9=88=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/14_KPI/api.KPI.ts | 2 + .../components/detailList/02_Evaluator.vue | 283 +++++++++++++++++- .../14_KPI/components/detailList/05_File.vue | 33 +- .../14_KPI/components/detailList/TabMain.vue | 6 +- src/modules/14_KPI/interface/response/Main.ts | 16 +- 5 files changed, 320 insertions(+), 20 deletions(-) diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index 5149ddd7c..7132bd98b 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -9,12 +9,14 @@ const kpiPlan = `${env.API_URI}/kpi/plan`; const kpiCapacity = `${env.API_URI}/kpi/capacity`; const kpiLink = `${env.API_URI}/kpi/link`; const KpiUser = `${env.API_URI}/kpi/user`; +const KpiFile = `${env.API_URI}/salary/file`; export default { KPI, /** รอบการประเมินผล*/ kpiPeriod, kpiPeriodById: (id: string) => `${kpiPeriod}/${id}`, kpiEvaluation, + kpiFile: KpiFile, /** role */ kpiRoleMainList: `${KPI}/role`, diff --git a/src/modules/14_KPI/components/detailList/02_Evaluator.vue b/src/modules/14_KPI/components/detailList/02_Evaluator.vue index 6bee11c56..9a00c9219 100644 --- a/src/modules/14_KPI/components/detailList/02_Evaluator.vue +++ b/src/modules/14_KPI/components/detailList/02_Evaluator.vue @@ -1,3 +1,284 @@ + + + diff --git a/src/modules/14_KPI/components/detailList/05_File.vue b/src/modules/14_KPI/components/detailList/05_File.vue index cf76d7ddc..3136506a1 100644 --- a/src/modules/14_KPI/components/detailList/05_File.vue +++ b/src/modules/14_KPI/components/detailList/05_File.vue @@ -19,6 +19,7 @@ const { messageError, dialogRemove, } = useCounterMixin(); + interface ArrayFileList { id: string; pathName: string; @@ -31,18 +32,20 @@ const documentFile = ref(null); const fileList = ref([]); async function getData() { - // showLoader(); - // await http - // .get(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}`) - // .then((res) => { - // fileList.value = res.data; - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // }); + console.log(config.API.kpiFile); + + showLoader(); + await http + .get(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}`) + .then((res) => { + fileList.value = res.data; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); } async function uploadFileDoc(uploadUrl: string, file: any) { @@ -69,7 +72,6 @@ async function uploadFileDoc(uploadUrl: string, file: any) { } async function clickUpload(file: any) { // const fileName = { fileName: file.name }; - // dialogConfirm( // $q, // async () => { @@ -106,7 +108,7 @@ async function clickUpload(file: any) { function downloadFile(fileName: string) { showLoader(); http - .get(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) + .get(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) .then((res) => { const data = res.data.downloadUrl; window.open(data, "_blank"); @@ -127,7 +129,7 @@ function deleteFile(fileName: string) { dialogRemove($q, async () => { showLoader(); http - .delete(config.API.file + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) + .delete(config.API.kpiFile + `/KPI/ไฟล์เอกสาร/${id.value}/${fileName}`) .then((res) => { success($q, `ลบไฟล์สำเร็จ`); @@ -215,6 +217,7 @@ onMounted(() => { > (12); class="q-pa-none" > - - - + + + diff --git a/src/modules/14_KPI/interface/response/Main.ts b/src/modules/14_KPI/interface/response/Main.ts index 1fdf8ce0e..2d8cea4d2 100644 --- a/src/modules/14_KPI/interface/response/Main.ts +++ b/src/modules/14_KPI/interface/response/Main.ts @@ -26,4 +26,18 @@ interface capacityDetails { level: string; } -export type { ResRound, ResDataCapacity }; +interface ResEvaluator { + createdAt: string; + createdFullName: string; + createdUserId: string; + id: string; + kpiUserEvaluationId: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + reason: string; + topic: string; + type: string; +} + +export type { ResRound, ResDataCapacity, ResEvaluator };