falta admin
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
+50
-166
@@ -1,94 +1,42 @@
|
||||
<template>
|
||||
<div class="full-h">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">Premiaciones</h2>
|
||||
<div class="full-h cont">
|
||||
<div class="has-text-centered block">
|
||||
<h2 class="is-size-2">
|
||||
Registro de Invitados Para la Entrega de Medallas
|
||||
</h2>
|
||||
<b-image
|
||||
:src="require('@/assets/login_image.png')"
|
||||
alt="LoginImage"
|
||||
ratio="601by235"
|
||||
class="my-4"
|
||||
></b-image>
|
||||
<p>
|
||||
Para garantizar el acceso de sus invitados a la ceremonia de entrega de
|
||||
medallas en la que usted será distinguido(a), le pedimos completar los
|
||||
siguientes datos:
|
||||
</p>
|
||||
</div>
|
||||
<div class="is-flex is-justify-content-center my-3">
|
||||
<b-radio v-model="loginType" name="loginType" native-value="1">
|
||||
Admin
|
||||
</b-radio>
|
||||
<b-radio v-model="loginType" name="loginType" native-value="2">
|
||||
Operador
|
||||
</b-radio>
|
||||
<b-radio v-model="loginType" name="loginType" native-value="3">
|
||||
Profesor
|
||||
</b-radio>
|
||||
<div class="is-flex is-justify-content-center">
|
||||
<form class="box">
|
||||
<b-field label="Numero de trabajador" :type="error">
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="noTrabajador"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !noTrabajador"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<form v-if="loginType == 1" class="box">
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input type="text" @keyup.enter.native="login()" v-model="usuario" />
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !(usuario && password)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
<form v-else-if="loginType == 2" class="box">
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input type="text" @keyup.enter.native="login()" v-model="usuario" />
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !(usuario && password)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
<form v-else-if="loginType == 3" class="box">
|
||||
<b-field label="Numero de trabajador" :type="error">
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="noTrabajador"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Adscripción" :type="error">
|
||||
<b-select v-model="adscripcion" expanded placeholder="Seleccione una adscripción">
|
||||
<option v-for="item in adscripciones" :value="item" :key="item.id">
|
||||
{{ item }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !(noTrabajador && adscripcion)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -104,72 +52,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loginType: 1,
|
||||
usuario: '',
|
||||
password: '',
|
||||
noTrabajador: '',
|
||||
adscripcion: null,
|
||||
adscripciones: [],
|
||||
error: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (this.usuario && this.password && !this.error || this.noTrabajador && this.adscripcion && !this.error) {
|
||||
if(this.loginType == 1){
|
||||
const data = {
|
||||
usuario: this.usuario,
|
||||
password: this.password,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/usuario/loginAdmin`, data)
|
||||
.then((res) => {
|
||||
const info = res.data
|
||||
localStorage.setItem('token', info.token)
|
||||
localStorage.setItem('usuario', info.Usuario.usuario)
|
||||
localStorage.setItem('tipoUsuario', info.Usuario.idTipoUsuario)
|
||||
localStorage.setItem('idUsuario', info.Usuario.idUsuario)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(`/${'admin'}`)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
if (this.noTrabajador && !this.error) {
|
||||
const data = {
|
||||
numeroTrabajador: this.noTrabajador,
|
||||
}
|
||||
|
||||
if(this.loginType == 2){
|
||||
const data = {
|
||||
usuario: this.usuario,
|
||||
password: this.password,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/usuario/loginOperador`, data)
|
||||
.then((res) => {
|
||||
const info = res.data
|
||||
|
||||
localStorage.setItem('token', info.token)
|
||||
localStorage.setItem('tipoUsuario', info.Usuario.tipoUsuario)
|
||||
localStorage.setItem('usuario', info.Usuario.usuario)
|
||||
localStorage.setItem('idUsuario', info.Usuario.idUsuario)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(`/${'operador'}`)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
}
|
||||
|
||||
if(this.loginType == 3){
|
||||
const data = {
|
||||
numeroTrabajador: this.noTrabajador,
|
||||
adscripcion: this.adscripcion,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/profesor/login`, data)
|
||||
@@ -180,7 +72,10 @@ export default {
|
||||
localStorage.setItem('idProfesor', info.Profesor.idProfesor)
|
||||
localStorage.setItem('nombre', info.Profesor.nombre)
|
||||
localStorage.setItem('adscripcion', info.Profesor.adscripcion)
|
||||
localStorage.setItem('numeroTrabajador', info.Profesor.numeroTrabajador)
|
||||
localStorage.setItem(
|
||||
'numeroTrabajador',
|
||||
info.Profesor.numeroTrabajador
|
||||
)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(`/${'profesor'}`)
|
||||
})
|
||||
@@ -189,8 +84,6 @@ export default {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -201,30 +94,21 @@ export default {
|
||||
usuario() {
|
||||
if (this.error) this.error = ''
|
||||
},
|
||||
loginType(){
|
||||
this.usuario = ''
|
||||
this.password = ''
|
||||
loginType() {
|
||||
this.noTrabajador = ''
|
||||
this.adscripcion = ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
axios.get(`${process.env.api}/profesor/adscripciones`).then((res) => {
|
||||
if (res) {
|
||||
res.data.forEach((item, index) => {
|
||||
this.adscripciones[index] = item.adscripcion
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.full-h {
|
||||
height: 75vh;
|
||||
min-height: 75vh;
|
||||
}
|
||||
.cont {
|
||||
width: 50%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 30rem;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="full-h">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">Registro Para la Entrega de Medallas</h2>
|
||||
</div>
|
||||
<div class="is-flex is-justify-content-center my-3">
|
||||
<b-radio v-model="loginType" name="loginType" native-value="1">
|
||||
Admin
|
||||
</b-radio>
|
||||
<b-radio v-model="loginType" name="loginType" native-value="2">
|
||||
Operador
|
||||
</b-radio>
|
||||
</div>
|
||||
<div class="is-flex is-justify-content-center my-3">
|
||||
<form v-if="loginType == 1" class="box">
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
type="text"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="usuario"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !(usuario && password)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
<form v-else-if="loginType == 2" class="box">
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
type="text"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="usuario"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !(usuario && password)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loginType: 1,
|
||||
usuario: '',
|
||||
password: '',
|
||||
noTrabajador: '',
|
||||
adscripcion: null,
|
||||
adscripciones: [],
|
||||
error: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (
|
||||
(this.usuario && this.password && !this.error) ||
|
||||
(this.noTrabajador && this.adscripcion && !this.error)
|
||||
) {
|
||||
if (this.loginType == 1) {
|
||||
const data = {
|
||||
usuario: this.usuario,
|
||||
password: this.password,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/usuario/loginAdmin`, data)
|
||||
.then((res) => {
|
||||
const info = res.data
|
||||
localStorage.setItem('token', info.token)
|
||||
localStorage.setItem('usuario', info.Usuario.usuario)
|
||||
localStorage.setItem('tipoUsuario', info.Usuario.idTipoUsuario)
|
||||
localStorage.setItem('idUsuario', info.Usuario.idUsuario)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(`/${'admin'}`)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
}
|
||||
|
||||
if (this.loginType == 2) {
|
||||
const data = {
|
||||
usuario: this.usuario,
|
||||
password: this.password,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/usuario/loginOperador`, data)
|
||||
.then((res) => {
|
||||
const info = res.data
|
||||
|
||||
localStorage.setItem('token', info.token)
|
||||
localStorage.setItem('tipoUsuario', info.Usuario.tipoUsuario)
|
||||
localStorage.setItem('usuario', info.Usuario.usuario)
|
||||
localStorage.setItem('idUsuario', info.Usuario.idUsuario)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(`/${'operador'}`)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
password() {
|
||||
if (this.error) this.error = ''
|
||||
},
|
||||
usuario() {
|
||||
if (this.error) this.error = ''
|
||||
},
|
||||
loginType() {
|
||||
this.usuario = ''
|
||||
this.password = ''
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.full-h {
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 30rem;
|
||||
}
|
||||
</style>
|
||||
@@ -29,7 +29,7 @@ export default {
|
||||
methods: {
|
||||
cerrarSesion() {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
this.$router.push('/loginOperador')
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -13,6 +13,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
idProfesor: '',
|
||||
idPremiacion: '',
|
||||
leyendo: false,
|
||||
isLoading: false,
|
||||
}
|
||||
@@ -20,13 +21,16 @@ export default {
|
||||
methods: {
|
||||
onDecode(decodedString) {
|
||||
try {
|
||||
this.idProfesor = JSON.parse(decodedString).idProfesor
|
||||
const data = JSON.parse(decodedString)
|
||||
this.idProfesor = data.idProfesor
|
||||
this.idPremiacion = data.idPremiacion
|
||||
} catch (err) {
|
||||
this.idProfesor = ''
|
||||
this.idPremiacion = ''
|
||||
this.errorMessage()
|
||||
}
|
||||
if (this.idProfesor) {
|
||||
this.enviar(this.idProfesor)
|
||||
if (this.idProfesor && this.idPremiacion) {
|
||||
this.enviar(this.idProfesor, this.idPremiacion)
|
||||
}
|
||||
},
|
||||
errorMessage() {
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<section class="container is-flex is-justify-content-center is-align-items-center">
|
||||
<LoginOperador
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LoginOperador from '../../components/LoginOperador.vue'
|
||||
|
||||
export default {
|
||||
components: { LoginOperador },
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
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(),
|
||||
})
|
||||
},
|
||||
// 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')
|
||||
},
|
||||
layout: 'login',
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -27,10 +27,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
enviar(idProfesor) {
|
||||
enviar(idProfesor, idPremiacion) {
|
||||
this.isLoading = true
|
||||
this.isReading = false
|
||||
const data = { idProfesor: idProfesor }
|
||||
const data = { idProfesor, idPremiacion }
|
||||
axios
|
||||
.post(`${process.env.api}/profesor/entradaInvitado`, data)
|
||||
.then((res) => {
|
||||
|
||||
+55
-10
@@ -4,16 +4,36 @@
|
||||
<p class="is-size-2 my-5">
|
||||
REGISTRO DE PROFESORES PARA LA OBTENCIÓN DE MEDALLA
|
||||
</p>
|
||||
<p class="is-size-5 block">
|
||||
A continuación, le pedimos el registro de sus invitados, recuerde que
|
||||
pueden ser hasta 3 personas. Por ser una ceremonia solemne, se solicita
|
||||
no asistir con niños menores de 12 años. A su correo PCPUMA, llegará la
|
||||
confirmación del registro y un código QR, por lo que le rogamos
|
||||
mantenerse pendiente de recibirlo, si no lo visualiza, revisar en SPAM.
|
||||
</p>
|
||||
</div>
|
||||
<div class="is-flex is-justify-content-center box">
|
||||
<div class="box">
|
||||
<div>
|
||||
<p class="is-size-4 block"><b>Nombre:</b> {{ `${Profesor.nombre}` }}</p>
|
||||
<p class="is-size-4 block">
|
||||
<b>Número de trabajador: </b>{{ `${Profesor.numeroTrabajador}` }}
|
||||
</p>
|
||||
<p class="is-size-4 block">
|
||||
<b>Adscripción:</b> {{ `${Profesor.adscripcion}` }}
|
||||
</p>
|
||||
<p v-if="isSent" class="is-size-3 block has-text-centered">¡Gracias por su registro!</p>
|
||||
|
||||
<div v-if="!isSent" class="is-flex block">
|
||||
<p class="is-size-4 block mr-4"><b>Premiacion: </b></p>
|
||||
<b-select
|
||||
v-model="premiacion"
|
||||
placeholder="Seleccione"
|
||||
class="is-size-4 block mx-0"
|
||||
>
|
||||
<option
|
||||
v-for="(premiacion, index) in premiaciones"
|
||||
:key="index"
|
||||
:value="premiacion.idPremiacion"
|
||||
>
|
||||
{{ premiacion.premiacion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</div>
|
||||
|
||||
<div v-if="!isSent" class="is-flex">
|
||||
<p class="is-size-4 block mr-4"><b>Cantidad de invitados: </b></p>
|
||||
<b-select
|
||||
@@ -91,7 +111,9 @@ export default {
|
||||
isLoading: false,
|
||||
Profesor: {},
|
||||
numeroInvitados: null,
|
||||
premiacion: null,
|
||||
invitados: [],
|
||||
premiaciones: [],
|
||||
flag: false,
|
||||
isDisabled: false,
|
||||
isSent: false,
|
||||
@@ -99,14 +121,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
enviar() {
|
||||
console.log(this.premiacion)
|
||||
this.isLoading = true
|
||||
this.invitados.forEach((item) => {
|
||||
item.nombreCompleto = `${item.nombre} ${item.apellido}`
|
||||
})
|
||||
const data = {
|
||||
idProfesor: this.Profesor.idProfesor,
|
||||
idPremiacion: this.premiacion,
|
||||
invitados: this.invitados,
|
||||
}
|
||||
console.log(data)
|
||||
axios
|
||||
.post(`${process.env.api}/invitado/infoInvitados`, data)
|
||||
.then((res) => {
|
||||
@@ -117,7 +142,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
this.errorToast()
|
||||
this.errorToast(err.response.data.message)
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
@@ -127,9 +152,10 @@ export default {
|
||||
type: 'is-success',
|
||||
})
|
||||
},
|
||||
errorToast(){
|
||||
errorToast(err) {
|
||||
this.$buefy.toast.open({
|
||||
message: 'Ha ocurrido un error al enviar los datos, intente de nuevo más tarde.',
|
||||
duration: 8000,
|
||||
message: err,
|
||||
type: 'is-danger',
|
||||
})
|
||||
},
|
||||
@@ -146,12 +172,28 @@ export default {
|
||||
}
|
||||
return false
|
||||
},
|
||||
fetchPremiaciones() {
|
||||
this.isLoading = true
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/profesor/premiaciones?idProfesor=${this.Profesor.idProfesor}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
if(res) this.premiaciones = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.Profesor.idProfesor = localStorage.getItem('idProfesor')
|
||||
this.Profesor.nombre = localStorage.getItem('nombre')
|
||||
this.Profesor.adscripcion = localStorage.getItem('adscripcion')
|
||||
this.Profesor.numeroTrabajador = localStorage.getItem('numeroTrabajador')
|
||||
this.fetchPremiaciones()
|
||||
},
|
||||
watch: {
|
||||
numeroInvitados() {
|
||||
@@ -171,4 +213,7 @@ export default {
|
||||
.full-h {
|
||||
min-height: 75vh;
|
||||
}
|
||||
.cont {
|
||||
width: 80%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -79,22 +79,6 @@ export default {
|
||||
onCancel: () => onCancel(),
|
||||
})
|
||||
},
|
||||
// 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')
|
||||
},
|
||||
layout: 'login',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user