tabla
This commit is contained in:
@@ -47,6 +47,14 @@
|
||||
{{ props.row.monto }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="Fecha"
|
||||
label="Fecha y hora"
|
||||
centered
|
||||
v-slot="props"
|
||||
>{{ hora(props.row.fechaInscripcion) }}</b-table-column
|
||||
>
|
||||
|
||||
<b-table-column
|
||||
field="inscripcion"
|
||||
label="Inscripción"
|
||||
@@ -98,10 +106,14 @@
|
||||
|
||||
<script>
|
||||
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: {
|
||||
|
||||
@@ -51,13 +51,13 @@
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import DatosTicket from './datosTicket.vue'
|
||||
import ModalCancelar from './modalCancelar.vue'
|
||||
import ModalDeclinar from './modalDeclinar.vue'
|
||||
import IsCancelacion from './isCancelacion.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DatosTicket,
|
||||
ModalCancelar,
|
||||
ModalDeclinar,
|
||||
IsCancelacion,
|
||||
},
|
||||
props: {
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
this.$buefy.modal.open({
|
||||
props: modalProps,
|
||||
parent: this,
|
||||
component: ModalCancelar,
|
||||
component: ModalDeclinar,
|
||||
hasModalCard: true,
|
||||
customClass: 'custom-class custom-class-2',
|
||||
trapFocus: true,
|
||||
|
||||
+60
-1
@@ -2,7 +2,12 @@
|
||||
<div class="container">
|
||||
<b-tabs v-model="activeTab">
|
||||
<b-tab-item label="Tabla de tickets">
|
||||
<TableTickets :updateIsLoading="updateIsLoading" />
|
||||
<TableTickets
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
/>
|
||||
</b-tab-item>
|
||||
|
||||
<b-tab-item label="Reportes">
|
||||
@@ -33,6 +38,60 @@ export default {
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
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(),
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user