71 lines
1.9 KiB
Vue
71 lines
1.9 KiB
Vue
<template>
|
|
<section class="container px-2 pb-6">
|
|
<div class="pb-5 pt-6">
|
|
<b-button type="is-info" tag="router-link" to="/admin/responsables">
|
|
Ver responsables
|
|
</b-button>
|
|
|
|
<b-button type="is-info" tag="router-link" to="/admin/registros">
|
|
Ver registros
|
|
</b-button>
|
|
|
|
<b-button type="is-info" tag="router-link" to="/admin/casos_especiales">
|
|
Ver casos especiales
|
|
</b-button>
|
|
</div>
|
|
|
|
<TablaServiciosSociales :admin="admin" :imprimirError="imprimirError" />
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
import TablaServiciosSociales from '@/components/admin/TablaServiciosSociales'
|
|
|
|
export default {
|
|
components: {
|
|
TablaServiciosSociales,
|
|
},
|
|
data() {
|
|
return {
|
|
admin: {},
|
|
}
|
|
},
|
|
methods: {
|
|
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('/')
|
|
}
|
|
},
|
|
getLocalhostInfo() {
|
|
this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
|
|
this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
|
|
this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
|
|
this.admin.token = {
|
|
headers: {
|
|
token: localStorage.getItem('token'),
|
|
},
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
this.getLocalhostInfo()
|
|
if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable')
|
|
if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
|
|
if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
|
|
},
|
|
}
|
|
</script>
|