From fa4ff7eb1e50950caa23f30b0fe47f98ab4ee6f2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 15 Jul 2025 13:30:34 +0700 Subject: [PATCH 1/4] =?UTF-8?q?fix=20rules=20=E0=B9=81=E0=B8=AA=E0=B8=94?= =?UTF-8?q?=E0=B8=87=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1=E0=B8=84=E0=B8=B4?= =?UTF-8?q?=E0=B8=94=E0=B9=80=E0=B8=AB=E0=B9=87=E0=B8=99=20=3D=3D>=20popup?= =?UTF-8?q?=20=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=84=E0=B8=A7?= =?UTF-8?q?=E0=B8=B2=E0=B8=A1=E0=B8=84=E0=B8=B4=E0=B8=94=E0=B9=80=E0=B8=AB?= =?UTF-8?q?=E0=B9=87=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialogs/PopupReason.vue | 6 +++++- .../09_leave/components/05_Leave/DetailLeavePage.vue | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue index 45f546b96..9ba658c11 100644 --- a/src/components/Dialogs/PopupReason.vue +++ b/src/components/Dialogs/PopupReason.vue @@ -28,6 +28,10 @@ const props = defineProps({ textReport: { type: String, }, + isRules: { + type: Boolean, + default: true, + }, }); watch(props, () => { if (modal.value === true && props.textReport == "") { @@ -68,7 +72,7 @@ function closeModal() { outlined dense lazy-rules - :rules="[(val:string) => !!val || `กรุณากรอก${label}`]" + :rules="isRules ? [(val:string) => !!val || `กรุณากรอก${label}`] : []" v-model="reason" :label="`${label}`" /> diff --git a/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue b/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue index 0387976c0..9cf589651 100644 --- a/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue +++ b/src/modules/09_leave/components/05_Leave/DetailLeavePage.vue @@ -63,6 +63,7 @@ const dialogTitle = ref("อนุญาต"); // Title ของ Dialog const dialogLabel = ref("เหตุผล"); // Label ของ Dialog const modalAdd = ref(false); // เปิด Modal เพิ่มผู้บังคับบัญชา const typeAdd = ref(""); // ประเภทการเพิ่ม เช่น COMMANDER, APPROVER +const isRules = ref(true); // เช็คว่ามีการกำหนดกฎของหมายความคิดเห็น /** Form รายละเอียดข้อมูล*/ const formData = reactive({ id: "", //Id การยื่นขอลา @@ -446,14 +447,17 @@ async function checkLeaveType(leaveTypeId: string, formData: FormData) { async function openModal(data: string) { if (data === "approve") { modalApprove.value = true; + isRules.value = false; dialogTitle.value = "อนุญาต"; } if (data === "UnApprove") { modalApprove.value = true; dialogTitle.value = "ไม่อนุญาต"; + isRules.value = true; } if (data === "authority") { modalApprove.value = true; + isRules.value = true; dialogTitle.value = "ความคิดเห็นของผู้บังคับบัญชา"; dialogLabel.value = "ความคิดเห็น"; } @@ -1229,7 +1233,8 @@ onMounted(async () => { v-model:modal="modalApprove" :title="dialogTitle" :label="dialogLabel" - :savaForm="clickSave" + :sava-form="clickSave" + :is-rules="isRules" /> Date: Tue, 15 Jul 2025 13:54:05 +0700 Subject: [PATCH 2/4] =?UTF-8?q?fix=20CurrentPage=20=3D=3D>=20=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=AD=E0=B8=B7=E0=B9=88=E0=B8=99=E0=B9=86=20?= =?UTF-8?q?=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=89=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=E0=B8=A1=E0=B8=AD=E0=B8=9A=E0=B8=AB=E0=B8=A1?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../01_masterdata/views/Assignment.vue | 84 +++++++------------ 1 file changed, 29 insertions(+), 55 deletions(-) diff --git a/src/modules/01_masterdata/views/Assignment.vue b/src/modules/01_masterdata/views/Assignment.vue index dafaa45b3..88c728027 100644 --- a/src/modules/01_masterdata/views/Assignment.vue +++ b/src/modules/01_masterdata/views/Assignment.vue @@ -1,9 +1,13 @@ From 07338cdb637499687c0c98b7cffefd83a4934c90 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 15 Jul 2025 13:59:18 +0700 Subject: [PATCH 3/4] =?UTF-8?q?fix=20CurrentPage=20=3D=3D=3D>=20=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/18_command/components/Main/TableMain.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/18_command/components/Main/TableMain.vue b/src/modules/18_command/components/Main/TableMain.vue index 3c74b9f78..9667a7a63 100644 --- a/src/modules/18_command/components/Main/TableMain.vue +++ b/src/modules/18_command/components/Main/TableMain.vue @@ -6,6 +6,7 @@ import { useRouter } from "vue-router"; import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; import { useCommandListStore } from "@/modules/18_command/store/ListStore"; +import { updateCurrentPage } from "@/utils/function"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -83,6 +84,11 @@ function onReCommand(id: string) { await http .put(config.API.commandAction(id, "resume")) .then(async () => { + page.value = await updateCurrentPage( + page.value, + store.maxPage, + store.rows.length + ); await fetchListCommand(); success($q, "ดึงไปทำคำสั่งใหม่สำเร็จ"); }) @@ -105,6 +111,11 @@ function onDeleteCommand(id: string) { await http .delete(config.API.command + `/${id}`) .then(async () => { + page.value = await updateCurrentPage( + page.value, + store.maxPage, + store.rows.length + ); await fetchListCommand(); success($q, "ลบรายการสำเร็จ"); }) From 972bae6cd67205d2c3dbb859f1843e38949d6992 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 15 Jul 2025 14:20:24 +0700 Subject: [PATCH 4/4] =?UTF-8?q?fix=20currentPage=20=3D=3D=3D>=20=E0=B8=88?= =?UTF-8?q?=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B8=AA=E0=B8=B4=E0=B8=97?= =?UTF-8?q?=E0=B8=98=E0=B8=B4=E0=B9=8C=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=99=E0=B8=A5=E0=B8=B2=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B9=83=E0=B8=8A=E0=B9=89=E0=B9=84=E0=B8=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/09_leave/views/07_LeaveHistoryMain.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/09_leave/views/07_LeaveHistoryMain.vue b/src/modules/09_leave/views/07_LeaveHistoryMain.vue index ca91cd5fa..93aaec70e 100644 --- a/src/modules/09_leave/views/07_LeaveHistoryMain.vue +++ b/src/modules/09_leave/views/07_LeaveHistoryMain.vue @@ -6,6 +6,7 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import { checkPermission } from "@/utils/permissions"; +import { updateCurrentPage } from "@/utils/function"; import { useCounterMixin } from "@/stores/mixin"; import { useLeaveHistoryDataStore } from "@/modules/09_leave/stores/LeaveHistoryStore"; @@ -186,6 +187,11 @@ function onDeleteLeaveBeginning(id: string) { await http .delete(config.API.leaveBeginning + `/${id}`) .then(async () => { + formFilter.page = await updateCurrentPage( + formFilter.page, + maxPage.value, + rows.value.length + ); await fetchDataLeaveBeginning(); success($q, "ลบข้อมูลสำเร็จ"); })