diff --git a/resources/assets/vue/components/companies/elements/CustomerPaymentBillingInnerComponent.vue b/resources/assets/vue/components/companies/elements/CustomerPaymentBillingInnerComponent.vue index c8fd956d..a2aaaedb 100644 --- a/resources/assets/vue/components/companies/elements/CustomerPaymentBillingInnerComponent.vue +++ b/resources/assets/vue/components/companies/elements/CustomerPaymentBillingInnerComponent.vue @@ -64,7 +64,10 @@
Make Payment
-
Generate Summary Invoice
+
+ Generate Summary Invoice + +
@@ -122,6 +125,7 @@ showPaymentProceedModal: false, showPaymentOutdatedModal: false, selectedShippingInvoicesOnlyIds: [], + isDownloading: false, } }, computed: { @@ -142,6 +146,8 @@ }, methods: { generateSummaryInvoice(){ + if (this.isDownloading) return; + this.isDownloading = true; let url = this.route('invoice.combined_summary', JSON.stringify(this.selectedIds)); if(window.LARAVEL_VAPOR_ENABLED){ this.$store.dispatch('crudRequest', {endpoint: url, method: 'get'}) @@ -149,6 +155,7 @@ { let success = response.ok; response.json().then(response => { + this.isDownloading = false; if(!success){return;} if (response.src) { // window.location.href = response.src; @@ -156,10 +163,13 @@ } }); } - ); + ).catch(() => { + this.isDownloading = false; + }); } else{ window.open(url, '_blank'); + this.isDownloading = false; } }, makePayment(){