Files
Andres2908 80b81e35a2 correciones
2022-05-17 00:06:40 -05:00

100 lines
2.4 KiB
Vue

<template>
<div class="container">
<b-tabs v-model="activeTab">
<b-tab-item label="Tabla de tickets">
<TableTickets
:updateIsLoading="updateIsLoading"
:imprimirError="imprimirError"
:imprimirMensaje="imprimirMensaje"
:imprimirWarning="imprimirWarning"
/>
</b-tab-item>
<b-tab-item label="Reportes">
<p class="title is-5">
Selecciona el periodo del que quieres obtener un reporte.
</p>
<Reporte :updateIsLoading="updateIsLoading" />
</b-tab-item>
</b-tabs>
</div>
</template>
<script>
import TableTickets from '~/components/admin/tableTickets.vue'
import Reporte from '~/components/admin/reporte.vue'
export default {
components: {
TableTickets,
Reporte,
},
data() {
return {
activeTab: 0,
}
},
methods: {
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>
<style></style>