From 8a1fb4f9ed36d3e44ef6454bc6c90fc18874a78a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 24 Apr 2026 15:59:07 +0700 Subject: [PATCH 1/2] refactor(worklist): formatDate colunm checkInTime checkOutTime --- .../09_leave/components/02_WorkList/DialogDetail.vue | 10 ++++++++-- src/modules/09_leave/components/02_WorkList/Tab1.vue | 6 ++++++ src/modules/09_leave/components/02_WorkList/Tab2.vue | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/modules/09_leave/components/02_WorkList/DialogDetail.vue b/src/modules/09_leave/components/02_WorkList/DialogDetail.vue index 9202066c0..176b593bb 100644 --- a/src/modules/09_leave/components/02_WorkList/DialogDetail.vue +++ b/src/modules/09_leave/components/02_WorkList/DialogDetail.vue @@ -267,7 +267,9 @@ watch(
เวลาเข้างาน
-
{{ formData.checkInTime }}
+
+ {{ `${formData.checkInDate} ${formData.checkInTime} น.` }} +
สถานที่ทำงาน
@@ -337,7 +339,11 @@ watch(
เวลาออกงาน
-
{{ formData.checkOutTime }}
+
+ {{ + `${formData.checkOutDate} ${formData.checkOutTime} น.` + }} +
สถานที่ทำงาน
diff --git a/src/modules/09_leave/components/02_WorkList/Tab1.vue b/src/modules/09_leave/components/02_WorkList/Tab1.vue index c33afe3c8..e4939c42f 100644 --- a/src/modules/09_leave/components/02_WorkList/Tab1.vue +++ b/src/modules/09_leave/components/02_WorkList/Tab1.vue @@ -74,6 +74,9 @@ const columns = ref([ field: "checkInTime", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.checkInDate} ${val} น.`; + }, }, { name: "checkInLocation", @@ -101,6 +104,9 @@ const columns = ref([ field: "checkOutTime", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.checkOutDate} ${val} น.`; + }, }, { name: "checkOutLocation", diff --git a/src/modules/09_leave/components/02_WorkList/Tab2.vue b/src/modules/09_leave/components/02_WorkList/Tab2.vue index 6c6af46b8..9475328a6 100644 --- a/src/modules/09_leave/components/02_WorkList/Tab2.vue +++ b/src/modules/09_leave/components/02_WorkList/Tab2.vue @@ -70,6 +70,9 @@ const columns = ref([ field: "checkInTime", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.checkInDate} ${val} น.`; + }, }, { name: "checkInLocation", @@ -88,6 +91,9 @@ const columns = ref([ field: "checkOutTime", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.checkOutDate} ${val} น.`; + }, }, { name: "checkOutLocation", From 5b71a6a37bfa7950f7a0457f3de464b286a8ef61 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 24 Apr 2026 16:25:24 +0700 Subject: [PATCH 2/2] fix display gov age --- .../detail/GovernmentInformation/01_Info.vue | 44 +++++++++---------- .../interface/index/government.ts | 4 +- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue index 5da73bfb0..edd6dea95 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue @@ -50,18 +50,10 @@ const formMain = reactive({ workDate: null, //วันที่เริ่มปฏิบัติราชการ reasonSameDate: "", retireDate: null, //วันเกษียณอายุ - ageAll: { - year: 0, - month: 0, - day: 0, - }, //อายุราชการ + ageAll: "", //อายุราชการ absent: 0, //ขาดราชการ age: 0, //อายุราชการเกื้อกูล - govAgeBkk:{ - year: 0, - month: 0, - day: 0, - } + govAgeBkk: "", }); const modalEdit = ref(false); //แสดง popup แก้ไขข้อมูลราชการ @@ -165,10 +157,22 @@ async function getData() { formMain.reasonSameDate = data.reasonSameDate; formMain.retireDate = data.dateLeave; formMain.dateRetireLaw = data.dateRetireLaw; - formMain.ageAll = data.govAge; + formMain.ageAll = data.govAge + ? ( + (data.govAge.year > 0 ? `${data.govAge.year} ปี ` : "") + + (data.govAge.month > 0 ? `${data.govAge.month} เดือน ` : "") + + (data.govAge.day > 0 ? `${data.govAge.day} วัน` : "") + ).trim() || "-" + : "-"; formMain.absent = data.govAgeAbsent; formMain.age = data.govAgePlus; - formMain.govAgeBkk = data.govAgeBkk; + formMain.govAgeBkk = data.govAgeBkk + ? ( + (data.govAgeBkk.year > 0 ? `${data.govAgeBkk.year} ปี ` : "") + + (data.govAgeBkk.month > 0 ? `${data.govAgeBkk.month} เดือน ` : "") + + (data.govAgeBkk.day > 0 ? `${data.govAgeBkk.day} วัน` : "") + ).trim() || "-" + : "-"; }) .catch((e) => { messageError($q, e); @@ -455,25 +459,19 @@ onMounted(() => { อายุราชการ
- {{ - formMain.ageAll - ? `${formMain.ageAll.year} ปี ${formMain.ageAll.month} เดือน ${formMain.ageAll.day} วัน` - : "-" - }} + {{ formMain.ageAll }}
- อายุราชการ (กทม.) + อายุราชการ (กทม.)
- {{ - formMain.govAgeBkk - ? `${formMain.govAgeBkk.year} ปี ${formMain.govAgeBkk.month} เดือน ${formMain.govAgeBkk.day} วัน` - : "-" - }} + {{ formMain.govAgeBkk }}
diff --git a/src/modules/04_registryPerson/interface/index/government.ts b/src/modules/04_registryPerson/interface/index/government.ts index b9796889c..283173e4c 100644 --- a/src/modules/04_registryPerson/interface/index/government.ts +++ b/src/modules/04_registryPerson/interface/index/government.ts @@ -13,8 +13,8 @@ interface FormMain { workDate: any; reasonSameDate: string; retireDate: any; - ageAll: GovAgeForm; - govAgeBkk: GovAgeForm; + ageAll: GovAgeForm | string; + govAgeBkk: GovAgeForm | string; absent: number; age: number; [key: string]: any;