tokens
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<p class="is-size-2">Lector de códigos QR</p>
|
||||
</div>
|
||||
<div v-if="!isReading" class="has-text-centered mb-4">
|
||||
<b-button type="is-info" @click="() => this.isReading = true">
|
||||
<b-button type="is-info" @click="() => (this.isReading = true)">
|
||||
Leer QR
|
||||
</b-button>
|
||||
</div>
|
||||
<Scanner :enviar="enviar" v-if="isReading"/>
|
||||
<Scanner :enviar="enviar" v-if="isReading" />
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
</template>
|
||||
@@ -18,7 +18,7 @@ import axios from 'axios'
|
||||
import Scanner from '../../components/operador/Scanner.vue'
|
||||
export default {
|
||||
components: {
|
||||
Scanner
|
||||
Scanner,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -32,7 +32,11 @@ export default {
|
||||
this.isReading = false
|
||||
const data = { idProfesor, idPremiacion }
|
||||
axios
|
||||
.post(`${process.env.api}/profesor/entradaInvitado`, data)
|
||||
.post(`${process.env.api}/profesor/entradaInvitado`, data, {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
this.successUpload()
|
||||
@@ -52,7 +56,7 @@ export default {
|
||||
confirmButtonColor: '#1e3c70',
|
||||
})
|
||||
},
|
||||
errorMessage(err){
|
||||
errorMessage(err) {
|
||||
this.$swal({
|
||||
title: err,
|
||||
type: 'error',
|
||||
@@ -60,7 +64,7 @@ export default {
|
||||
confirmButtonText: 'Aceptar',
|
||||
confirmButtonColor: '#1e3c70',
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
layout: 'default',
|
||||
}
|
||||
|
||||
+30
-14
@@ -15,8 +15,12 @@
|
||||
<div v-if="premiaciones.length !== 0" class="box">
|
||||
<div>
|
||||
<p class="is-size-4 block"><b>Nombre:</b> {{ `${Profesor.nombre}` }}</p>
|
||||
<p v-if="alreadyRegistred" class="is-size-3 block has-text-centered">Este profesor ya registró invitados en otro momento.</p>
|
||||
<p v-if="isSent" class="is-size-3 block has-text-centered">¡Gracias por su registro!</p>
|
||||
<p v-if="alreadyRegistred" class="is-size-3 block has-text-centered">
|
||||
Este profesor ya registró invitados en otro momento.
|
||||
</p>
|
||||
<p v-if="isSent" class="is-size-3 block has-text-centered">
|
||||
¡Gracias por su registro!
|
||||
</p>
|
||||
|
||||
<div v-if="!isSent && !alreadyRegistred" class="is-flex block">
|
||||
<p class="is-size-4 block mr-4"><b>Premiacion: </b></p>
|
||||
@@ -35,7 +39,7 @@
|
||||
</b-select>
|
||||
</div>
|
||||
|
||||
<div v-if="!isSent && !alreadyRegistred" class="is-flex">
|
||||
<div v-if="!isSent && !alreadyRegistred" class="is-flex">
|
||||
<p class="is-size-4 block mr-4"><b>Cantidad de invitados: </b></p>
|
||||
<b-select
|
||||
v-model="numeroInvitados"
|
||||
@@ -103,7 +107,9 @@
|
||||
</div>
|
||||
<div v-if="premiaciones.length === 0" class="box">
|
||||
<p class="is-size-4 block"><b>Nombre:</b> {{ `${Profesor.nombre}` }}</p>
|
||||
<p class="is-size-4 block"><b>No hay premiaciones activas para este profesor.</b> </p>
|
||||
<p class="is-size-4 block">
|
||||
<b>No hay premiaciones activas para este profesor.</b>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -128,7 +134,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
enviar() {
|
||||
console.log(this.premiacion)
|
||||
this.isLoading = true
|
||||
this.invitados.forEach((item) => {
|
||||
item.nombreCompleto = `${item.nombre} ${item.apellido}`
|
||||
@@ -138,9 +143,12 @@ export default {
|
||||
idPremiacion: this.premiacion,
|
||||
invitados: this.invitados,
|
||||
}
|
||||
console.log(data)
|
||||
axios
|
||||
.post(`${process.env.api}/invitado/infoInvitados`, data)
|
||||
.post(`${process.env.api}/invitado/infoInvitados`, data, {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
this.invitados = []
|
||||
@@ -183,11 +191,16 @@ export default {
|
||||
this.isLoading = true
|
||||
await axios
|
||||
.get(
|
||||
`${process.env.api}/profesor/premiaciones?idProfesor=${this.Profesor.idProfesor}`
|
||||
`${process.env.api}/profesor/premiaciones?idProfesor=${this.Profesor.idProfesor}`,
|
||||
{
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
if(res) this.premiaciones = res.data
|
||||
if (res) this.premiaciones = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
@@ -196,14 +209,18 @@ export default {
|
||||
},
|
||||
async yaRegistrado() {
|
||||
this.isLoading = true
|
||||
console.log(this.Profesor.idProfesor, this.premiaciones[0].idPremiacion)
|
||||
await axios
|
||||
.get(
|
||||
`${process.env.api}/profesor/yaRegistro?idProfesor=${this.Profesor.idProfesor}&idPremiacion=${this.premiaciones[0].idPremiacion}`
|
||||
`${process.env.api}/profesor/yaRegistro?idProfesor=${this.Profesor.idProfesor}&idPremiacion=${this.premiaciones[0].idPremiacion}`,
|
||||
{
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
this.isLoading = false
|
||||
if(res) this.alreadyRegistred = res.data
|
||||
if (res) this.alreadyRegistred = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
@@ -217,8 +234,7 @@ export default {
|
||||
this.Profesor.adscripcion = localStorage.getItem('adscripcion')
|
||||
this.Profesor.numeroTrabajador = localStorage.getItem('numeroTrabajador')
|
||||
await this.fetchPremiaciones()
|
||||
console.log(this.premiaciones)
|
||||
if(this.premiaciones.length === 1) {
|
||||
if (this.premiaciones.length === 1) {
|
||||
await this.yaRegistrado()
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user