From ecc10e16c9030cbe54d478f64beb9dee1eb50830 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 24 Mar 2026 16:50:26 +0700 Subject: [PATCH 1/3] feat:absentlate --- src/api/registry/api.registry.ts | 6 + .../GovernmentInformation/08_AbsentLate.vue | 424 ++++++++++++++++++ .../08_DialogAbsentLate.vue | 242 ++++++++++ .../detail/GovernmentInformation/Main.vue | 5 + .../interface/response/Government.ts | 19 +- .../04_registryPerson/stores/AbsentLate.ts | 19 + 6 files changed, 714 insertions(+), 1 deletion(-) create mode 100644 src/modules/04_registryPerson/components/detail/GovernmentInformation/08_AbsentLate.vue create mode 100644 src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue create mode 100644 src/modules/04_registryPerson/stores/AbsentLate.ts diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 0cbfc086e..f3378e539 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -272,4 +272,10 @@ export default { profileAssistanceReturn: `${env.API_URI}/placement/repatriation`, profileAssistanceUpdateDelete: (type: string) => `${registryNew}${type}/assistance/update-delete/`, + + profileAbsentLate: (type: string) => `${registryNew}${type}/absent-late`, + profileAbsentLateUpdateDelete: (type: string) => `${registryNew}${type}/absent-late/update-delete`, + profileAbsentLateHistory: (id: string, type: string) => + `${registryNew}${type}/absent-late/history/${id}`, + }; diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_AbsentLate.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_AbsentLate.vue new file mode 100644 index 000000000..1ae40bde9 --- /dev/null +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_AbsentLate.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue new file mode 100644 index 000000000..3bc7b9c3e --- /dev/null +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue index da7af1456..3f30cf12e 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue @@ -14,6 +14,7 @@ import PerformSpecialWork from "@/modules/04_registryPerson/components/detail/Go import ActingPos from "@/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue"; //รักษาการในตำแหน่ง import HelpGovernmentDetail from "@/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue"; //ช่วยราชการ import Postion from "@/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue"; +import AbsentLate from "@/modules/04_registryPerson/components/detail/GovernmentInformation/08_AbsentLate.vue"; import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store"; const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); @@ -47,6 +48,7 @@ const storeRegistry = useRegistryNewDataStore(); + @@ -76,6 +78,9 @@ const storeRegistry = useRegistryNewDataStore(); :citizen-id="storeRegistry.citizenId" /> + + + { + const statusOps = ref([ + { name: "ขาดราชการ", id: "ABSENT" }, + { name: "มาสาย", id: "LATE" }, + ]); + + const stampTypeOps = ref([ + { name: "เต็มวัน", id: "FULL_DAY" }, + { name: "ครึ่งเช้า", id: "MORNING" }, + { name: "ครึ่งบ่าย ", id: "AFTERNOON" }, + ]); + + return { statusOps, stampTypeOps }; +}); From 0a5f64c17ca4f228fa7f785f9b663e5e8f51f42e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 25 Mar 2026 09:18:51 +0700 Subject: [PATCH 2/3] fix: payload profileEmployeeId --- .../GovernmentInformation/08_DialogAbsentLate.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue index 3bc7b9c3e..0697b5ad9 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue @@ -57,16 +57,23 @@ function onSubmit() { dialogConfirm($q, async () => { try { showLoader(); - const playload = { + const payload = { ...form, stampDate: convertDateToAPI(form.stampDate), - profileId: isStatusEdit.value ? undefined : profileId.value, + profileId: + !isStatusEdit.value && empType.value === "" + ? profileId.value + : undefined, + profileEmployeeId: + !isStatusEdit.value && empType.value !== "" + ? profileId.value + : undefined, }; const method = isStatusEdit.value ? "patch" : "post"; const url = isStatusEdit.value ? config.API.profileAbsentLate(empType.value) + `/${rowId.value}` : config.API.profileAbsentLate(empType.value); - await http[method](url, playload); + await http[method](url, payload); success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData(); closeDialog(); From 5f48063ae79424b67e82d7c5f7fdb2c195f8c566 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 25 Mar 2026 10:27:45 +0700 Subject: [PATCH 3/3] fix layout and select input --- .../08_DialogAbsentLate.vue | 64 +++++++++++-------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue index 0697b5ad9..4d0311de3 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue @@ -90,6 +90,17 @@ function closeDialog() { modal.value = false; } +watch( + () => form.stampType, + (stampType) => { + if (stampType === "FULL_DAY") { + form.stampAmount = "1.0"; + } else if (stampType === "MORNING" || stampType === "AFTERNOON") { + form.stampAmount = "0.5"; + } + } +); + watch( () => modal.value, (newVal) => { @@ -119,29 +130,31 @@ watch(
-
- +
+
+ +
-
+
-
+
-
+
@@ -229,7 +244,6 @@ watch( label="เหตุผล" hide-bottom-space type="textarea" - :rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]" />