diff --git a/components/registro/CapturaDatos.vue b/components/registro/CapturaDatos.vue index 795d65a..be4ce2e 100644 --- a/components/registro/CapturaDatos.vue +++ b/components/registro/CapturaDatos.vue @@ -49,12 +49,14 @@ -
-

- -

-

Adjunta foto de tu ticket

-
+
+
+

+ +

+

Adjunta foto de tu ticket

+
+
@@ -116,6 +118,8 @@ import axios from 'axios' export default { props: { pedirInscripciones: { type: Function, required: true }, + inscripcionesUsuario: { type: Array, required: true }, + datosUsuario: { type: Object, required: true }, imprimirMensaje: { type: Function, required: true }, imprimirWarning: { type: Function, required: true }, imprimirError: { type: Function, required: true }, @@ -126,8 +130,8 @@ export default { const today = new Date() return { terminos: false, - datosUsuario: {}, - inscripcionesUsuario: null, + // datosUsuario: {}, + // inscripcionesUsuario: null, idArea: '', folio: '', @@ -154,39 +158,39 @@ export default { fechaTicket: this.fechaTicket, idFechaInscripcion: 1, } - this.updateIsLoading(false) + this.updateIsLoading(true) axios .post(`${process.env.api}/usuario/inscripcionUsuario`, data) .then((res) => { this.updateIsLoading(false) - this.imprimirMensaje(res.data.message) this.pedirInscripciones() + this.imprimirMensaje(res.data.message) + this.areaPermitida() + this.clear() }) .catch((err) => { console.log(err) this.updateIsLoading(false) - // this.imprimirError(err.response.data) + this.imprimirError(err.response.data) }) - // this.mensajeWarning() }, areaPermitida() { - this.datosUsuario = JSON.parse(localStorage.getItem('datosUsuario')) - this.inscripcionesUsuario = JSON.parse( - localStorage.getItem('inscripcionesUsuario') - ) + console.log(this.inscripcionesUsuario) if ( this.datosUsuario.idCarrera === 11122 || this.datosUsuario.idCarrera === 20226 ) this.areaMac = true - console.log(this.inscripcionesUsuario) + for (let i = 0; i < this.inscripcionesUsuario.length; i++) { + console.log('entre') if (this.inscripcionesUsuario[i].idArea === 1) this.areasInscritas[0] = true else if (this.inscripcionesUsuario[i].idArea === 2) this.areasInscritas[1] = true - else this.areasInscritas[2] = true + else if (this.inscripcionesUsuario[i].idArea === 3) + this.areasInscritas[2] = true } if ( @@ -233,11 +237,17 @@ export default { today.getDate() + mesesCortos[today.getMonth()] - today.getDate() ) }, + clear() { + this.idArea = '' + this.folio = '' + this.monto = '' + }, deleteDropFile(index) { this.dropFiles.splice(index, 1) }, }, created() { + // this.datosUsuario = JSON.parse(localStorage.getItem('datosUsuario')) this.areaPermitida() }, } diff --git a/components/registro/DatosUsuario.vue b/components/registro/DatosUsuario.vue index 2f687b2..cc0dfad 100644 --- a/components/registro/DatosUsuario.vue +++ b/components/registro/DatosUsuario.vue @@ -37,7 +37,6 @@ diff --git a/pages/registro/index.vue b/pages/registro/index.vue index 6aa14e7..b3dd8f4 100644 --- a/pages/registro/index.vue +++ b/pages/registro/index.vue @@ -35,7 +35,6 @@

Datos del alumno

@@ -43,6 +42,8 @@

Instrucciones

{ this.inscripcionesUsuario = res.data - localStorage.setItem( - 'inscripcionesUsuario', - JSON.stringify(this.inscripcionesUsuario) - ) + console.log(res.data) + if (this.inscripcionesUsuario[0].confirmacion === true) + this.activeStep = 1 + if (this.inscripcionesUsuario[0].validacion === true) + this.activeStep = 2 }) .catch((err) => { this.error = 'is-danger' - this.updateIsLoading(false) this.imprimirError(err.response.data) }) }, @@ -154,8 +155,9 @@ export default { }) }, }, - created() { + mounted() { this.datosUsuario = JSON.parse(localStorage.getItem('datosUsuario')) + this.pedirInscripciones() }, }