From c812866dce95b339f7876c9841a7373610ae5ca9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 21 Sep 2023 15:50:34 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=9B=E0=B8=B5=20=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80?= =?UTF-8?q?=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=A3=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=AA=E0=B8=99=E0=B8=AD?= =?UTF-8?q?=E0=B8=82=E0=B8=AD=E0=B8=9E=E0=B8=A3=E0=B8=B0=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=E0=B8=97=E0=B8=B2=E0=B8=99=E0=B9=80=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=AD=E0=B8=B4=E0=B8=AA=E0=B8=A3=E0=B8=B4=E0=B8=A2=E0=B8=B2?= =?UTF-8?q?=E0=B8=A0=E0=B8=A3=E0=B8=93=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Proposals/addProposals.vue | 9 +++++---- .../components/1_Proposals/listProposals.vue | 11 ++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/07_insignia/components/1_Proposals/addProposals.vue b/src/modules/07_insignia/components/1_Proposals/addProposals.vue index e71787afd..699c0fd55 100644 --- a/src/modules/07_insignia/components/1_Proposals/addProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/addProposals.vue @@ -77,6 +77,7 @@ const fileUploadDoc = async (files: any) => { const updateYear = async (e: number) => { yearly.value = e; + await updateDateRange(); }; // แก้ไขข้อมูล @@ -104,11 +105,11 @@ const SaveData = async () => { // อัพเดทวันที่เริ่มต้น และ สิ้นสุด const updateDateRange = () => { if (roundInsig.value.value == 1) { - dateStart.value = new Date(new Date().getFullYear(), 9, 1); - dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29); + dateStart.value = new Date(yearly.value, 9, 1); + dateEnd.value = new Date(yearly.value + 1, 3, 29); } else if (roundInsig.value.value == 2) { - dateStart.value = new Date(new Date().getFullYear(), 3, 29); - dateEnd.value = new Date(new Date().getFullYear(), 4, 29); + dateStart.value = new Date(yearly.value + 1, 3, 29); + dateEnd.value = new Date(yearly.value + 1, 4, 29); } }; // เพิ่มข้อมูลรอบการเสนอขอพระราชทานเครื่องราชฯ diff --git a/src/modules/07_insignia/components/1_Proposals/listProposals.vue b/src/modules/07_insignia/components/1_Proposals/listProposals.vue index 9b2dac7cc..bfc27cf7f 100644 --- a/src/modules/07_insignia/components/1_Proposals/listProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/listProposals.vue @@ -118,7 +118,10 @@ const fetchData = async () => { }); }; // redirect หน้าข้อมูลรอบการเสนอข้อ -const clickEdit = (col: any) => { +interface Col { + period_id: string; +} +const clickEdit = (col: Col) => { router.push(`/insignia/round-add/${col.period_id}`); }; // ยืนยันการลบรอบการเสนอขอ @@ -172,10 +175,12 @@ const getRequest = async (id: string) => { // ค้นหาในตาราง const filterKeyword = ref(""); -const filterRef = ref(null); +const filterRef = ref(null); const resetFilter = () => { filterKeyword.value = ""; - filterRef.value.focus(); + if (filterRef.value) { + filterRef.value.focus(); + } }; const attrs = ref(useAttrs());