From 4774fadf95cad17f61531c55554c0eefccf89311 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 14 Jan 2025 15:34:04 +0700 Subject: [PATCH 001/142] =?UTF-8?q?fix=20mindate=20=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=8A=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogAddEmployee.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue index 1da8f2be4..59ec45930 100644 --- a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue +++ b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue @@ -223,15 +223,20 @@ function filterSelector(val: string, update: Function, refData: string) { } } -/** - * ฟังก์ชันคำนวนอายุ - */ +/** ฟังก์ชันคำนวนอายุ*/ function calculateMaxDate() { const today = new Date(); today.setFullYear(today.getFullYear() - 18); return today; } +/** function เช็คอายุไม่เกิน 60 ปี*/ +function calculateMinDate() { + const today = new Date(); + today.setFullYear(today.getFullYear() - 60); // ลดปีลงไป 60 ปี + return today; +} + /** * ฟังก์ชันบันทึกข้อมูลลูกจ้างชั่วคราว */ @@ -390,6 +395,7 @@ watch( Date: Wed, 15 Jan 2025 16:10:21 +0700 Subject: [PATCH 002/142] fix size Profile --- src/modules/04_registryPerson/views/detailView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index a06fa80b6..1ca8790e8 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -168,8 +168,8 @@ function resizeImage(file: File): Promise { img.onload = () => { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); - const width = 150; - const height = 200; + const width = 354; + const height = 472; // ปรับขนาดภาพ canvas.width = width; @@ -1111,7 +1111,7 @@ onMounted(async () => { From c4596b89980c16e487f159d3bd27722ba9badda2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 15 Jan 2025 16:20:26 +0700 Subject: [PATCH 003/142] =?UTF-8?q?fix=20columns=20=E0=B8=88=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=E0=B8=A5=E0=B8=B3=E0=B8=94=E0=B8=B1=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=9C?= =?UTF-8?q?=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DialogSortEducation.vue | 163 +++++++++--------- 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue index 0b9f5578a..c1960f4c4 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue @@ -108,18 +108,7 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - { - name: "isEducation", - align: "left", - label: "เป็นวุฒิการศึกษาในตำแหน่ง", - sortable: true, - field: "isEducation", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => (v === true ? "ใช่" : "ไม่ใช่"), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, + { name: "degree", align: "left", @@ -143,82 +132,94 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "fundName", + name: "isEducation", align: "left", - label: "ทุน", + label: "เป็นวุฒิการศึกษาในตำแหน่ง", sortable: true, - field: "fundName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "gpa", - align: "left", - label: "เกรดเฉลี่ย", - sortable: true, - field: "gpa", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "country", - align: "left", - label: "ประเทศ", - sortable: true, - field: "country", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "other", - align: "left", - label: "ข้อมูลการติดต่อ", - sortable: true, - field: "other", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "duration", - align: "left", - label: "ระยะเวลา", - sortable: true, - field: "duration", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "durationYear", - align: "left", - label: "ระยะเวลาหลักสูตร (ปี)", - sortable: true, - field: "durationYear", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "note", - align: "left", - label: "หมายเหตุ", - sortable: true, - field: "note", + field: "isEducation", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (v) => (v === true ? "ใช่" : "ไม่ใช่"), sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + // { + // name: "fundName", + // align: "left", + // label: "ทุน", + // sortable: true, + // field: "fundName", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "gpa", + // align: "left", + // label: "เกรดเฉลี่ย", + // sortable: true, + // field: "gpa", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "country", + // align: "left", + // label: "ประเทศ", + // sortable: true, + // field: "country", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "other", + // align: "left", + // label: "ข้อมูลการติดต่อ", + // sortable: true, + // field: "other", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "duration", + // align: "left", + // label: "ระยะเวลา", + // sortable: true, + // field: "duration", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "durationYear", + // align: "left", + // label: "ระยะเวลาหลักสูตร (ปี)", + // sortable: true, + // field: "durationYear", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "note", + // align: "left", + // label: "หมายเหตุ", + // sortable: true, + // field: "note", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // sort: (a: string, b: string) => + // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, ]); /** * fiunction จัดลำดับ From 7f004f48d151dcb72c0585686f982be6d948a41a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 16 Jan 2025 14:20:05 +0700 Subject: [PATCH 004/142] =?UTF-8?q?fix=20=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=A8=E0=B8=B6=E0=B8=81=E0=B8=A9=E0=B8=B2=E0=B8=9A=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=88=E0=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonalDetail/DetailMain.vue | 26 +++++++++---------- .../PersonalDetail/Information/Certicate.vue | 4 +-- .../PersonalDetail/Information/Education.vue | 14 +++++++--- .../05_placement/interface/index/Main.ts | 4 +-- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/modules/05_placement/components/PersonalDetail/DetailMain.vue b/src/modules/05_placement/components/PersonalDetail/DetailMain.vue index 4b75284f9..0e5bf0ce5 100644 --- a/src/modules/05_placement/components/PersonalDetail/DetailMain.vue +++ b/src/modules/05_placement/components/PersonalDetail/DetailMain.vue @@ -224,22 +224,22 @@ async function fetchData() { data.education.map((row: any) => { listRow.push({ id: guidCheck(row.id) ?? "", - educationLevel: row.educationLevel ?? "", - educationLevelId: guidCheck(row.educationLevelId) ?? "", - institute: row.institute ?? "", - degree: row.degree ?? "", - field: row.field ?? "", - gpa: row.gpa ?? "", - country: row.country ?? "", - duration: row.duration ?? "", - other: row.other ?? "", - fundName: row.fundName ?? "", + educationLevel: row.educationLevel ?? "-", + educationLevelId: guidCheck(row.educationLevelId) ?? "-", + institute: row.institute ?? "-", + degree: row.degree ?? "-", + field: row.field ?? "-", + gpa: row.gpa ?? "-", + country: row.country ?? "-", + duration: row.duration ?? "-", + other: row.other ?? "-", + fundName: row.fundName ?? "-", durationYear: row.durationYear ?? 0, finishDate: row.finishDate ?? new Date(), isDate: row.isDate ? "true" : "false", - startDate: row.startDate ? new Date(row.startDate) : new Date(), - endDate: row.endDate ? new Date(row.endDate) : new Date(), - positionPath: row.positionPath ?? "", + startDate: row.startDate ? new Date(row.startDate) : "", + endDate: row.endDate ? new Date(row.endDate) : "", + positionPath: row.positionPath ?? "-", isEducation: row.isEducation ? true : false, }); }); diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue b/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue index e672d9044..446df1a7f 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Certicate.vue @@ -544,10 +544,10 @@ onMounted(() => { v-if="col.name == 'issueDate' || col.name == 'expireDate'" class="table_ellipsis" > - {{ date2Thai(col.value) }} + {{ col.value ? date2Thai(col.value) : "-" }}
- {{ col.value }} + {{ col.value ? col.value : "-" }}
diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Education.vue b/src/modules/05_placement/components/PersonalDetail/Information/Education.vue index d9ab751de..1cd7825b1 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Education.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Education.vue @@ -696,7 +696,9 @@ watch(visibleColumns, (count: String[], prevCount: String[]) => { onMounted(async () => { await fetchLevel(); await fetchPositionPath(); + rows.value = props.data; + rowsData.value = props.data; }); diff --git a/src/modules/06_retirement/router.ts b/src/modules/06_retirement/router.ts index a6e9f27e3..5ad3f78fc 100644 --- a/src/modules/06_retirement/router.ts +++ b/src/modules/06_retirement/router.ts @@ -58,8 +58,12 @@ const dismissOrderEmp = () => import("@/modules/06_retirement/views/08_dismissOrderEmp.vue"); const outDetail = () => import("@/modules/06_retirement/components/06_dismissOrder/Detail.vue"); +const outDetailEmp = () => + import("@/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue"); const outDetailOnly = () => import("@/modules/06_retirement/components/06_dismissOrder/Detail.vue"); +const outDetailOnlyEmp = () => + import("@/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue"); /** รายงาน*/ @@ -311,6 +315,16 @@ export default [ Role: "STAFF", }, }, + { + path: "/retirementEmployee/dismiss-order/:id", + name: "outDetailEmp", + component: outDetailEmp, + meta: { + Auth: true, + Key: "SYS_DISMISS_EMP", + Role: "STAFF", + }, + }, { path: "/retirement/dismiss-order-detail/:id", name: "outDetailOnly", @@ -321,6 +335,16 @@ export default [ Role: "STAFF", }, }, + { + path: "/retirementEmployee/dismiss-order-detail/:id", + name: "outDetailOnlyEmp", + component: outDetailOnlyEmp, + meta: { + Auth: true, + Key: "SYS_DISMISS_EMP", + Role: "STAFF", + }, + }, { path: "/retirement/report", diff --git a/src/modules/06_retirement/views/06_dismissOrder.vue b/src/modules/06_retirement/views/06_dismissOrder.vue index 6091089bb..37ab5f30b 100644 --- a/src/modules/06_retirement/views/06_dismissOrder.vue +++ b/src/modules/06_retirement/views/06_dismissOrder.vue @@ -154,7 +154,7 @@ function openModalOrder() { async function getData() { showLoader(); await http - .get(config.API.retirementOut) + .get(config.API.retirementOut+`/officer`) .then((res: any) => { const data = res.data.result; rows.value = data; diff --git a/src/modules/06_retirement/views/08_dismissOrderEmp.vue b/src/modules/06_retirement/views/08_dismissOrderEmp.vue index df760b20d..c34ce6568 100644 --- a/src/modules/06_retirement/views/08_dismissOrderEmp.vue +++ b/src/modules/06_retirement/views/08_dismissOrderEmp.vue @@ -154,19 +154,19 @@ function openModalOrder() { async function getData() { showLoader(); await http - .get(config.API.retirementOut) + .get(config.API.retirementOut + `/employee`) .then((res: any) => { const data = res.data.result; rows.value = data; rowsData.value = data; filters.value = data; + hideLoader(); }) .catch((e) => { messageError($q, e); - }) - .finally(() => { hideLoader(); - }); + }) + .finally(() => {}); } async function clickDelete(id: string) { @@ -209,7 +209,9 @@ onMounted(async () => { + + + + {{ fileData?.fileName }} + +
+ + + +
+
+
+
diff --git a/src/modules/04_registryPerson/interface/request/Government.ts b/src/modules/04_registryPerson/interface/request/Government.ts index a7d38ca56..89faa2225 100644 --- a/src/modules/04_registryPerson/interface/request/Government.ts +++ b/src/modules/04_registryPerson/interface/request/Government.ts @@ -12,7 +12,7 @@ interface DatAssistance { agency: string; commandNo: string; document: string; - isUpload: boolean; + // isUpload: boolean; } export type { DataActing, DatAssistance }; diff --git a/src/modules/04_registryPerson/interface/response/Government.ts b/src/modules/04_registryPerson/interface/response/Government.ts index 5638cb5d7..e4ef15454 100644 --- a/src/modules/04_registryPerson/interface/response/Government.ts +++ b/src/modules/04_registryPerson/interface/response/Government.ts @@ -33,4 +33,11 @@ interface ResAssistanceData { profileId: string; } -export type { ResActingPosData, ResAssistanceData }; +interface ResFileData { + downloadUrl: string; + fileName: string; + path: string; + pathname: string; +} + +export type { ResActingPosData, ResAssistanceData, ResFileData }; From 15c1c2038f47395c6cd979f8c7a9e99be634fc82 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 28 Jan 2025 17:44:16 +0700 Subject: [PATCH 076/142] no message --- .../detail/GovernmentInformation/06_HelpGovernment.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue index e348cade5..1b431ec0e 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -199,12 +199,7 @@ function onSubmit() { async function uploadProfile(id: string) { await http .post( - config.API.subFile( - "ทะเบียนประวัติ", - "ปฏิบัติราชการพิเศษ", - profileId.value, - id - ), + config.API.subFile("ทะเบียนประวัติ", "ช่วยราชการ", profileId.value, id), { replace: true, fileList: [ @@ -264,7 +259,7 @@ async function onDownloadFile(id: string, isLoad: boolean = true) { .get( config.API.subFileByFileName( "ทะเบียนประวัติ", - "ปฏิบัติราชการพิเศษ", + "ช่วยราชการ", profileId.value, id, "เอกสารหลักฐาน" From 20118de309b37452edad653df5df4dd8a4c14b9d Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 28 Jan 2025 18:27:41 +0700 Subject: [PATCH 077/142] fixing score probation --- .../components/probation/FormEvaluation/FormEvaluateScore.vue | 4 ++-- .../probation/FormEvaluation/FormEvaluateScoreAdd.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index a2c3c0cc1..a6f1eb53c 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -391,7 +391,7 @@ function putformData() { develop_self_learning_percent: Number(self_learning_percent.value), develop_training_seminar_percent: Number(training_seminar_percent.value), develop_other_training_percent: Number(other_training_percent.value), - achievement_score: Number(score1.value), + achievement_score: Number(score1Per60.value), achievement_percent: Number(percent_score1.value), achievement_score_total: Number(achievement_score_total.value), achievement_result: Number(achievement_result.value), @@ -399,7 +399,7 @@ function putformData() { behavior_percent: Number(percent_score2.value), behavior_score_total: Number(behavior_score_total.value), behavior_result: Number(behavior_result.value), - sum_score: Number(score1.value) + Number(score2.value), + sum_score: (Number(score1Per60.value) + Number(score2.value)) / 2, sum_percent: percent_sum.value, chairman_dated: dateToISO(dateAutherise.value), develop_result: Number(develop_result.value), diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue index fc66cbd80..2aaa5d924 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue @@ -363,7 +363,7 @@ const putformData = () => { develop_self_learning_percent: Number(self_learning_percent.value), develop_training_seminar_percent: Number(training_seminar_percent.value), develop_other_training_percent: Number(other_training_percent.value), - achievement_score: Number(score1.value), + achievement_score: Number(score1Per60.value), achievement_percent: Number(percent_score1.value), achievement_score_total: Number(achievement_score_total.value), achievement_result: Number(achievement_result.value), @@ -371,7 +371,7 @@ const putformData = () => { behavior_percent: Number(percent_score2.value), behavior_score_total: Number(behavior_score_total.value), behavior_result: Number(behavior_result.value), - sum_score: Number(score1.value) + Number(score2.value), + sum_score: (Number(score1Per60.value) + Number(score2.value)) / 2, sum_percent: percent_sum.value, develop_result: Number(develop_result.value), chairman_dated: dateToISO(dateAutherise.value), From e92997302b40fd56a44d14cad3a70290d4f94ea3 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 29 Jan 2025 09:56:04 +0700 Subject: [PATCH 078/142] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=B1=E0=B8=9E=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 5 + .../detail/Achievement/03_Insignia.vue | 197 +++++++++++++----- .../Achievement/04_DeclarationHonor.vue | 83 +++++++- .../04_PerformSpecialWork.vue | 85 +++++++- .../components/detail/Other/03_Document7.vue | 10 +- .../PersonalInformation/06_SpecialSkill.vue | 85 +++++++- .../04_registryPerson/interface/index/Main.ts | 39 ++++ .../interface/index/performSpecialWork.ts | 1 + .../interface/request/DeclarationHonor.ts | 1 + .../interface/request/Insignia.ts | 1 + .../interface/response/DeclarationHonor.ts | 1 + .../interface/response/Insignia.ts | 1 + .../04_registryPerson/stores/insignia.ts | 47 +++-- 13 files changed, 448 insertions(+), 108 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index b4042f38d..60bf53e6a 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -1,6 +1,7 @@ import env from "../index"; const registryNew = `${env.API_URI}/org/profile`; +const org = `${env.API_URI}/org`; const metadata = `${env.API_URI}/org/metadata/`; export default { @@ -42,6 +43,10 @@ export default { profileNewInsign: (type: string) => `${registryNew}${type}/insignia`, profileNewInsignByProfileId: (profileId: string, type: string) => `${registryNew}${type}/insignia/${profileId}`, + + orgInsigniaActive: () => + `${org}/insignia/insignia-type/active`, + profileNewInsignById: (dataId: string, type: string) => `${registryNew}${type}/insignia/${dataId}`, profileNewInsignHisById: (dataId: string, type: string) => diff --git a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue index 786cc67b9..bde2c4bcc 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue @@ -15,6 +15,9 @@ import type { DataOption, DataOptionInsignia, InsigniaOps, + InsigniasType, + InsigniasTypeSub, + ResFileData, } from "@/modules/04_registryPerson/interface/index/Main"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/Insignia"; import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Insignia"; @@ -37,7 +40,9 @@ const { onSearchDataTable, } = mixin; -const fileUpload = ref(); +const isUpload = ref(false); +const fileUpload = ref(null); +const fileData = ref(null); const uploadUrl = ref(""); /** props*/ const isLeave = defineModel("isLeave", { @@ -76,8 +81,10 @@ const OpsFilter = ref({ insigniaOptions: [], }); -const insigniaOptions = ref([]); -const insigniaOptionsMain = ref([]); +const insigniaOptions = ref([]); +const insigniaOptionsMain = ref([]); +const insigniaOptionsName = ref([]); +const insigniaOptionsNameMain = ref([]); //ต้วลือกรายการครื่องราช const Ops = ref({ insigniaOptions: [], @@ -118,7 +125,7 @@ const columns = ref([ field: "insigniaId", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Ops.value.insigniaOptions.find((r) => r.id === v)?.name, + format: (v) => store.allNameInsignia.find((r) => r.id === v)?.name, sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, @@ -305,7 +312,7 @@ const columnsHistory = ref([ field: "insigniaId", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Ops.value.insigniaOptions.find((r) => r.id === v)?.name, + format: (v) => store.allNameInsignia.find((r) => r.id === v)?.name, sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, @@ -487,18 +494,21 @@ async function fetchData() { } } -/** fetch ข้อมูลเครื่องราชอิสริยาภรณ์*/ -async function fetchInsignia() { +/** ดึง */ +async function getInsigniaActive() { showLoader(); - try { - const res = await http.get(config.API.insigniaOrg); - const data = res.data.result; - mapInsigniaOption(data); - } catch (error) { - messageError($q, error); - } finally { - hideLoader(); - } + http + .get(config.API.orgInsigniaActive()) + .then((res) => { + const data = res.data.result; + mapInsigniaOption(data); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); } /** @@ -514,15 +524,18 @@ async function addEditData(editStatus: boolean = false) { const method = editStatus ? "patch" : "post"; const reqBody: RequestItemsObject = { ...insigniaForm, + isUpload: !isEdit.value ? undefined : isUpload.value, profileEmployeeId: !editStatus && empType.value !== "" ? profileId.value : undefined, + profileId: !editStatus && empType.value === "" ? profileId.value : undefined, + }; try { await http[method](url, reqBody).then(async (res) => { - if (fileUpload.value && res.data.result) { - await uploadProfile(res.data.result); + if ((fileUpload.value && id.value) || res.data.result) { + await uploadProfile(id.value); } }); @@ -574,19 +587,37 @@ async function uploadFileURL(uploadUrl: string, file: any) { "Content-Type": file.type, }, }) - .then(() => { - fileUpload.value = undefined; + .then(async (res) => { + if (res.status == 200) { + await isUploadFn(); + } + fileUpload.value = null; }) .catch((err) => { messageError($q, err); }); } +async function isUploadFn() { + await http + .patch(config.API.profileNewInsignById(id.value, empType.value), { + isUpload: fileUpload.value ? true : false, + }) + .then(async (res) => {}) + + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + /** * ฟังก์ชันโหลไฟลเอกสารหลักฐาน * @param id รายการที่ต้องการโหลด */ - async function onDownloadFile(id: string) { +async function onDownloadFile(id: string, isLoad: boolean = true) { showLoader(); await http .get( @@ -599,8 +630,11 @@ async function uploadFileURL(uploadUrl: string, file: any) { ) ) .then(async (res) => { - const data = res.data.downloadUrl; - window.open(data, "_blank"); + const data = res.data; + fileData.value = data; + if (isLoad) { + window.open(data.downloadUrl, "_blank"); + } }) .catch((err) => { messageError($q, err); @@ -631,13 +665,28 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) { insigniaForm.refCommandDate = row.refCommandDate; insigniaForm.refCommandNo = row.refCommandNo; insigniaForm.note = row.note; + isUpload.value = row.isUpload; - const insigniaTypeFilter = insigniaOptionsMain.value.filter( - (r: any) => r.typeId === insigniaType.value + if (isUpload.value) { + onDownloadFile(row.id, false); + } + const list = store.insigniaTypeOpMain; + + const insigniaTypeFilter = list.filter( + (r: InsigniasType) => r.id === insigniaType.value ); if (insigniaTypeFilter.length > 0) { - OpsFilter.value.insigniaOptions = insigniaTypeFilter; - insigniaOptions.value = OpsFilter.value.insigniaOptions; + const type = insigniaTypeFilter; + const name = insigniaTypeFilter[0].insignias.map( + (item: InsigniasTypeSub) => ({ + ...item, + name: `${item.name} (${item.shortName})`, + }) + ); + insigniaOptions.value = type; + insigniaOptionsMain.value = type; + insigniaOptionsName.value = name; + insigniaOptionsNameMain.value = name; } } else { clearData(); @@ -687,29 +736,46 @@ function onSubmit() { * @param refData type ที่กำหนด ของ input นั้นๆ */ function filterSelector(val: string, update: Function, refData: string) { - switch (refData) { - case "insigniaOptions": - update(() => { - insigniaOptions.value = OpsFilter.value.insigniaOptions.filter( - (v: DataOption) => v.name.indexOf(val) > -1 - ); - }); - break; - default: - break; + if (refData == "type") { + update(() => { + insigniaOptions.value = store.insigniaTypeOpMain.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); + } else if (refData == "insigniaOptions") { + update(() => { + insigniaOptionsName.value = insigniaOptionsNameMain.value.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); } } /** ค้นหาลำดับชั้น*/ -function insigniaTypeSelection(check: boolean) { +function insigniaTypeSelection(check: boolean, id: string) { if (check) { insigniaForm.insigniaId = ""; - } - const insigniaTypeFilter = insigniaOptionsMain.value.filter( - (r: any) => r.typeId === insigniaType.value - ); - if (insigniaTypeFilter.length > 0) { - OpsFilter.value.insigniaOptions = insigniaTypeFilter; + const data = store.insigniaTypeOpMain.find( + (item: InsigniasType) => item.id == id + ); + if (data) { + const listData = data.insignias.map((item: InsigniasTypeSub) => ({ + id: item.id, + createdAt: item.createdAt, + createdUserId: item.createdUserId, + lastUpdatedAt: item.lastUpdatedAt, + lastUpdateUserId: item.lastUpdateUserId, + createdFullName: item.createdFullName, + lastUpdateFullName: item.lastUpdateFullName, + name: `${item.name} (${item.shortName})`, + shortName: item.shortName, + level: item.level, + isActive: item.isActive, + note: item.note, + insigniaTypeId: item.insigniaTypeId, + })); + insigniaOptionsNameMain.value = listData; + } } } @@ -729,7 +795,9 @@ function clearData() { insigniaForm.refCommandNo = ""; insigniaForm.refCommandDate = null; insigniaForm.note = ""; - fileUpload.value = undefined; + fileUpload.value = null; + isUpload.value = false; + fileData.value = null; } function serchDataTable() { @@ -751,10 +819,9 @@ function serchDataTableHistory() { /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(async () => { await fetchData(); - store.insigniaOption.length === 0 ? await fetchInsignia() : ""; - Ops.value.insigniaOptions = store.insigniaOption; + store.insigniaTypeOpMain.length === 0 ? await getInsigniaActive() : ""; - insigniaOptionsMain.value = store.insigniaOption; + insigniaOptionsMain.value = store.insigniaTypeOpMain; insigniaOptions.value = store.insigniaOption; }); @@ -1064,12 +1131,12 @@ onMounted(async () => { v-model="insigniaType" class="inputgreen" :label="`${'ลำดับชั้น'}`" - :options="store.insigniaTypeOp" + :options="insigniaOptions" :rules="[(val:string) => !!val || `${'กรุณาเลือกลำดับชั้น'}`]" @filter="(inputValue:string, - doneFn:Function) => filterSelector(inputValue, doneFn,'insigniaOptions' + doneFn:Function) => filterSelector(inputValue, doneFn,'type' ) " - @update:modelValue="insigniaTypeSelection(true)" + @update:modelValue="(val:any)=>insigniaTypeSelection(true,val)" > + + + + {{ fileData?.fileName }} + +
+ + + +
+
+
+
diff --git a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue index 98649d300..bbd549ce8 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -11,7 +11,10 @@ import config from "@/app.config"; import type { QTableProps } from "quasar"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/DeclarationHonor"; -import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; +import type { + DataOption, + ResFileData, +} from "@/modules/04_registryPerson/interface/index/Main"; import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/DeclarationHonor"; import DialogHeader from "@/components/DialogHeader.vue"; @@ -34,13 +37,14 @@ const profileId = ref( route.params.id ? route.params.id.toString() : "" ); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); - +const isUpload = ref(false); +const fileUpload = ref(null); +const fileData = ref(null); /** props*/ const isLeave = defineModel("isLeave", { required: true, }); -const fileUpload = ref(); const uploadUrl = ref(""); const typeOp = ref([ @@ -282,6 +286,7 @@ async function addEditData(editStatus: boolean = false) { const method = editStatus ? "patch" : "post"; const reqBody: RequestItemsObject = { ...declHonorForm, + isUpload: !isEdit.value ? undefined : isUpload.value, profileEmployeeId: !editStatus && empType.value !== "" ? profileId.value : undefined, profileId: @@ -295,8 +300,8 @@ async function addEditData(editStatus: boolean = false) { try { await http[method](url, reqBody).then(async (res) => { - if (fileUpload.value && res.data.result) { - await uploadProfile(res.data.result); + if ((fileUpload.value && id.value) || res.data.result) { + await uploadProfile(id.value); } }); await fetchData(); @@ -352,19 +357,38 @@ async function uploadFileURL(uploadUrl: string, file: any) { "Content-Type": file.type, }, }) - .then(() => { - fileUpload.value = undefined; + .then(async (res) => { + if (res.status == 200) { + await isUploadFn(); + } + fileUpload.value = null; }) .catch((err) => { messageError($q, err); }); } +async function isUploadFn() { + await http + .patch(config.API.profileNewHonorById(id.value, empType.value), { + isUpload: fileUpload.value ? true : false, + isDate: declHonorForm.isDate === "true" ? true : false, + }) + .then(async (res) => {}) + + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + /** * ฟังก์ชันโหลไฟลเอกสารหลักฐาน * @param id รายการที่ต้องการโหลด */ -async function onDownloadFile(id: string) { +async function onDownloadFile(id: string, isLoad: boolean = true) { showLoader(); await http .get( @@ -377,8 +401,11 @@ async function onDownloadFile(id: string) { ) ) .then(async (res) => { - const data = res.data.downloadUrl; - window.open(data, "_blank"); + const data = res.data; + fileData.value = data; + if (isLoad) { + window.open(data.downloadUrl, "_blank"); + } }) .catch((err) => { messageError($q, err); @@ -404,6 +431,12 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) { declHonorForm.refCommandDate = row.refCommandDate; declHonorForm.type = row.type; declHonorForm.isDate = row.isDate ? "true" : "false"; + + isUpload.value = row.isUpload; + + if (isUpload.value) { + onDownloadFile(row.id, false); + } } else { clearData(); } @@ -456,6 +489,10 @@ function clearData() { declHonorForm.type = ""; declHonorForm.refCommandDate = null; declHonorForm.isDate = "false"; + + fileUpload.value = null; + isUpload.value = false; + fileData.value = null; } function serchDataTable() { @@ -890,6 +927,7 @@ onMounted(() => {
{
+ + + + {{ fileData?.fileName }} + +
+ + + +
+
+
+
diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue index 3937c6d79..4fc0bdbdd 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue @@ -10,6 +10,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/index/performSpecialWork"; +import type { ResFileData } from "@/modules/04_registryPerson/interface/index/Main"; import DialogHeader from "@/components/DialogHeader.vue"; import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue"; @@ -33,8 +34,13 @@ const profileId = ref( route.params.id ? route.params.id.toString() : "" ); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); -const fileUpload = ref(); + const uploadUrl = ref(""); + +const isUpload = ref(false); +const fileUpload = ref(null); +const fileData = ref(null); + /** props*/ const isLeave = defineModel("isLeave", { required: true, @@ -51,7 +57,8 @@ const dutyData = reactive({ detail: "", //รายละเอียด reference: "", //เอกสารอ้างอิง refCommandNo: "", //เลขที่คำสั่ง - refCommandDate: null, //'เอกสารอ้างอิง (ลงวันที่)' + refCommandDate: null, //'เอกสารอ้างอิง (ลงวันที่)', + isUpload: false, }); const mode = ref("table"); //การแสดงผล Table card @@ -158,6 +165,12 @@ function openDialogEdit(props: RequestItemsObject) { dutyData.reference = props.reference; dutyData.refCommandNo = props.refCommandNo; dutyData.refCommandDate = props.refCommandDate; + + isUpload.value = props.isUpload; + + if (isUpload.value && props.id) { + onDownloadFile(props.id, false); + } } /** @@ -179,7 +192,11 @@ function closeDialog() { dutyData.reference = ""; dutyData.refCommandNo = ""; dutyData.refCommandDate = null; - fileUpload.value = undefined; + fileUpload.value = null; + + fileUpload.value = null; + isUpload.value = false; + fileData.value = null; } /** fetch ข้อมูลรายการพิเศษ*/ @@ -211,6 +228,7 @@ function addData() { reference: dutyData.reference, refCommandNo: dutyData.refCommandNo, refCommandDate: dutyData.refCommandDate, + isUpload: !edit.value ? undefined : isUpload.value, }; http .post(config.API.profileNewDuty(empType.value), body) @@ -239,8 +257,8 @@ function editData(idData: string) { profileId: undefined, }) .then(async (res) => { - if (fileUpload.value && res.data.result) { - await uploadProfile(res.data.result); + if (fileUpload.value && id.value) { + await uploadProfile(id.value); } await fetchData(profileId.value); await success($q, "บันทึกข้อมูลสำเร็จ"); @@ -297,19 +315,37 @@ async function uploadFileURL(uploadUrl: string, file: any) { "Content-Type": file.type, }, }) - .then(() => { - fileUpload.value = undefined; + .then(async (res) => { + if (res.status == 200) { + await isUploadFn(); + } + fileUpload.value = null; }) .catch((err) => { messageError($q, err); }); } +async function isUploadFn() { + await http + .patch(config.API.profileNewDutyByDutyId(id.value, empType.value), { + isUpload: fileUpload.value ? true : false, + }) + .then(async (res) => {}) + + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + /** * ฟังก์ชันโหลไฟลเอกสารหลักฐาน * @param id รายการที่ต้องการโหลด */ -async function onDownloadFile(id: string) { +async function onDownloadFile(id: string, isLoad: boolean = true) { showLoader(); await http .get( @@ -322,8 +358,11 @@ async function onDownloadFile(id: string) { ) ) .then(async (res) => { - const data = res.data.downloadUrl; - window.open(data, "_blank"); + const data = res.data; + fileData.value = data; + if (isLoad) { + window.open(data.downloadUrl, "_blank"); + } }) .catch((err) => { messageError($q, err); @@ -756,6 +795,7 @@ onMounted(() => {
{
+ + + + {{ fileData?.fileName }} + +
+ + + +
+
+
+
diff --git a/src/modules/04_registryPerson/components/detail/Other/03_Document7.vue b/src/modules/04_registryPerson/components/detail/Other/03_Document7.vue index 410eb9b31..c7c69e9cb 100644 --- a/src/modules/04_registryPerson/components/detail/Other/03_Document7.vue +++ b/src/modules/04_registryPerson/components/detail/Other/03_Document7.vue @@ -43,10 +43,10 @@ async function getData() { showLoader(); await http .get( - config.API.file("ระบบทะเบียนประวัติ", "เอกสาร ก.พ.7", profileId.value) + config.API.file("ระบบทะเบียนประวัติ", "เอกสารหลักฐานเพิ่มเติม", profileId.value) ) .then((res) => { - console.log("ระบบทะเบียนประวัติ", "เอกสาร ก.พ.7", profileId.value) + console.log("ระบบทะเบียนประวัติ", "เอกสารหลักฐานเพิ่มเติม", profileId.value) fileList.value = res.data; }) .catch((e) => { @@ -73,7 +73,7 @@ function clickUpload(file: any) { .post( config.API.file( "ระบบทะเบียนประวัติ", - "เอกสาร ก.พ.7", + "เอกสารหลักฐานเพิ่มเติม", profileId.value ), { @@ -135,7 +135,7 @@ function downloadFile(fileName: string) { .get( config.API.fileByFile( "ระบบทะเบียนประวัติ", - "เอกสาร ก.พ.7", + "เอกสารหลักฐานเพิ่มเติม", profileId.value, fileName ) @@ -163,7 +163,7 @@ function deleteFile(fileName: string) { .delete( config.API.fileByFile( "ระบบทะเบียนประวัติ", - "เอกสาร ก.พ.7", + "เอกสารหลักฐานเพิ่มเติม", profileId.value, fileName ) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue index 545248ac4..0f1e10b7a 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue @@ -13,6 +13,7 @@ import { useCounterMixin } from "@/stores/mixin"; import type { QTableProps } from "quasar"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/SpecialSkill"; import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/SpecialSkill"; +import type { ResFileData } from "@/modules/04_registryPerson/interface/index/Main"; import dialogHeader from "@/components/DialogHeader.vue"; @@ -35,9 +36,12 @@ const profileId = ref( route.params.id ? route.params.id.toString() : "" ); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); -const fileUpload = ref(); -const uploadUrl = ref(""); +const uploadUrl = ref(""); +const isUpload = ref(false); +const fileUpload = ref(null); +const fileData = ref(null); +const isEdit = ref(false); const mode = ref("table"); //การแสดงของ Table card /** * props @@ -227,7 +231,11 @@ function clearForm() { specialSkill.field = ""; specialSkill.reference = ""; specialSkill.remark = ""; - fileUpload.value = undefined; + isEdit.value = false; + + fileUpload.value = null; + isUpload.value = false; + fileData.value = null; } /** @@ -242,6 +250,12 @@ function editForm(row: any) { specialSkill.reference = row.reference; specialSkill.remark = row.remark; dialog.value = true; + isEdit.value = true; + isUpload.value = row.isUpload; + + if (isUpload.value) { + onDownloadFile(row.id, false); + } } /** function fetch ข้อมูลความสามรรถพิเศษ*/ @@ -291,6 +305,7 @@ async function addData() { dateEnd: null, profileId: empType.value === "" ? id.value : undefined, profileEmployeeId: empType.value !== "" ? id.value : undefined, + isUpload: !isEdit.value ? undefined : isUpload.value, }) .then(async (res) => { if (fileUpload.value && res.data.result) { @@ -322,8 +337,8 @@ async function editData(idData: string) { profileId: undefined, }) .then(async (res) => { - if (fileUpload.value && res.data.result) { - await uploadProfile(res.data.result); + if (fileUpload.value && id.value) { + await uploadProfile(id.value); } await fetchData(id.value); await success($q, "บันทึกข้อมูลสำเร็จ"); @@ -380,19 +395,37 @@ async function uploadFileURL(uploadUrl: string, file: any) { "Content-Type": file.type, }, }) - .then(() => { - fileUpload.value = undefined; + .then(async (res) => { + if (res.status == 200) { + await isUploadFn(); + } + fileUpload.value = null; }) .catch((err) => { messageError($q, err); }); } +async function isUploadFn() { + await http + .patch(config.API.profileNewAbilityByAbilityId(editId.value, empType.value), { + isUpload: fileUpload.value ? true : false, + }) + .then(async (res) => {}) + + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + /** * ฟังก์ชันโหลไฟลเอกสารหลักฐาน * @param id รายการที่ต้องการโหลด */ -async function onDownloadFile(id: string) { +async function onDownloadFile(id: string, isLoad: boolean = true) { showLoader(); await http .get( @@ -405,8 +438,11 @@ async function onDownloadFile(id: string) { ) ) .then(async (res) => { - const data = res.data.downloadUrl; - window.open(data, "_blank"); + const data = res.data; + fileData.value = data; + if (isLoad) { + window.open(data.downloadUrl, "_blank"); + } }) .catch((err) => { messageError($q, err); @@ -419,6 +455,7 @@ async function onDownloadFile(id: string) { /** function ปิด popup ข้อมูลความสามารถพิเศษ*/ function closeDialog() { dialog.value = false; + clearForm(); } /** function ปิด popup รายการประวัติ*/ @@ -590,7 +627,7 @@ onMounted(() => { dense round icon="mdi-file-document-outline" - @click="onDownloadFile(props.row.id)" + @click="onDownloadFile(props.row.profileId)" > ดาวน์โหลด @@ -713,6 +750,7 @@ onMounted(() => {
{
+ + + + {{ fileData?.fileName }} + +
+ + + +
+
+
+
diff --git a/src/modules/04_registryPerson/interface/index/Main.ts b/src/modules/04_registryPerson/interface/index/Main.ts index b3008f377..8a4b1d88e 100644 --- a/src/modules/04_registryPerson/interface/index/Main.ts +++ b/src/modules/04_registryPerson/interface/index/Main.ts @@ -83,6 +83,41 @@ interface Request { topic: string; } +interface InsigniasType { + id: string; + createdAt: Date; + createdUserId: string; + lastUpdatedAt: Date; + lastUpdateUserId: string; + createdFullName: string; + lastUpdateFullName: string; + name: string; + isActive: boolean; + insignias: InsigniasTypeSub[]; +} + +interface InsigniasTypeSub { + id:string; + createdAt:Date; + createdUserId:string; + lastUpdatedAt:Date; + lastUpdateUserId:string; + createdFullName:string; + lastUpdateFullName:string; + name:string; + shortName:string; + level:string; + isActive:string; + note:string; + insigniaTypeId:string; +} + +interface ResFileData { + downloadUrl: string; + fileName: string; + path: string; + pathname: string; +} export type { Pagination, DataOption, @@ -97,4 +132,8 @@ export type { DataOptionEducation, DataOptionEducationLevel, Request, + + InsigniasType, + InsigniasTypeSub, + ResFileData }; diff --git a/src/modules/04_registryPerson/interface/index/performSpecialWork.ts b/src/modules/04_registryPerson/interface/index/performSpecialWork.ts index 556605b34..91ddf78de 100644 --- a/src/modules/04_registryPerson/interface/index/performSpecialWork.ts +++ b/src/modules/04_registryPerson/interface/index/performSpecialWork.ts @@ -21,6 +21,7 @@ interface RequestItemsObject { reference: string; refCommandNo: string; refCommandDate: Date | null; + isUpload: boolean; } interface MyObjectRef { diff --git a/src/modules/04_registryPerson/interface/request/DeclarationHonor.ts b/src/modules/04_registryPerson/interface/request/DeclarationHonor.ts index 33eb39b71..e2b750b2d 100644 --- a/src/modules/04_registryPerson/interface/request/DeclarationHonor.ts +++ b/src/modules/04_registryPerson/interface/request/DeclarationHonor.ts @@ -8,6 +8,7 @@ interface RequestItemsObject { refCommandNo: string; type: string; isDate: boolean | string; + isUpload?: boolean|undefined; } export type { RequestItemsObject }; diff --git a/src/modules/04_registryPerson/interface/request/Insignia.ts b/src/modules/04_registryPerson/interface/request/Insignia.ts index 868cca232..4a27f11aa 100644 --- a/src/modules/04_registryPerson/interface/request/Insignia.ts +++ b/src/modules/04_registryPerson/interface/request/Insignia.ts @@ -14,6 +14,7 @@ interface RequestItemsObject { refCommandNo: string; note: string; profileEmployeeId?: string | null; + isUpload?: boolean | undefined; } export type { RequestItemsObject }; diff --git a/src/modules/04_registryPerson/interface/response/DeclarationHonor.ts b/src/modules/04_registryPerson/interface/response/DeclarationHonor.ts index 9a8182574..c925a8365 100644 --- a/src/modules/04_registryPerson/interface/response/DeclarationHonor.ts +++ b/src/modules/04_registryPerson/interface/response/DeclarationHonor.ts @@ -14,6 +14,7 @@ interface ResponseObject { profileId: string; type: string; refCommandDate: Date; + isUpload: boolean; refCommandNo: string; } diff --git a/src/modules/04_registryPerson/interface/response/Insignia.ts b/src/modules/04_registryPerson/interface/response/Insignia.ts index 5f6901993..29328196a 100644 --- a/src/modules/04_registryPerson/interface/response/Insignia.ts +++ b/src/modules/04_registryPerson/interface/response/Insignia.ts @@ -20,6 +20,7 @@ interface ResponseObject { volumeNo: string; refCommandDate: Date | null; refCommandNo: string; + isUpload: boolean; note: string; } diff --git a/src/modules/04_registryPerson/stores/insignia.ts b/src/modules/04_registryPerson/stores/insignia.ts index ce94db30a..b8cca347e 100644 --- a/src/modules/04_registryPerson/stores/insignia.ts +++ b/src/modules/04_registryPerson/stores/insignia.ts @@ -1,30 +1,37 @@ import { ref, computed } from "vue"; import { defineStore } from "pinia"; -import type { DataOptionInsignia,DataOption } from "@/modules/04_registryPerson/interface/index/Main"; +import type { + DataOptionInsignia, + DataOption, + InsigniasType, + InsigniasTypeSub, +} from "@/modules/04_registryPerson/interface/index/Main"; import type { ResponseObject as Insignia } from "@/modules/07_insignia/interface/response/Main"; export const useInsigniaDataStore = defineStore("insigniaDataStore", () => { - const insigniaOption = ref([]); - const insigniaTypeOp = ref([]); - const insigniaTypeOpMain = ref([]); + const insigniaOption = ref([]); - function mapInsigniaOption(resData: any) { - insigniaTypeOp.value = Array.from( - new Map( - resData.map((item:any) => [item.insigniaTypeName, { id: item.insigniaTypeId, name: item.insigniaTypeName }]) - ).values() - ) as DataOption[]; + const insigniaTypeOp = ref([]); + const insigniaTypeOpMain = ref([]); + const allNameInsignia = ref([]); - insigniaOption.value = []; - resData.map((r: Insignia) => { - insigniaOption.value.push({ - id: r.id.toString(), - name: r.name.toString() + ` (${r.shortName})`, - typeId: r.insigniaTypeId.toString(), - typeName: r.insigniaTypeName.toString(), - }); - }); + function mapInsigniaOption(resData: InsigniasType[]) { + insigniaTypeOpMain.value = resData; + insigniaTypeOp.value = resData; + + allNameInsignia.value = resData + .flatMap((item: InsigniasType) => item.insignias) + .map((i: InsigniasTypeSub) => ({ + ...i, + name: `${i.name} (${i.shortName})`, + })); } - return { insigniaOption, mapInsigniaOption,insigniaTypeOp }; + return { + insigniaOption, + mapInsigniaOption, + insigniaTypeOp, + insigniaTypeOpMain, + allNameInsignia, + }; }); From 451def7e8ed7274224a48fdf9714d21337baa3cd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 29 Jan 2025 10:35:39 +0700 Subject: [PATCH 079/142] =?UTF-8?q?fix=20=E0=B8=97=E0=B8=94=E0=B8=A5?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../probation/FormEvaluation/Header.vue | 5 + .../probation/FormEvaluation/Template3.vue | 33 +------ .../FormEvaluation/TemplateSummaryScore.vue | 95 +++++++++++++++++++ .../components/probation/MainDetail.vue | 20 ++-- .../components/probation/SummaryScore.vue | 48 ++++++++-- 5 files changed, 153 insertions(+), 48 deletions(-) create mode 100644 src/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue index 2f7c29eb5..c92247eda 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue @@ -2,6 +2,10 @@ import { ref, watch } from "vue"; import { useRoute } from "vue-router"; +import { useProbationDataStore } from "@/modules/05_placement/storeProbation"; + +const DataStore = useProbationDataStore(); + const tabHead = ref("save1"); const route = useRoute(); const checkRoutePermisson = ref(route.name == "probationFormDetail"); @@ -71,6 +75,7 @@ function nextPage() {
ครั้งที่ {{ i }}
("save1"); const tabs = ref([]); const dataArrayNumber = ref(1); -const evaluate = ref([]); const assignId = ref(route.params.form.toString()); -const personalId = ref(route.params.personalId.toString()); const isLoad = ref(false); const fullName = ref(""); @@ -137,22 +123,11 @@ onMounted(() => { - - - +
diff --git a/src/modules/05_placement/components/probation/MainDetail.vue b/src/modules/05_placement/components/probation/MainDetail.vue index 2f8f89a7e..5501b5fb1 100644 --- a/src/modules/05_placement/components/probation/MainDetail.vue +++ b/src/modules/05_placement/components/probation/MainDetail.vue @@ -45,22 +45,17 @@ const TabsTemplate3 = defineAsyncComponent( ) ); -const SummaryScore = defineAsyncComponent( - () => import("@/modules/05_placement/components/probation/SummaryScore.vue") +const TabsTemplateSummaryScore = defineAsyncComponent( + () => + import( + "@/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue" + ) ); const $q = useQuasar(); const mixin = useCounterMixin(); -const { - date2Thai, - dateToISO, - success, - messageError, - showLoader, - hideLoader, - dialogConfirm, -} = mixin; +const { messageError } = mixin; const router = useRouter(); const route = useRoute(); @@ -288,7 +283,8 @@ onMounted(async () => { - + + diff --git a/src/modules/05_placement/components/probation/SummaryScore.vue b/src/modules/05_placement/components/probation/SummaryScore.vue index e31447e43..dbf1e8166 100644 --- a/src/modules/05_placement/components/probation/SummaryScore.vue +++ b/src/modules/05_placement/components/probation/SummaryScore.vue @@ -13,6 +13,10 @@ const checkRoutePermisson = ref(route.name == "probationFormDetail"); const assignId = ref(route.params.form.toString()); const status = ref(false); +const props = defineProps({ + tab: { type: String, require: true }, +}); + const develop_orientation_score = ref(); const develop_self_learning_score = ref(); const develop_training_seminar_score = ref(); @@ -54,8 +58,13 @@ const result_option = reactive([ /** get คะแนน */ async function getReportScore() { showLoader(); + const noNumber = props?.tab ? Number(props?.tab.charAt(4)) : ""; + await http - .get(config.API.summaryReportDetail(assignId.value)) + .get( + config.API.summaryReportDetail(assignId.value) + + `&evaluate_no=${noNumber}` + ) .then((res) => { const data = res.data.result; develop_orientation_score.value = data.develop_orientation_score; @@ -138,15 +147,24 @@ onMounted(() => { - + ผ่าน (สูงกว่าร้อยละ 60) - + ไม่ผ่าน (ต่ำกว่าร้อยละ 60)
+ @@ -171,10 +189,18 @@ onMounted(() => { - + ผ่าน (สูงกว่าร้อยละ 60) - + ไม่ผ่าน (ต่ำกว่าร้อยละ 60) @@ -204,10 +230,18 @@ onMounted(() => { - + ผ่าน (สูงกว่าร้อยละ 60) - + ไม่ผ่าน (ต่ำกว่าร้อยละ 60) From 6b6bbadf878f5b2ae5e74142e2422cdd5381c6d3 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 29 Jan 2025 10:56:38 +0700 Subject: [PATCH 080/142] fix --- .../components/probation/FormEvaluation/Template3.vue | 2 +- .../probation/FormEvaluation/TemplateSummaryScore.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue index 75fd09ac6..06119cf33 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue @@ -125,7 +125,7 @@ onMounted(() => {
- ยังไม่ได้รับการแบบประเมินผล + ยังไม่ได้ดำเนินการแบบประเมินผล
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue index a56c3b489..e8e4fd01f 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/TemplateSummaryScore.vue @@ -83,7 +83,7 @@ onMounted(() => {
- ยังไม่ได้รับการแบบประเมินผล + ยังไม่ได้ดำเนินการแบบประเมินผล
From 6f05aa81ee25a1019c249fc5c025a3c34bdeaed9 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 29 Jan 2025 11:21:54 +0700 Subject: [PATCH 081/142] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AA?= =?UTF-8?q?=E0=B8=A3=E0=B8=A3=E0=B8=AB=E0=B8=B2=20=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A5=E0=B9=80=E0=B8=95=E0=B8=AD=E0=B8=A3=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/TableCandidate.vue | 12 +++++++---- .../views/02_qualify/DisablePeriod.vue | 20 +++++++++++-------- .../03_recruiting/views/02_qualify/Period.vue | 7 ++++--- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index aab9cc439..869216ee2 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -365,8 +365,10 @@ async function clickPassExam() { showLoader(); await http .get(config.API.exportExamPassExamList(examId.value)) - .then(() => { - window.open(config.API.exportExamPassExamList(examId.value)); + .then(async(res) => { + const data = res.data.result; + data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; + await genReport(data, data.reportName,'pdf'); }) .catch((e) => { messageError($q, e); @@ -380,8 +382,10 @@ async function clickCandidateList() { showLoader(); await http .get(config.API.exportExamCandidateList(examId.value)) - .then(() => { - window.open(config.API.exportExamCandidateList(examId.value)); + .then(async(res) => { + const data = res.data.result; + data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; + await genReport(data, data.reportName,'pdf'); }) .catch((e) => { messageError($q, e); diff --git a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue index 50f8a367a..b12dc148d 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue @@ -24,7 +24,8 @@ import HistoryTable from "@/components/TableHistory.vue"; const $q = useQuasar(); // show dialog const router = useRouter(); const mixin = useCounterMixin(); -const { success, dateText, messageError, showLoader, hideLoader } = mixin; +const { success, dateText, messageError, showLoader, hideLoader, date2Thai } = + mixin; const name = ref(""); const year = ref(new Date().getFullYear() + 543); @@ -41,6 +42,7 @@ const tittleHistory = ref("ประวัติการนำเข้ const modalHistory = ref(false); //modal ประวัติการแก้ไขข้อมูล const rows = ref([]); const filter = ref(""); //search data table +const filterHistory = ref(""); //search data table const textTittle = ref(""); const textTittleScore = ref(""); const textTittleCandidate = ref(""); @@ -92,6 +94,9 @@ const columns = ref([ field: "year", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.year + 543}`; + }, }, { name: "examCount", @@ -125,12 +130,15 @@ const columnsHistory = ref([ }, { name: "createdAt", - align: "center", + align: "left", label: "วันที่ดำเนินการ", sortable: true, field: "createdAt", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${date2Thai(row.createdAt)}`; + }, }, { name: "createdFullName", @@ -504,9 +512,6 @@ onMounted(async () => {
{{ col.value }}
-
- {{ col.value + 543 }} -
{ v-model:modal="modalHistory" v-model:inputvisible="visibleColumnsHistory" v-model:tittle="tittleHistory" + v-model:inputfilter="filterHistory" + :filter="filterHistory" > diff --git a/src/modules/05_placement/components/probation/SummaryScore.vue b/src/modules/05_placement/components/probation/SummaryScore.vue index dbf1e8166..c75bfc2c8 100644 --- a/src/modules/05_placement/components/probation/SummaryScore.vue +++ b/src/modules/05_placement/components/probation/SummaryScore.vue @@ -55,6 +55,7 @@ const result_option = reactive([ }, ]); +const checkDisplay = ref(null); /** get คะแนน */ async function getReportScore() { showLoader(); @@ -98,6 +99,10 @@ async function getReportScore() { reason.value = data.reason; pass_result.value = data.pass_result; evaluate_date.value = data.evaluate_date; + checkDisplay.value = true; + }) + .catch((e) => { + checkDisplay.value = false; }) .finally(() => { hideLoader(); @@ -111,7 +116,12 @@ onMounted(() => { @@ -688,7 +659,7 @@ onMounted(async () => { @@ -697,7 +668,6 @@ onMounted(async () => { standout dense v-model="formProbation.keyword" - ref="filterRef2" outlined placeholder="ค้นหา" @keydown.enter.prevent="filterKeyword2Fn(formProbation.page)" @@ -708,7 +678,6 @@ onMounted(async () => { v-if="filterKeyword2 !== ''" name="clear" class="cursor-pointer" - @click="resetFilter2" /> @@ -723,7 +692,6 @@ onMounted(async () => { :paging="true" dense class="custom-header-table" - v-bind="attrs" :pagination-label="paginationLabel2" v-model:pagination="pagination2" @update:pagination="updatePagination" @@ -750,7 +718,7 @@ onMounted(async () => { outline color="primary" label="เพิ่ม" - @click="clickAdd(props.row)" + @click="addPersonalData(props.row)" > diff --git a/src/modules/05_placement/interface/response/Probation.ts b/src/modules/05_placement/interface/response/Probation.ts new file mode 100644 index 000000000..acd70a9ad --- /dev/null +++ b/src/modules/05_placement/interface/response/Probation.ts @@ -0,0 +1,47 @@ +interface ResListProbation { + firstName: string; + idcard: string; + lastName: string; + name: string; + order_number: string; + ordering: number; + organization: string; + personal_id: string; + position_level: string; + position_line: string; + position_type: string; + prefixName: string; + probation_no: number; + probation_status: number; +} + +interface ResProfileProbation { + firstName: string; + id: string; + idcard: string; + isProbation: boolean; + lastName: string; + orgChild1: string; + orgChild1Name: string; + orgChild2: string; + orgChild2Name: string; + orgChild3: string; + orgChild3Name: string; + orgChild4: string; + orgChild4Name: string; + orgRootName: string; + posExecutiveName: string; + posLevelName: string; + posNo: string; + posTypeName: string; + position: string; + positionArea: string; + positionExecutiveField: string; + positionField: string; + prefix: string; + rank: string; + refCommandNo: string; + root: string; +} + +export type { ResListProbation, ResProfileProbation }; From 73db661b34f87a8de94f383ce858a9f6c4f4641e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 5 Feb 2025 17:47:10 +0700 Subject: [PATCH 123/142] =?UTF-8?q?layout=20=E0=B8=97=E0=B8=94=E0=B8=A5?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=9B=E0=B8=8F=E0=B8=B4=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=97?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/MainAppoint.vue | 4 +- .../components/probation/MainProbation.vue | 2 +- .../components/probation/MainSurvey.vue | 60 +++++++++---------- .../components/probation/MainTabs.vue | 6 +- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/modules/05_placement/components/probation/MainAppoint.vue b/src/modules/05_placement/components/probation/MainAppoint.vue index fb50de670..ae08e5f3d 100644 --- a/src/modules/05_placement/components/probation/MainAppoint.vue +++ b/src/modules/05_placement/components/probation/MainAppoint.vue @@ -1,5 +1,5 @@