Preguntamos si quiere hacer otra inscripcion

This commit is contained in:
Andres2908
2022-02-09 23:07:51 -06:00
parent db7c252b70
commit d2f8fe0c65
3 changed files with 26 additions and 7 deletions
+13 -3
View File
@@ -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>
+1 -1
View File
@@ -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()
+12 -3
View File
@@ -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>