nueva-chismosa #35
					 11 changed files with 270 additions and 138 deletions
				
			
		
							
								
								
									
										3
									
								
								resources/js/app.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								resources/js/app.js
									
										
									
									
										vendored
									
									
								
							|  | @ -91,6 +91,7 @@ const app = new Vue({ | ||||||
|                         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; | ||||||
|  |                                 Event.$emit("pedido-actualizado"); | ||||||
|                             }); |                             }); | ||||||
|                     } else { |                     } else { | ||||||
|                         axios.get('/admin/obtener_sesion') |                         axios.get('/admin/obtener_sesion') | ||||||
|  | @ -111,6 +112,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
 | ||||||
|  | @ -126,6 +128,7 @@ const app = new Vue({ | ||||||
|         }).then((response) => { |         }).then((response) => { | ||||||
|           this.pedido = response.data.data; |           this.pedido = response.data.data; | ||||||
|           this.$toast('Pedido actualizado'); |           this.$toast('Pedido actualizado'); | ||||||
|  |           Event.$emit("pedido-actualizado"); | ||||||
|         }); |         }); | ||||||
|       }); |       }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,10 +1,31 @@ | ||||||
| <template> | <template> | ||||||
|     <div v-show="this.$root.pedido.aprobado" class="notification is-warning has-text-centered"> |     <div v-show="aprobado" class="notification is-warning has-text-centered"> | ||||||
|         Tu pedido fue <strong>aprobado</strong>, por lo que no puede ser modificado |         Tu pedido fue <strong>aprobado</strong>, por lo que no puede ser modificado | ||||||
|     </div> |     </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  |     export default { | ||||||
|  |         data() { | ||||||
|  |             return { | ||||||
|  |                 aprobado: false, | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         mounted() { | ||||||
|  |             Event.$on('pedido-actualizado', this.actualizarEstado); | ||||||
|  |             if (this.$root.pedido != null) { | ||||||
|  |                 this.actualizarEstado(); | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         methods: { | ||||||
|  |             pedidoAprobado: function() { | ||||||
|  |                 return this.$root.pedido.aprobado; | ||||||
|  |             }, | ||||||
|  |             actualizarEstado: function() { | ||||||
|  |                 this.aprobado = this.pedidoAprobado(); | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |     } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style> | <style> | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| <template> | <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 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 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%" > |           <div @click.capture="seleccionarCategoria(categoria)" class="card" style="height:100%" > | ||||||
|  |  | ||||||
|  | @ -1,55 +1,83 @@ | ||||||
| <template> | <template> | ||||||
|     <div> |     <div class="column is-one-third"> | ||||||
|         <table v-show="productos.length != 0" class="chismosa-tabla table is-narrow is-striped is-bordered"> |         <div class="fixed-right"> | ||||||
|  |             <table v-show="mostrar_tabla" class="table is-striped is-bordered tabla-chismosa is-narrow"> | ||||||
|                 <thead> |                 <thead> | ||||||
|                 <tr> |                 <tr> | ||||||
|                     <th>Producto</th> |                     <th>Producto</th> | ||||||
|                 <th><abbr title="Cantidad">C</abbr></th> |                     <th>Cantidad</th> | ||||||
|                     <th><abbr title="Precio Total">$</abbr></th> |                     <th><abbr title="Precio Total">$</abbr></th> | ||||||
|                 <th><abbr title="Eliminar"></abbr></th> |  | ||||||
|                 </tr> |                 </tr> | ||||||
|                 </thead> |                 </thead> | ||||||
|                 <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">{{ cantidad_bonos_transporte }}</th> | ||||||
|                 <th class="has-text-right">{{ totalBonosDeTransporte }}</th> |                     <th class="has-text-right">{{ total_bonos_transporte }}</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> | ||||||
|                 <th class="has-text-right">-{{ this.$root.pedido.devoluciones_total }}</th> |                         <abbr :title="notas_devoluciones">{{ notas_devoluciones_abbr }}</abbr> | ||||||
|                 <th> |                         <button @click.capture="modificarDevoluciones()" class="button is-warning is-small"> | ||||||
|                     <button @click.capture="modificarDevoluciones()" class="button is-warning"> |  | ||||||
|                             <span class="icon"> |                             <span class="icon"> | ||||||
|                                 <i class="fas fa-edit"></i> |                                 <i class="fas fa-edit"></i> | ||||||
|                             </span> |                             </span> | ||||||
|                         </button> |                         </button> | ||||||
|                 </th> |                     </td> | ||||||
|  |                     <th class="has-text-right">-{{ devoluciones }}</th> | ||||||
|                 </tr> |                 </tr> | ||||||
|                 <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> |  | ||||||
|                 </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> | ||||||
|  |     </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|     export default { |     export default { | ||||||
|         computed: { |         data() { | ||||||
|             productos: function() { |             return { | ||||||
|                 return this.$root.productos |                 mostrar_tabla: false, | ||||||
|  |                 cantidad_bonos_transporte: 0, | ||||||
|  |                 total_bonos_transporte: 0, | ||||||
|  |                 devoluciones: 0, | ||||||
|  |                 notas_devoluciones: "", | ||||||
|  |                 notas_devoluciones_abbr: "", | ||||||
|  |                 total: 0, | ||||||
|  |                 productos: [], | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         mounted() { | ||||||
|  |             Event.$on('pedido-actualizado', this.pedidoActualizado); | ||||||
|  |             Event.$on('toggle-chismosa', this.pedidoActualizado); | ||||||
|  |         }, | ||||||
|  |         methods: { | ||||||
|  |             pedidoActualizado: function() { | ||||||
|  |                 this.mostrar_tabla = this.$root.productos.length > 0; | ||||||
|  |                 this.cantidad_bonos_transporte = this.cantidadBonosDeTransporte(); | ||||||
|  |                 this.total_bonos_transporte = this.totalBonosDeTransporte(); | ||||||
|  |                 this.devoluciones = this.$root.pedido.devoluciones_total; | ||||||
|  |                 this.notas_devoluciones = this.$root.pedido.devoluciones_notas; | ||||||
|  |                 this.notas_devoluciones_abbr = this.notas_devoluciones.substring(0, 15); | ||||||
|  |                 if (this.notas_devoluciones.length > 15) { | ||||||
|  |                     this.notas_devoluciones_abbr += "..."; | ||||||
|  |                 } | ||||||
|  |                 this.total = this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total); | ||||||
|  |                 this.productos = 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 | ||||||
|  | @ -57,22 +85,18 @@ | ||||||
|             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() { |  | ||||||
|                 return this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total) |  | ||||||
|             } |  | ||||||
|         }, |         }, | ||||||
|         methods: { |  | ||||||
|             modificarDevoluciones: function() { |  | ||||||
|                 Event.$emit("modificar-devoluciones"); |  | ||||||
|             }, |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style> | <style> | ||||||
| @media (max-width: 719px) { |     .tabla-chismosa { | ||||||
|     .chismosa-tabla { |         width: 100%; | ||||||
|         max-width: 80vw; |  | ||||||
|     } |     } | ||||||
|  |     .fixed-right { | ||||||
|  |         position: fixed; | ||||||
|  |         overflow-y: auto; | ||||||
|  |         max-height: 81vh; | ||||||
|  |         margin-right: 20px; | ||||||
|     } |     } | ||||||
| </style> | </style> | ||||||
|  | @ -5,16 +5,9 @@ | ||||||
|             <span class="icon is-small mr-1"> |             <span class="icon is-small mr-1"> | ||||||
|                 <img src="/assets/chismosa.png"> |                 <img src="/assets/chismosa.png"> | ||||||
|             </span> |             </span> | ||||||
|             <span v-text="'$' + this.$limpiarInt($root.devoluciones ? $root.pedido.total_menos_devoluciones : $root.pedido.total)"></span> |             <span v-text="'$' + 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> | ||||||
| 
 | 
 | ||||||
|  | @ -32,33 +25,21 @@ export default { | ||||||
|     }, |     }, | ||||||
|     data() { |     data() { | ||||||
|         return { |         return { | ||||||
|             activa: false |             activa: false, | ||||||
|  |             total: 0, | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|  |     mounted() { | ||||||
|  |         Event.$on('pedido-actualizado', this.actualizar); | ||||||
|  |     }, | ||||||
|     methods: { |     methods: { | ||||||
|         toggle() { |         toggle() { | ||||||
|             this.activa = !this.activa |             this.activa = !this.activa; | ||||||
|  |             Event.$emit("toggle-chismosa", this.activa); | ||||||
|  |         }, | ||||||
|  |         actualizar() { | ||||||
|  |             this.total = this.$limpiarInt(this.$root.devoluciones ? this.$root.pedido.total_menos_devoluciones : this.$root.pedido.total); | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
| } | } | ||||||
| </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> |  | ||||||
|  |  | ||||||
							
								
								
									
										31
									
								
								resources/js/components/PedidoBody.vue
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								resources/js/components/PedidoBody.vue
									
										
									
									
									
										Normal 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> | ||||||
							
								
								
									
										100
									
								
								resources/js/components/Producto/ProductoCantidad.vue
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								resources/js/components/Producto/ProductoCantidad.vue
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,100 @@ | ||||||
|  | <template> | ||||||
|  |     <div class="field has-addons contador"> | ||||||
|  |         <div class="control"> | ||||||
|  |             <button class="button is-small" @click.capture="decrementar();"> | ||||||
|  |                 <i class="fa fa-solid fa-minus"></i> | ||||||
|  |             </button> | ||||||
|  |         </div> | ||||||
|  |         <div class="control"> | ||||||
|  |             <input id="cantidad" v-model="cantidad" class="input is-small" type="number" style="text-align: center"> | ||||||
|  |         </div> | ||||||
|  |         <div class="control" @click="incrementar();"> | ||||||
|  |             <button class="button is-small"> | ||||||
|  |                 <i class="fa fa-solid fa-plus"></i> | ||||||
|  |             </button> | ||||||
|  |         </div> | ||||||
|  |         <button :disabled="!hayCambios()" class="button is-small is-success ml-1" @click="confirmar()"> | ||||||
|  |             <span class="icon"> | ||||||
|  |                 <i class="fas fa-check"></i> | ||||||
|  |             </span> | ||||||
|  |         </button> | ||||||
|  |         <button :disabled="!puedeBorrar()" class="button is-small is-danger ml-1" @click="borrar()"> | ||||||
|  |             <span class="icon"> | ||||||
|  |                 <i class="fas fa-trash-alt"></i> | ||||||
|  |             </span> | ||||||
|  |         </button> | ||||||
|  |     </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  |     export default { | ||||||
|  |         props: { | ||||||
|  |             producto: Object | ||||||
|  |         }, | ||||||
|  |         data() { | ||||||
|  |             return { | ||||||
|  |                 cantidad: this.producto.cantidad, | ||||||
|  |                 enChismosa: this.producto.cantidad, | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         mounted() { | ||||||
|  |             if (this.producto.pivot !== undefined) { | ||||||
|  |                 this.cantidad = this.producto.pivot.cantidad; | ||||||
|  |                 this.enChismosa = this.cantidad; | ||||||
|  |             } | ||||||
|  |             Event.$on('sync-subpedido', (cantidad,productoId) => { | ||||||
|  |                 if (this.producto.id === productoId) | ||||||
|  |                     this.sincronizar(cantidad); | ||||||
|  |             }); | ||||||
|  |         }, | ||||||
|  |         methods: { | ||||||
|  |             decrementar() { | ||||||
|  |                 this.cantidad -= 1; | ||||||
|  |             }, | ||||||
|  |             incrementar() { | ||||||
|  |                 this.cantidad += 1; | ||||||
|  |             }, | ||||||
|  |             confirmar() { | ||||||
|  |                 Event.$emit('sync-subpedido', this.cantidad, this.producto.id); | ||||||
|  |             }, | ||||||
|  |             borrar() { | ||||||
|  |                 this.cantidad = 0; | ||||||
|  |                 this.confirmar(); | ||||||
|  |             }, | ||||||
|  |             sincronizar(cantidad) { | ||||||
|  |                 this.cantidad = cantidad; | ||||||
|  |                 if (this.producto.pivot != null) { | ||||||
|  |                     this.producto.pivot.cantidad = cantidad; | ||||||
|  |                 } else { | ||||||
|  |                     this.producto.cantidad = cantidad; | ||||||
|  |                 } | ||||||
|  |                 this.enChismosa = cantidad; | ||||||
|  |             }, | ||||||
|  |             hayCambios() { | ||||||
|  |                 return this.cantidad != this.enChismosa; | ||||||
|  |             }, | ||||||
|  |             puedeBorrar() { | ||||||
|  |                 return this.enChismosa > 0; | ||||||
|  |             }, | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style> | ||||||
|  |     /* Chrome, Safari, Edge, Opera */ | ||||||
|  |     input::-webkit-outer-spin-button, | ||||||
|  |     input::-webkit-inner-spin-button { | ||||||
|  |         -webkit-appearance: none; | ||||||
|  |         margin: 0; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /* Firefox */ | ||||||
|  |     input[type=number] { | ||||||
|  |         appearance: textfield; | ||||||
|  |         -moz-appearance: textfield; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     .contador { | ||||||
|  |         min-width: 178px; | ||||||
|  |     } | ||||||
|  | </style> | ||||||
|  | @ -1,6 +1,11 @@ | ||||||
| <script> | <script> | ||||||
|  | import ProductoCantidad from './Producto/ProductoCantidad.vue'; | ||||||
|  | 
 | ||||||
| export default { | export default { | ||||||
|     name: "ProductoCard", |     name: "ProductoCard", | ||||||
|  |     components: { | ||||||
|  |         ProductoCantidad, | ||||||
|  |     }, | ||||||
|     props: { |     props: { | ||||||
|         producto: Object |         producto: Object | ||||||
|     }, |     }, | ||||||
|  | @ -68,31 +73,7 @@ export default { | ||||||
|             </div> |             </div> | ||||||
|             <footer class="columns"> |             <footer class="columns"> | ||||||
|                 <div class="column is-three-quarters"> |                 <div class="column is-three-quarters"> | ||||||
|                     <div class="field has-addons"> |                     <producto-cantidad :producto="producto"></producto-cantidad> | ||||||
|                         <div class="control"> |  | ||||||
|                             <button :disabled="cantidad < 1" class="button is-small" @click.capture="decrementar();"> |  | ||||||
|                                 <i class="fa fa-solid fa-minus"></i> |  | ||||||
|                             </button> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="control"> |  | ||||||
|                             <input id="cantidad" v-model="cantidad" class="input is-small" type="number" style="text-align: center"> |  | ||||||
|                         </div> |  | ||||||
|                         <div class="control" @click="incrementar();"> |  | ||||||
|                             <button class="button is-small"> |  | ||||||
|                                 <i class="fa fa-solid fa-plus"></i> |  | ||||||
|                             </button> |  | ||||||
|                         </div> |  | ||||||
|                         <button :disabled="!hayCambios() || cantidad < 0" class="button is-small is-success ml-3" @click="confirmar()"> |  | ||||||
|                             <span class="icon"> |  | ||||||
|                                 <i class="fas fa-check"></i> |  | ||||||
|                             </span> |  | ||||||
|                         </button> |  | ||||||
|                         <button :disabled="!puedeBorrar()" class="button is-small is-danger ml-3" @click="borrar()"> |  | ||||||
|                             <span class="icon"> |  | ||||||
|                                 <i class="fas fa-trash-alt"></i> |  | ||||||
|                             </span> |  | ||||||
|                         </button> |  | ||||||
|                     </div> |  | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="column"> |                 <div class="column"> | ||||||
|                     <p class="subtitle is-7 is-hidden-mobile" v-if="enChismosa !== 0">{{ enChismosa }} en chismosa</p> |                     <p class="subtitle is-7 is-hidden-mobile" v-if="enChismosa !== 0">{{ enChismosa }} en chismosa</p> | ||||||
|  |  | ||||||
|  | @ -1,27 +1,21 @@ | ||||||
| <template> | <template> | ||||||
| 	<tr> | 	<tr> | ||||||
|             <td>{{ this.producto.nombre }}</td> |             <td>{{ this.producto.nombre }}</td> | ||||||
|             <td class="has-text-right">{{ this.producto.pivot.cantidad }}</td> |             <td class="has-text-right"> | ||||||
|  |                 <producto-cantidad :producto="producto"></producto-cantidad> | ||||||
|  |             </td> | ||||||
|             <td class="has-text-right">{{ Math.ceil(this.producto.pivot.total) }}</td> |             <td class="has-text-right">{{ Math.ceil(this.producto.pivot.total) }}</td> | ||||||
|             <td><button @click.capture="eliminarProducto()" class="button is-danger"> |  | ||||||
|                 <span class="icon"> |  | ||||||
|                     <i class="fas fa-trash-alt"></i> |  | ||||||
|                 </span> |  | ||||||
|             </button></td> |  | ||||||
|     </tr> |     </tr> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|  |     import ProductoCantidad from './Producto/ProductoCantidad.vue'; | ||||||
|  | 	 | ||||||
|     export default { |     export default { | ||||||
|  |         components: { | ||||||
|  |             ProductoCantidad, | ||||||
|  |         }, | ||||||
| 		props: { | 		props: { | ||||||
| 	        producto: Object | 	        producto: Object | ||||||
| 	    }, | 	    }, | ||||||
| 	    methods: { |  | ||||||
| 	        seleccionarProducto() { |  | ||||||
| 	            Event.$emit("producto-seleccionado",this.producto); |  | ||||||
| 	        }, |  | ||||||
| 	        eliminarProducto() { |  | ||||||
| 	            Event.$emit("sync-subpedido", 0, this.producto.id); |  | ||||||
| 	        } |  | ||||||
|         } |  | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| <template> | <template> | ||||||
| 	<div v-show="visible" class="block ml-6 mr-6"> | 	<div v-show="visible" class="column"> | ||||||
|       <div class="columns is-multiline is-mobile"> |       <div class="columns is-multiline is-mobile"> | ||||||
|         <producto-card v-for="(producto,i) in productos" :key="i" :producto="producto"> |         <producto-card v-for="(producto,i) in productos" :key="i" :producto="producto"> | ||||||
|         </producto-card><!-- END BLOCK COLUMN --> |         </producto-card><!-- END BLOCK COLUMN --> | ||||||
|  |  | ||||||
|  | @ -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…
	
	Add table
		
		Reference in a new issue