From 534c89b2eef703bfd8c21c77c8f0d5b42fe5875d Mon Sep 17 00:00:00 2001 From: Andres2908 Date: Tue, 22 Mar 2022 18:21:39 -0600 Subject: [PATCH] tabla --- .../{modalCancelar.vue => modalDeclinar.vue} | 0 components/admin/tableTickets.vue | 74 +++++-------------- components/admin/ticket.vue | 6 +- pages/admin/index.vue | 61 ++++++++++++++- 4 files changed, 81 insertions(+), 60 deletions(-) rename components/admin/{modalCancelar.vue => modalDeclinar.vue} (100%) diff --git a/components/admin/modalCancelar.vue b/components/admin/modalDeclinar.vue similarity index 100% rename from components/admin/modalCancelar.vue rename to components/admin/modalDeclinar.vue diff --git a/components/admin/tableTickets.vue b/components/admin/tableTickets.vue index f070afb..dbe9a12 100644 --- a/components/admin/tableTickets.vue +++ b/components/admin/tableTickets.vue @@ -47,6 +47,14 @@ {{ props.row.monto }} + {{ hora(props.row.fechaInscripcion) }} + import axios from 'axios' +import moment from 'moment' export default { props: { updateIsLoading: { type: Function, require: true }, + imprimirError: { type: Function, require: true }, + imprimirMensaje: { type: Function, require: true }, + imprimirWarning: { type: Function, require: true }, }, data() { return { @@ -110,7 +122,7 @@ export default { inscripciones: [], isPaginated: true, currentPage: 1, - perPage: 5, + perPage: 10, data: {}, dataIns: {}, @@ -132,6 +144,7 @@ export default { }) .catch((err) => { this.updateIsLoading(false) + this.imprimirError(err.response.data) }) }, verTicket(value) { @@ -155,13 +168,13 @@ export default { this.token ) .then((res) => { + this.updateIsLoading(false) this.imprimirMensaje(res.data.message) this.todasInscripciones() - this.updateIsLoading(false) }) .catch((err) => { - this.imprimirError(err.response.data) this.updateIsLoading(false) + this.imprimirError(err.response.data) }) }, inscripcion(inscripcion) { @@ -185,59 +198,8 @@ export default { this.updateIsLoading(false) }) }, - imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) { - this.$buefy.dialog.alert({ - ariaRole: 'alertdialog', - ariaModal: true, - type: 'is-danger', - title, - message: err.message, - confirmText: 'Entendido', - hasIcon: true, - iconPack: 'mdi', - icon: 'alert-octagon', - onConfirm: () => onConfirm(), - }) - if (err.err && err.err === 'token error') { - localStorage.clear() - this.$router.push('/') - } - }, - imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) { - this.$buefy.dialog.alert({ - ariaRole: 'alertdialog', - ariaModal: true, - type: 'is-success', - title, - message, - confirmText: 'Ok', - hasIcon: true, - iconPack: 'mdi', - icon: 'check-circle', - onConfirm: () => onConfirm(), - }) - }, - imprimirWarning( - message, - onConfirm = () => {}, - title = '¡Espera un minuto!', - onCancel = () => {} - ) { - this.$buefy.dialog.alert({ - ariaRole: 'alertdialog', - ariaModal: true, - type: 'is-warning', - title, - message, - confirmText: 'Confirmar', - canCancel: true, - cancelText: 'Cancelar', - hasIcon: true, - iconPack: 'mdi', - icon: 'help-circle', - onConfirm: () => onConfirm(), - onCancel: () => onCancel(), - }) + hora(value) { + return moment(value).format('LLL') }, }, watch: { diff --git a/components/admin/ticket.vue b/components/admin/ticket.vue index aadaf61..fecc21d 100644 --- a/components/admin/ticket.vue +++ b/components/admin/ticket.vue @@ -51,13 +51,13 @@