From 8626d1f4e3295ffa6eb315fc8d47d99fb6fe8356 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 10 Mar 2025 18:30:28 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../04_registryPerson/stores/Position.ts | 4 +- .../21_report/views/02_reportRegistry.vue | 181 +++++++++++++----- 2 files changed, 136 insertions(+), 49 deletions(-) diff --git a/src/modules/04_registryPerson/stores/Position.ts b/src/modules/04_registryPerson/stores/Position.ts index 583f8d659..ee7c6d0ea 100644 --- a/src/modules/04_registryPerson/stores/Position.ts +++ b/src/modules/04_registryPerson/stores/Position.ts @@ -24,7 +24,9 @@ export const useGovernmentPosDataStore = defineStore("GovernmentPos", () => { const posExecutiveData = ref([]); //รายการตำแหน่งทางการบริหาร function convertCommandCodeName(val: string) { - return commandCodeData.value.find((e: DataOption) => e.id === val)?.name; + return ( + commandCodeData.value.find((e: DataOption) => e.id === val)?.name ?? "-" + ); } return { diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index 3738266fd..3e9850572 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -94,6 +94,9 @@ const statusOps = ref([]); //ตัวเลือก สถาน const education = ref(""); const educationOp = ref([]); const educationOpMain = ref([]); +const educationLevel = ref(""); +const field = ref(""); +const positionArea = ref(""); /** ตัวแปรสังกัด */ const modalOrg = ref(false); @@ -128,6 +131,8 @@ const visibleColumnsBase = ref([ "gender", "status", "education", + "educationLevel", + "field", "dateAppoint", "dateRetireLaw", "age", @@ -247,6 +252,17 @@ const columns = computed(() => { sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "educationLevel", + align: "left", + label: "ระดับการศึกษา", + sortable: true, + field: "educationLevel", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "education", align: "left", @@ -258,6 +274,18 @@ const columns = computed(() => { sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + + { + name: "field", + align: "left", + label: "สาขา", + sortable: true, + field: "field", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "dateAppoint", align: "left", @@ -336,10 +364,6 @@ const rangeTerm = ref({ }); const isLoadStructureTree = ref(true); -function onOpenOrg() { - modalOrg.value = true; -} - /** * ฟังก์ชั่นค้นหาข้อมูลของ Option Filter * @param val คำที่ค้นหา @@ -491,29 +515,12 @@ function getDataPerson() { }); } -/** function ดึง ข้อมูลระดับการศึกษา*/ -function getEducationLevel() { - http - .get(config.API.orgEducationLevel) - .then(async (res) => { - const list = res.data.result.map((r: DataEducationLevel) => ({ - id: r.id, - name: r.name, - })); - educationOpMain.value = list; - }) - .catch((err) => { - messageError($q, err); - }); -} - async function onSearch() { loadingBtn.value = true; pagination.value.page = 1; const queryParams = { node: storeReport.formFilter.node ?? null, nodeId: storeReport.formFilter.nodeId ?? "", - posType: posType.value, posLevel: posLevel.value, position: position.value, @@ -521,11 +528,13 @@ async function onSearch() { gender: gender.value, status: status.value, education: education.value.trim(), + educationLevel: educationLevel.value.trim(), + field: field.value.trim(), + positionArea: education.value.trim(), ageMin: rangeAge.value.min, ageMax: rangeAge.value.max, dateStart: dateStart.value ?? null, dateEnd: dateEnd.value ?? null, - isProbation: isProbation.value, isRetire: isRetire.value, retireType: retireType.value, @@ -546,6 +555,22 @@ async function onSearch() { ) .then(async (res) => { const data = res.data.result.data; + const Educations = [ + { + field: "", + degree: "วิทยาศาสตร์บัณฑิต", + isHigh: null, + isEducation: 1, + educationLevel: "", + }, + { + field: "", + degree: "วิทยาศาสตร์บัณฑิต2", + isHigh: null, + isEducation: 1, + educationLevel: "ปริญญาตรี", + }, + ]; total.value = res.data.result.total; rows.value = data.map((item: any, index: number) => ({ profileId: item.profileId, @@ -561,7 +586,12 @@ async function onSearch() { positionExecutive: item.posExecutiveName ?? "-", gender: item.gender ?? "-", status: item.relationship ?? "-", - education: item.degree ?? "-", + education: + Educations.length > 0 ? Educations.map((e) => e.degree) : "-", + educationLevel: + Educations.length > 0 ? Educations.map((e) => e.educationLevel) : "-", + field: Educations.length > 0 ? Educations.map((e) => e.field) : "-", + dateAppoint: item.dateAppoint ?? "-", age: item.age ?? "-", positionDate: @@ -599,6 +629,9 @@ function exportToExcel() { ...rest, dateAppoint: date2Thai(e.dateAppoint), dateRetireLaw: date2Thai(e.dateRetireLaw), + education: e.education.map((e: string) => `${e}`).join(", "), + educationLevel: e.education.map((e: string) => `${e}`).join(", "), + feild: e.education.map((e: string) => `${e}`).join(", "), }; }); @@ -635,6 +668,10 @@ function clearFilter() { gender.value = ""; //เพศ status.value = ""; //สถานภาพ education.value = ""; //วุฒิการศึกษา + field.value = ""; + educationLevel.value = ""; + positionArea.value = ""; + //ช่วงเวลาบรรจุ dateStart.value = null; //ตั้งแต่วันที่ dateEnd.value = null; //ถึงวันที่ @@ -743,6 +780,14 @@ onMounted(async () => { }); }); +function formatEducation(value: any) { + return Array.isArray(value) && value.length > 0 + ? value + .map((e, index) => (e ? `- ${e}` : index > 0 ? "
" : "")) + .join("
") + : "-"; +} + watch( () => storeMenu.permissions, () => { @@ -774,7 +819,7 @@ watch( map-options option-label="name" option-value="id" - @update:model-value="clearFilter(), getType()" + @update:model-value="clearFilter(), getType(), (rows = [])" > @@ -1238,6 +1283,25 @@ watch(
+
+ + + +
+
- + +
+
+ +
+
+ + +
@@ -1677,6 +1752,16 @@ watch( > {{ col.value ? col.value : "-" }}
+
+
+
+
{{ col.value ? col.value : "-" }}