diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index b259bf8be..f516f473d 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -127,7 +127,6 @@ async function paginate() { } function endPagination() { - hasMoreData.value = arrayData.hasMoreData.value; isLoading.value = false; emit('onFetch', store.data); emit('onPaginate'); @@ -183,11 +182,12 @@ defineExpose({ fetch, addFilter }); + diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 093806567..a87ccbb96 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -98,7 +98,7 @@ export function useArrayData(key, userOptions) { const { limit } = filter; hasMoreData.value = response.data.length >= limit; - + store.hasMoreData = hasMoreData.value; if (append) { if (!store.data) store.data = []; for (const row of response.data) store.data.push(row); @@ -169,7 +169,7 @@ export function useArrayData(key, userOptions) { } async function loadMore() { - if (!hasMoreData.value) return; + if (!hasMoreData.value && !store.hasMoreData) return; store.skip = store.limit * page.value; page.value += 1; diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue index 4a8cf154a..12e03fd32 100644 --- a/src/pages/Entry/Card/EntryBasicData.vue +++ b/src/pages/Entry/Card/EntryBasicData.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; +import { useRole } from 'src/composables/useRole'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; @@ -15,6 +16,8 @@ import { toDate } from 'src/filters'; const route = useRoute(); const { t } = useI18n(); +const { hasAny } = useRole(); +const isAdministrative = () => hasAny(['administrative']); const suppliersOptions = ref([]); const travelsOptions = ref([]); @@ -206,6 +209,7 @@ const onFilterTravelSelected = (formData, id) => {