Deshabilita botones de eportar pedido barrial e imprimir planillas cuando no hay subpedidos aprobados

This commit is contained in:
nat 2022-11-08 15:55:49 -03:00
parent 85f0a5a06b
commit f67232f55c
1 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="container is-max-widescreen is-max-desktop animate__animated" :class="animation" v-show="!init">
<div class="buttons is-right">
<a class="button is-success" :href="'/admin/exportar-pedido-a-csv/'+gdc">
<a class="button is-success" :href="hayAprobados ? '/admin/exportar-pedido-a-csv/'+gdc : '#'" :disabled="!hayAprobados">
<span>
Exportar pedido barrial
</span>
@ -9,7 +9,7 @@
<i class="fas fa-download"></i>
</span>
</a>
<a class="button is-info" :href="'/admin/exportar-planillas-a-pdf/'+gdc">
<a class="button is-info" :href="hayAprobados ? '/admin/exportar-planillas-a-pdf/'+gdc : '#'" :disabled="!hayAprobados">
<span>
Imprimir Planillas
</span>
@ -56,6 +56,11 @@ export default {
subpedidos: []
}
},
computed: {
hayAprobados: function() {
return this.subpedidos.filter(sp => sp.aprobado).length > 0
}
},
beforeCreate() {
axios.get("/admin/obtener_sesion").then(response => {
this.gdc = response.data.gdc;