From 1e1bb91b299fce1e9f4e8d09ea3749dbe59c4de7 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 20 Jun 2025 10:31:08 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5=20dialog?= =?UTF-8?q?=20=E0=B8=8A=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=20KPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 2 + .../Tab/Dialog/DialogGovernment.vue | 161 +++++++----------- 2 files changed, 62 insertions(+), 101 deletions(-) diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index a8d2a289a..c17017e95 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -188,4 +188,6 @@ export default { workflowCommanderOperate: `${workflow}/commander/operate`, workflowCommanderSign: `${workflow}/commander/sign`, + + orgAssistance: (id: string) => `${orgProfile}/assistance/${id}`, }; diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue index 8a911126a..cdd8e0091 100644 --- a/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue @@ -31,85 +31,27 @@ const rowsMain = ref([]); //หัวตาราง const columns = ref([ { - name: "no", + name: "commandName", align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "name", - align: "left", - label: "ชื่อ-นามสกุล", + label: "ประเภทคำสั่ง", sortable: true, - field: "name", + field: "commandName", headerStyle: "font-size: 14px", style: "font-size: 14px", - format(val, row) { - return `${row.prefix}${row.firstName} ${row.lastName}`; - }, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { - name: "posMasterNoOld", + name: "agency", align: "left", - label: "เลขที่ตำแหน่ง", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, - field: "posMasterNoOld", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - return findPosMasterNoOld(row); - }, - }, - { - name: "positionOld", - align: "left", - label: "ตำแหน่งในสายงาน", - sortable: true, - field: "positionOld", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionLevel", - align: "left", - label: "ตำแหน่งประเภท", - sortable: true, - field: "positionLevel", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - let name = ""; - if (row.posTypeNameOld && row.posLevelNameOld) { - name = `${row.posTypeNameOld} (${row.posLevelNameOld})`; - } else if (row.posTypeNameOld) { - name = `${row.posTypeNameOld}`; - } else if (row.posLevelNameOld) { - name = `(${row.posLevelNameOld})`; - } else name = "-"; - return name; - }, - }, - { - name: "organizationPositionOld", - align: "left", - label: "สังกัด", - sortable: true, - field: "organization", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val, row) => findOrgNameOld(row), - }, - { - name: "organization", - align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", - sortable: true, - field: "organization", + 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", @@ -117,9 +59,11 @@ const columns = ref([ label: "วันเริ่มช่วยราชการ", sortable: true, field: "dateStart", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (val) => date2Thai(val), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -127,29 +71,11 @@ const columns = ref([ label: "วันสิ้นสุดการช่วยราชการ", sortable: true, field: "dateEnd", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (val) => date2Thai(val), - }, - { - name: "createdAt", - align: "left", - label: "วันที่ดำเนินการ", - sortable: true, - field: "createdAt", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val) => date2Thai(val), - }, - { - name: "status", - align: "left", - label: "สถานะ", - sortable: true, - field: "status", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val) => statusText(val), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -159,22 +85,54 @@ 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", + align: "left", + label: "เอกสารอ้างอิง", + sortable: true, + 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", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + format: (v) => date2Thai(v, false, true), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); const visibleColumns = ref([ - "no", - "name", - "posMasterNoOld", - "positionOld", - "positionLevel", - "organizationPositionOld", - "organization", + "commandName", + "agency", "dateStart", "dateEnd", - "createdAt", - "status", "commandNo", + "document", + "lastUpdateFullName", + "lastUpdatedAt", ]); /** แปลง สถานะเป็น text */ @@ -209,7 +167,8 @@ function close() { function getData() { showLoader(); http - .get(config.API.placementKeycloak + `/${store.dataProfile.profileId}`) + // .get(config.API.placementKeycloak + `/${store.dataProfile.profileId}`) + .get(config.API.orgAssistance(store.dataEvaluation.profileId)) .then((res) => { const data = res.data.result; rows.value = data;