Compare commits

...

2 commits

Author SHA1 Message Date
ale
db056e7d34 Migas para ollas 2025-06-20 02:00:48 -03:00
ale
8649ff5bbd Cambio nombre 2025-06-20 01:50:17 -03:00
3 changed files with 12 additions and 4 deletions

View file

@ -13,7 +13,7 @@ class OllasController extends Controller
{ {
$tipoOlla = TipoPedido::firstOrCreate(['nombre' => 'olla']); $tipoOlla = TipoPedido::firstOrCreate(['nombre' => 'olla']);
$pedido = $gdc->subpedidos()->firstOrCreate([ $pedido = $gdc->subpedidos()->firstOrCreate([
'nombre' => 'Pedido de Olla de ' . $gdc->nombre, 'nombre' => 'Pedido de Ollas de ' . $gdc->nombre,
'tipo_pedido_id' => $tipoOlla->id, 'tipo_pedido_id' => $tipoOlla->id,
]); ]);
return response()->json(new SubpedidoResource($pedido)); return response()->json(new SubpedidoResource($pedido));

View file

@ -1,16 +1,18 @@
<script> <script>
import PedidosMain from "../pedidos/PedidosMain.vue"; import PedidosMain from "../pedidos/PedidosMain.vue";
import { mapActions } from "vuex"; import { mapActions, mapMutations } from "vuex";
export default { export default {
name: "OllasBody", name: "OllasBody",
components: { PedidosMain }, components: { PedidosMain },
methods: { methods: {
...mapActions('pedido', ["getPedidoDeOllas", "getGrupoDeCompra"]), ...mapActions('pedido', ["getPedidoDeOllas", "getGrupoDeCompra"]),
...mapMutations('ui', ["migasOllas"])
}, },
async mounted() { async mounted() {
await this.getGrupoDeCompra(); await this.getGrupoDeCompra();
await this.getPedidoDeOllas(); await this.getPedidoDeOllas();
this.migasOllas();
}, },
} }
</script> </script>

View file

@ -35,7 +35,10 @@ const mutations = {
reset(state) { reset(state) {
state.show_chismosa = false; state.show_chismosa = false;
state.show_devoluciones = false; state.show_devoluciones = false;
} },
migasOllas(state) {
state.migas.reverse().pop();
},
}; };
const actions = { const actions = {
@ -53,7 +56,7 @@ const actions = {
} }
dispatch(miga.action, miga.arguments ?? null, { root: true }); dispatch(miga.action, miga.arguments ?? null, { root: true });
state.migas = dropWhile(state.migas.reverse(),(m => m.nombre !== miga.nombre)).reverse(); state.migas = dropWhile(state.migas.reverse(), (m => m.nombre !== miga.nombre)).reverse();
}, },
toast(_, { mensaje }) { toast(_, { mensaje }) {
return window.bulmaToast.toast({ return window.bulmaToast.toast({
@ -72,6 +75,9 @@ const actions = {
resetear({ commit }) { resetear({ commit }) {
commit("reset"); commit("reset");
}, },
migasOllas({ commit }) {
commit("migasOllas");
},
}; };
export default { export default {