Agregada miga para volver al select de pedidos
This commit is contained in:
parent
8488d9d6c5
commit
0512ea9ab2
4 changed files with 19 additions and 5 deletions
|
@ -11,12 +11,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions, mapGetters, mapState } from "vuex";
|
import { mapActions, mapGetters, mapMutations, mapState } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('productos',["getProductos"]),
|
...mapActions('productos',["getProductos"]),
|
||||||
...mapActions('ui',["clickMiga"]),
|
...mapActions('ui',["clickMiga"]),
|
||||||
|
...mapMutations('ui',["addMiga"]),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('ui',["migas"]),
|
...mapState('ui',["migas"]),
|
||||||
|
@ -26,8 +27,17 @@ export default {
|
||||||
},
|
},
|
||||||
migaActiva() {
|
migaActiva() {
|
||||||
return this.migas.length - 1
|
return this.migas.length - 1
|
||||||
|
},
|
||||||
|
pedido() {
|
||||||
|
return this.pedidoDefinido
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
pedido(newValue) {
|
||||||
|
if (newValue)
|
||||||
|
this.addMiga({ nombre: 'Categorias', action: 'productos/getProductos' });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
3
resources/js/store/modules/barrio.js
vendored
3
resources/js/store/modules/barrio.js
vendored
|
@ -31,6 +31,9 @@ const actions = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
commit('setPedidos', response.data);
|
commit('setPedidos', response.data);
|
||||||
|
},
|
||||||
|
async limpiarPedidos({ commit }) {
|
||||||
|
commit('setPedidos', []);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
6
resources/js/store/modules/pedido.js
vendored
6
resources/js/store/modules/pedido.js
vendored
|
@ -85,8 +85,10 @@ const actions = {
|
||||||
dispatch("ui/error", { error: error }, { root: true });
|
dispatch("ui/error", { error: error }, { root: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async resetear({ commit }) {
|
async resetear({ commit, dispatch }) {
|
||||||
await axios.delete("/pedido/sesion")
|
await axios.delete("/pedido/sesion");
|
||||||
|
dispatch("barrio/limpiarPedidos", null, { root: true });
|
||||||
|
dispatch("productos/getProductos", null, { root: true });
|
||||||
commit('reset');
|
commit('reset');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
3
resources/js/store/modules/ui.js
vendored
3
resources/js/store/modules/ui.js
vendored
|
@ -3,8 +3,7 @@ import { dropWhile } from "lodash/array";
|
||||||
const state = {
|
const state = {
|
||||||
show_chismosa: false,
|
show_chismosa: false,
|
||||||
show_devoluciones: false,
|
show_devoluciones: false,
|
||||||
miga_inicial: { nombre: 'Categorias', action: 'productos/getProductos' },
|
migas: [{ nombre: 'Pedidos', action: 'pedido/resetear' }],
|
||||||
migas: [{ nombre: 'Categorias', action: 'productos/getProductos' }],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue