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 { useRoute } from 'vue-router'
|
||||
import { useRoutesStore } from '@/stores/routes.store'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const ordersStore = useOrdersStore();
|
||||
const siteControlStore = useSiteControlStore();
|
||||
@@ -19,8 +20,10 @@ const { categories } = storeToRefs(categoriesStore);
|
||||
const { uuid } = storeToRefs(ordersStore);
|
||||
const { showConfirmationModal, isLoading} = storeToRefs(siteControlStore);
|
||||
const { route, routes } = storeToRefs(routeStore);
|
||||
const isOrderConfirmed = ref(true)
|
||||
|
||||
async function confirmOrder() {
|
||||
isOrderConfirmed.value = false;
|
||||
await axiosInstance.put('/zamowienie/' + uuid.value);
|
||||
showConfirmationModal.value = false;
|
||||
if (uuid.value != undefined && route.value != undefined) {
|
||||
@@ -29,6 +32,7 @@ async function confirmOrder() {
|
||||
ordersStore.orderToClone = false
|
||||
isLoading.value = false;
|
||||
}
|
||||
isOrderConfirmed.value = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -46,7 +50,7 @@ async function confirmOrder() {
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<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>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user