2022-05-25 19:03:29 -03:00
|
|
|
<template>
|
2024-09-10 21:31:49 -03:00
|
|
|
<div class="column">
|
|
|
|
<table v-show="mostrar_tabla" class="chismosa-tabla table is-narrow is-striped is-bordered">
|
2022-05-25 19:03:29 -03:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Producto</th>
|
|
|
|
<th><abbr title="Cantidad">C</abbr></th>
|
|
|
|
<th><abbr title="Precio Total">$</abbr></th>
|
|
|
|
<th></th>
|
|
|
|
<th><abbr title="Eliminar"></abbr></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<th><abbr title="Bonos de Transporte">B. Transporte</abbr></th>
|
2024-09-10 21:31:49 -03:00
|
|
|
<th class="has-text-right">{{ cantidadBonosDeTransporte() }}</th>
|
|
|
|
<th class="has-text-right">{{ totalBonosDeTransporte() }}</th>
|
2022-05-25 19:03:29 -03:00
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
2024-07-11 18:59:47 -03:00
|
|
|
<tr v-if="this.$root.devoluciones">
|
2024-07-17 17:25:41 -03:00
|
|
|
<th><p>Devoluciones</p></th>
|
2024-09-10 21:31:49 -03:00
|
|
|
<td><p :title="notasDevoluciones()">...</p></td>
|
|
|
|
<th class="has-text-right">-{{ devoluciones() }}</th>
|
2023-10-04 22:47:42 -03:00
|
|
|
<th>
|
|
|
|
<button @click.capture="modificarDevoluciones()" class="button is-warning">
|
|
|
|
<span class="icon">
|
|
|
|
<i class="fas fa-edit"></i>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
2022-05-25 19:03:29 -03:00
|
|
|
<tr>
|
|
|
|
<th>Total total</th>
|
|
|
|
<th></th>
|
2024-09-10 21:31:49 -03:00
|
|
|
<th class="has-text-right">{{ total() }}</th>
|
2022-05-25 19:03:29 -03:00
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
2024-09-10 21:31:49 -03:00
|
|
|
<producto-row v-for="producto in productos()" :producto="producto" :key="producto.id"></producto-row>
|
2022-05-25 19:03:29 -03:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2024-09-10 21:31:49 -03:00
|
|
|
<p class="has-text-centered" v-show="!mostrar_tabla">
|
2023-05-27 20:08:55 -03:00
|
|
|
Compa, todavía no agregaste nada a la chismosa.
|
|
|
|
</p>
|
2022-05-25 19:03:29 -03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2024-09-10 21:31:49 -03:00
|
|
|
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)
|
|
|
|
},
|
2023-05-27 20:08:55 -03:00
|
|
|
productos: function() {
|
2023-06-17 15:54:18 -03:00
|
|
|
return this.$root.productos
|
2023-05-27 20:08:55 -03:00
|
|
|
},
|
2024-09-10 21:31:49 -03:00
|
|
|
modificarDevoluciones: function() {
|
|
|
|
Event.$emit("modificar-devoluciones");
|
|
|
|
},
|
2023-05-27 20:08:55 -03:00
|
|
|
cantidadBonosDeTransporte: function() {
|
2023-09-09 13:32:49 -03:00
|
|
|
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) / 15
|
2023-05-27 20:08:55 -03:00
|
|
|
},
|
|
|
|
totalBonosDeTransporte: function() {
|
2023-09-09 13:32:49 -03:00
|
|
|
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte)
|
2023-05-27 20:08:55 -03:00
|
|
|
},
|
2024-09-10 21:31:49 -03:00
|
|
|
devoluciones: function() {
|
|
|
|
return this.$root.pedido.devoluciones_total;
|
2023-10-04 22:47:42 -03:00
|
|
|
},
|
2024-09-10 21:31:49 -03:00
|
|
|
notasDevoluciones: function() {
|
|
|
|
return this.$root.pedido.devoluciones_notas;
|
|
|
|
},
|
|
|
|
},
|
2022-05-25 19:03:29 -03:00
|
|
|
}
|
2024-09-10 21:31:49 -03:00
|
|
|
</script>
|