Primeras cosas de chismosa

This commit is contained in:
Alejandro Tasistro 2025-05-19 15:01:54 -03:00
parent 5b65bc5d9f
commit 40e466aa82
2 changed files with 48 additions and 0 deletions

View file

@ -2,6 +2,7 @@ import Vue from 'vue';
import Vuex from 'vuex';
import admin from "./modules/admin";
import login from "./modules/login";
import chismosa from "./modules/chismosa";
Vue.use(Vuex);
@ -9,5 +10,6 @@ export default new Vuex.Store({
modules: {
admin,
login,
chismosa,
},
});

46
resources/js/store/modules/chismosa.js vendored Normal file
View file

@ -0,0 +1,46 @@
const state = {
lastFetch: null,
pedido_id: null,
nombre: null,
productos: null,
aprobado: null,
total: null,
total_transporte: null,
cantidad_transporte: null,
total_sin_devoluciones: null,
devoluciones_habilitadas: null,
devoluciones_total: null,
devoluciones_notas: null,
};
const mutations = {
setState(state, { pedido }) {
state.lastFetch = new Date();
state.pedido_id = pedido.id;
state.nombre = pedido.nombre;
state.productos = pedido.productos;
state.aprobado = pedido.aprobado;
state.total = pedido.total;
state.total_transporte = pedido.total_transporte;
state.cantidad_transporte = pedido.cantidad_transporte;
state.total_sin_devoluciones = pedido.total_sin_devoluciones;
state.devoluciones_habilitadas = pedido.grupo_de_compra.devoluciones_habilitadas;
state.devoluciones_total = pedido.devoluciones_total;
state.devoluciones_notas = pedido.devoluciones_notas;
},
};
const actions = {
async getPedido({ commit }) {
},
async modificarChismosa({ commit }, { producto_id, cantidad, notas }) {
},
async modificarDevoluciones({ commit }, { monto, notas }) {}
};
export default {
namespaced: true,
state,
mutations,
actions,
};