Compare commits

..

2 commits

Author SHA1 Message Date
Rodrigo
fbae6770df Cismosa: Ajustes visuales 2024-09-10 22:07:16 -03:00
Rodrigo
69cd306263 Moví la chismosa a la derecha de los productos 2024-09-10 21:31:49 -03:00
7 changed files with 119 additions and 95 deletions

1
resources/js/app.js vendored
View file

@ -111,6 +111,7 @@ const app = new Vue({
}).then((response) => {
this.pedido = response.data.data
this.$toast('Pedido actualizado exitosamente')
Event.$emit("pedido-actualizado");
});
});
// Actualizar monto y notas de devoluciones

View file

@ -1,5 +1,5 @@
<template>
<div v-show="visible" class="block ml-3 mr-3">
<div v-show="visible" class="column">
<div class="columns is-multiline is-mobile">
<div v-for="(categoria,i) in categorias" :key="i" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
<div @click.capture="seleccionarCategoria(categoria)" class="card" style="height:100%" >

View file

@ -1,82 +1,103 @@
<template>
<div>
<table v-show="productos.length != 0" class="chismosa-tabla table is-narrow is-striped is-bordered">
<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>
<th class="has-text-right">{{ cantidadBonosDeTransporte }}</th>
<th class="has-text-right">{{ totalBonosDeTransporte }}</th>
<th></th>
<th></th>
</tr>
<tr v-if="this.$root.devoluciones">
<th><p>Devoluciones</p></th>
<td><p :title="this.$root.pedido.devoluciones_notas">...</p></td>
<th class="has-text-right">-{{ this.$root.pedido.devoluciones_total }}</th>
<th>
<button @click.capture="modificarDevoluciones()" class="button is-warning">
<span class="icon">
<i class="fas fa-edit"></i>
</span>
</button>
</th>
<th></th>
</tr>
<tr>
<th>Total total</th>
<th></th>
<th class="has-text-right">{{ total }}</th>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody>
<producto-row v-for="producto in productos" :producto="producto" :key="producto.id"></producto-row>
</tbody>
</table>
<p class="has-text-centered" v-show="productos.length == 0">
Compa, todavía no agregaste nada a la chismosa.
</p>
<div class="column is-one-third full-height">
<div class="fixed-right">
<table v-show="mostrar_tabla" class="table is-striped is-bordered tabla-chismosa">
<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>
<th class="has-text-right">{{ cantidadBonosDeTransporte() }}</th>
<th class="has-text-right">{{ totalBonosDeTransporte() }}</th>
<th></th>
<th></th>
</tr>
<tr v-if="this.$root.devoluciones">
<th><p>Devoluciones</p></th>
<td><p :title="notasDevoluciones()">...</p></td>
<th class="has-text-right">-{{ devoluciones() }}</th>
<th>
<button @click.capture="modificarDevoluciones()" class="button is-warning">
<span class="icon">
<i class="fas fa-edit"></i>
</span>
</button>
</th>
<th></th>
</tr>
<tr>
<th>Total total</th>
<th></th>
<th class="has-text-right">{{ total() }}</th>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody>
<producto-row v-for="producto in productos()" :producto="producto" :key="producto.id"></producto-row>
</tbody>
</table>
<p class="has-text-centered" v-show="!mostrar_tabla">
Compa, todavía no agregaste nada a la chismosa.
</p>
</div>
</div>
</template>
<script>
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() {
return this.$root.productos
},
modificarDevoluciones: function() {
Event.$emit("modificar-devoluciones");
},
cantidadBonosDeTransporte: function() {
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) / 15
},
totalBonosDeTransporte: function() {
return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte)
},
total: function() {
return this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total)
}
},
methods: {
modificarDevoluciones: function() {
Event.$emit("modificar-devoluciones");
devoluciones: function() {
return this.$root.pedido.devoluciones_total;
},
}
notasDevoluciones: function() {
return this.$root.pedido.devoluciones_notas;
},
},
}
</script>
<style>
@media (max-width: 719px) {
.chismosa-tabla {
max-width: 80vw;
.tabla-chismosa {
width: 100%;
}
.fixed-right {
position: fixed;
overflow-y: auto;
max-height: 88vh;
}
}
</style>

View file

@ -8,13 +8,6 @@
<span v-text="'$' + this.$limpiarInt($root.devoluciones ? $root.pedido.total_menos_devoluciones : $root.pedido.total)"></span>
</a>
</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>
</template>
@ -37,28 +30,9 @@ export default {
},
methods: {
toggle() {
this.activa = !this.activa
this.activa = !this.activa;
Event.$emit("toggle-chismosa", this.activa);
},
},
}
</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>

View file

@ -0,0 +1,31 @@
<template>
<div class="columns ml-3 mr-3">
<categorias-container :class="chismosaActiva ? 'hide-below-1024' : ''"></categorias-container>
<productos-container :class="chismosaActiva ? 'hide-below-1024' : ''"></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', (activa) => {
this.chismosaActiva = activa;
});
},
}
</script>

View file

@ -1,5 +1,5 @@
<template>
<div v-show="visible" class="block ml-6 mr-6">
<div v-show="visible" class="column">
<div class="columns is-multiline is-mobile">
<producto-card v-for="(producto,i) in productos" :key="i" :producto="producto">
</producto-card><!-- END BLOCK COLUMN -->

View file

@ -1,9 +1,6 @@
@extends('layouts.app')
@section('content')
<chismosa></chismosa>
<categorias-container></categorias-container>
<productos-container></productos-container>
<producto-modal></producto-modal>
<pedido-body></pedido-body>
<devoluciones-modal></devoluciones-modal>
@endsection