identacion

This commit is contained in:
Lemuel Marquez
2021-01-05 15:14:10 -06:00
parent 086da2a0c7
commit 2f92ddea4a
15 changed files with 1501 additions and 1362 deletions
@@ -39,7 +39,7 @@ import moment from "moment";
export default {
props: {
alumno: Object
alumno: Object,
},
methods: {
fecha(date) {
+5 -6
View File
@@ -7,8 +7,7 @@
<b>Programa: </b><span> {{ programa.programa }} </span>
</p>
<p class="is-size-5 mb-3" v-if="programa.clavePrograma">
<b>Clave del programa: </b
><span> {{ programa.clavePrograma }} </span>
<b>Clave del programa: </b><span> {{ programa.clavePrograma }} </span>
</p>
<p class="is-size-5 mb-3" v-if="programa.dependencia">
<b>Dependecia: </b><span> {{ programa.dependencia }} </span>
@@ -23,7 +22,7 @@
<script>
export default {
props: {
programa: Object
}
}
</script>
programa: Object,
},
};
</script>
@@ -49,8 +49,8 @@ export default {
validarExt() {
const extPermitidas = /(.csv)$/i;
if (!extPermitidas.exec(this.csv.name)) {
this.toastType = 'is-danger'
this.toastMessage = 'Asegurate de ingresar un archivo .CSV'
this.toastType = "is-danger";
this.toastMessage = "Asegurate de ingresar un archivo .CSV";
this.toast();
this.csv = {};
}
@@ -72,7 +72,7 @@ export default {
onConfirm: () => this.enviarCargaMasiva(),
});
},
enviarCargaMasiva () {
enviarCargaMasiva() {
this.isLoading = true;
const formData = new FormData();
if (this.cartaAceptacion) {
@@ -82,15 +82,15 @@ export default {
.put(`${process.env.api}/programa/carga_masiva`, formData)
.then((res) => {
this.isLoading = false;
this.toastType = 'is-success'
this.toastMessage = 'Se ha enviado la carga masiva con éxito'
this.toastType = "is-success";
this.toastMessage = "Se ha enviado la carga masiva con éxito";
this.toast();
})
.catch((err) => {
this.isLoading = false;
this.toastType = 'is-danger'
this.toastMessage = err.response.data.message
this.toast()
this.toastType = "is-danger";
this.toastMessage = err.response.data.message;
this.toast();
});
},
},
@@ -121,7 +121,7 @@ export default {
localStorage.setItem("correo", responsable.usuario);
localStorage.setItem("idResponsable", responsable.idUsuario);
localStorage.setItem("nombre", responsable.nombre);
this.$router.push('/admin/programa/infoResponsable');
this.$router.push("/admin/programa/infoResponsable");
},
},
computed: {
+3 -3
View File
@@ -21,7 +21,7 @@
<script>
export default {
props: {
status: Number
}
}
status: Number,
},
};
</script>
+7 -7
View File
@@ -1,8 +1,8 @@
<template>
<div class="container">
<div class="mb-5">
<BotonRegresar
:path="'/admin'"
<BotonRegresar
:path="'/admin'"
:deleteFromLocalStorage="['idServicio']"
/>
</div>
@@ -103,10 +103,10 @@
Cancelar servicio
</b-button>
<div>
<BotonRegresar
:path="'/admin'"
:deleteFromLocalStorage="['idServicio']"
/>
<BotonRegresar
:path="'/admin'"
:deleteFromLocalStorage="['idServicio']"
/>
</div>
<b-loading
:is-full-page="true"
@@ -300,7 +300,7 @@ export default {
ariaRole: "alertdialog",
ariaModal: true,
});
}
},
},
async created() {
await this.obtenerRegistro();
+178 -170
View File
@@ -59,7 +59,10 @@
<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> Programa Interno: </strong>
{{ programa.programaInterno }}
</p>
<p><strong> Profesor: </strong> {{ programa.profesor }}</p>
</div>
</div>
@@ -69,7 +72,8 @@
<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>
<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>
@@ -84,7 +88,8 @@
<p><strong> Direccion: </strong> {{ alumno.direccion }}</p>
<p><strong> Telefono: </strong> {{ alumno.telefono }}</p>
<p>
<strong> Fecha de nacimiento: </strong> {{ fecha(alumno.nacimiento) }}
<strong> Fecha de nacimiento: </strong>
{{ fecha(alumno.nacimiento) }}
</p>
</div>
</div>
@@ -208,263 +213,266 @@
<div class="Liberacion" v-if="activeStep == 5"></div>
</div>
<div class="container px-3">
</div>
<div class="container px-3"></div>
</section>
</template>
<script>
import 'buefy/dist/buefy.css'
import moment from 'moment'
import axios from 'axios'
import "buefy/dist/buefy.css";
import moment from "moment";
import axios from "axios";
export default {
data () {
data() {
return {
activeStep: '',
activeStep: "",
isFullPage: true,
file: [],
nacimiento: [],
minDate: new Date(),
maxDate: new Date(),
telefono: '',
direccion: '',
maxDate: new Date(),
telefono: "",
direccion: "",
alumno: {
carrera: '',
creditos: '',
nombre: '',
cuenta: '',
correo: '',
direccion: '',
nacimiento: '',
telefono: '',
idCuestionario: '',
informeGlobal: '',
idAlumno: '',
idCarrera: '',
idServicio: '',
carrera: "",
creditos: "",
nombre: "",
cuenta: "",
correo: "",
direccion: "",
nacimiento: "",
telefono: "",
idCuestionario: "",
informeGlobal: "",
idAlumno: "",
idCarrera: "",
idServicio: "",
inicio: [],
fin: [],
registro: []
registro: [],
},
programa: {
programa: '',
institucion: '',
dependencia: '',
clave: '',
acatlan: '',
programaInterno: '',
profesor: ''
programa: "",
institucion: "",
dependencia: "",
clave: "",
acatlan: "",
programaInterno: "",
profesor: "",
},
mensajes: [
{ status: 0, mensaje: '' },
{ status: 1, mensaje: '' },
{ 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'
"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: 3, mensaje: "" },
{
status: 4,
mensaje:
'Espera a que tus documentos sean validados por el Departamento de Servicio Social y Bolsa de Trabajo'
"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'
"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' }
]
}
{ 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 = ''
reset() {
this.file = [];
this.nacimiento = [];
this.telefono = "";
this.direccion = "";
},
getData () {
getData() {
axios
.get(`${process.env.api}/servicio/alumno`, {
params: {
idUsuario: localStorage.getItem('idUsuario')
}
idUsuario: localStorage.getItem("idUsuario"),
},
})
.then((resp) => {
console.log(resp.data)
this.activeStep = resp.data.Status.idStatus - 1
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.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')
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)
window.localStorage.setItem(
"idCuestionarioAlumno",
resp.data.idCuestionarioAlumno
);
window.localStorage.setItem("idServicio", resp.data.idServicio);
})
.catch((error) => {
console.log(error.message)
})
console.log(error.message);
});
},
enviarRegistro () {
enviarRegistro() {
const loadingComponent = this.$buefy.loading.open({
container: this.isFullPage ? null : this.$refs.element.$el
})
container: this.isFullPage ? null : this.$refs.element.$el,
});
const data = {
idServicio: this.alumno.idServicio,
direccion: this.direccion,
telefono: this.telefono,
fechaNacimiento: moment(this.nacimiento)
}
fechaNacimiento: moment(this.nacimiento),
};
axios
.put(`${process.env.api}/servicio/registro_validado`, data)
.then((res) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Success',
message: 'Se enviaron los datos correctamente',
type: 'is-success',
title: "Success",
message: "Se enviaron los datos correctamente",
type: "is-success",
hasIcon: true,
icon: 'checkbox-marked-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
icon: "checkbox-marked-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
this.reset()
this.getData()
this.reset();
this.getData();
})
.catch((error) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Error',
title: "Error",
message: error.response.data.message,
type: 'is-danger',
type: "is-danger",
hasIcon: true,
icon: 'alert-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
})
icon: "alert-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
});
},
enviarInforme () {
enviarInforme() {
const loadingComponent = this.$buefy.loading.open({
container: this.isFullPage ? null : this.$refs.element.$el
})
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)
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'
}
"Content-Type": "multipart/form-data",
},
})
.then((res) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Success',
message: 'Se enviaron los datos correctamente',
type: 'is-success',
title: "Success",
message: "Se enviaron los datos correctamente",
type: "is-success",
hasIcon: true,
icon: 'checkbox-marked-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
icon: "checkbox-marked-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
this.reset()
this.getData()
this.reset();
this.getData();
})
.catch((error) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Error',
title: "Error",
message: error.response.data.message,
type: 'is-danger',
type: "is-danger",
hasIcon: true,
icon: 'alert-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
})
icon: "alert-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
});
},
fecha(date) {
const fecha = moment(date);
return `${fecha.year()}/${fecha.month() + 1}/${fecha.date()}`;
},
fecha (date) {
const fecha = moment(date)
return `${fecha.year()}/${fecha.month() + 1}/${fecha.date()}`
}
},
computed: {
steps () {
const steps = [...this.baseSteps]
return steps
}
steps() {
const steps = [...this.baseSteps];
return steps;
},
},
created () {
this.getData()
created() {
this.getData();
},
watch: {
file () {
console.log(this.file.size)
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',
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 = []
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)
}
}
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>
+1 -1
View File
@@ -46,7 +46,7 @@ export default {
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {},
env: {
api: 'http://localhost:3000'
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'
+6 -8
View File
@@ -1,9 +1,7 @@
<template>
<div class="container">
<p class="is-size-2 mb-5">Programas de Servicio Social</p>
<BotonRegresar
:path="'/admin'"
/>
<BotonRegresar :path="'/admin'" />
<CargaMasiva />
<a :href="link">
<b-button class="my-4 is-info">Descargar plantilla</b-button>
@@ -20,12 +18,12 @@ export default {
components: {
tablaResponsables,
cargaMasiva,
botonRegresar
botonRegresar,
},
data(){
data() {
return {
link: `${process.env.api}/plantilla.csv`
}
}
link: `${process.env.api}/plantilla.csv`,
};
},
};
</script>
+41 -30
View File
@@ -1,15 +1,21 @@
<template>
<div class="container">
<BotonRegresar
<BotonRegresar
:path="'/admin/programa'"
:deleteFromLocalStorage="['correo','idResponsable','nombre']"
:deleteFromLocalStorage="['correo', 'idResponsable', 'nombre']"
/>
<p class="is-size-2 mb-4"> Información del responsable</p>
<p class="is-size-4 mb-4"> <strong>Nombre: </strong> {{ nombre }}</p>
<p class="is-size-4 mb-4"> <strong>Correo: </strong> {{ correo }}</p>
<p class="is-size-2 mb-4">Información del responsable</p>
<p class="is-size-4 mb-4"><strong>Nombre: </strong> {{ nombre }}</p>
<p class="is-size-4 mb-4"><strong>Correo: </strong> {{ correo }}</p>
<div class="columns">
<p class="is-size-4 column is-narrow" style="width: 125px;"> <strong>Programa: </strong></p>
<b-select class="column" v-model="selected" placeholder="Elija un programa">
<p class="is-size-4 column is-narrow" style="width: 125px;">
<strong>Programa: </strong>
</p>
<b-select
class="column"
v-model="selected"
placeholder="Elija un programa"
>
<option
v-for="programa in programas"
v-bind:key="programa.id"
@@ -19,9 +25,15 @@
</option>
</b-select>
</div>
<p class="is-size-4 mb-4"> <strong>Institución: </strong> {{ selected.institucion }}</p>
<p class="is-size-4 mb-4"> <strong>Dependencia: </strong> {{ selected.dependencia }}</p>
<p class="is-size-4 mb-4"> <strong>Clave: </strong> {{ selected.clavePrograma }}</p>
<p class="is-size-4 mb-4">
<strong>Institución: </strong> {{ selected.institucion }}
</p>
<p class="is-size-4 mb-4">
<strong>Dependencia: </strong> {{ selected.dependencia }}
</p>
<p class="is-size-4 mb-4">
<strong>Clave: </strong> {{ selected.clavePrograma }}
</p>
<div class="">
<b-button
class="boton is-info my-5"
@@ -31,9 +43,9 @@
Editar información
</b-button>
</div>
<BotonRegresar
<BotonRegresar
:path="'/admin/programa'"
:deleteFromLocalStorage="['correo','idResponsable','nombre']"
:deleteFromLocalStorage="['correo', 'idResponsable', 'nombre']"
/>
</div>
</template>
@@ -44,25 +56,25 @@ import botonRegresar from "../../../../components/botonRegresar";
export default {
components: {
botonRegresar
botonRegresar,
},
data() {
return {
idResponsable: localStorage.getItem("idResponsable"),
correo: localStorage.getItem('correo'),
nombre: localStorage.getItem('nombre'),
correo: localStorage.getItem("correo"),
nombre: localStorage.getItem("nombre"),
programas: [],
selected: {},
};
},
methods: {
obtenerProgramas () {
obtenerProgramas() {
return axios
.get(
`${process.env.api}/programa?idUsuario=${this.idResponsable}` //,this.token
)
.then((res) => {
this.programas = res.data
this.programas = res.data;
})
.catch((err) => {
this.error();
@@ -80,23 +92,22 @@ export default {
ariaRole: "alertdialog",
ariaModal: true,
});
},
},
created() {
this.obtenerProgramas();
},
beforeCreate() {
if (!localStorage.getItem("idResponsable")) {
this.$router.push("/admin/programa");
}
},
created () {
this.obtenerProgramas()
},
beforeCreate(){
if(!localStorage.getItem("idResponsable")){
this.$router.push("/admin/programa")
}
}
};
</script>
<style scoped>
.programa{
margin-right: 20px;
padding-right: 20px;
}
.programa {
margin-right: 20px;
padding-right: 20px;
}
</style>
@@ -1,8 +1,6 @@
<template>
<div class="container">
<BotonRegresar
:path="'/admin/programa/infoResponsable'"
/>
<BotonRegresar :path="'/admin/programa/infoResponsable'" />
<p class="is-size-2">Editar información del responsable</p>
<b-field label="Nombre">
<b-input type="text" v-model="nuevo.nombre" :placeholder="viejo.nombre">
@@ -12,10 +10,12 @@
<b-input type="email" v-model="nuevo.correo" :placeholder="viejo.correo">
</b-input>
</b-field>
<BotonRegresar
:path="'/admin/programa/infoResponsable'"
/>
<b-button class="boton is-info my-5" v-if="mostrar()" @click="editarResponsable()">
<BotonRegresar :path="'/admin/programa/infoResponsable'" />
<b-button
class="boton is-info my-5"
v-if="mostrar()"
@click="editarResponsable()"
>
Editar responsable
</b-button>
<b-button class="boton is-info my-5" v-else disabled>
@@ -30,15 +30,15 @@
</template>
<script>
import validator from 'validator'
import botonRegresar from '../../../../../components/botonRegresar'
import validator from "validator";
import botonRegresar from "../../../../../components/botonRegresar";
//import axios from 'axios'
export default {
components: {
botonRegresar
botonRegresar,
},
data () {
data() {
return {
viejo: {
idResponsable: localStorage.getItem("idResponsable"),
@@ -49,10 +49,10 @@ export default {
nombre: "",
correo: "",
},
idServicio: localStorage.getItem('idServicio'),
token: localStorage.getItem('token'),
isLoading: false
}
idServicio: localStorage.getItem("idServicio"),
token: localStorage.getItem("token"),
isLoading: false,
};
},
methods: {
mostrar() {
@@ -66,12 +66,12 @@ export default {
}
return true;
}
},
},
beforeCreate() {
if (!localStorage.getItem("idResponsable")) {
this.$router.push("/admin/programa");
}
},
beforeCreate(){
if(!localStorage.getItem("idResponsable")){
this.$router.push("/admin/programa")
}
}
}
};
</script>
+4 -4
View File
@@ -11,10 +11,10 @@ export default {
components: {
vistaServicio,
},
beforeCreate(){
if(!window.localStorage.getItem("idServicio")){
this.$router.push("/admin")
beforeCreate() {
if (!window.localStorage.getItem("idServicio")) {
this.$router.push("/admin");
}
}
},
};
</script>
+4 -4
View File
@@ -10,10 +10,10 @@ export default {
components: {
Form,
},
beforeCreate(){
if(!window.localStorage.getItem("idServicio")){
this.$router.push("/admin")
beforeCreate() {
if (!window.localStorage.getItem("idServicio")) {
this.$router.push("/admin");
}
}
},
};
</script>
File diff suppressed because it is too large Load Diff
+190 -188
View File
@@ -9,7 +9,6 @@
icon-left="arrow-left-box"
class="border-info my-5"
size="is-medium"
>
regresar
</b-button>
@@ -90,7 +89,7 @@
expanded
v-model="programaSelectedID"
>
<option value="">Seleccionar</option>
<option value="">Seleccionar</option>
<option
v-for="programa in programas"
v-bind:key="programa.idPrograma"
@@ -218,283 +217,286 @@
</template>
<script>
import 'buefy/dist/buefy.css'
import validator from 'validator'
import axios from 'axios'
import moment from 'moment'
import "buefy/dist/buefy.css";
import validator from "validator";
import axios from "axios";
import moment from "moment";
export default {
data () {
data() {
return {
isFullPage: true,
noCuenta: '',
sizeOk: '',
noCuenta: "",
sizeOk: "",
searched: false,
minDate: new Date('2020-12-20'),
programaSelectedID: '',
minDate: new Date("2020-12-20"),
programaSelectedID: "",
file: [],
programas: [],
programaSelected: {
idPrograma: null,
institucion: '',
dependencia: '',
programa: '',
clavePrograma: '',
acatlan: '',
activo: '',
idUsuario: '',
programaInterno: '',
profesor: ''
institucion: "",
dependencia: "",
programa: "",
clavePrograma: "",
acatlan: "",
activo: "",
idUsuario: "",
programaInterno: "",
profesor: "",
},
alumno: {
cuenta: '',
nombre: '',
carrera: '',
creditos: '',
idAlumno: '',
idCarrera: '',
cuenta: "",
nombre: "",
carrera: "",
creditos: "",
idAlumno: "",
idCarrera: "",
inicio: [],
fin: [],
correo: ''
}
}
correo: "",
},
};
},
methods: {
reset () {
this.programaSelected.idPrograma = ''
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 = ''
reset() {
this.programaSelected.idPrograma = "";
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 = "";
this.alumno.cuenta = ''
this.alumno.nombre = ''
this.alumno.creditos = ''
this.alumno.carrera = ''
this.alumno.idAlumno = ''
this.alumno.idCarrera = ''
this.alumno.correo = ''
this.alumno.inicio = []
this.alumno.fin = []
this.alumno.cuenta = "";
this.alumno.nombre = "";
this.alumno.creditos = "";
this.alumno.carrera = "";
this.alumno.idAlumno = "";
this.alumno.idCarrera = "";
this.alumno.correo = "";
this.alumno.inicio = [];
this.alumno.fin = [];
this.noCuenta = ''
this.file = []
this.programaSelectedID= ''
this.noCuenta = "";
this.file = [];
this.programaSelectedID = "";
},
disabled () {
if(this.programaSelected.acatlan == false){
if(
this.file != '' &&
this.noCuenta != '' &&
this.alumno.correo != '' &&
this.alumno.inicio != '' &&
this.alumno.fin != '' &&
this.programaSelectedID != ''
) return false
else return true
}
else{
if(
this.file != '' &&
this.noCuenta != '' &&
this.alumno.correo != '' &&
this.alumno.inicio != '' &&
this.alumno.fin != '' &&
this.programaSelectedID != '' &&
this.programaSelected.programaInterno != '' &&
this.programaSelected.profesor != ''
) return false
else return true
}
disabled() {
if (this.programaSelected.acatlan == false) {
if (
this.file != "" &&
this.noCuenta != "" &&
this.alumno.correo != "" &&
this.alumno.inicio != "" &&
this.alumno.fin != "" &&
this.programaSelectedID != ""
)
return false;
else return true;
} else {
if (
this.file != "" &&
this.noCuenta != "" &&
this.alumno.correo != "" &&
this.alumno.inicio != "" &&
this.alumno.fin != "" &&
this.programaSelectedID != "" &&
this.programaSelected.programaInterno != "" &&
this.programaSelected.profesor != ""
)
return false;
else return true;
}
},
esNumero (numero) {
const ultimaLetra = numero.length - 1
esNumero(numero) {
const ultimaLetra = numero.length - 1;
if (numero && !validator.isNumeric(numero[ultimaLetra])) {
return numero.substr(0, ultimaLetra)
return numero.substr(0, ultimaLetra);
}
return numero
return numero;
},
maxLength (str, max) {
if (str.length > max) return str.substr(0, max)
return str
maxLength(str, max) {
if (str.length > max) return str.substr(0, max);
return str;
},
correoValidado () {
correoValidado() {
if (validator.isEmail(this.alumno.correo)) {
console.log('es correo')
return ''
console.log("es correo");
return "";
}
},
buscarAlumno () {
buscarAlumno() {
const loadingComponent = this.$buefy.loading.open({
container: this.isFullPage ? null : this.$refs.element.$el
})
container: this.isFullPage ? null : this.$refs.element.$el,
});
axios
.get(`${process.env.api}/usuario/escolares`, {
params: {
numeroCuenta: this.noCuenta
}
numeroCuenta: this.noCuenta,
},
})
.then((resp) => {
loadingComponent.close()
loadingComponent.close();
console.log(resp.data)
this.alumno.cuenta = this.noCuenta
this.alumno.nombre = resp.data.nombre
this.alumno.carrera = resp.data.carrera
this.alumno.creditos = parseInt(resp.data.creditos, 10)
this.alumno.idCarrera = resp.data.idCarrera
this.alumno.idAlumno = resp.data.idUsuario
console.log(resp.data);
this.alumno.cuenta = this.noCuenta;
this.alumno.nombre = resp.data.nombre;
this.alumno.carrera = resp.data.carrera;
this.alumno.creditos = parseInt(resp.data.creditos, 10);
this.alumno.idCarrera = resp.data.idCarrera;
this.alumno.idAlumno = resp.data.idUsuario;
this.searched = true
this.searched = true;
})
.catch((error) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Error',
title: "Error",
message: error.response.data.message,
type: 'is-danger',
type: "is-danger",
hasIcon: true,
icon: 'alert-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
})
icon: "alert-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
});
},
Enviar () {
Enviar() {
const loadingComponent = this.$buefy.loading.open({
container: this.isFullPage ? null : this.$refs.element.$el
})
container: this.isFullPage ? null : this.$refs.element.$el,
});
const data = {
idUsuario: this.alumno.idAlumno,
idPrograma: this.programaSelected.idPrograma,
idCarrera: this.alumno.idCarrera,
numeroCuenta: this.alumno.cuenta,
creditos: (this.alumno.creditos).toString(),
creditos: this.alumno.creditos.toString(),
correo: this.alumno.correo,
programaInterno:this.programaSelected.programaInterno,
profesor:this.programaSelected.profesor,
programaInterno: this.programaSelected.programaInterno,
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)
fechaFin: moment(this.alumno.fin),
};
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'
}
"Content-Type": "multipart/form-data",
},
})
.then((res) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Success',
message: 'Se enviaron los datos correctamente',
type: 'is-success',
title: "Success",
message: "Se enviaron los datos correctamente",
type: "is-success",
hasIcon: true,
icon: 'checkbox-marked-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
icon: "checkbox-marked-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
this.reset()
this.reset();
})
.catch((error) => {
loadingComponent.close()
loadingComponent.close();
this.$buefy.dialog.alert({
title: 'Error',
title: "Error",
message: error.response.data.message,
type: 'is-danger',
type: "is-danger",
hasIcon: true,
icon: 'alert-circle',
iconPack: 'mdi',
ariaRole: 'alertdialog',
ariaModal: true
})
})
}
icon: "alert-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
});
},
},
watch: {
noCuenta () {
noCuenta() {
if (this.searched === false) {
this.noCuenta = Number(this.noCuenta) < 0 ? '' : this.noCuenta
this.noCuenta = this.esNumero(this.noCuenta)
this.noCuenta = this.maxLength(this.noCuenta, 9)
this.noCuenta = Number(this.noCuenta) < 0 ? "" : this.noCuenta;
this.noCuenta = this.esNumero(this.noCuenta);
this.noCuenta = this.maxLength(this.noCuenta, 9);
} else {
this.noCuenta = ''
this.searched = false
this.reset()
this.noCuenta = "";
this.searched = false;
this.reset();
}
},
programaSelectedID () {
programaSelectedID() {
if (this.programaSelectedID) {
for (let i = 0; i < this.programas.length; i++) {
if (this.programas[i].idPrograma === this.programaSelectedID) {
this.programaSelected.idPrograma = this.programas[i].idPrograma
this.programaSelected.programa = this.programas[i].programa
this.programaSelected.institucion = this.programas[i].institucion
this.programaSelected.dependencia = this.programas[i].dependencia
this.programaSelected.clavePrograma = this.programas[i].clavePrograma
this.programaSelected.acatlan = this.programas[i].acatlan
this.programaSelected.activo = this.programas[i].activo
this.programaSelected.idPrograma = this.programas[i].idPrograma;
this.programaSelected.programa = this.programas[i].programa;
this.programaSelected.institucion = this.programas[i].institucion;
this.programaSelected.dependencia = this.programas[i].dependencia;
this.programaSelected.clavePrograma = this.programas[
i
].clavePrograma;
this.programaSelected.acatlan = this.programas[i].acatlan;
this.programaSelected.activo = this.programas[i].activo;
}
}
}
},
file () {
console.log(this.file.size)
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',
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 = []
icon: "alert-circle",
iconPack: "mdi",
ariaRole: "alertdialog",
ariaModal: true,
});
this.file = [];
}
},
'alumno.inicio' () {
this.alumno.fin = []
}
"alumno.inicio"() {
this.alumno.fin = [];
},
},
mounted () {
console.log(localStorage.getItem('idUsuario'))
mounted() {
console.log(localStorage.getItem("idUsuario"));
axios
.get(`${process.env.api}/programa`, {
params: {
idUsuario: localStorage.getItem('idUsuario')
}
idUsuario: localStorage.getItem("idUsuario"),
},
})
.then((resp) => {
console.log(resp.data)
this.programas = resp.data
console.log(this.programas)
console.log(resp.data);
this.programas = resp.data;
console.log(this.programas);
})
.catch((error) => {
console.log(error.response.data.message)
})
console.log(error.response.data.message);
});
},
computed: {
minDate2 () {
const min = new Date(this.alumno.inicio)
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate())
}
}
}
minDate2() {
const min = new Date(this.alumno.inicio);
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate());
},
},
};
</script>
<style scoped>