diff --git a/resources/scripts/admin/stores/category.js b/resources/scripts/admin/stores/category.js index a1c35b3b..787f61b4 100644 --- a/resources/scripts/admin/stores/category.js +++ b/resources/scripts/admin/stores/category.js @@ -17,6 +17,7 @@ export const useCategoryStore = (useWindow = false) => { name: '', description: '', }, + editCategory: null }), getters: { diff --git a/resources/scripts/admin/stores/customer.js b/resources/scripts/admin/stores/customer.js index 0069961e..ffb3b58d 100644 --- a/resources/scripts/admin/stores/customer.js +++ b/resources/scripts/admin/stores/customer.js @@ -25,6 +25,7 @@ export const useCustomerStore = (useWindow = false) => { currentCustomer: { ...customerStub(), }, + editCustomer: null }), getters: { diff --git a/resources/scripts/admin/views/expenses/Create.vue b/resources/scripts/admin/views/expenses/Create.vue index ca36c8ad..8f689a7d 100644 --- a/resources/scripts/admin/views/expenses/Create.vue +++ b/resources/scripts/admin/views/expenses/Create.vue @@ -77,6 +77,7 @@ label="name" track-by="id" :options="searchCategory" + v-if="!isFetchingInitialData" :filter-results="false" resolve-on-load :delay="500" @@ -180,6 +181,7 @@ label="name" track-by="id" :options="searchCustomer" + v-if="!isFetchingInitialData" :filter-results="false" resolve-on-load :delay="500" @@ -280,7 +282,7 @@ diff --git a/resources/scripts/admin/views/invoices/View.vue b/resources/scripts/admin/views/invoices/View.vue index 9e0a3078..22c98ad3 100644 --- a/resources/scripts/admin/views/invoices/View.vue +++ b/resources/scripts/admin/views/invoices/View.vue @@ -40,6 +40,10 @@ const isSendingEmail = ref(false) const isRequestOnGoing = ref(false) const isSearching = ref(false) const isLoading = ref(false) +const invoiceList = ref(null) +const page_no = ref(1) +const last_page_no = ref(1) +const isLoadMore = ref(false) const searchData = reactive({ orderBy: null, @@ -118,14 +122,38 @@ function hasActiveUrl(id) { return route.params.id == id } -async function loadInvoices() { - isLoading.value = true - await invoiceStore.fetchInvoices() +async function loadInvoices(params, isScroll=false) { + if(isScroll) { + isLoadMore.value = true + } + else { + isLoading.value = true + } + let invoice = await invoiceStore.fetchInvoices(params) isLoading.value = false + isLoadMore.value = false + let invoice_list = invoiceList.value ? invoiceList.value : [] + + for (const key in invoice.data.data) { + invoice_list.push(invoice.data.data[key]) + } + invoiceList.value = invoice_list - setTimeout(() => { - scrollToInvoice() - }, 500) + page_no.value = params ? params.page : 1 + last_page_no.value = invoice.data.meta.last_page + let isInvoiceExist = invoiceList.value.find(inv=>inv.id==route.params.id) + + if(isScroll==false && !isInvoiceExist && page_no.value { + if(isScroll==false) { + scrollToInvoice() + } + }, 500) + } } function scrollToInvoice() { @@ -133,9 +161,21 @@ function scrollToInvoice() { if (el) { el.scrollIntoView({ behavior: 'smooth' }) el.classList.add('shake') + addScrollListner() } } +function addScrollListner() { + let el = document.getElementById("scroll_load") + el.addEventListener('scroll', (ev) => { + if(ev.target.scrollTop>0 && (ev.target.scrollTop == ev.target.scrollHeight - ev.target.clientHeight)) { + if(page_no.value
-
+ +
diff --git a/resources/scripts/admin/views/payments/Create.vue b/resources/scripts/admin/views/payments/Create.vue index 663a69c0..39888302 100644 --- a/resources/scripts/admin/views/payments/Create.vue +++ b/resources/scripts/admin/views/payments/Create.vue @@ -84,9 +84,9 @@