From ad921145b888db3323c15592bf28e1c34313ca3e Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 5 Mar 2025 18:25:40 +0700 Subject: [PATCH 1/6] fixing layout --- src/modules/04_registryPerson/views/listView.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/04_registryPerson/views/listView.vue b/src/modules/04_registryPerson/views/listView.vue index 9909e3287..e54ede9a9 100644 --- a/src/modules/04_registryPerson/views/listView.vue +++ b/src/modules/04_registryPerson/views/listView.vue @@ -620,20 +620,20 @@ onMounted(async () => { - + /> --> - + /> -->
Date: Wed, 5 Mar 2025 22:46:10 +0700 Subject: [PATCH 2/6] updated --- src/stores/mixin.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 40ea4b8d1..37b194cca 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -1154,13 +1154,13 @@ export const useCounterMixin = defineStore("mixin", () => { const m = parseInt(month); const d = parseInt(day); - // const parts = []; - // if (y > 0) parts.push(`${y} ปี`); - // if (m > 0) parts.push(`${m} เดือน`); - // if (d > 0) parts.push(`${d} วัน`); + const parts = []; + if (y > 0) parts.push(`${y} ปี`); + if (m > 0) parts.push(`${m} เดือน`); + if (d > 0) parts.push(`${d} วัน`); - // return parts.length > 0 ? parts.join(" ") : ""; // กรณีที่ทั้งหมดเป็น 0 - return `${y} ปี ${m} เดือน ${d} วัน`; + return parts.length > 0 ? parts.join(" ") : `${y} ปี ${m} เดือน ${d} วัน`; // กรณีที่ทั้งหมดเป็น 0 + // return `${y} ปี ${m} เดือน ${d} วัน`; } return { From e7eb440ca6dcc0920914837fff4eaff863f29abd Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 5 Mar 2025 23:19:48 +0700 Subject: [PATCH 3/6] fixing --- src/modules/21_report/views/02_reportRegistry.vue | 13 +++++++++---- src/stores/mixin.ts | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index 566ca13b7..3738266fd 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -38,8 +38,13 @@ const { fetchStructureTree } = useStructureTree(); const storeMenu = useMenuDataStore(); -const { messageError, showLoader, hideLoader, date2Thai, formatDatePosition } = - useCounterMixin(); +const { + messageError, + showLoader, + hideLoader, + date2Thai, + formatDatePositionReport, +} = useCounterMixin(); const loadingBtn = ref(false); const total = ref(0); @@ -560,13 +565,13 @@ async function onSearch() { dateAppoint: item.dateAppoint ?? "-", age: item.age ?? "-", positionDate: - formatDatePosition( + formatDatePositionReport( item.positionDate?.Years, item.positionDate?.Months, item.positionDate?.Days ) ?? "-", levelDate: - formatDatePosition( + formatDatePositionReport( item.levelDate?.posExecutiveYears, item.levelDate?.posExecutiveMonths, item.levelDate?.posExecutiveDays diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 37b194cca..d85dced88 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -1163,6 +1163,20 @@ export const useCounterMixin = defineStore("mixin", () => { // return `${y} ปี ${m} เดือน ${d} วัน`; } + function formatDatePositionReport(year: string, month: string, day: string) { + const y = parseInt(year); + const m = parseInt(month); + const d = parseInt(day); + + const parts = []; + if (y > 0) parts.push(`${y} ปี`); + if (m > 0) parts.push(`${m} เดือน`); + if (d > 0) parts.push(`${d} วัน`); + + return parts.length > 0 ? parts.join(" ") : ""; // กรณีที่ทั้งหมดเป็น 0 + // return `${y} ปี ${m} เดือน ${d} วัน`; + } + return { calAge, date2Thai, @@ -1210,5 +1224,6 @@ export const useCounterMixin = defineStore("mixin", () => { onSearchDataTable, formatDatePosition, + formatDatePositionReport, }; }); From 8650cb21530ca407e480e7fb73f0c732ceafe6a0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 6 Mar 2025 09:02:53 +0700 Subject: [PATCH 4/6] fix Columns --- .../GovernmentInformation/07_Position.vue | 22 +- .../07_PositionHistory.vue | 238 ++++++++---------- 2 files changed, 112 insertions(+), 148 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue index 7bbc69e65..51f4051c9 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -26,7 +26,6 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/Governm import { useCounterMixin } from "@/stores/mixin"; import { useSalaryDataStore } from "@/modules/04_registryPerson/stores/salary"; import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; -const { findOrgName } = useCounterMixin(); const $q = useQuasar(); const route = useRoute(); @@ -50,6 +49,7 @@ const { pathRegistryEmp, onSearchDataTable, formatDatePosition, + findOrgName, } = useCounterMixin(); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); @@ -561,13 +561,13 @@ function onSubmit() { !isStatusEdit.value && empType.value === "" ? profileId.value : undefined, - date: formDataSalary.date, // วันที่ + // date: formDataSalary.date, // วันที่ posNo: formDataSalary.posNo, //ตำแหน่งเลขที่ - position: formDataSalary.position, //ตำแหน่ง - positionLine: - empType.value === "" ? formDataSalary.positionLine : undefined, //สายงาน - positionPathSide: - empType.value === "" ? formDataSalary.positionPathSide : undefined, // ด้าน/สาขา + // position: formDataSalary.position, //ตำแหน่ง + // positionLine: + // empType.value === "" ? formDataSalary.positionLine : undefined, //สายงาน + // positionPathSide: + // empType.value === "" ? formDataSalary.positionPathSide : undefined, // ด้าน/สาขา positionExecutive: empType.value === "" ? formDataSalary.positionExecutive : undefined, //ตำแหน่งทางการบริหาร positionType: formDataSalary.positionType, // ประเภทตำแหน่ง @@ -588,8 +588,12 @@ function onSubmit() { typeof formDataSalary.amountSpecial === "number" ? formDataSalary.amountSpecial : Number(formDataSalary?.amountSpecial?.replace(/,/g, "")), //เงินค่าตอบแทนพิเศษ - refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง - templateDoc: formDataSalary.doc, // เอกสารอ้างอิง + // refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง + // templateDoc: formDataSalary.doc, // เอกสารอ้างอิง + posNoAbb: null, + positionName: "positionName", + remark: "remark", + commandCode: "1", }; try { diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue index efd42c67b..0cf7dba46 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue @@ -21,6 +21,7 @@ const { messageError, pathRegistryEmp, onSearchDataTable, + findOrgName, } = useCounterMixin(); /** props*/ @@ -36,7 +37,7 @@ const baseColumns = ref([ { name: "commandDateAffect", align: "left", - label: "วัน เดือน ปี", + label: "วันที่คำสั่งมีผล", sortable: true, field: "commandDateAffect", headerStyle: "font-size: 14px", @@ -47,70 +48,6 @@ const baseColumns = ref([ .toString() .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - { - name: "amount", - align: "left", - label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน", - sortable: true, - field: "amount", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionSalaryAmount", - align: "left", - label: "เงินประจำตำแหน่ง", - sortable: true, - field: "positionSalaryAmount", - headerStyle: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "mouthSalaryAmount", - align: "left", - label: "เงินค่าตอบแทนรายเดือน", - sortable: true, - field: "mouthSalaryAmount", - headerStyle: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "oc", - align: "left", - label: "สังกัด", - sortable: true, - field: "oc", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionName", - align: "left", - label: "ตำแหน่ง", - sortable: true, - field: "positionName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "posNo", align: "left", @@ -127,45 +64,40 @@ const baseColumns = ref([ : "-"; }, sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "positionLine", + name: "positionName", align: "left", - label: "สายงาน", + label: empType.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน", sortable: true, - field: "positionLine", + field: "positionName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionPathSide", - align: "left", - label: "ด้าน/สาขา", - sortable: true, - field: "positionPathSide", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "positionType", align: "left", - label: "ตำแหน่งประเภท", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", sortable: true, field: "positionType", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "positionLevel", align: "left", - label: "ระดับ", + label: empType.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ", sortable: true, field: "positionLevel", format(val, row) { @@ -194,38 +126,47 @@ const baseColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "positionExecutiveSide", + name: "amount", align: "left", - label: "ด้านทางการบริหาร", + label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน", sortable: true, - field: "positionExecutiveSide", + field: "amount", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (v) => Number(v).toLocaleString(), sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "salaryClass", - align: "left", - label: "ตำแหน่ง (รายละเอียด)", - sortable: true, - field: "salaryClass", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - 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" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + // { + // name: "positionSalaryAmount", + // align: "left", + // label: "เงินประจำตำแหน่ง", + // sortable: true, + // field: "positionSalaryAmount", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // format: (v) => Number(v).toLocaleString(), + // sort: (a: string, b: string) => + // a + // .toString() + // .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "mouthSalaryAmount", + // align: "left", + // label: "เงินค่าตอบแทนรายเดือน", + // sortable: true, + // field: "mouthSalaryAmount", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // format: (v) => Number(v).toLocaleString(), + // sort: (a: string, b: string) => + // a + // .toString() + // .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, { name: "refCommandNo", align: "left", @@ -242,6 +183,51 @@ const baseColumns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + 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: "commandDateSign", + align: "left", + label: "วันที่ลงนาม", + sortable: true, + field: "commandDateSign", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v), + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "organization", + align: "left", + label: "สังกัด", + sortable: true, + field: "organization", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format(val, row) { + return findOrgName({ + root: row.orgRoot, + child1: row.orgChild1, + child2: row.orgChild2, + child3: row.orgChild3, + child4: row.orgChild4, + }); + }, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "remark", align: "left", @@ -253,48 +239,22 @@ const baseColumns = ref([ 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", - 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" }), - }, ]); const visibleColumns = ref([ "commandDateAffect", "amount", "positionSalaryAmount", "mouthSalaryAmount", - "oc", - "positionName", "posNo", - "positionLine", - "positionPathSide", + "positionName", "positionType", "positionLevel", "positionExecutive", - "positionExecutiveSide", - "salaryClass", + "commandDateSign", "commandName", "refCommandNo", "remark", + "organization", "lastUpdateFullName", "lastUpdatedAt", ]); From 377a8dc7c18e4a8563b00b5e400e5c1fcaae115a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 6 Mar 2025 09:31:23 +0700 Subject: [PATCH 5/6] =?UTF-8?q?fix=20UI=20=E0=B8=84=E0=B9=89=E0=B8=99?= =?UTF-8?q?=E0=B8=AB=E0=B8=B2=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95?= =?UTF-8?q?=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../04_registryPerson/views/listView.vue | 703 +++++++++--------- 1 file changed, 347 insertions(+), 356 deletions(-) diff --git a/src/modules/04_registryPerson/views/listView.vue b/src/modules/04_registryPerson/views/listView.vue index a766b7f07..62cae82ab 100644 --- a/src/modules/04_registryPerson/views/listView.vue +++ b/src/modules/04_registryPerson/views/listView.vue @@ -1,12 +1,5 @@