From 52cfa6e0af5a99f1b533a2431d3c330b1be1874b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 16 Mar 2026 10:14:03 +0700 Subject: [PATCH 1/5] fix(registry): add reactive-rules rule prefix rank --- .../detail/PersonalInformation/01_Profile.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index 8f54e02cd..7730029f7 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -406,6 +406,12 @@ function calculateMinDate() { return today; } +function prefixRankRule() { + return [ + () => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", + ]; +} + /** ดูการเปลี่ยนแปลงของวันเกิดเมื่อมีการเปลี่ยนแปลงจะคำนวนอายูใหม่*/ watch( () => formData.birthDate, @@ -599,7 +605,8 @@ onMounted(() => { class="inputgreen" :options="store.Ops.prefixOps" :label="dataLabel.prefix" - :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" + :rules="prefixRankRule()" + reactive-rules @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'prefixOps' )" @@ -620,7 +627,8 @@ onMounted(() => { input-debounce="0" option-label="name" option-value="name" - :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" + :rules="prefixRankRule()" + reactive-rules v-model="formData.rank" class="inputgreen" :options="store.Ops.rankOps" From 1d99705b651cec37be47e12ded423c465d9dafbd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 24 Mar 2026 10:01:34 +0700 Subject: [PATCH 2/5] fix(registry-officer): add field leaveSubTypeName and coupleDayLevelCountry form leave --- .../detail/GovernmentInformation/03_Leave.vue | 59 ++++++++++++++++++- .../interface/index/leave.ts | 3 + 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue index 726ed821a..721542aba 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue @@ -202,6 +202,17 @@ const pagination = ref({ const columnsHistory = ref(baseColumns.value); const visibleColumnsHistory = ref(baseVisibleColumns.value); +/** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/ +const leaveSubTypeName = ref(""); +const optionSubTypeName = ref([ + "ศึกษาต่อ", + "ฝึกอบรม", + "ปฎิบัติการวิจัย", + "ดูงาน", +]); + +const coupleDayLevelCountry = ref(""); + /** function fetch ข้อมูลรายการลา*/ async function getData() { showLoader(); @@ -213,6 +224,7 @@ async function getData() { ...item, id: item.id, typeLeave: item.leaveType.name, + codeLeave: item.leaveType.code, code: item.leaveType.refCommandDate, dateStartLeave: item.dateLeaveStart, dateEndLeave: item.dateLeaveEnd, @@ -292,8 +304,10 @@ function openDialogEdit(props: DetailData) { typeLeave.value = { id: props.typeLeaveId, name: props.typeLeave, - code: props.code, + code: props.codeLeave, }; + leaveSubTypeName.value = props.leaveSubTypeName; + coupleDayLevelCountry.value = props.coupleDayLevelCountry; statLeave.value = props.status; reason.value = props.reason; dateRange.value = [ @@ -316,6 +330,10 @@ function onSubmit() { const body = { leaveTypeId: typeLeave.value?.id, + leaveSubTypeName: + typeLeave.value?.code === "LV-008" ? leaveSubTypeName.value : undefined, + coupleDayLevelCountry: + typeLeave.value?.code === "LV-010" ? coupleDayLevelCountry.value : undefined, dateLeaveStart: dateToISO(dateRange.value[0]), dateLeaveEnd: dateToISO(dateRange.value[1]), leaveDays: numLeave.value, @@ -451,6 +469,8 @@ function closeDialog() { dateRange.value = [new Date(), new Date()]; numLeave.value = 1; numUsedLeave.value = 0; + leaveSubTypeName.value = ""; + coupleDayLevelCountry.value = ""; } function statusLeave(val: string) { @@ -741,6 +761,43 @@ onMounted(() => { ) " /> + +
+ + +
Date: Tue, 24 Mar 2026 16:50:26 +0700 Subject: [PATCH 3/5] 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 4/5] 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 5/5] 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 || `${'กรุณากรอกเหตุผล'}`]" />