add: crud completed of budgets
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
const query = ref('');
|
||||
const currentBudget = ref(null);
|
||||
const openModal = ref(false);
|
||||
const printOpen = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
getInitData();
|
||||
@@ -60,14 +61,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
const handleSetCurrentBudget = (budget) => {
|
||||
const handleSetCurrentBudget = (data) => {
|
||||
openModal.value = true;
|
||||
currentBudget.value = budget;
|
||||
currentBudget.value = data.budget;
|
||||
if(data.print) {
|
||||
printOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const handleResetCurrentBudget = () => {
|
||||
openModal.value = false;
|
||||
currentBudget.value = null;
|
||||
printOpen.value = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -76,6 +81,7 @@
|
||||
<CreateBudgetModal
|
||||
v-if="openModal === true"
|
||||
:budget="currentBudget"
|
||||
:is-print="printOpen"
|
||||
@reset-budget="handleResetCurrentBudget"
|
||||
/>
|
||||
<div>
|
||||
@@ -93,7 +99,7 @@
|
||||
<button
|
||||
class="btn-primary-sm radius-sm"
|
||||
data-toggle="modal" data-target="#budgetModal"
|
||||
@click="handleSetCurrentBudget(null)"
|
||||
@click="handleSetCurrentBudget({budget: null, print: false})"
|
||||
><i class="fa-solid fa-plus"></i> <span class="clear-sm"> Crear</span><span class="clear-md"> presupuesto</span></button>
|
||||
</div>
|
||||
<Spiner v-if="loading"/>
|
||||
@@ -102,7 +108,7 @@
|
||||
v-if="companyStore.budgets.length > 0"
|
||||
v-for="budget in companyStore.budgets"
|
||||
:budget="budget"
|
||||
@set-budget="handleSetCurrentBudget(budget)"
|
||||
@set-budget="handleSetCurrentBudget"
|
||||
/>
|
||||
<CardEmpty
|
||||
v-else
|
||||
|
||||
Reference in New Issue
Block a user