disabled confiramtion button untill everyting is finished
This commit is contained in:
		| @@ -7,6 +7,7 @@ import { useContractorsStore } from '@/stores/contractors.store' | |||||||
| import { useCategoriesStore } from '@/stores/categories.store' | import { useCategoriesStore } from '@/stores/categories.store' | ||||||
| import { useRoute } from 'vue-router' | import { useRoute } from 'vue-router' | ||||||
| import { useRoutesStore } from '@/stores/routes.store' | import { useRoutesStore } from '@/stores/routes.store' | ||||||
|  | import {  ref } from 'vue' | ||||||
|  |  | ||||||
| const ordersStore = useOrdersStore(); | const ordersStore = useOrdersStore(); | ||||||
| const siteControlStore = useSiteControlStore(); | const siteControlStore = useSiteControlStore(); | ||||||
| @@ -19,8 +20,10 @@ const { categories } = storeToRefs(categoriesStore); | |||||||
| const { uuid } = storeToRefs(ordersStore); | const { uuid } = storeToRefs(ordersStore); | ||||||
| const { showConfirmationModal, isLoading} = storeToRefs(siteControlStore); | const { showConfirmationModal, isLoading} = storeToRefs(siteControlStore); | ||||||
| const { route, routes } = storeToRefs(routeStore); | const { route, routes } = storeToRefs(routeStore); | ||||||
|  | const isOrderConfirmed = ref(true) | ||||||
|  |  | ||||||
| async function confirmOrder() { | async function confirmOrder() { | ||||||
|  |   isOrderConfirmed.value = false; | ||||||
|   await axiosInstance.put('/zamowienie/' + uuid.value); |   await axiosInstance.put('/zamowienie/' + uuid.value); | ||||||
|   showConfirmationModal.value = false; |   showConfirmationModal.value = false; | ||||||
|   if (uuid.value != undefined && route.value != undefined) { |   if (uuid.value != undefined && route.value != undefined) { | ||||||
| @@ -29,6 +32,7 @@ async function confirmOrder() { | |||||||
|     ordersStore.orderToClone = false |     ordersStore.orderToClone = false | ||||||
|     isLoading.value = false; |     isLoading.value = false; | ||||||
|   } |   } | ||||||
|  |   isOrderConfirmed.value = true; | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| @@ -46,7 +50,7 @@ async function confirmOrder() { | |||||||
|         </section> |         </section> | ||||||
|         <footer class="modal-card-foot"> |         <footer class="modal-card-foot"> | ||||||
|           <div class="buttons"> |           <div class="buttons"> | ||||||
|             <button class="button is-success" @click="confirmOrder">Tak</button> |             <button class="button is-success" @click="confirmOrder"  :disabled="!isOrderConfirmed">Tak</button> | ||||||
|             <button class="button" @click="$emit('close')">Nie</button> |             <button class="button" @click="$emit('close')">Nie</button> | ||||||
|           </div> |           </div> | ||||||
|         </footer> |         </footer> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user