From 27fb61604fdfa84c878998fae0b25eb8c74af63e Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 1 Apr 2025 13:42:35 +0700 Subject: [PATCH 1/4] no message --- .../06_evaluate/components/ExpertPageDetail.vue | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/modules/06_evaluate/components/ExpertPageDetail.vue b/src/modules/06_evaluate/components/ExpertPageDetail.vue index 79f0a33..9313bb0 100644 --- a/src/modules/06_evaluate/components/ExpertPageDetail.vue +++ b/src/modules/06_evaluate/components/ExpertPageDetail.vue @@ -233,19 +233,9 @@ async function onClickDowloadFile( { 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), - }, + { birthDate: profile.value == null ? "" : date2Thai(profile.value.birthDate), }, { govAge: profile.value == null ? "" : profile.value.govAge }, - { - positionLevelNew: - profile.value == null - ? "" - : profile.value.type == "EXPERT" - ? "ชำนาญการ" - : "ชำนาญการพิเศษ", - }, + { 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 From c45d3f8e6e3c410087068bff5d1f093c98bfeb6f Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 1 Apr 2025 16:34:24 +0700 Subject: [PATCH 2/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80?= =?UTF-8?q?=E0=B8=A1=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=8A=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A2=E0=B8=A7=E0=B8=8A=E0=B8=B2=E0=B8=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/org/api.org.ts | 3 + src/interface/Main.ts | 3 + .../components/ExpertPageDetail.vue | 143 +++++++++++++++--- src/stores/data.ts | 8 +- 4 files changed, 135 insertions(+), 22 deletions(-) diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts index ba33d4b..8ad1a24 100644 --- a/src/api/org/api.org.ts +++ b/src/api/org/api.org.ts @@ -61,6 +61,9 @@ export default { dataUserCertificateByType: (emType: string, type: string) => `${org}/profile${emType}/${type}/user`, + dataUserEvaByType: (type: string) => + `${org}/profile/${type}/user`, + dataUserOther: `${profileOrg}/other/user`, dataUserOtherByType: (type: string) => `${org}/profile${type}/other/user`, diff --git a/src/interface/Main.ts b/src/interface/Main.ts index a24e4a0..61e21db 100644 --- a/src/interface/Main.ts +++ b/src/interface/Main.ts @@ -12,6 +12,9 @@ interface ProfileData { citizenId?: string; salary?: number|null; birthDate?: string; + org?: string; + dateStart?: string; + dateRetireLaw?: string; } interface InformationData { diff --git a/src/modules/06_evaluate/components/ExpertPageDetail.vue b/src/modules/06_evaluate/components/ExpertPageDetail.vue index 9313bb0..1469831 100644 --- a/src/modules/06_evaluate/components/ExpertPageDetail.vue +++ b/src/modules/06_evaluate/components/ExpertPageDetail.vue @@ -8,6 +8,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import genReport from "@/plugins/genreport"; import { useCounterMixin } from "@/stores/mixin"; +import { useDataStore } from "@/stores/data"; import type { FormRef, @@ -17,6 +18,7 @@ import type { const $q = useQuasar(); const mixin = useCounterMixin(); +const dataPerson = useDataStore(); const { dialogConfirm, messageError, @@ -24,12 +26,13 @@ const { hideLoader, date2Thai, success, + findOrgName, } = mixin; const router = useRouter(); const route = useRoute(); - +const currentYear = new Date().getFullYear(); const evaluateId = ref(route.params.id as string); -const profile = ref(); +let profile = ref(); /** form ผู้เซ็นเอกสาร*/ const formCommand = reactive({ @@ -228,17 +231,81 @@ async function onClickDowloadFile( { certificates: certificates }, { salaries: salaries }, { trainings: trainings }, - { 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, + { + fullName: dataPerson.formData.firstName + ? `${dataPerson.formData.prefix}${dataPerson.formData.firstName} ${dataPerson.formData.lastName}` + : "", + }, + { + position: dataPerson.formData.position + ? dataPerson.formData.position + : "", + }, + { + positionLevel: dataPerson.formData.posLevelName + ? dataPerson.formData.posLevelName + : "", + }, + { posNo: dataPerson.formData.posNo ? dataPerson.formData.posNo : "" }, + { org: dataPerson.formData ? dataPerson.formData.org : "" }, + { + birthDate: dataPerson.formData.birthDate + ? date2Thai(new Date(dataPerson.formData.birthDate)) + : "", + }, + { + govAge: profile.value.government + ? `${ + profile.value.government.govAge.day !== 0 + ? `${profile.value.government.govAge.day} วัน` + : "" + } ${ + profile.value.government.govAge.month !== 0 + ? `${profile.value.government.govAge.month} เดือน` + : "" + } ${ + profile.value.government.govAge.year !== 0 + ? `${profile.value.government.govAge.year} ปี` + : "" + }` + : ``, + }, + { + positionLevelNew: + profile.value == null + ? "" + : profile.value.type == "EXPERT" + ? "ชำนาญการ" + : "ชำนาญการพิเศษ", + }, + + tp === "EV1_005" + ? { salary: dataPerson.formData.salary ? dataPerson.formData.salary : "" } + : null, + + tp === "EV1_006" ? { lastTwoYear: (currentYear - 2).toString() } : null, + tp === "EV1_006" ? { lastOneYear: (currentYear - 1).toString() } : null, + tp === "EV1_006" ? { currentYear: currentYear.toString() } : null, + tp === "EV1_006" ? { commanderFullname: formData.commanderFullname } : null, + tp === "EV1_006" ? { commanderPosition: formData.commanderPosition } : null, + tp === "EV1_006" ? { commanderOrg: "" } : null, + tp === "EV1_006" + ? { commanderAboveFullname: formData.commanderAboveFullname } + : null, + tp === "EV1_006" + ? { commanderAbovePosition: formData.commanderAbovePosition } + : null, + tp === "EV1_006" ? { commanderAboveOrg: "" } : null, + tp === "EV1_007" ? { positionName: "-" } : null, - tp === "EV1_007" ? { positionLeaveName: "-" } : null + tp === "EV1_007" ? { positionLeaveName: "-" } : null, + + tp === "EV1_009" ? { dateStart: dataPerson.formData.dateStart } : null, + tp === "EV1_009" + ? { dateRetireLaw: dataPerson.formData.dateRetireLaw } + : null, + + tp === "EV1_010" ? { subject: formData.subject } : null ); const body = { template: tp, @@ -339,16 +406,49 @@ function getData() { }); } +function getDetail(type: any) { + http.get(config.API.dataUserEvaByType(type)).then((res) => { + profile.value = { + ...profile.value, // รักษาข้อมูลเดิมที่เก็บไว้ก่อนหน้านี้ + [type === "salary" + ? "salaries" + : type === "certificate" + ? "certificates" + : type === "training" + ? "trainings" + : type]: res.data.result, // เก็บข้อมูลตามประเภท (type) + }; + }); +} + +const keyObject = ref([ + "educations", + "certificate", + "salary", + "training", + "assessments", + "government", +]); onMounted(() => { - getData(); - downloadFile("1-แบบพิจารณาคุณสมบัติบุคคล"); - downloadFile("2-แบบแสดงรายละเอียดการเสนอผลงาน"); - downloadFile( - "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก)" - ); - downloadFile("4-แบบประเมินคุณลักษณะบุคคล"); - downloadFile("5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)"); - downloadFile("6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)"); + showLoader(); + Promise.all([getData(), ...keyObject.value.map(getDetail)]) + .then(() => {}) + .catch((e) => { + hideLoader(); + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + + [ + "1-แบบพิจารณาคุณสมบัติบุคคล", + "2-แบบแสดงรายละเอียดการเสนอผลงาน", + "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก)", + "4-แบบประเมินคุณลักษณะบุคคล", + "5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)", + "6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)", + ].forEach((fileName) => downloadFile(fileName)); }); @@ -381,6 +481,7 @@ onMounted(() => { class="text-weight-medium bg-grey-1 col-12 q-py-sm q-px-md" > ผลงาน +
diff --git a/src/stores/data.ts b/src/stores/data.ts index 3752548..2000d80 100644 --- a/src/stores/data.ts +++ b/src/stores/data.ts @@ -13,7 +13,7 @@ export const useDataStore = defineStore("dataMain", () => { const storeRegistry = useRegistryInFormationStore(); const $q = useQuasar(); const mixin = useCounterMixin(); - const { messageError, showLoader, hideLoader, findPosMasterNo } = mixin; + const { messageError, showLoader, hideLoader, findPosMasterNo,findOrgName } = mixin; // ref() คือการประกาศ state เหมือน vuex const formData = reactive({ profileId: "", @@ -28,6 +28,9 @@ export const useDataStore = defineStore("dataMain", () => { salary: null, birthDate: '', posNo: "", + org: "", + dateStart: "", + dateRetireLaw: "", }); const count = ref(0); const loader = ref(false); @@ -110,7 +113,10 @@ export const useDataStore = defineStore("dataMain", () => { formData.posTypeName = data.posTypeName; formData.posExecutiveName = data.posExecutiveName; formData.posLevelName = data.posLevelName; + formData.dateStart = data.dateStart; + formData.dateRetireLaw = data.dateRetireLaw; formData.posNo = findPosMasterNo(data); + formData.org = findOrgName(data); storeRegistry.profileId = data.profileId; storeRegistry.citizenId = data.citizenId; } From 9371dd15fcfae1eef45d59d436e099b3e276f322 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 2 Apr 2025 14:28:26 +0700 Subject: [PATCH 3/4] =?UTF-8?q?fix=20=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../10_registry/02_Government/07_Position.vue | 6 +++--- src/modules/10_registry/03_Salary/01_Salary.vue | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/10_registry/02_Government/07_Position.vue b/src/modules/10_registry/02_Government/07_Position.vue index fc84f61..6f076ee 100644 --- a/src/modules/10_registry/02_Government/07_Position.vue +++ b/src/modules/10_registry/02_Government/07_Position.vue @@ -198,11 +198,11 @@ const baseColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "commandCode", + name: "commandName", align: "left", label: "ประเภทคำสั่ง", sortable: true, - field: "commandCode", + field: "commandName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -301,7 +301,7 @@ const baseVisibleColumns = ref([ "positionExecutive", "amount", "commandNo", - "commandCode", + "commandName", "commandDateSign", "organization", "remark", diff --git a/src/modules/10_registry/03_Salary/01_Salary.vue b/src/modules/10_registry/03_Salary/01_Salary.vue index c11c51a..25bb95f 100644 --- a/src/modules/10_registry/03_Salary/01_Salary.vue +++ b/src/modules/10_registry/03_Salary/01_Salary.vue @@ -182,11 +182,11 @@ const baseColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "commandCode", + name: "commandName", align: "left", label: "ประเภทคำสั่ง", sortable: true, - field: "commandCode", + field: "commandName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -316,7 +316,7 @@ const visibleColumns = ref([ "positionSalaryAmount", "mouthSalaryAmount", "commandNo", - "commandCode", + "commandName", "commandDateSign", "organization", "remark", @@ -349,7 +349,7 @@ const visibleColumnsHistory = ref([ "positionSalaryAmount", "mouthSalaryAmount", "commandNo", - "commandCode", + "commandName", "commandDateSign", "organization", "remark", @@ -509,11 +509,11 @@ const baseColumnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "commandCode", + name: "commandName", align: "left", label: "ประเภทคำสั่ง", sortable: true, - field: "commandCode", + field: "commandName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => From 86b2aaf2e2edf2ec1264c7f36f287f1b4684bdbb Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 3 Apr 2025 10:55:55 +0700 Subject: [PATCH 4/4] =?UTF-8?q?fix=20Columns=20=E0=B8=8A=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=A7=E0=B8=A2=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 --- .../02_Government/06_Assistance.vue | 74 ++++++++++++++++++- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/src/modules/10_registry/02_Government/06_Assistance.vue b/src/modules/10_registry/02_Government/06_Assistance.vue index a87f459..b9526ce 100644 --- a/src/modules/10_registry/02_Government/06_Assistance.vue +++ b/src/modules/10_registry/02_Government/06_Assistance.vue @@ -29,22 +29,38 @@ const modalHistory = ref(false); /** ตัวแปรข้อมูล */ const visibleColumns = ref([ + "commandName", "agency", "dateStart", "dateEnd", "commandNo", "document", + "lastUpdateFullName", "lastUpdatedAt", ]); const columns = ref([ + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { name: "agency", align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, field: "agency", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateStart", @@ -55,6 +71,8 @@ const columns = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -65,6 +83,8 @@ const columns = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -74,6 +94,8 @@ const columns = ref([ field: "commandNo", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "document", @@ -83,6 +105,19 @@ const columns = ref([ field: "document", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdatedAt", @@ -102,6 +137,7 @@ const pagination = ref({ }); const visibleColumnsHistory = ref([ + "commandName", "agency", "dateStart", "dateEnd", @@ -111,14 +147,28 @@ const visibleColumnsHistory = ref([ "lastUpdatedAt", ]); const columnsHistory = ref([ + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { name: "agency", align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, field: "agency", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateStart", @@ -129,6 +179,8 @@ const columnsHistory = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -139,6 +191,8 @@ const columnsHistory = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -148,6 +202,8 @@ const columnsHistory = ref([ field: "commandNo", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "document", @@ -157,6 +213,8 @@ const columnsHistory = ref([ field: "document", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdateFullName", @@ -166,6 +224,8 @@ const columnsHistory = ref([ field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdatedAt", @@ -173,9 +233,11 @@ const columnsHistory = ref([ label: "วันที่แก้ไข", sortable: true, field: "lastUpdatedAt", + format: (v) => date2Thai(v, false, true), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => date2Thai(v, false, true), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); @@ -316,6 +378,7 @@ onMounted(async () => { {{ col.label }} + @@ -331,17 +394,20 @@ onMounted(async () => { ดาวน์โหลด + + +