forked from nathalie/pedi2
Moví la chismosa a la derecha de los productos
This commit is contained in:
parent
1204a80b3c
commit
69cd306263
|
@ -111,6 +111,7 @@ const app = new Vue({
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.pedido = response.data.data
|
this.pedido = response.data.data
|
||||||
this.$toast('Pedido actualizado exitosamente')
|
this.$toast('Pedido actualizado exitosamente')
|
||||||
|
Event.$emit("pedido-actualizado");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Actualizar monto y notas de devoluciones
|
// Actualizar monto y notas de devoluciones
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="column">
|
||||||
<table v-show="productos.length != 0" class="chismosa-tabla table is-narrow is-striped is-bordered">
|
<table v-show="mostrar_tabla" class="chismosa-tabla table is-narrow is-striped is-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Producto</th>
|
<th>Producto</th>
|
||||||
|
@ -13,15 +13,15 @@
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th><abbr title="Bonos de Transporte">B. Transporte</abbr></th>
|
<th><abbr title="Bonos de Transporte">B. Transporte</abbr></th>
|
||||||
<th class="has-text-right">{{ cantidadBonosDeTransporte }}</th>
|
<th class="has-text-right">{{ cantidadBonosDeTransporte() }}</th>
|
||||||
<th class="has-text-right">{{ totalBonosDeTransporte }}</th>
|
<th class="has-text-right">{{ totalBonosDeTransporte() }}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="this.$root.devoluciones">
|
<tr v-if="this.$root.devoluciones">
|
||||||
<th><p>Devoluciones</p></th>
|
<th><p>Devoluciones</p></th>
|
||||||
<td><p :title="this.$root.pedido.devoluciones_notas">...</p></td>
|
<td><p :title="notasDevoluciones()">...</p></td>
|
||||||
<th class="has-text-right">-{{ this.$root.pedido.devoluciones_total }}</th>
|
<th class="has-text-right">-{{ devoluciones() }}</th>
|
||||||
<th>
|
<th>
|
||||||
<button @click.capture="modificarDevoluciones()" class="button is-warning">
|
<button @click.capture="modificarDevoluciones()" class="button is-warning">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
|
@ -34,16 +34,16 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total total</th>
|
<th>Total total</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th class="has-text-right">{{ total }}</th>
|
<th class="has-text-right">{{ total() }}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
<tbody>
|
<tbody>
|
||||||
<producto-row v-for="producto in productos" :producto="producto" :key="producto.id"></producto-row>
|
<producto-row v-for="producto in productos()" :producto="producto" :key="producto.id"></producto-row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="has-text-centered" v-show="productos.length == 0">
|
<p class="has-text-centered" v-show="!mostrar_tabla">
|
||||||
Compa, todavía no agregaste nada a la chismosa.
|
Compa, todavía no agregaste nada a la chismosa.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,32 +51,40 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
data() {
|
||||||
|
return {
|
||||||
|
mostrar_tabla: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
Event.$on('pedido-actualizado', this.pedidoActualizado);
|
||||||
|
Event.$on('toggle-chismosa', this.pedidoActualizado);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
pedidoActualizado: function() {
|
||||||
|
this.mostrar_tabla = this.$root.productos.length > 0;
|
||||||
|
},
|
||||||
|
total: function() {
|
||||||
|
return this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total)
|
||||||
|
},
|
||||||
productos: function() {
|
productos: function() {
|
||||||
return this.$root.productos
|
return this.$root.productos
|
||||||
},
|
},
|
||||||
|
modificarDevoluciones: function() {
|
||||||
|
Event.$emit("modificar-devoluciones");
|
||||||
|
},
|
||||||
cantidadBonosDeTransporte: function() {
|
cantidadBonosDeTransporte: function() {
|
||||||
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) / 15
|
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) / 15
|
||||||
},
|
},
|
||||||
totalBonosDeTransporte: function() {
|
totalBonosDeTransporte: function() {
|
||||||
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte)
|
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte)
|
||||||
},
|
},
|
||||||
total: function() {
|
devoluciones: function() {
|
||||||
return this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total)
|
return this.$root.pedido.devoluciones_total;
|
||||||
}
|
},
|
||||||
|
notasDevoluciones: function() {
|
||||||
|
return this.$root.pedido.devoluciones_notas;
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
modificarDevoluciones: function() {
|
|
||||||
Event.$emit("modificar-devoluciones");
|
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
@media (max-width: 719px) {
|
|
||||||
.chismosa-tabla {
|
|
||||||
max-width: 80vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -8,13 +8,6 @@
|
||||||
<span v-text="'$' + this.$limpiarInt($root.devoluciones ? $root.pedido.total_menos_devoluciones : $root.pedido.total)"></span>
|
<span v-text="'$' + this.$limpiarInt($root.devoluciones ? $root.pedido.total_menos_devoluciones : $root.pedido.total)"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-menu chismosa-menu" :id="id" role="menu">
|
|
||||||
<div class="dropdown-content">
|
|
||||||
<div class="dropdown-item">
|
|
||||||
<chismosa></chismosa>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -37,28 +30,9 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggle() {
|
toggle() {
|
||||||
this.activa = !this.activa
|
this.activa = !this.activa;
|
||||||
|
Event.$emit("toggle-chismosa");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
@media (max-width: 719px) {
|
|
||||||
.chismosa-menu {
|
|
||||||
vertical-align: top;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 75vh;
|
|
||||||
max-width: 100vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 720px) {
|
|
||||||
.chismosa-menu {
|
|
||||||
vertical-align: top;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 75vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<template>
|
||||||
|
<div class="columns">
|
||||||
|
<categorias-container></categorias-container>
|
||||||
|
<productos-container></productos-container>
|
||||||
|
<chismosa v-show="chismosaActiva"></chismosa>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Chismosa from './Chismosa.vue';
|
||||||
|
import ProductosContainer from './ProductosContainer.vue';
|
||||||
|
import CategoriasContainer from './CategoriasContainer.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
componets: {
|
||||||
|
Chismosa,
|
||||||
|
ProductosContainer,
|
||||||
|
CategoriasContainer,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
chismosaActiva: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
Event.$on('toggle-chismosa', () => {
|
||||||
|
this.chismosaActiva = !this.chismosaActiva;
|
||||||
|
console.log(this.chismosaActiva);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,9 +1,6 @@
|
||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<chismosa></chismosa>
|
<pedido-body></pedido-body>
|
||||||
<categorias-container></categorias-container>
|
|
||||||
<productos-container></productos-container>
|
|
||||||
<producto-modal></producto-modal>
|
|
||||||
<devoluciones-modal></devoluciones-modal>
|
<devoluciones-modal></devoluciones-modal>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
Loading…
Reference in New Issue