From 36b136bd0e4c81c5cd3cb6d8db39d54f93990330 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 24 Dec 2024 10:37:09 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=82=E0=B9=89=E0=B8=B2-?= =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/09_leave/components/02_WorkList/DialogDetail.vue | 5 +++-- src/modules/09_leave/components/02_WorkList/DialogEdit.vue | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/09_leave/components/02_WorkList/DialogDetail.vue b/src/modules/09_leave/components/02_WorkList/DialogDetail.vue index 2f24fad01..9d3e19323 100644 --- a/src/modules/09_leave/components/02_WorkList/DialogDetail.vue +++ b/src/modules/09_leave/components/02_WorkList/DialogDetail.vue @@ -147,8 +147,9 @@ watch( - รายละเอียดการลงเวลาของ - {{ formData.fullName }} + รายละเอียดการลงเวลา + + {{ formData.fullName }} Date: Tue, 24 Dec 2024 11:39:10 +0700 Subject: [PATCH 2/3] fix bug --- .../04_SpecialTime/DialogApprove.vue | 135 +++++++----------- .../09_leave/views/04_SpecialTimeMain.vue | 50 +++---- 2 files changed, 71 insertions(+), 114 deletions(-) diff --git a/src/modules/09_leave/components/04_SpecialTime/DialogApprove.vue b/src/modules/09_leave/components/04_SpecialTime/DialogApprove.vue index 64d7256a8..9203da9ce 100644 --- a/src/modules/09_leave/components/04_SpecialTime/DialogApprove.vue +++ b/src/modules/09_leave/components/04_SpecialTime/DialogApprove.vue @@ -7,10 +7,8 @@ import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useSpecialTimeStore } from "@/modules/09_leave/stores/SpecialTimeStore"; -import type { - dataRowRound, - MyObjectRoundRef, -} from "@/modules/09_leave/interface/response/specialTime"; +import type { dataRowRound } from "@/modules/09_leave/interface/response/specialTime"; +import type { DataOption } from "@/modules/09_leave/interface/index/Main"; import DialogHeader from "@/components/DialogHeader.vue"; @@ -19,7 +17,7 @@ const $q = useQuasar(); const SpecialTimeStore = useSpecialTimeStore(); const mixin = useCounterMixin(); const { dialogConfirm, showLoader, success, messageError, hideLoader } = mixin; -const option = ref(SpecialTimeStore.optionStatus); +const option = ref(SpecialTimeStore.optionStatus); /** props*/ const props = defineProps({ @@ -32,14 +30,9 @@ const props = defineProps({ checkOutStatus: { type: String, default: "" }, closeDialog: { type: Function, default: () => {} }, detailData: Object, + fetchData: { type: Function, default: () => {} }, }); -const checkInRef = ref(null); -const checkOutRef = ref(null); -const checkInStatusRef = ref(null); -const checkOutStatusRef = ref(null); -const reasonRef = ref(null); - const formData = reactive({ checkIn: "", checkOut: "", @@ -50,73 +43,35 @@ const formData = reactive({ checkOutEdit: false, }); -const objectRound: MyObjectRoundRef = { - checkIn: checkInRef, - checkOut: checkOutRef, - checkInStatus: checkInStatusRef, - checkOutStatus: checkOutStatusRef, - note: reasonRef, -}; - -/** function validateFom*/ -function validateForm() { - const hasError = []; - for (const key in objectRound) { - if (Object.prototype.hasOwnProperty.call(objectRound, key)) { - const property = objectRound[key]; - if (property.value && typeof property.value.validate === "function") { - const isValid = property.value.validate(); - hasError.push(isValid); - } - } - } - if (hasError.every((result) => result === true)) { - onSubmit(); - } -} - /** function confrim*/ -function onSubmit() { - dialogConfirm( - $q, - async () => { - await approveData(); - props.closeDialog?.(); - }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" - ); -} - -/** function บันทึกข้อมูล*/ -async function approveData() { - showLoader(); - const body = { - checkInTime: formData.checkIn, - checkOutTime: formData.checkOut, - checkInStatus: formData.checkInStatus, - checkOutStatus: formData.checkOutStatus, - reason: formData.note, - }; - await http - .put(config.API.specialTimeApprove(props.id), body) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - SpecialTimeStore.fetchData(); - hideLoader(); - }); +async function onSubmit() { + dialogConfirm($q, async () => { + showLoader(); + await http + .put(config.API.specialTimeApprove(props.id), { + checkInTime: formData.checkIn, + checkOutTime: formData.checkOut, + checkInStatus: formData.checkInStatus, + checkOutStatus: formData.checkOutStatus, + reason: formData.note, + }) + .then(async () => { + await props.fetchData(); + success($q, "บันทึกข้อมูลสำเร็จ"); + props.closeDialog?.(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); + }); } /** function closeDialog*/ function close() { - if (props.closeDialog) { - props.closeDialog(); - } + props.closeDialog(); } /** @@ -127,7 +82,7 @@ function close() { function filterOptionFn(val: string, update: Function) { update(() => { option.value = SpecialTimeStore.optionStatus.filter( - (e: any) => e.name.search(val) !== -1 + (e: DataOption) => e.name.search(val) !== -1 ); }); } @@ -176,7 +131,7 @@ watch( From ed0cdc7378f535cb2ae0fe42a6aec58753fe4eda Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 24 Dec 2024 13:16:52 +0700 Subject: [PATCH 3/3] fix bug --- .../components/03_ChangeRound/DialogForm.vue | 31 ++++++++++--------- .../09_leave/stores/ChangeRoundStore.ts | 6 ++-- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/modules/09_leave/components/03_ChangeRound/DialogForm.vue b/src/modules/09_leave/components/03_ChangeRound/DialogForm.vue index 3b5a0f634..04b6a8e98 100644 --- a/src/modules/09_leave/components/03_ChangeRound/DialogForm.vue +++ b/src/modules/09_leave/components/03_ChangeRound/DialogForm.vue @@ -232,7 +232,7 @@ watch( />
- +
@@ -270,10 +270,12 @@ watch( :borderless="true" outlined style="width: 23.5rem" + class="inputgreen" />
- -
-
- -
-
+ + + +
diff --git a/src/modules/09_leave/stores/ChangeRoundStore.ts b/src/modules/09_leave/stores/ChangeRoundStore.ts index 4083c11e4..d76e74a4a 100644 --- a/src/modules/09_leave/stores/ChangeRoundStore.ts +++ b/src/modules/09_leave/stores/ChangeRoundStore.ts @@ -127,9 +127,9 @@ export const useChangeRoundDataStore = defineStore( showLoader(); await http .post(config.API.leaveSearch(), { - citizenId: dataDetail.cardId || "", //เลขประจำตัวประชาชน - firstname: dataDetail.firstName || "", //ชื่อจริง - lastname: dataDetail.lastName || "", //นามสกุล + citizenId: dataDetail.cardId.trim() || "", //เลขประจำตัวประชาชน + firstname: dataDetail.firstName.trim() || "", //ชื่อจริง + lastname: dataDetail.lastName.trim() || "", //นามสกุล page: dataDetail.page, //หน้า pageSize: dataDetail.pageSize || 10, //จำนวนแถวต่อหน้า keyword: dataDetail.keyword || "", //keyword ค้นหา