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());