pre termino alumno listo para pruebas
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3 class="title">Formulario Pre-registro</h3>
|
||||
|
||||
<b-field label="Fecha de nacimiento">
|
||||
<b-datepicker
|
||||
placeholder="Fecha de nacimiento"
|
||||
icon="calendar-today"
|
||||
:max-date="maxDate"
|
||||
v-model="nacimiento"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Telefono">
|
||||
<b-input
|
||||
type="tel"
|
||||
placeholder="Telefono"
|
||||
maxlength="10"
|
||||
v-model="telefono"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Direccion">
|
||||
<b-input
|
||||
type="textarea"
|
||||
placeholder="Direccion"
|
||||
maxlength="200"
|
||||
v-model="direccion"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="has-text-centered">
|
||||
<b-button
|
||||
type="is-success"
|
||||
:disabled="telefono == '' || direccion == ''"
|
||||
@click="
|
||||
imprimirWarning(
|
||||
'¿Estas seguro(a) que tus datos son correctos?',
|
||||
terminarPreRegistro
|
||||
)
|
||||
"
|
||||
>
|
||||
Enviar
|
||||
</b-button>
|
||||
</b-field>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
idServicio: { type: Number, required: true },
|
||||
alumno: { type: Object, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
obtenerServicio: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
direccion: '',
|
||||
telefono: '',
|
||||
nacimiento: new Date(),
|
||||
maxDate: new Date(),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
terminarPreRegistro() {
|
||||
const data = {
|
||||
idServicio: this.idServicio,
|
||||
direccion: this.direccion,
|
||||
telefono: this.telefono,
|
||||
fechaNacimiento: moment(this.nacimiento),
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(
|
||||
`${process.env.api}/servicio/registro_validado`,
|
||||
data,
|
||||
this.alumno.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.obtenerServicio()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -1,19 +1,15 @@
|
||||
<template>
|
||||
<div class="mb-6">
|
||||
<h4
|
||||
class="block is-size-4"
|
||||
v-if="
|
||||
Status.idStatus === 3 ||
|
||||
Status.idStatus === 5 ||
|
||||
Status.idStatus === 6 ||
|
||||
Status.idStatus === 8 ||
|
||||
Status.idStatus === 9
|
||||
"
|
||||
>
|
||||
Estimado alumno(a):
|
||||
</h4>
|
||||
<h4 class="block is-size-4">Estimado alumno(a):</h4>
|
||||
|
||||
<p class="has-text-justified is-size-6">
|
||||
<span v-if="Status.idStatus === 2">
|
||||
Para poder terminar con el registro de tu trámite de servicio social te
|
||||
pedimos que verifiques que tus datos sean correctos, de no ser asi
|
||||
comunicarte con COESI, y también contesta el formulario que se encuentra
|
||||
hasta el final de esta página.
|
||||
</span>
|
||||
|
||||
<span v-if="Status.idStatus === 3">
|
||||
Te informamos que el Área de Registro y Control de Servicio Social ha
|
||||
validado tu solicitud de registro de servicio social por lo que el
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3 class="title is-3 my-5">Formulario Pre-registro</h3>
|
||||
<form>
|
||||
<b-field label="Fecha de nacimiento">
|
||||
<b-datepicker
|
||||
placeholder="Fecha de nacimiento"
|
||||
icon="calendar-today"
|
||||
v-model="nacimiento"
|
||||
:min-date="minDate"
|
||||
:max-date="maxDate"
|
||||
>
|
||||
</b-datepicker>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Telefono">
|
||||
<b-input
|
||||
placeholder="Telefono"
|
||||
maxlength="10"
|
||||
v-model="telefono"
|
||||
type="tel"
|
||||
pattern="^[0-9-+\s()]*$"
|
||||
>
|
||||
</b-input>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Direccion">
|
||||
<b-input
|
||||
maxlength="200 "
|
||||
placeholder="Direccion"
|
||||
type="textarea"
|
||||
v-model="direccion"
|
||||
></b-input>
|
||||
</b-field>
|
||||
</form>
|
||||
<div class="my-4 mb-6">
|
||||
<b-field>
|
||||
<button
|
||||
:disabled="nacimiento == '' || telefono == '' || direccion == ''"
|
||||
class="button is-success is-medium"
|
||||
@click="enviarRegistro()"
|
||||
>
|
||||
Enviar
|
||||
</button>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading">
|
||||
</b-loading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
token: {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
},
|
||||
nacimiento: [],
|
||||
minDate: new Date(),
|
||||
maxDate: new Date(),
|
||||
telefono: '',
|
||||
direccion: '',
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
props: ['idServicio'],
|
||||
methods: {
|
||||
reset() {
|
||||
this.nacimiento = []
|
||||
this.telefono = ''
|
||||
this.direccion = ''
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false
|
||||
switch (msj) {
|
||||
case 'invalid signature':
|
||||
msj = 'Tu token no es valido, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'jwt expired':
|
||||
msj = 'Tu sesión ha expirado, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'jwt malformed':
|
||||
msj = 'No se encontro tu token, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'No hay token':
|
||||
msj = 'Ocurrio un error al enviar tu token, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
}
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: 'Error',
|
||||
message: msj,
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: 'alert-circle',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
})
|
||||
if (salir == true) {
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
},
|
||||
enviarRegistro() {
|
||||
this.isLoading = true
|
||||
const data = {
|
||||
idServicio: this.idServicio,
|
||||
direccion: this.direccion,
|
||||
telefono: this.telefono,
|
||||
fechaNacimiento: moment(this.nacimiento),
|
||||
}
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/registro_validado`, data, this.token)
|
||||
.then((res) => {
|
||||
this.$buefy.dialog.alert({
|
||||
title: 'Success',
|
||||
message: 'Se enviaron los datos correctamente',
|
||||
type: 'is-success',
|
||||
hasIcon: true,
|
||||
icon: 'checkbox-marked-circle',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
})
|
||||
|
||||
this.reset()
|
||||
this.$parent.getData()
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let i = new Date().getFullYear() - 80 // hoy - 80 años fecha minima
|
||||
let j = new Date().getFullYear() - 10 //hoy - 10 años
|
||||
this.minDate.setFullYear(i)
|
||||
this.maxDate.setFullYear(j)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
+14
-23
@@ -9,9 +9,17 @@
|
||||
|
||||
<InformacionServicio :servicio="servicio" />
|
||||
|
||||
<p>{{ servicio }}</p>
|
||||
<!-- <PreRegistroValidado :idServicio="servicio.idServicio" v-if="status == 2" />
|
||||
|
||||
<CompletarDatosPersonales
|
||||
:idServicio="servicio.idServicio"
|
||||
:alumno="alumno"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:obtenerServicio="obtenerServicio"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
v-if="servicio.Status.idStatus === 2"
|
||||
/>
|
||||
<!--
|
||||
<PreTermino
|
||||
:idServicio="alumno.idServicio"
|
||||
:idCuestionario="alumno.idCuestionario"
|
||||
@@ -28,7 +36,7 @@ import axios from 'axios'
|
||||
import BarraProgreso from '@/components/alumno/BarraProgreso'
|
||||
import InformacionServicio from '@/components/alumno/InformacionServicio'
|
||||
import Mensajes from '@/components/alumno/mensajes'
|
||||
import PreRegistroValidado from '@/components/alumno/pre-registro-validado'
|
||||
import CompletarDatosPersonales from '@/components/alumno/CompletarDatosPersonales'
|
||||
import PreTermino from '@/components/alumno/preTermino'
|
||||
|
||||
export default {
|
||||
@@ -36,7 +44,7 @@ export default {
|
||||
BarraProgreso,
|
||||
InformacionServicio,
|
||||
Mensajes,
|
||||
PreRegistroValidado,
|
||||
CompletarDatosPersonales,
|
||||
PreTermino,
|
||||
},
|
||||
data() {
|
||||
@@ -161,21 +169,4 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.border-info {
|
||||
border: 1px solid #167df0;
|
||||
}
|
||||
.info-alumno p {
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
.info-programa p {
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
.mensaje {
|
||||
margin: 3.5rem 0;
|
||||
}
|
||||
.else {
|
||||
display: flex;
|
||||
align-content: center !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user