From 6cf673626e8e38392f79e83a7f230e39b25d6854 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 1 Mar 2024 15:00:41 +0700 Subject: [PATCH] no message --- src/modules/13_salary/views/salaryLists.vue | 48 +++++++++++---------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 005c98762..a4c521142 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -38,34 +38,13 @@ const periodLatest = ref(); const isLoad = ref(false); +/** ตัวแปร select*/ const page = ref(1); const pageSize = ref(50); const lastPage = ref(0); const loading = ref(false); const nextPage = ref(1); -function onScroll({ to, ref }: { to: number; ref: any }) { - const lastIndex = roundOptions.value.length - 1; - - if ( - loading.value !== true && - nextPage.value < lastPage.value && - to === lastIndex - ) { - loading.value = true; - - setTimeout(() => { - nextPage.value++; - page.value = nextPage.value; - getRound(); - nextTick(() => { - ref.refresh(); - loading.value = false; - }); - }, 500); - } -} - /**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/ async function getRound() { showLoader(); @@ -278,6 +257,29 @@ async function onChangeAgency() { } } +/** function onScrollSelect รอบการขึ้นเงินเดือน*/ +function onScroll({ to, ref }: { to: number; ref: any }) { + const lastIndex = roundOptions.value.length - 1; + + if ( + loading.value !== true && + nextPage.value < lastPage.value && + to === lastIndex + ) { + loading.value = true; + + setTimeout(() => { + nextPage.value++; + page.value = nextPage.value; + getRound(); + nextTick(() => { + ref.refresh(); + loading.value = false; + }); + }, 500); + } +} + onMounted(async () => { await getRound(); }); @@ -289,7 +291,7 @@ onMounted(async () => { รายการเงินเดือน - +