diff --git a/src/modules/09_leave/components/2_Leave/Tab1.vue b/src/modules/09_leave/components/2_Leave/Tab1.vue index 5a42d3f3d..9723b991e 100644 --- a/src/modules/09_leave/components/2_Leave/Tab1.vue +++ b/src/modules/09_leave/components/2_Leave/Tab1.vue @@ -33,6 +33,7 @@ const querySting = reactive({ keyword: leaveStore.filter.keyword, //keyword ค้นหา }); const maxPage = ref(1); +const totalList = ref(0); //** เรียกข้อมูลจาก API*/ async function fecthLeaveList() { @@ -50,6 +51,7 @@ async function fecthLeaveList() { .then((res) => { const data = res.data.result; maxPage.value = Math.ceil(data.total / querySting.pageSize); + totalList.value = data.total; leaveStore.fetchListLeave(data.data); /** ส่งข้อมูลไป stores*/ }) .catch((err) => { @@ -143,6 +145,7 @@ watch( :page="querySting.page" :rowsPerPage="querySting.pageSize" :maxPage="maxPage" + :totalList="totalList" @update:querySting="updatePaging" /> diff --git a/src/modules/09_leave/components/2_Leave/Tab2.vue b/src/modules/09_leave/components/2_Leave/Tab2.vue index 4ac1621ac..722afc7b2 100644 --- a/src/modules/09_leave/components/2_Leave/Tab2.vue +++ b/src/modules/09_leave/components/2_Leave/Tab2.vue @@ -33,6 +33,7 @@ const querySting = reactive({ keyword: leaveStore.filter.keyword, //keyword ค้นหา }); const maxPage = ref(1); +const totalList = ref(0); //** เรียกข้อมูลจาก API*/ async function fecthLeaveList() { @@ -50,6 +51,7 @@ async function fecthLeaveList() { .then((res) => { const data = res.data.result; maxPage.value = Math.ceil(data.total / querySting.pageSize); + totalList.value = data.tatol; fetchListLeaveReject(data.data); /** ส่งข้อมูลไป stores*/ }) .catch((err) => { @@ -96,6 +98,7 @@ onMounted(async () => { :page="querySting.page" :rowsPerPage="querySting.pageSize" :maxPage="maxPage" + :totalList="totalList" @update:querySting="updatePaging" /> diff --git a/src/modules/09_leave/components/2_Leave/TableList.vue b/src/modules/09_leave/components/2_Leave/TableList.vue index caf17aea7..7a20ae936 100644 --- a/src/modules/09_leave/components/2_Leave/TableList.vue +++ b/src/modules/09_leave/components/2_Leave/TableList.vue @@ -202,6 +202,10 @@ const props = defineProps({ type: Number, require: true, }, + totalList: { + type: Number, + require: true, + }, }); const emit = defineEmits(["update:querySting"]); @@ -291,6 +295,7 @@ onMounted(() => {