forked from nathalie/pedi2
Cambio de logica de obtener sesion + variable para habilitar devoluciones
This commit is contained in:
parent
388beba5cc
commit
716d1ca6fa
|
@ -59,7 +59,8 @@ const app = new Vue({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
gdc: null,
|
gdc: null,
|
||||||
pedido: null
|
pedido: null,
|
||||||
|
devoluciones: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -77,12 +78,18 @@ const app = new Vue({
|
||||||
Event.$on('obtener-sesion', () => {
|
Event.$on('obtener-sesion', () => {
|
||||||
axios.get('/subpedidos/obtener_sesion')
|
axios.get('/subpedidos/obtener_sesion')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
if (response.data.subpedido.id) {
|
||||||
this.pedido = response.data.subpedido.id
|
this.pedido = response.data.subpedido.id
|
||||||
axios.get('/api/subpedidos/' + this.pedido)
|
axios.get('/api/subpedidos/' + this.pedido)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.pedido = response.data.data
|
this.pedido = response.data.data
|
||||||
this.gdc = this.pedido.grupo_de_compra.id
|
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
axios.get('/admin/obtener_sesion')
|
||||||
|
.then(response => {
|
||||||
|
this.gdc = response.data.gdc
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Event.$on('sync-subpedido', (cantidad, id) => {
|
Event.$on('sync-subpedido', (cantidad, id) => {
|
||||||
|
|
Loading…
Reference in New Issue