From e12da05ffe0561b2ee8f1240bf90703e9a8b69b3 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 1 May 2025 15:15:52 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B9=80?= =?UTF-8?q?=E0=B8=95=E0=B8=AD=E0=B8=A3=E0=B9=8C=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_leave/components/FormLeave/12_FollowSpouseForm.vue | 5 +++-- src/modules/05_leave/components/ListView.vue | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/05_leave/components/FormLeave/12_FollowSpouseForm.vue b/src/modules/05_leave/components/FormLeave/12_FollowSpouseForm.vue index 19c0109..a41e91f 100644 --- a/src/modules/05_leave/components/FormLeave/12_FollowSpouseForm.vue +++ b/src/modules/05_leave/components/FormLeave/12_FollowSpouseForm.vue @@ -233,6 +233,7 @@ async function fetchCheck() { reasonLeave.value = data.message ? data.message : "จำนวนวันลาเกินที่กำหนด"; + checkTotalHistory(); hideLoader(); }) .catch((e: any) => { @@ -315,7 +316,7 @@ watch(props.data, async () => { formDataFollowSpouse.coupleDayEndDateHistory = props.data.coupleDayEndDateHistory; leaveDocumentList.value = props.data.leaveDocument; - + checkTotalHistory(); const leaveTotal = await calculateDurationYmd( props.data.leaveStartDate, props.data.leaveEndDate @@ -361,7 +362,7 @@ onMounted(async () => { formDataFollowSpouse.coupleDayEndDateHistory = props.data.coupleDayEndDateHistory; leaveDocumentList.value = props.data.leaveDocument; - + checkTotalHistory(); const leaveTotal = await calculateDurationYmd( props.data.leaveStartDate, props.data.leaveEndDate diff --git a/src/modules/05_leave/components/ListView.vue b/src/modules/05_leave/components/ListView.vue index ce4c666..9c0df62 100644 --- a/src/modules/05_leave/components/ListView.vue +++ b/src/modules/05_leave/components/ListView.vue @@ -41,8 +41,8 @@ async function fetchDataTable() { showLoader(); const body = { year: year.value, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.) - type: type.value, //*Id ประเภทการลา - status: status.value, //*สถานะการของลา + type: LeaveData.type, //*Id ประเภทการลา + status: LeaveData.status, //*สถานะการของลา page: page.value.toString(), //*หน้า pageSize: pageSize.value.toString(), //*จำนวนแถวต่อหน้า keyword: filter.value, //keyword ค้นหา From 45fdb9c8b8b92a66414b26bca558b5399f7cee07 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 1 May 2025 17:06:06 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/05_leave/components/ListView.vue | 4 +++- src/modules/05_leave/components/Table.vue | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/05_leave/components/ListView.vue b/src/modules/05_leave/components/ListView.vue index 9c0df62..af64c6c 100644 --- a/src/modules/05_leave/components/ListView.vue +++ b/src/modules/05_leave/components/ListView.vue @@ -35,7 +35,7 @@ const filter = ref(""); const maxPage = ref(1); const page = ref(1); const pageSize = ref(10); - +const total = ref(0) /** function เรียกข้อมูลการลา*/ async function fetchDataTable() { showLoader(); @@ -53,6 +53,7 @@ async function fetchDataTable() { const data = res.data.result.data; LeaveData.fetchListLeave(data); maxPage.value = Math.ceil(res.data.result.total / pageSize.value); + total.value = res.data.result.total; }) .catch((err) => { messageError($q, err); @@ -187,6 +188,7 @@ onMounted(async () => { :maxPage="maxPage" :pageSize="pageSize" :leaveType="leaveType" + :total="total" >