tokens, funcion error sin probar, cambiar los loading de js a html
This commit is contained in:
@@ -1,495 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<div class="container px-3">
|
||||
<div class="progressBar my-6">
|
||||
<b-steps
|
||||
type="is-success"
|
||||
size="is-large"
|
||||
:has-navigation="false"
|
||||
v-model="activeStep"
|
||||
>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Registro"
|
||||
icon="account-plus"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Registro validado"
|
||||
icon="account-clock"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Registro"
|
||||
icon="account"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Termino"
|
||||
icon="account-details"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Termino"
|
||||
icon="account-clock"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Liberacion"
|
||||
icon="account-check"
|
||||
></b-step-item>
|
||||
</b-steps>
|
||||
</div>
|
||||
|
||||
<div class="mensajeDiv" v-for="mensaje in mensajes" :key="mensaje.status">
|
||||
<div v-if="mensaje.mensaje != '' && mensaje.status == activeStep">
|
||||
<p class="mensaje has-text-justified">
|
||||
<span class="block is-size-5">Estimado alumno(a): </span
|
||||
><br /><br />
|
||||
{{ mensaje.mensaje }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<div class="info-programa">
|
||||
<h3 class="title is-3">Información del programa</h3>
|
||||
<p><strong> Programa: </strong> {{ programa.programa }}</p>
|
||||
<p><strong> Institución: </strong> {{ programa.institucion }}</p>
|
||||
<p><strong> Dependencia: </strong> {{ programa.dependencia }}</p>
|
||||
<p><strong> Clave del programa: </strong> {{ programa.clave }}</p>
|
||||
<div v-if="programa.acatlan == true">
|
||||
<p>
|
||||
<strong> Programa Interno: </strong>
|
||||
{{ programa.programaInterno }}
|
||||
</p>
|
||||
<p><strong> Profesor: </strong> {{ programa.profesor }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-alumno mt-6">
|
||||
<h3 class="title is-3">Información del alumno</h3>
|
||||
<p><strong> Nombre: </strong> {{ alumno.nombre }}</p>
|
||||
<p><strong> Número de cuenta: </strong> {{ alumno.cuenta }}</p>
|
||||
<p><strong> Carrera: </strong> {{ alumno.carrera }}</p>
|
||||
<p>
|
||||
<strong> Créditos: </strong>{{ alumno.creditos
|
||||
}}<span v-if="alumno.creditos">%</span>
|
||||
</p>
|
||||
<p><strong> Correo del alumno: </strong> {{ alumno.correo }}</p>
|
||||
<p><strong> Fecha de inicio: </strong> {{ fecha(alumno.inicio) }}</p>
|
||||
<p>
|
||||
<strong> Fecha de finalización: </strong> {{ fecha(alumno.fin) }}
|
||||
</p>
|
||||
<p>
|
||||
<strong> Fecha de registro: </strong> {{ fecha(alumno.registro) }}
|
||||
</p>
|
||||
|
||||
<div class="mt-4 info-extra" v-if="activeStep >= 2">
|
||||
<p><strong> Direccion: </strong> {{ alumno.direccion }}</p>
|
||||
<p><strong> Telefono: </strong> {{ alumno.telefono }}</p>
|
||||
<p>
|
||||
<strong> Fecha de nacimiento: </strong>
|
||||
{{ fecha(alumno.nacimiento) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="registro" v-if="activeStep == 1">
|
||||
<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"
|
||||
>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
<div class="registro-validado" v-if="activeStep == 2"></div>
|
||||
|
||||
<div class="pre-termino" v-if="activeStep == 3 || activeStep == 9">
|
||||
<h3 class="title is-4 mt-6">
|
||||
Cuestionario de evaluación del programa de servicio social
|
||||
</h3>
|
||||
<div class="my-6" v-if="alumno.idCuestionario == null">
|
||||
<b-button
|
||||
tag="router-link"
|
||||
to="/alumno/cuestionario"
|
||||
type="is-info is-light "
|
||||
icon-left="book-open"
|
||||
class="border-info"
|
||||
size="is-medium"
|
||||
>
|
||||
cuestionario
|
||||
</b-button>
|
||||
</div>
|
||||
<div class="is-flex" v-else>
|
||||
<p class="block is-size-5">Cuestionario contestado</p>
|
||||
<b-icon icon="check-bold" size="is-small" type="is-success"> </b-icon>
|
||||
</div>
|
||||
|
||||
<h3 class="title is-4 mt-6">
|
||||
Informe global de actividades (en formato .PDF. No se aceptan fotos).
|
||||
</h3>
|
||||
<div v-if="alumno.informeGlobal == null">
|
||||
<b-field type="black">
|
||||
<b-upload
|
||||
v-model="file"
|
||||
type="black"
|
||||
drag-drop
|
||||
expanded
|
||||
accept="application/pdf"
|
||||
>
|
||||
<section class="section">
|
||||
<div class="content has-text-centered">
|
||||
<p>
|
||||
<b-icon icon="upload" size="is-large"></b-icon>
|
||||
</p>
|
||||
<p>
|
||||
{{
|
||||
file.name ||
|
||||
"Arrastra aquí tu archivo o da click para buscar"
|
||||
}}
|
||||
</p>
|
||||
<p>Tamaño máximo 20MB</p>
|
||||
</div>
|
||||
</section>
|
||||
</b-upload>
|
||||
</b-field>
|
||||
<b-field class="derecha">
|
||||
<button
|
||||
:disabled="file == ''"
|
||||
class="button is-success is-medium mb-4"
|
||||
@click="enviarInforme()"
|
||||
>
|
||||
Enviar
|
||||
</button>
|
||||
</b-field>
|
||||
</div>
|
||||
<div class="is-flex" v-else>
|
||||
<p class="block is-size-5">Informe Global enviado.</p>
|
||||
<b-icon icon="check-bold" size="is-small" type="is-success"> </b-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="termino" v-if="activeStep == 4"></div>
|
||||
|
||||
<div class="Liberacion" v-if="activeStep == 5"></div>
|
||||
</div>
|
||||
|
||||
<div class="container px-3"></div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import "buefy/dist/buefy.css";
|
||||
import moment from "moment";
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeStep: "",
|
||||
isFullPage: true,
|
||||
file: [],
|
||||
nacimiento: [],
|
||||
minDate: new Date(),
|
||||
maxDate: new Date(),
|
||||
telefono: "",
|
||||
direccion: "",
|
||||
alumno: {
|
||||
carrera: "",
|
||||
creditos: "",
|
||||
nombre: "",
|
||||
cuenta: "",
|
||||
correo: "",
|
||||
direccion: "",
|
||||
nacimiento: "",
|
||||
telefono: "",
|
||||
idCuestionario: "",
|
||||
informeGlobal: "",
|
||||
idAlumno: "",
|
||||
idCarrera: "",
|
||||
idServicio: "",
|
||||
inicio: [],
|
||||
fin: [],
|
||||
registro: [],
|
||||
},
|
||||
programa: {
|
||||
programa: "",
|
||||
institucion: "",
|
||||
dependencia: "",
|
||||
clave: "",
|
||||
acatlan: "",
|
||||
programaInterno: "",
|
||||
profesor: "",
|
||||
},
|
||||
mensajes: [
|
||||
{ status: 0, mensaje: "" },
|
||||
{ status: 1, mensaje: "" },
|
||||
{
|
||||
status: 2,
|
||||
mensaje:
|
||||
"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 siguiente trámite lo realizarás hasta que concluyas 480 horas en un periodo de mínimo 6 meses y obtengas tu carta de término por parte de la institución, quien se encargará de subir dicho archivo a este sistema, además de responder un cuestionario sobre tu desempeño. A su vez, deberás responder el siguiente cuestionario de evaluación del programa de servicio social en donde participaste y enviar el informe global de actividades elaborado por ti, con firma y sello de visto bueno de tu jefe inmediato. En cuanto el Área de Registro y Control de Servicio Social valide tu solicitud, podrás revisar las indicaciones del siguiente paso en el panel llamado “Liberación” Cualquier duda puedes acudir al área de Registro y Control de Servicio Social en COESI de lunes a viernes de 10:00 a 14:00 hrs. y de 16:00 a 20:00 hrs. o bien, comunicarte al 5623 1686 o al correo registross@acatlan.unam.mx",
|
||||
},
|
||||
{ status: 3, mensaje: "" },
|
||||
{
|
||||
status: 4,
|
||||
mensaje:
|
||||
"Espera a que tus documentos sean validados por el Departamento de Servicio Social y Bolsa de Trabajo",
|
||||
},
|
||||
{
|
||||
status: 5,
|
||||
mensaje:
|
||||
"Te confirmamos que has concluido con los trámites necesarios para la liberación de tu servicio social por lo que ahora sólo queda esperar a que en máximo 15 días hábiles se te notifique por correo electrónico a partir de cuándo puedes recoger la copia de tu carta de liberación en las ventanillas del Área de Registro y Control de Servicio Social. Cualquier duda puedes acudir al área de Registro y Control de Servicio Social en COESI de lunes a viernes de 10:00 a 13:00 hrs. y de 16:00 a 19:00 hrs. o bien, comunicarte al 5623 1686 o al correo registross@apolo.acatlan.unam.mx",
|
||||
},
|
||||
{ status: 6, mensaje: "" },
|
||||
{ status: 7, mensaje: "" },
|
||||
{ status: 8, mensaje: "" },
|
||||
{
|
||||
status: 9,
|
||||
mensaje:
|
||||
"Informe global de actividades rechazado. Por favor reenvia el informe correctamente",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.file = [];
|
||||
this.nacimiento = [];
|
||||
this.telefono = "";
|
||||
this.direccion = "";
|
||||
},
|
||||
getData() {
|
||||
axios
|
||||
.get(`${process.env.api}/servicio/alumno`, {
|
||||
params: {
|
||||
idUsuario: localStorage.getItem("idUsuario"),
|
||||
},
|
||||
})
|
||||
.then((resp) => {
|
||||
console.log(resp.data);
|
||||
this.activeStep = resp.data.Status.idStatus - 1;
|
||||
|
||||
this.programa.programa = resp.data.Programa.programa;
|
||||
this.programa.dependencia = resp.data.Programa.dependencia;
|
||||
this.programa.institucion = resp.data.Programa.institucion;
|
||||
this.programa.clave = resp.data.Programa.clavePrograma;
|
||||
this.programa.profesor = resp.data.profesor;
|
||||
this.programa.acatlan = resp.data.Programa.acatlan;
|
||||
this.programa.programaInterno = resp.data.programaInterno;
|
||||
|
||||
this.alumno.creditos = parseInt(resp.data.creditos, 10);
|
||||
this.alumno.carrera = resp.data.Carrera.carrera;
|
||||
this.alumno.idCarrera = resp.data.Carrera.idCarrera;
|
||||
this.alumno.correo = resp.data.correo;
|
||||
this.alumno.inicio = resp.data.fechaInicio;
|
||||
this.alumno.fin = resp.data.fechaFin;
|
||||
this.alumno.registro = resp.data.createdAt;
|
||||
this.alumno.direccion = resp.data.direccion;
|
||||
this.alumno.nacimiento = resp.data.fechaNacimiento;
|
||||
this.alumno.telefono = resp.data.telefono;
|
||||
this.alumno.idServicio = resp.data.idServicio;
|
||||
this.alumno.idCuestionario = resp.data.idCuestionarioAlumno;
|
||||
this.alumno.informeGlobal = resp.data.informeGlobal;
|
||||
this.alumno.nombre = localStorage.getItem("nombre");
|
||||
this.alumno.cuenta = localStorage.getItem("usuario");
|
||||
|
||||
window.localStorage.setItem(
|
||||
"idCuestionarioAlumno",
|
||||
resp.data.idCuestionarioAlumno
|
||||
);
|
||||
window.localStorage.setItem("idServicio", resp.data.idServicio);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
});
|
||||
},
|
||||
enviarRegistro() {
|
||||
const loadingComponent = this.$buefy.loading.open({
|
||||
container: this.isFullPage ? null : this.$refs.element.$el,
|
||||
});
|
||||
|
||||
const data = {
|
||||
idServicio: this.alumno.idServicio,
|
||||
direccion: this.direccion,
|
||||
telefono: this.telefono,
|
||||
fechaNacimiento: moment(this.nacimiento),
|
||||
};
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/registro_validado`, data)
|
||||
.then((res) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Success",
|
||||
message: "Se enviaron los datos correctamente",
|
||||
type: "is-success",
|
||||
hasIcon: true,
|
||||
icon: "checkbox-marked-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
|
||||
this.reset();
|
||||
this.getData();
|
||||
})
|
||||
.catch((error) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
});
|
||||
},
|
||||
enviarInforme() {
|
||||
const loadingComponent = this.$buefy.loading.open({
|
||||
container: this.isFullPage ? null : this.$refs.element.$el,
|
||||
});
|
||||
const data = {
|
||||
idServicio: this.alumno.idServicio,
|
||||
};
|
||||
const formData = new FormData();
|
||||
console.log(data);
|
||||
formData.append("data", JSON.stringify(data));
|
||||
formData.append("informeGlobal", this.file);
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/informe_global`, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Success",
|
||||
message: "Se enviaron los datos correctamente",
|
||||
type: "is-success",
|
||||
hasIcon: true,
|
||||
icon: "checkbox-marked-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
|
||||
this.reset();
|
||||
this.getData();
|
||||
})
|
||||
.catch((error) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
});
|
||||
},
|
||||
fecha(date) {
|
||||
const fecha = moment(date);
|
||||
return `${fecha.year()}/${fecha.month() + 1}/${fecha.date()}`;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
steps() {
|
||||
const steps = [...this.baseSteps];
|
||||
return steps;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
watch: {
|
||||
file() {
|
||||
console.log(this.file.size);
|
||||
if (this.file.size >= 20000000) {
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: "El tamaño del archivo exede los 20MB",
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
this.file = [];
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
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>
|
||||
.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>
|
||||
+2
-2
@@ -46,8 +46,8 @@ export default {
|
||||
// Build Configuration (https://go.nuxtjs.dev/config-build)
|
||||
build: {},
|
||||
env: {
|
||||
api: "http://localhost:3000",
|
||||
// api: "https://venus.acatlan.unam.mx/ss-pruebas",
|
||||
//api: "http://localhost:3000",
|
||||
api: "https://venus.acatlan.unam.mx/ss-pruebas",
|
||||
// api: "https://890af9d598a4.ngrok.io"
|
||||
// api: 'https//venus.acatlan.unam.mx/pruebas_pcpuma'
|
||||
},
|
||||
|
||||
@@ -765,10 +765,12 @@
|
||||
<div v-else class="vh ">
|
||||
<h1>Ya has contestado tu cuestionario :)</h1>
|
||||
</div>
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Buefy from 'buefy';
|
||||
import "buefy/dist/buefy.css";
|
||||
import moment from "moment";
|
||||
import axios from "axios";
|
||||
@@ -776,7 +778,13 @@ import axios from "axios";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
token: {
|
||||
headers:{
|
||||
taken: window.localStorage.getItem('token')
|
||||
}
|
||||
},
|
||||
maxCheckbox: 0,
|
||||
isLoading: false,
|
||||
current: 1,
|
||||
idCuestionario: "",
|
||||
answers: {
|
||||
@@ -1013,9 +1021,43 @@ export default {
|
||||
return false;
|
||||
// activar boton
|
||||
else return true;
|
||||
},
|
||||
error(msj){
|
||||
let salir =false;
|
||||
switch(msj){
|
||||
case 'invalid signature':
|
||||
msj= "tu token no es valido, inicia sesión de nuevo"
|
||||
break;
|
||||
case 'jwt expired':
|
||||
msj= "tu sesión ha expirado, inicia sesión de nuevo"
|
||||
break;
|
||||
case 'no hay token':
|
||||
msj= "no has enviado tu token, inicia sesión de nuevo"
|
||||
break;
|
||||
default:
|
||||
salir=true
|
||||
}
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
if (salir === true) {
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
enviarCuestionario() {
|
||||
this.isLoading=true
|
||||
|
||||
if (this.answers.p3Otro != "" && this.maxCheckbox < 3) {
|
||||
console.log("agregarotro");
|
||||
this.answers.p3.push(this.answers.p3Otro);
|
||||
@@ -1027,42 +1069,43 @@ export default {
|
||||
sexo: this.answers.sexo,
|
||||
edad: this.answers.edad,
|
||||
servicioMedico: this.answers.servicioMedico,
|
||||
pUno: this.answers.p1,
|
||||
pDos: this.answers.p2,
|
||||
pTres: this.answers.p3,
|
||||
pCuatro: this.answers.p4,
|
||||
pCinco: this.answers.p5,
|
||||
pSeis: this.answers.p6,
|
||||
pSiete: this.answers.p7,
|
||||
pOcho: this.answers.p8,
|
||||
pNueve: this.answers.p9,
|
||||
pDiez: this.answers.p10,
|
||||
pOnce: this.answers.p11,
|
||||
pDoce: this.answers.p12,
|
||||
pTrece: this.answers.p13,
|
||||
pCatorce: this.answers.p14,
|
||||
pQuince: this.answers.p15,
|
||||
pDieciseis: this.answers.p16,
|
||||
pDiecisiete: this.answers.p17,
|
||||
pDieciocho: this.answers.p18,
|
||||
pDiecinueve: this.answers.p19,
|
||||
pVeinte: this.answers.p20,
|
||||
pVeintiuno: this.answers.p21,
|
||||
pVeintidos: this.answers.p22,
|
||||
pVeintitres: this.answers.p23,
|
||||
pVeinticuatro: this.answers.p24,
|
||||
pVeinticinco: this.answers.p25,
|
||||
pVeintiseis: this.answers.p26,
|
||||
pVeintisiete: this.answers.p27,
|
||||
pVeintiocho: this.answers.p28,
|
||||
pVeintinueve: this.answers.p29,
|
||||
pTreinta: this.answers.p30,
|
||||
p1: this.answers.p1,
|
||||
p2: this.answers.p2,
|
||||
p3: this.answers.p3,
|
||||
p4: this.answers.p4,
|
||||
p5: this.answers.p5,
|
||||
p6: this.answers.p6,
|
||||
p7: this.answers.p7,
|
||||
p8: this.answers.p8,
|
||||
p9: this.answers.p9,
|
||||
p10: this.answers.p10,
|
||||
p11: this.answers.p11,
|
||||
p12: this.answers.p12,
|
||||
p13: this.answers.p13,
|
||||
p14: this.answers.p14,
|
||||
p15: this.answers.p15,
|
||||
p16: this.answers.p16,
|
||||
p17: this.answers.p17,
|
||||
p18: this.answers.p18,
|
||||
p19: this.answers.p19,
|
||||
p20: this.answers.p20,
|
||||
p21: this.answers.p21,
|
||||
p22: this.answers.p22,
|
||||
p23: this.answers.p23,
|
||||
p24: this.answers.p24,
|
||||
p25: this.answers.p25,
|
||||
p26: this.answers.p26,
|
||||
p27: this.answers.p27,
|
||||
p28: this.answers.p28,
|
||||
p29: this.answers.p29,
|
||||
p30: this.answers.p30,
|
||||
};
|
||||
console.log(data);
|
||||
|
||||
axios
|
||||
.post(`${process.env.api}/cuestionario_alumno`, data)
|
||||
.post(`${process.env.api}/cuestionario_alumno`, data, this.token)
|
||||
.then((res) => {
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Success",
|
||||
message: "Se enviaron los datos correctamente",
|
||||
@@ -1075,20 +1118,15 @@ export default {
|
||||
});
|
||||
|
||||
//this.reset()
|
||||
localStorage.removeItem("idCuestionarioAlumno");
|
||||
this.$router.push("/alumno");
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
});
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading=false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
@@ -1106,6 +1144,7 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.SINO * {
|
||||
margin: 0.5rem 0 !important;
|
||||
|
||||
+504
-3
@@ -1,12 +1,513 @@
|
||||
<template>
|
||||
<section>
|
||||
<DataAlumno />
|
||||
<div class="container px-3">
|
||||
<div class="progressBar my-6">
|
||||
<b-steps
|
||||
type="is-success"
|
||||
size="is-large"
|
||||
:has-navigation="false"
|
||||
v-model="activeStep"
|
||||
>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Registro"
|
||||
icon="account-plus"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Registro validado"
|
||||
icon="account-clock"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Registro"
|
||||
icon="account"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Pre Termino"
|
||||
icon="account-details"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Termino"
|
||||
icon="account-clock"
|
||||
></b-step-item>
|
||||
<b-step-item
|
||||
:clickable="false"
|
||||
label="Liberacion"
|
||||
icon="account-check"
|
||||
></b-step-item>
|
||||
</b-steps>
|
||||
</div>
|
||||
|
||||
<div class="mensajeDiv" v-for="mensaje in mensajes" :key="mensaje.status">
|
||||
<div v-if="mensaje.mensaje != '' && mensaje.status == activeStep">
|
||||
<p class="mensaje has-text-justified">
|
||||
<span class="block is-size-5">Estimado alumno(a): </span
|
||||
><br /><br />
|
||||
{{ mensaje.mensaje }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<div class="info-programa">
|
||||
<h3 class="title is-3">Información del programa</h3>
|
||||
<p><strong> Programa: </strong> {{ programa.programa }}</p>
|
||||
<p><strong> Institución: </strong> {{ programa.institucion }}</p>
|
||||
<p><strong> Dependencia: </strong> {{ programa.dependencia }}</p>
|
||||
<p><strong> Clave del programa: </strong> {{ programa.clave }}</p>
|
||||
<div v-if="programa.acatlan == true">
|
||||
<p>
|
||||
<strong> Programa Interno: </strong>
|
||||
{{ programa.programaInterno }}
|
||||
</p>
|
||||
<p><strong> Profesor: </strong> {{ programa.profesor }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-alumno mt-6">
|
||||
<h3 class="title is-3">Información del alumno</h3>
|
||||
<p><strong> Nombre: </strong> {{ alumno.nombre }}</p>
|
||||
<p><strong> Número de cuenta: </strong> {{ alumno.cuenta }}</p>
|
||||
<p><strong> Carrera: </strong> {{ alumno.carrera }}</p>
|
||||
<p>
|
||||
<strong> Créditos: </strong>{{ alumno.creditos
|
||||
}}<span v-if="alumno.creditos">%</span>
|
||||
</p>
|
||||
<p><strong> Correo del alumno: </strong> {{ alumno.correo }}</p>
|
||||
<p><strong> Fecha de inicio: </strong> {{ fecha(alumno.inicio) }}</p>
|
||||
<p>
|
||||
<strong> Fecha de finalización: </strong> {{ fecha(alumno.fin) }}
|
||||
</p>
|
||||
<p>
|
||||
<strong> Fecha de registro: </strong> {{ fecha(alumno.registro) }}
|
||||
</p>
|
||||
|
||||
<div class="mt-4 info-extra" v-if="activeStep >= 2">
|
||||
<p><strong> Direccion: </strong> {{ alumno.direccion }}</p>
|
||||
<p><strong> Telefono: </strong> {{ alumno.telefono }}</p>
|
||||
<p>
|
||||
<strong> Fecha de nacimiento: </strong>
|
||||
{{ fecha(alumno.nacimiento) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="registro" v-if="activeStep == 1">
|
||||
<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"
|
||||
>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
<div class="registro-validado" v-if="activeStep == 2"></div>
|
||||
|
||||
<div class="pre-termino" v-if="activeStep == 3 || activeStep == 9">
|
||||
<h3 class="title is-4 mt-6">
|
||||
Cuestionario de evaluación del programa de servicio social
|
||||
</h3>
|
||||
<div class="my-6" v-if="alumno.idCuestionario == null">
|
||||
<b-button
|
||||
tag="router-link"
|
||||
to="/alumno/cuestionario"
|
||||
type="is-info is-light "
|
||||
icon-left="book-open"
|
||||
class="border-info"
|
||||
size="is-medium"
|
||||
>
|
||||
cuestionario
|
||||
</b-button>
|
||||
</div>
|
||||
<div class="is-flex" v-else>
|
||||
<p class="block is-size-5">Cuestionario contestado</p>
|
||||
<b-icon icon="check-bold" size="is-small" type="is-success"> </b-icon>
|
||||
</div>
|
||||
|
||||
<h3 class="title is-4 mt-6">
|
||||
Informe global de actividades (en formato .PDF. No se aceptan fotos).
|
||||
</h3>
|
||||
<div v-if="alumno.informeGlobal == null">
|
||||
<b-field type="black">
|
||||
<b-upload
|
||||
v-model="file"
|
||||
type="black"
|
||||
drag-drop
|
||||
expanded
|
||||
accept="application/pdf"
|
||||
>
|
||||
<section class="section">
|
||||
<div class="content has-text-centered">
|
||||
<p>
|
||||
<b-icon icon="upload" size="is-large"></b-icon>
|
||||
</p>
|
||||
<p>
|
||||
{{
|
||||
file.name ||
|
||||
"Arrastra aquí tu archivo o da click para buscar"
|
||||
}}
|
||||
</p>
|
||||
<p>Tamaño máximo 20MB</p>
|
||||
</div>
|
||||
</section>
|
||||
</b-upload>
|
||||
</b-field>
|
||||
<b-field class="derecha">
|
||||
<button
|
||||
:disabled="file == ''"
|
||||
class="button is-success is-medium mb-4"
|
||||
@click="enviarInforme()"
|
||||
>
|
||||
Enviar
|
||||
</button>
|
||||
</b-field>
|
||||
</div>
|
||||
<div class="is-flex" v-else>
|
||||
<p class="block is-size-5">Informe Global enviado.</p>
|
||||
<b-icon icon="check-bold" size="is-small" type="is-success"> </b-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="termino" v-if="activeStep == 4"></div>
|
||||
|
||||
<div class="Liberacion" v-if="activeStep == 5"></div>
|
||||
</div>
|
||||
|
||||
<div class="container px-3"></div>
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataAlumno from "../../components/alumno/DataAlumno";
|
||||
import "buefy/dist/buefy.css";
|
||||
import moment from "moment";
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
components: { DataAlumno },
|
||||
data() {
|
||||
return {
|
||||
token: {
|
||||
headers:{
|
||||
taken: window.localStorage.getItem('token')
|
||||
}
|
||||
},
|
||||
activeStep: "",
|
||||
isLoading: false,
|
||||
file: [],
|
||||
nacimiento: [],
|
||||
minDate: new Date(),
|
||||
maxDate: new Date(),
|
||||
telefono: "",
|
||||
direccion: "",
|
||||
alumno: {
|
||||
carrera: "",
|
||||
creditos: "",
|
||||
nombre: "",
|
||||
cuenta: "",
|
||||
correo: "",
|
||||
direccion: "",
|
||||
nacimiento: "",
|
||||
telefono: "",
|
||||
idCuestionario: "",
|
||||
informeGlobal: "",
|
||||
idAlumno: "",
|
||||
idCarrera: "",
|
||||
idServicio: "",
|
||||
inicio: [],
|
||||
fin: [],
|
||||
registro: [],
|
||||
},
|
||||
programa: {
|
||||
programa: "",
|
||||
institucion: "",
|
||||
dependencia: "",
|
||||
clave: "",
|
||||
acatlan: "",
|
||||
programaInterno: "",
|
||||
profesor: "",
|
||||
},
|
||||
mensajes: [
|
||||
{ status: 0, mensaje: "" },
|
||||
{ status: 1, mensaje: "" },
|
||||
{
|
||||
status: 2,
|
||||
mensaje:
|
||||
"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 siguiente trámite lo realizarás hasta que concluyas 480 horas en un periodo de mínimo 6 meses y obtengas tu carta de término por parte de la institución, quien se encargará de subir dicho archivo a este sistema, además de responder un cuestionario sobre tu desempeño. A su vez, deberás responder el siguiente cuestionario de evaluación del programa de servicio social en donde participaste y enviar el informe global de actividades elaborado por ti, con firma y sello de visto bueno de tu jefe inmediato. En cuanto el Área de Registro y Control de Servicio Social valide tu solicitud, podrás revisar las indicaciones del siguiente paso en el panel llamado “Liberación” Cualquier duda puedes acudir al área de Registro y Control de Servicio Social en COESI de lunes a viernes de 10:00 a 14:00 hrs. y de 16:00 a 20:00 hrs. o bien, comunicarte al 5623 1686 o al correo registross@acatlan.unam.mx",
|
||||
},
|
||||
{ status: 3, mensaje: "" },
|
||||
{
|
||||
status: 4,
|
||||
mensaje:
|
||||
"Espera a que tus documentos sean validados por el Departamento de Servicio Social y Bolsa de Trabajo",
|
||||
},
|
||||
{
|
||||
status: 5,
|
||||
mensaje:
|
||||
"Te confirmamos que has concluido con los trámites necesarios para la liberación de tu servicio social por lo que ahora sólo queda esperar a que en máximo 15 días hábiles se te notifique por correo electrónico a partir de cuándo puedes recoger la copia de tu carta de liberación en las ventanillas del Área de Registro y Control de Servicio Social. Cualquier duda puedes acudir al área de Registro y Control de Servicio Social en COESI de lunes a viernes de 10:00 a 13:00 hrs. y de 16:00 a 19:00 hrs. o bien, comunicarte al 5623 1686 o al correo registross@apolo.acatlan.unam.mx",
|
||||
},
|
||||
{ status: 6, mensaje: "" },
|
||||
{ status: 7, mensaje: "" },
|
||||
{ status: 8, mensaje: "" },
|
||||
{
|
||||
status: 9,
|
||||
mensaje:
|
||||
"Informe global de actividades rechazado. Por favor reenvia el informe correctamente",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.file = [];
|
||||
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"
|
||||
break;
|
||||
case 'jwt expired':
|
||||
msj= "tu sesión ha expirado, inicia sesión de nuevo"
|
||||
break;
|
||||
case 'no hay token':
|
||||
msj= "no has enviado tu token, inicia sesión de nuevo"
|
||||
break;
|
||||
default:
|
||||
salir=true
|
||||
}
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
if (salir === true) {
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
|
||||
},
|
||||
getData() {
|
||||
axios
|
||||
.get(`${process.env.api}/servicio/alumno`, {
|
||||
params: {
|
||||
idUsuario: localStorage.getItem("idUsuario"),
|
||||
},
|
||||
}, this.token)
|
||||
.then((resp) => {
|
||||
console.log(resp.data);
|
||||
this.activeStep = resp.data.Status.idStatus - 1;
|
||||
|
||||
this.programa.programa = resp.data.Programa.programa;
|
||||
this.programa.dependencia = resp.data.Programa.dependencia;
|
||||
this.programa.institucion = resp.data.Programa.institucion;
|
||||
this.programa.clave = resp.data.Programa.clavePrograma;
|
||||
this.programa.profesor = resp.data.profesor;
|
||||
this.programa.acatlan = resp.data.Programa.acatlan;
|
||||
this.programa.programaInterno = resp.data.programaInterno;
|
||||
|
||||
this.alumno.creditos = parseInt(resp.data.creditos, 10);
|
||||
this.alumno.carrera = resp.data.Carrera.carrera;
|
||||
this.alumno.idCarrera = resp.data.Carrera.idCarrera;
|
||||
this.alumno.correo = resp.data.correo;
|
||||
this.alumno.inicio = resp.data.fechaInicio;
|
||||
this.alumno.fin = resp.data.fechaFin;
|
||||
this.alumno.registro = resp.data.createdAt;
|
||||
this.alumno.direccion = resp.data.direccion;
|
||||
this.alumno.nacimiento = resp.data.fechaNacimiento;
|
||||
this.alumno.telefono = resp.data.telefono;
|
||||
this.alumno.idServicio = resp.data.idServicio;
|
||||
this.alumno.idCuestionario = resp.data.idCuestionarioAlumno;
|
||||
this.alumno.informeGlobal = resp.data.informeGlobal;
|
||||
this.alumno.nombre = localStorage.getItem("nombre");
|
||||
this.alumno.cuenta = localStorage.getItem("usuario");
|
||||
|
||||
window.localStorage.setItem("idCuestionarioAlumno",resp.data.idCuestionarioAlumno);
|
||||
window.localStorage.setItem("idServicio", resp.data.idServicio);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message)
|
||||
});
|
||||
},
|
||||
enviarRegistro() {
|
||||
this.isLoading=true
|
||||
const data = {
|
||||
idServicio: this.alumno.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",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
|
||||
this.reset();
|
||||
this.getData();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading=false
|
||||
})
|
||||
},
|
||||
enviarInforme() {
|
||||
this.isLoading = true
|
||||
const data = {
|
||||
idServicio: this.alumno.idServicio,
|
||||
};
|
||||
const formData = new FormData();
|
||||
console.log(data);
|
||||
formData.append("data", JSON.stringify(data));
|
||||
formData.append("informeGlobal", this.file);
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/informe_global`, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
token: this.token.headers.token
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Success",
|
||||
message: "Se enviaron los datos correctamente",
|
||||
type: "is-success",
|
||||
hasIcon: true,
|
||||
icon: "checkbox-marked-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
|
||||
this.reset();
|
||||
this.getData();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading= false
|
||||
})
|
||||
|
||||
},
|
||||
fecha(date) {
|
||||
const fecha = moment(date);
|
||||
return `${fecha.year()}/${fecha.month() + 1}/${fecha.date()}`;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
steps() {
|
||||
const steps = [...this.baseSteps];
|
||||
return steps;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
watch: {
|
||||
file() {
|
||||
console.log(this.file.size);
|
||||
if (this.file.size >= 20000000) {
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: "El tamaño del archivo exede los 20MB",
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
this.file = [];
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
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>
|
||||
.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>
|
||||
|
||||
+2
-8
@@ -84,14 +84,8 @@ export default {
|
||||
window.localStorage.setItem("idUsuario", resp.data.Usuario.idUsuario);
|
||||
window.localStorage.setItem("token", resp.data.token);
|
||||
window.localStorage.setItem("nombre", resp.data.Usuario.nombre);
|
||||
window.localStorage.setItem(
|
||||
"idTipoUsuario",
|
||||
resp.data.Usuario.TipoUsuario.idTipoUsuario
|
||||
);
|
||||
window.localStorage.setItem(
|
||||
"tipoUsuario",
|
||||
resp.data.Usuario.TipoUsuario.tipoUsuario
|
||||
);
|
||||
window.localStorage.setItem("idTipoUsuario", resp.data.Usuario.TipoUsuario.idTipoUsuario);
|
||||
window.localStorage.setItem("tipoUsuario", resp.data.Usuario.TipoUsuario.tipoUsuario);
|
||||
window.localStorage.setItem("usuario", resp.data.Usuario.usuario);
|
||||
this.$router.push(`/${resp.data.Usuario.TipoUsuario.tipoUsuario}`);
|
||||
})
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -225,7 +226,12 @@ import moment from "moment";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isFullPage: true,
|
||||
token: {
|
||||
headers:{
|
||||
token: window.localStorage.getItem('token')
|
||||
}
|
||||
},
|
||||
isLoading:false,
|
||||
noCuenta: "",
|
||||
sizeOk: "",
|
||||
searched: false,
|
||||
@@ -330,19 +336,47 @@ export default {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
error(msj){
|
||||
let salir =false;
|
||||
switch(msj){
|
||||
case 'invalid signature':
|
||||
msj= "tu token no es valido, inicia sesión de nuevo"
|
||||
break;
|
||||
case 'jwt expired':
|
||||
msj= "tu sesión ha expirado, inicia sesión de nuevo"
|
||||
break;
|
||||
case 'no hay token':
|
||||
msj= "no has enviado tu token, inicia sesión de nuevo"
|
||||
break;
|
||||
default:
|
||||
salir=true
|
||||
}
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
if (salir === true) {
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
|
||||
},
|
||||
buscarAlumno() {
|
||||
const loadingComponent = this.$buefy.loading.open({
|
||||
container: this.isFullPage ? null : this.$refs.element.$el,
|
||||
});
|
||||
this.isLoading=true
|
||||
axios
|
||||
.get(`${process.env.api}/usuario/escolares`, {
|
||||
params: {
|
||||
numeroCuenta: this.noCuenta,
|
||||
},
|
||||
})
|
||||
},this.token)
|
||||
.then((resp) => {
|
||||
loadingComponent.close();
|
||||
|
||||
console.log(resp.data);
|
||||
this.alumno.cuenta = this.noCuenta;
|
||||
this.alumno.nombre = resp.data.nombre;
|
||||
@@ -350,27 +384,17 @@ export default {
|
||||
this.alumno.creditos = parseInt(resp.data.creditos, 10);
|
||||
this.alumno.idCarrera = resp.data.idCarrera;
|
||||
this.alumno.idAlumno = resp.data.idUsuario;
|
||||
|
||||
this.searched = true;
|
||||
})
|
||||
.catch((error) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading = false
|
||||
});
|
||||
},
|
||||
Enviar() {
|
||||
const loadingComponent = this.$buefy.loading.open({
|
||||
container: this.isFullPage ? null : this.$refs.element.$el,
|
||||
});
|
||||
this.isLoading=true
|
||||
const data = {
|
||||
idUsuario: this.alumno.idAlumno,
|
||||
idPrograma: this.programaSelected.idPrograma,
|
||||
@@ -382,20 +406,20 @@ export default {
|
||||
profesor: this.programaSelected.profesor,
|
||||
fechaInicio: moment(this.alumno.inicio),
|
||||
fechaFin: moment(this.alumno.fin),
|
||||
};
|
||||
const formData = new FormData();
|
||||
console.log(data);
|
||||
formData.append("alumno", JSON.stringify(data));
|
||||
formData.append("cartaAceptacion", this.file);
|
||||
};
|
||||
const formData = new FormData();
|
||||
console.log(data);
|
||||
formData.append("alumno", JSON.stringify(data));
|
||||
formData.append("cartaAceptacion", this.file);
|
||||
|
||||
axios
|
||||
.post(`${process.env.api}/servicio/nuevo`, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
token:this.token.headers.token
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Success",
|
||||
message: "Se enviaron los datos correctamente",
|
||||
@@ -410,17 +434,10 @@ export default {
|
||||
this.reset();
|
||||
})
|
||||
.catch((error) => {
|
||||
loadingComponent.close();
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
type: "is-danger",
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading = false
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -452,6 +469,20 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
this.programaSelected.institucion = "";
|
||||
this.programaSelected.dependencia = "";
|
||||
this.programaSelected.programa = "";
|
||||
this.programaSelected.clavePrograma = "";
|
||||
this.programaSelected.acatlan = "";
|
||||
this.programaSelected.activo = "";
|
||||
//this.programaSelected.idUsuario = "";
|
||||
this.programaSelected.programaInterno = "";
|
||||
this.programaSelected.profesor = "";
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
file() {
|
||||
console.log(this.file.size);
|
||||
@@ -479,15 +510,15 @@ export default {
|
||||
.get(`${process.env.api}/programa`, {
|
||||
params: {
|
||||
idUsuario: localStorage.getItem("idUsuario"),
|
||||
},
|
||||
})
|
||||
}
|
||||
},this.token)
|
||||
.then((resp) => {
|
||||
console.log(resp.data);
|
||||
this.programas = resp.data;
|
||||
console.log(this.programas);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.response.data.message);
|
||||
this.error(error.response.data.message)
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user