Preguntamos si quiere hacer otra inscripcion
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-table class="box" :data="inscripciones">
|
||||
<b-table
|
||||
class="box"
|
||||
:data="inscripciones"
|
||||
:paginated="isPaginated"
|
||||
:per-page="perPage"
|
||||
:current-page.sync="currentPage"
|
||||
>
|
||||
<b-table-column
|
||||
field="numeroCuenta"
|
||||
label="Número de cuenta"
|
||||
@@ -38,10 +44,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
inscripciones: [],
|
||||
isPaginated: true,
|
||||
currentPage: 1,
|
||||
perPage: 5,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
todasInscripciones() {
|
||||
todasInscripciones(perPage) {
|
||||
console.log(this.currentPage)
|
||||
axios
|
||||
.get(`${process.env.api}/admin/todas_inscripciones`)
|
||||
.then((res) => {
|
||||
@@ -66,7 +76,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.todasInscripciones()
|
||||
this.todasInscripciones(this.currentPage)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -178,7 +178,7 @@ export default {
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.pedirInscripciones()
|
||||
this.pedirInscripciones(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.areaPermitida()
|
||||
this.clear()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<b-step-item
|
||||
step="3"
|
||||
label="Terminado"
|
||||
label="Validación"
|
||||
type="is-success"
|
||||
:clickable="isStepsClickable"
|
||||
>
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async pedirInscripciones() {
|
||||
async pedirInscripciones(mostrarWarning) {
|
||||
await axios
|
||||
.get(
|
||||
`${process.env.api}/usuario/inscripciones?idUsuario=${this.datosUsuario.idUsuario}`
|
||||
@@ -91,12 +91,21 @@ export default {
|
||||
this.activeStep = 1
|
||||
if (this.inscripcionesUsuario[0].validacion === true)
|
||||
this.activeStep = 2
|
||||
if (this.inscripcionesUsuario.length > 0 && mostrarWarning) {
|
||||
this.imprimirWarning(
|
||||
'Tu ya tienes una inscripción en proceso, ¿Quieres realizar otra?',
|
||||
this.clearActiveStep
|
||||
)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
clearActiveStep() {
|
||||
this.activeStep = 0
|
||||
},
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
@@ -162,7 +171,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.datosUsuario = JSON.parse(localStorage.getItem('datosUsuario'))
|
||||
this.pedirInscripciones()
|
||||
this.pedirInscripciones(true)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user