2022-06-08 20:32:50 -03:00
|
|
|
<template>
|
2024-09-09 01:28:13 -03:00
|
|
|
<div class="block ml-3 mr-3 is-max-widescreen is-max-desktop">
|
2024-08-30 01:33:47 -03:00
|
|
|
<admin-tabs-secciones></admin-tabs-secciones>
|
2024-07-11 16:32:25 -03:00
|
|
|
<div class="block" id="pedidos-seccion"
|
|
|
|
:class="seccionActiva === 'pedidos-seccion' ? 'is-active' : 'is-hidden'">
|
2023-10-04 22:37:59 -03:00
|
|
|
<div class="block pb-6" id="pedidos-tabla-y-dropdown" v-show="hayPedidos">
|
2024-08-30 01:33:47 -03:00
|
|
|
<admin-dropdown-descargar
|
2022-11-13 17:34:33 -03:00
|
|
|
:gdc="gdc">
|
2024-08-30 01:33:47 -03:00
|
|
|
</admin-dropdown-descargar>
|
|
|
|
<admin-tabla-pedidos
|
2023-10-04 22:37:59 -03:00
|
|
|
:pedidos="pedidos" :bonosDeTransporte="bonosDeTransporte" :totalBonosBarriales="totalBonosBarriales">
|
2024-08-30 01:33:47 -03:00
|
|
|
</admin-tabla-pedidos>
|
2022-11-13 17:34:33 -03:00
|
|
|
</div>
|
|
|
|
<p class="has-text-centered" v-show="!hayPedidos">
|
|
|
|
Todavía no hay ningún pedido para administrar.
|
|
|
|
</p>
|
|
|
|
</div>
|
2024-07-11 16:32:25 -03:00
|
|
|
<div class="block pb-6" id="bonos-seccion"
|
|
|
|
:class="seccionActiva === 'bonos-seccion' ? 'is-active' : 'is-hidden'">
|
2024-08-30 01:33:47 -03:00
|
|
|
<admin-tabla-bonos v-show="hayAprobados"
|
2022-11-13 17:00:24 -03:00
|
|
|
:pedidos="pedidos">
|
2024-08-30 01:33:47 -03:00
|
|
|
</admin-tabla-bonos>
|
2022-11-13 17:34:33 -03:00
|
|
|
<p class="has-text-centered" v-show="!hayAprobados">
|
|
|
|
Todavía no hay pedidos aprobados.
|
|
|
|
</p>
|
2022-11-13 17:00:24 -03:00
|
|
|
</div>
|
2024-07-11 16:32:25 -03:00
|
|
|
<div class="block pb-6" id="caracteristicas-seccion"
|
|
|
|
:class="seccionActiva === 'caracteristicas-seccion' ? 'is-active' : 'is-hidden'">
|
2024-08-30 01:33:47 -03:00
|
|
|
<admin-caracteristicas-opcionales>
|
|
|
|
</admin-caracteristicas-opcionales>
|
2024-07-11 16:32:25 -03:00
|
|
|
</div>
|
2022-06-08 20:32:50 -03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-08-30 01:33:47 -03:00
|
|
|
import CaracteristicasOpcionales from "./CaracteristicasOpcionales.vue";
|
|
|
|
import TabsSecciones from "./TabsSecciones.vue";
|
|
|
|
import DropdownDescargar from "./DropdownDescargar.vue";
|
|
|
|
import TablaPedidos from "./TablaPedidos.vue";
|
|
|
|
import TablaBonos from "./TablaBonos.vue";
|
2022-06-08 20:32:50 -03:00
|
|
|
export default {
|
2022-11-12 20:20:13 -03:00
|
|
|
components: {
|
2024-08-30 01:33:47 -03:00
|
|
|
CaracteristicasOpcionales,
|
|
|
|
TabsSecciones,
|
|
|
|
DropdownDescargar,
|
|
|
|
TablaPedidos,
|
|
|
|
TablaBonos,
|
2022-11-12 20:20:13 -03:00
|
|
|
},
|
2022-06-08 20:32:50 -03:00
|
|
|
data() {
|
|
|
|
return {
|
2022-10-21 19:17:52 -03:00
|
|
|
gdc: 0,
|
2022-11-13 17:34:33 -03:00
|
|
|
pedidos: [],
|
2023-05-24 15:01:31 -03:00
|
|
|
bonosDeTransporte: 0,
|
2023-10-04 22:37:59 -03:00
|
|
|
totalBonosBarriales: 0,
|
2022-11-13 17:34:33 -03:00
|
|
|
tabActiva: "pedidos",
|
2024-07-11 18:33:45 -03:00
|
|
|
seccionActiva: "pedidos-seccion",
|
2022-06-08 20:32:50 -03:00
|
|
|
}
|
|
|
|
},
|
2022-11-08 15:55:49 -03:00
|
|
|
computed: {
|
2022-11-12 21:16:35 -03:00
|
|
|
hayPedidos: function() {
|
|
|
|
return this.pedidos.length !== 0
|
|
|
|
},
|
2022-11-08 15:55:49 -03:00
|
|
|
hayAprobados: function() {
|
2022-11-12 21:16:35 -03:00
|
|
|
return this.pedidos.filter(p => p.aprobado).length > 0
|
2022-11-08 15:55:49 -03:00
|
|
|
}
|
|
|
|
},
|
2022-06-08 20:32:50 -03:00
|
|
|
methods: {
|
2022-11-12 21:16:35 -03:00
|
|
|
fetchPedidos() {
|
2023-05-24 15:01:31 -03:00
|
|
|
axios.get("/api/grupos-de-compra/"+this.gdc+"/bonos-de-transporte", {})
|
|
|
|
.then(response => this.bonosDeTransporte = response.data.bdt);
|
2022-06-09 10:34:28 -03:00
|
|
|
axios.get("/api/subpedidos/resources", {
|
2022-11-12 21:16:35 -03:00
|
|
|
params: {
|
|
|
|
grupo_de_compra: this.gdc
|
|
|
|
}})
|
|
|
|
.then(response => {
|
|
|
|
this.pedidos = response.data.data
|
2023-05-24 15:01:31 -03:00
|
|
|
}).get;
|
2024-08-20 21:15:22 -03:00
|
|
|
axios.get("/api/grupos-de-compra/"+this.gdc+"/bonos-barriales", {})
|
|
|
|
.then(response => this.totalBonosBarriales = response.data.bonos_barriales)
|
2022-11-13 17:34:33 -03:00
|
|
|
},
|
|
|
|
setSeccionActiva(tabId) {
|
|
|
|
this.tabActiva = tabId;
|
|
|
|
this.seccionActiva = tabId + "-seccion";
|
2023-10-04 22:37:59 -03:00
|
|
|
},
|
|
|
|
getBonosBarriales() {
|
|
|
|
axios.get("/api/grupos-de-compra/"+this.gdc+"/bonos-barriales", {})
|
|
|
|
.then(response => this.totalBonosBarriales = response.data.bonos_barriales)
|
2022-06-08 20:32:50 -03:00
|
|
|
}
|
2022-06-08 22:19:44 -03:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
Event.$on('sync-aprobacion', (_) => {
|
2022-11-12 21:16:35 -03:00
|
|
|
this.fetchPedidos();
|
2022-11-13 17:00:24 -03:00
|
|
|
});
|
|
|
|
|
|
|
|
axios.get("/admin/obtener_sesion").then(response => {
|
|
|
|
this.gdc = response.data.gdc;
|
|
|
|
this.fetchPedidos();
|
2023-10-04 22:37:59 -03:00
|
|
|
this.bonosBarriales = this.getBonosBarriales()
|
2022-11-13 17:00:24 -03:00
|
|
|
});
|
2022-06-08 20:32:50 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-10-21 19:17:52 -03:00
|
|
|
<style>
|
2022-06-08 20:32:50 -03:00
|
|
|
|
|
|
|
</style>
|