Crear pedido setea state, quitado todo lo relativo a sesion, y quitado codigo comentado
This commit is contained in:
parent
a594e8a049
commit
94e384c83c
2 changed files with 0 additions and 26 deletions
17
resources/js/app.js
vendored
17
resources/js/app.js
vendored
|
@ -71,21 +71,6 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Event.$on('obtener-sesion', () => {
|
|
||||||
if (!window.location.pathname.startsWith('/admin')) {
|
|
||||||
axios.get('/subpedidos/obtener_sesion')
|
|
||||||
.then(response => {
|
|
||||||
this.gdc = response.data.gdc;
|
|
||||||
// this.settearDevoluciones();
|
|
||||||
this.pedido = response.data.subpedido.id;
|
|
||||||
axios.get('/api/subpedidos/' + this.pedido)
|
|
||||||
.then(response => {
|
|
||||||
this.pedido = response.data.data;
|
|
||||||
Event.$emit("pedido-actualizado");
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Event.$on('sync-subpedido', (cantidad, id, notas) => {
|
Event.$on('sync-subpedido', (cantidad, id, notas) => {
|
||||||
if (this.pedido.aprobado) {
|
if (this.pedido.aprobado) {
|
||||||
this.$toast('No se puede modificar un pedido ya aprobado', 2000);
|
this.$toast('No se puede modificar un pedido ya aprobado', 2000);
|
||||||
|
@ -117,8 +102,6 @@ const app = new Vue({
|
||||||
Event.$emit("pedido-actualizado");
|
Event.$emit("pedido-actualizado");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (window.location.pathname.startsWith('/productos'))
|
|
||||||
Event.$emit('obtener-sesion')
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
9
resources/js/store/modules/pedido.js
vendored
9
resources/js/store/modules/pedido.js
vendored
|
@ -34,20 +34,11 @@ const actions = {
|
||||||
nombre: nombre,
|
nombre: nombre,
|
||||||
grupo_de_compra_id: grupo_de_compra_id
|
grupo_de_compra_id: grupo_de_compra_id
|
||||||
});
|
});
|
||||||
const pedido = response.data;
|
|
||||||
await axios.post("/subpedidos/sesion", { id: pedido.id, });
|
|
||||||
commit('setState', pedido);
|
|
||||||
},
|
|
||||||
async getPedido({ commit }) {
|
|
||||||
const sesion = await axios.get("/subpedidos/sesion");
|
|
||||||
const response = await axios.get(`/api/subpedidos/${sesion.data}`);
|
|
||||||
commit('setState', response.data.data);
|
commit('setState', response.data.data);
|
||||||
},
|
},
|
||||||
async elegirPedido({ commit }, { pedido }) {
|
async elegirPedido({ commit }, { pedido }) {
|
||||||
await axios.post("/subpedidos/sesion", { id: pedido.id, });
|
|
||||||
const response = await axios.get(`/api/subpedidos/${pedido.id}`);
|
const response = await axios.get(`/api/subpedidos/${pedido.id}`);
|
||||||
commit('setState', response.data.data);
|
commit('setState', response.data.data);
|
||||||
// window.location.href = 'productos';
|
|
||||||
},
|
},
|
||||||
async modificarChismosa({ commit }, producto_id, cantidad, notas) {},
|
async modificarChismosa({ commit }, producto_id, cantidad, notas) {},
|
||||||
async modificarDevoluciones({ commit }, monto, notas) {}
|
async modificarDevoluciones({ commit }, monto, notas) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue