forked from nathalie/pedi2
Arreglo a ProductoCantidad
This commit is contained in:
parent
b845637064
commit
a998f76d44
|
@ -38,6 +38,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.producto.pivot !== undefined) {
|
||||||
|
this.cantidad = this.producto.pivot.cantidad;
|
||||||
|
this.enChismosa = this.cantidad;
|
||||||
|
}
|
||||||
Event.$on('sync-subpedido', (cantidad,productoId) => {
|
Event.$on('sync-subpedido', (cantidad,productoId) => {
|
||||||
if (this.producto.id === productoId)
|
if (this.producto.id === productoId)
|
||||||
this.sincronizar(cantidad);
|
this.sincronizar(cantidad);
|
||||||
|
@ -59,7 +63,11 @@
|
||||||
},
|
},
|
||||||
sincronizar(cantidad) {
|
sincronizar(cantidad) {
|
||||||
this.cantidad = cantidad;
|
this.cantidad = cantidad;
|
||||||
|
if (this.producto.pivot != null) {
|
||||||
|
this.producto.pivot.cantidad = cantidad;
|
||||||
|
} else {
|
||||||
this.producto.cantidad = cantidad;
|
this.producto.cantidad = cantidad;
|
||||||
|
}
|
||||||
this.enChismosa = cantidad;
|
this.enChismosa = cantidad;
|
||||||
},
|
},
|
||||||
hayCambios() {
|
hayCambios() {
|
||||||
|
|
Loading…
Reference in New Issue