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">
|
2022-11-13 17:34:33 -03:00
|
|
|
<pedidos-admin-tabs-secciones></pedidos-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">
|
2022-11-13 17:34:33 -03:00
|
|
|
<pedidos-admin-dropdown-descargar
|
|
|
|
:gdc="gdc">
|
|
|
|
</pedidos-admin-dropdown-descargar>
|
|
|
|
<pedidos-admin-tabla-pedidos
|
2023-10-04 22:37:59 -03:00
|
|
|
:pedidos="pedidos" :bonosDeTransporte="bonosDeTransporte" :totalBonosBarriales="totalBonosBarriales">
|
2022-11-13 17:34:33 -03:00
|
|
|
</pedidos-admin-tabla-pedidos>
|
|
|
|
</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'">
|
2022-11-13 17:34:33 -03:00
|
|
|
<pedidos-admin-tabla-bonos v-show="hayAprobados"
|
2022-11-13 17:00:24 -03:00
|
|
|
:pedidos="pedidos">
|
|
|
|
</pedidos-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'">
|
|
|
|
<pedidos-admin-caracteristicas-opcionales>
|
|
|
|
</pedidos-admin-caracteristicas-opcionales>
|
|
|
|
</div>
|
2022-06-08 20:32:50 -03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-11-13 17:34:33 -03:00
|
|
|
import PedidosAdminTabsSecciones from './PedidosAdminTabsSecciones.vue';
|
2022-11-12 20:20:13 -03:00
|
|
|
import PedidosAdminDropdownDescargar from "./PedidosAdminDropdownDescargar.vue";
|
2022-11-13 17:34:33 -03:00
|
|
|
import PedidosAdminTablaBonos from './PedidosAdminTablaBonos.vue';
|
2022-11-12 21:16:35 -03:00
|
|
|
import PedidosAdminTablaPedidos from "./PedidosAdminTablaPedidos.vue";
|
2024-07-11 16:32:25 -03:00
|
|
|
import PedidosAdminCaracteristicasOpcionales from "./PedidosAdminCaracteristicasOpcionales.vue";
|
2022-06-08 20:32:50 -03:00
|
|
|
export default {
|
2022-11-12 20:20:13 -03:00
|
|
|
name: "PedidosAdminBody",
|
|
|
|
components: {
|
2024-07-11 16:32:25 -03:00
|
|
|
PedidosAdminCaracteristicasOpcionales,
|
2022-11-13 17:34:33 -03:00
|
|
|
PedidosAdminTabsSecciones,
|
2022-11-12 21:16:35 -03:00
|
|
|
PedidosAdminDropdownDescargar,
|
2022-11-13 17:00:24 -03:00
|
|
|
PedidosAdminTablaPedidos,
|
2022-11-13 17:34:33 -03:00
|
|
|
PedidosAdminTablaBonos,
|
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>
|