Agregado OllasBody que carga pedido de ollas
This commit is contained in:
parent
9062faf24e
commit
0009d4b123
3 changed files with 34 additions and 1 deletions
|
@ -5,9 +5,10 @@ import ComisionesBody from "./comisiones/Body.vue";
|
|||
import AdminBody from "./admin/Body.vue";
|
||||
import PedidosBody from "./pedidos/Body.vue";
|
||||
import InfoTags from "./comunes/InfoTags.vue";
|
||||
import OllasBody from "./ollas/OllasBody.vue";
|
||||
export default {
|
||||
name: 'Main',
|
||||
components: { InfoTags, ComisionesBody, AdminBody, PedidosBody, NavBar },
|
||||
components: { OllasBody, InfoTags, ComisionesBody, AdminBody, PedidosBody, NavBar },
|
||||
computed: {
|
||||
...mapState("login", ["rol"]),
|
||||
},
|
||||
|
@ -26,6 +27,7 @@ export default {
|
|||
<pedidos-body v-if="rol === 'barrio'"/>
|
||||
<admin-body v-else-if="rol === 'admin_barrio'"/>
|
||||
<comisiones-body v-else-if="rol === 'comision'"/>
|
||||
<ollas-body v-else-if="rol === 'ollas'"/>
|
||||
<info-tags/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
26
resources/js/components/ollas/OllasBody.vue
Normal file
26
resources/js/components/ollas/OllasBody.vue
Normal file
|
@ -0,0 +1,26 @@
|
|||
<script>
|
||||
import PedidosMain from "../pedidos/PedidosMain.vue";
|
||||
import { mapActions } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OllasBody",
|
||||
components: { PedidosMain },
|
||||
methods: {
|
||||
...mapActions('pedido', ["getPedidoDeOllas", "getGrupoDeCompra"]),
|
||||
},
|
||||
async mounted() {
|
||||
await this.getGrupoDeCompra();
|
||||
await this.getPedidoDeOllas();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="ollas-body" class="pb-6 mb-6">
|
||||
<pedidos-main></pedidos-main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
5
resources/js/store/modules/pedido.js
vendored
5
resources/js/store/modules/pedido.js
vendored
|
@ -94,6 +94,11 @@ const actions = {
|
|||
dispatch("ui/resetear", null, { root: true });
|
||||
commit('reset');
|
||||
},
|
||||
async getPedidoDeOllas({ commit }) {
|
||||
const response = await axios.get(`/api/ollas/${state.grupo_de_compra.id}`);
|
||||
console.log(response);
|
||||
commit('setPedido', response.data);
|
||||
},
|
||||
};
|
||||
|
||||
const getters = {
|
||||
|
|
Loading…
Add table
Reference in a new issue