nuevo formateo
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<b>Correo: </b>{{ alumno.correo }}
|
||||
</p>
|
||||
<p class="is-size-5 mt-3" v-if="alumno.creditos">
|
||||
<b>Créditos: </b>{{ alumno.creditos + "%" }}
|
||||
<b>Créditos: </b>{{ alumno.creditos + '%' }}
|
||||
</p>
|
||||
<p class="is-size-5 mt-3" v-if="alumno.fechaInicio">
|
||||
<b>Fecha de inicio: </b>{{ fecha(alumno.fechaInicio) }}
|
||||
@@ -41,7 +41,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment";
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -49,9 +49,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fecha(date) {
|
||||
const fecha = moment(date.substr(0, 10));
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -24,5 +24,5 @@ export default {
|
||||
props: {
|
||||
programa: Object,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
><strong>{{ title }}</strong></span
|
||||
>
|
||||
<a :href="link" target="_blank">
|
||||
<b-button class="is-link is-light">
|
||||
Ver
|
||||
</b-button>
|
||||
<b-button class="is-link is-light"> Ver </b-button>
|
||||
</a>
|
||||
<b-button
|
||||
class="is-danger"
|
||||
@@ -25,9 +23,7 @@
|
||||
>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeBool" disabled>
|
||||
Rechazar documento
|
||||
</b-button>
|
||||
<b-button v-else-if="mensajeBool" disabled> Rechazar documento </b-button>
|
||||
<b-loading
|
||||
:is-full-page="true"
|
||||
v-model="isLoading"
|
||||
@@ -37,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
@@ -48,59 +44,59 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mensajeRech: "",
|
||||
mensajeRech: '',
|
||||
mensajeBool: false,
|
||||
idServicio: localStorage.getItem("idServicio"),
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
isLoading: false,
|
||||
token: {
|
||||
headers: {
|
||||
token: window.localStorage.getItem("token"),
|
||||
token: window.localStorage.getItem('token'),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
esRechazable() {
|
||||
switch (this.idDoc) {
|
||||
case 1:
|
||||
if (this.status == 1) return true;
|
||||
else return false;
|
||||
if (this.status == 1) return true
|
||||
else return false
|
||||
case 2:
|
||||
if (this.status == 5) return true;
|
||||
else return false;
|
||||
if (this.status == 5) return true
|
||||
else return false
|
||||
case 3:
|
||||
if (this.status == 5) return true;
|
||||
else return false;
|
||||
if (this.status == 5) return true
|
||||
else return false
|
||||
}
|
||||
},
|
||||
rechazarDialog() {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Confimar servicio",
|
||||
message: "¿Seguro(a) que quiere rechazar este documento?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-danger",
|
||||
title: 'Confimar servicio',
|
||||
message: '¿Seguro(a) que quiere rechazar este documento?',
|
||||
confirmText: 'Confirmar',
|
||||
cancelText: 'Cancelar',
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
onConfirm: () => {
|
||||
switch (this.idDoc) {
|
||||
case 1:
|
||||
this.rechazarCartaAceptacion();
|
||||
break;
|
||||
this.rechazarCartaAceptacion()
|
||||
break
|
||||
case 2:
|
||||
this.rechazarCartaTermino();
|
||||
break;
|
||||
this.rechazarCartaTermino()
|
||||
break
|
||||
case 3:
|
||||
this.rechazarInformeGlobal();
|
||||
this.rechazarInformeGlobal()
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
rechazarCartaAceptacion() {
|
||||
this.isLoading = true;
|
||||
this.isLoading = true
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
}
|
||||
axios
|
||||
.put(
|
||||
`${process.env.api}/servicio/rechazar_aceptacion`,
|
||||
@@ -108,102 +104,102 @@ export default {
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
this.isLoading = false
|
||||
this.$buefy.dialog.alert('Se ha rechazado el documento')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error(err.response.data.message);
|
||||
this.errorDoc();
|
||||
});
|
||||
this.isLoading = false
|
||||
this.error(err.response.data.message)
|
||||
this.errorDoc()
|
||||
})
|
||||
},
|
||||
rechazarCartaTermino() {
|
||||
this.isLoading = true;
|
||||
this.isLoading = true
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
}
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_termino`, data, this.token)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
this.isLoading = false
|
||||
this.$buefy.dialog.alert('Se ha rechazado el documento')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error(err.response.data.message);
|
||||
this.errorDoc();
|
||||
});
|
||||
this.isLoading = false
|
||||
this.error(err.response.data.message)
|
||||
this.errorDoc()
|
||||
})
|
||||
},
|
||||
rechazarInformeGlobal() {
|
||||
this.isLoading = true;
|
||||
this.isLoading = true
|
||||
const data = {
|
||||
mensaje: this.mensajeRech,
|
||||
idServicio: this.idServicio,
|
||||
};
|
||||
}
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/rechazar_informe`, data, this.token)
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
this.$buefy.dialog.alert("Se ha rechazado el documento");
|
||||
this.$router.push("/admin");
|
||||
this.isLoading = false
|
||||
this.$buefy.dialog.alert('Se ha rechazado el documento')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error(err.response.data.message);
|
||||
this.errorDoc();
|
||||
});
|
||||
this.isLoading = false
|
||||
this.error(err.response.data.message)
|
||||
this.errorDoc()
|
||||
})
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false;
|
||||
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;
|
||||
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",
|
||||
title: 'Error',
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
icon: 'alert-circle',
|
||||
iconPack: 'mdi',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
if (salir == true) {
|
||||
localStorage.clear();
|
||||
this.$router.push(`/`);
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
},
|
||||
errorDoc() {
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: "Ha ocurrido un error al rechazar el documento",
|
||||
type: "is-danger",
|
||||
title: 'Error',
|
||||
message: 'Ha ocurrido un error al rechazar el documento',
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: "times-circle",
|
||||
iconPack: "fa",
|
||||
ariaRole: "alertdialog",
|
||||
icon: 'times-circle',
|
||||
iconPack: 'fa',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<p>
|
||||
{{
|
||||
nuevo.cartaAceptacion.name ||
|
||||
"Arrastra aquí tu archivo o da click para buscar"
|
||||
'Arrastra aquí tu archivo o da click para buscar'
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
@@ -105,7 +105,7 @@
|
||||
<p>
|
||||
{{
|
||||
nuevo.cartaTermino.name ||
|
||||
"Arrastra aquí tu archivo o da click para buscar"
|
||||
'Arrastra aquí tu archivo o da click para buscar'
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
@@ -131,7 +131,7 @@
|
||||
<p>
|
||||
{{
|
||||
nuevo.informeGlobal.name ||
|
||||
"Arrastra aquí tu archivo o da click para buscar"
|
||||
'Arrastra aquí tu archivo o da click para buscar'
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
@@ -157,10 +157,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import moment from "moment";
|
||||
import validator from "validator";
|
||||
import botonRegresar from "../../../botonRegresar";
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import validator from 'validator'
|
||||
import botonRegresar from '../../../botonRegresar'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -168,12 +168,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
idServicio: localStorage.getItem("idServicio"),
|
||||
idStatus: Number(localStorage.getItem("idStatus")),
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
idStatus: Number(localStorage.getItem('idStatus')),
|
||||
viejo: {},
|
||||
nuevo: {
|
||||
correo: "",
|
||||
fechaInicioFinal: "",
|
||||
correo: '',
|
||||
fechaInicioFinal: '',
|
||||
fechaFinFinal: null,
|
||||
direccion: null,
|
||||
telefono: null,
|
||||
@@ -187,50 +187,50 @@ export default {
|
||||
fechaFin: [],
|
||||
token: {
|
||||
headers: {
|
||||
token: window.localStorage.getItem("token"),
|
||||
token: window.localStorage.getItem('token'),
|
||||
},
|
||||
},
|
||||
minDate1: new Date("2020-01-01"),
|
||||
minDate1: new Date('2020-01-01'),
|
||||
isLoading: false,
|
||||
padding: false,
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
status6() {
|
||||
if (this.idStatus === 6) {
|
||||
this.padding = true;
|
||||
return false;
|
||||
this.padding = true
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
return true
|
||||
},
|
||||
obtenerRegistro() {
|
||||
this.isLoading = true;
|
||||
this.isLoading = true
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/admin?idServicio=${this.idServicio}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.viejo = res.data;
|
||||
this.viejo = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
dangerToast() {
|
||||
this.$buefy.toast.open({
|
||||
message: "Asegurate de ingresar un PDF",
|
||||
type: "is-danger",
|
||||
});
|
||||
message: 'Asegurate de ingresar un PDF',
|
||||
type: 'is-danger',
|
||||
})
|
||||
},
|
||||
toast() {
|
||||
this.$buefy.toast.open({
|
||||
message: "Se han actualizado los datos",
|
||||
type: "is-success",
|
||||
});
|
||||
message: 'Se han actualizado los datos',
|
||||
type: 'is-success',
|
||||
})
|
||||
},
|
||||
mostrar() {
|
||||
if (
|
||||
@@ -245,182 +245,182 @@ export default {
|
||||
) {
|
||||
if (this.nuevo.correo) {
|
||||
if (validator.isEmail(this.nuevo.correo)) {
|
||||
return true;
|
||||
return true
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
},
|
||||
validarExt(a) {
|
||||
const extPermitidas = /(.pdf)$/i;
|
||||
const extPermitidas = /(.pdf)$/i
|
||||
switch (a) {
|
||||
case 1:
|
||||
if (!extPermitidas.exec(this.nuevo.cartaAceptacion.name)) {
|
||||
this.dangerToast();
|
||||
this.nuevo.cartaAceptacion = {};
|
||||
this.dangerToast()
|
||||
this.nuevo.cartaAceptacion = {}
|
||||
}
|
||||
break;
|
||||
break
|
||||
case 2:
|
||||
if (!extPermitidas.exec(this.nuevo.cartaTermino.name)) {
|
||||
this.dangerToast();
|
||||
this.nuevo.cartaTermino = {};
|
||||
this.dangerToast()
|
||||
this.nuevo.cartaTermino = {}
|
||||
}
|
||||
break;
|
||||
break
|
||||
case 3:
|
||||
if (!extPermitidas.exec(this.nuevo.informeGlobal.name)) {
|
||||
this.dangerToast();
|
||||
this.nuevo.informeGlobal = {};
|
||||
this.dangerToast()
|
||||
this.nuevo.informeGlobal = {}
|
||||
}
|
||||
break;
|
||||
break
|
||||
}
|
||||
},
|
||||
actualizar() {
|
||||
const formData = new FormData();
|
||||
const data = { idServicio: this.idServicio };
|
||||
const formData = new FormData()
|
||||
const data = { idServicio: this.idServicio }
|
||||
|
||||
this.isLoading = true;
|
||||
if (this.nuevo.direccion) data.direccion = this.nuevo.direccion;
|
||||
if (this.nuevo.correo) data.correo = this.nuevo.correo;
|
||||
if (this.nuevo.telefono) data.telefono = this.nuevo.telefono;
|
||||
this.isLoading = true
|
||||
if (this.nuevo.direccion) data.direccion = this.nuevo.direccion
|
||||
if (this.nuevo.correo) data.correo = this.nuevo.correo
|
||||
if (this.nuevo.telefono) data.telefono = this.nuevo.telefono
|
||||
if (this.nuevo.fechaInicioFinal)
|
||||
data.fechaInicio = this.nuevo.fechaInicioFinal;
|
||||
if (this.nuevo.fechaFinFinal) data.fechaFin = this.nuevo.fechaFinFinal;
|
||||
data.fechaInicio = this.nuevo.fechaInicioFinal
|
||||
if (this.nuevo.fechaFinFinal) data.fechaFin = this.nuevo.fechaFinFinal
|
||||
if (this.nuevo.fechaNacimientoFinal)
|
||||
data.fechaNacimiento = this.nuevo.fechaNacimientoFinal;
|
||||
formData.append("data", JSON.stringify(data));
|
||||
data.fechaNacimiento = this.nuevo.fechaNacimientoFinal
|
||||
formData.append('data', JSON.stringify(data))
|
||||
if (this.nuevo.cartaAceptacion)
|
||||
formData.append("cartaAceptacion", this.nuevo.cartaAceptacion);
|
||||
formData.append('cartaAceptacion', this.nuevo.cartaAceptacion)
|
||||
if (this.nuevo.cartaTermino)
|
||||
formData.append("cartaTermino", this.nuevo.cartaTermino);
|
||||
formData.append('cartaTermino', this.nuevo.cartaTermino)
|
||||
if (this.nuevo.informeGlobal)
|
||||
formData.append("informeGlobal", this.nuevo.informeGlobal);
|
||||
formData.append('informeGlobal', this.nuevo.informeGlobal)
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/update`, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
'Content-Type': 'multipart/form-data',
|
||||
token: this.token.headers.token,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.toast();
|
||||
this.$router.push("/admin/servicio");
|
||||
this.toast()
|
||||
this.$router.push('/admin/servicio')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
actualizarDialog() {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Actualizar datos",
|
||||
message: "¿Seguro(a) que quiere actualizar estos datos?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-success",
|
||||
title: 'Actualizar datos',
|
||||
message: '¿Seguro(a) que quiere actualizar estos datos?',
|
||||
confirmText: 'Confirmar',
|
||||
cancelText: 'Cancelar',
|
||||
type: 'is-success',
|
||||
hasIcon: true,
|
||||
onConfirm: () => this.actualizar(),
|
||||
});
|
||||
})
|
||||
},
|
||||
passwordDialog() {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Actualizar datos",
|
||||
message: "¿Seguro(a) que quiere actualizar la contraseña?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-success",
|
||||
title: 'Actualizar datos',
|
||||
message: '¿Seguro(a) que quiere actualizar la contraseña?',
|
||||
confirmText: 'Confirmar',
|
||||
cancelText: 'Cancelar',
|
||||
type: 'is-success',
|
||||
hasIcon: true,
|
||||
onConfirm: () => this.password(),
|
||||
});
|
||||
})
|
||||
},
|
||||
password() {
|
||||
this.isLoading = true;
|
||||
const data = { idServicio: this.idServicio };
|
||||
this.isLoading = true
|
||||
const data = { idServicio: this.idServicio }
|
||||
axios
|
||||
.put(`${process.env.api}/usuario/new_password_alumno`, data, this.token)
|
||||
.then((res) => {
|
||||
this.$buefy.toast.open({
|
||||
message: "Se ha enviado el correo con la nueva contraseña",
|
||||
type: "is-success",
|
||||
});
|
||||
this.$router.push("/admin");
|
||||
message: 'Se ha enviado el correo con la nueva contraseña',
|
||||
type: 'is-success',
|
||||
})
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false;
|
||||
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;
|
||||
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",
|
||||
title: 'Error',
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
icon: 'alert-circle',
|
||||
iconPack: 'mdi',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
if (salir == true) {
|
||||
localStorage.clear();
|
||||
this.$router.push(`/`);
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
},
|
||||
fecha(date) {
|
||||
if (date) {
|
||||
const fecha = moment(date.substr(0, 10));
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
minDate2() {
|
||||
const min = new Date(this.fechaInicio);
|
||||
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate());
|
||||
const min = new Date(this.fechaInicio)
|
||||
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate())
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
fechaInicio: function() {
|
||||
this.nuevo.fechaInicioFinal = moment(this.fechaInicio[0]);
|
||||
this.fechaFin[0] = null;
|
||||
fechaInicio: function () {
|
||||
this.nuevo.fechaInicioFinal = moment(this.fechaInicio[0])
|
||||
this.fechaFin[0] = null
|
||||
},
|
||||
fechaFin: function() {
|
||||
this.nuevo.fechaFinFinal = moment(this.fechaFin[0]);
|
||||
fechaFin: function () {
|
||||
this.nuevo.fechaFinFinal = moment(this.fechaFin[0])
|
||||
},
|
||||
fechaNacimiento: function() {
|
||||
this.nuevo.fechaNacimientoFinal = moment(this.fechaNacimiento[0]);
|
||||
fechaNacimiento: function () {
|
||||
this.nuevo.fechaNacimientoFinal = moment(this.fechaNacimiento[0])
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerRegistro();
|
||||
this.obtenerRegistro()
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
<template>
|
||||
<div id="Status">
|
||||
<p class="is-size-1" v-if="status == 1">
|
||||
Pre Registro
|
||||
</p>
|
||||
<p class="is-size-1" v-else-if="status == 2">
|
||||
Pre Registro Válidado
|
||||
</p>
|
||||
<p class="is-size-1" v-else-if="status == 3">
|
||||
Registro
|
||||
</p>
|
||||
<p class="is-size-1" v-else-if="status == 4">
|
||||
Pre Término
|
||||
</p>
|
||||
<p class="is-size-1" v-else-if="status == 5">
|
||||
Término
|
||||
</p>
|
||||
<p class="is-size-1" v-else-if="status == 6">
|
||||
Liberación
|
||||
</p>
|
||||
<p class="is-size-1" v-if="status == 1">Pre Registro</p>
|
||||
<p class="is-size-1" v-else-if="status == 2">Pre Registro Válidado</p>
|
||||
<p class="is-size-1" v-else-if="status == 3">Registro</p>
|
||||
<p class="is-size-1" v-else-if="status == 4">Pre Término</p>
|
||||
<p class="is-size-1" v-else-if="status == 5">Término</p>
|
||||
<p class="is-size-1" v-else-if="status == 6">Liberación</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -26,5 +14,5 @@ export default {
|
||||
props: {
|
||||
status: Number,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3 class="is-size-3 mb-5" v-if="status == 1">
|
||||
<strong>
|
||||
Confirmar el pre-registro del alumno
|
||||
</strong>
|
||||
<strong> Confirmar el pre-registro del alumno </strong>
|
||||
</h3>
|
||||
<h3 class="is-size-3 mb-5" v-if="status == 4">
|
||||
<strong>
|
||||
Término
|
||||
</strong>
|
||||
<strong> Término </strong>
|
||||
</h3>
|
||||
<h3 class="is-size-3 mb-5" v-if="status == 5">
|
||||
<strong>
|
||||
Validar el término del alumno
|
||||
</strong>
|
||||
<strong> Validar el término del alumno </strong>
|
||||
</h3>
|
||||
</div>
|
||||
</template>
|
||||
@@ -23,5 +17,5 @@ export default {
|
||||
props: {
|
||||
status: Number,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,14 +51,10 @@
|
||||
Visto bueno Acatlán
|
||||
</b-checkbox>
|
||||
<p v-if="alumno.idCuestionarioPrograma" class="my-4">
|
||||
<strong>
|
||||
Cuenta con cuestionario de programa resuelto.
|
||||
</strong>
|
||||
<strong> Cuenta con cuestionario de programa resuelto. </strong>
|
||||
</p>
|
||||
<p v-if="alumno.idCuestionarioAlumno" class="my-4">
|
||||
<strong>
|
||||
Cuenta con cuestionario de alumno resuelto.
|
||||
</strong>
|
||||
<strong> Cuenta con cuestionario de alumno resuelto. </strong>
|
||||
</p>
|
||||
</div>
|
||||
<div id="acciones" class="my-5">
|
||||
@@ -98,9 +94,7 @@
|
||||
>
|
||||
Cancelar servicio
|
||||
</b-button>
|
||||
<b-button v-else-if="enviarCancel" disabled>
|
||||
Cancelar servicio
|
||||
</b-button>
|
||||
<b-button v-else-if="enviarCancel" disabled> Cancelar servicio </b-button>
|
||||
<div>
|
||||
<BotonRegresar
|
||||
:path="'/admin'"
|
||||
@@ -117,13 +111,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import tituloServicio from "./tituloServicio";
|
||||
import tituloStatus from "./tituloStatus";
|
||||
import datosPrograma from "./datosPrograma";
|
||||
import datosPersonales from "./datosPersonales";
|
||||
import documento from "./documento";
|
||||
import botonRegresar from "../../botonRegresar";
|
||||
import axios from 'axios'
|
||||
import tituloServicio from './tituloServicio'
|
||||
import tituloStatus from './tituloStatus'
|
||||
import datosPrograma from './datosPrograma'
|
||||
import datosPersonales from './datosPersonales'
|
||||
import documento from './documento'
|
||||
import botonRegresar from '../../botonRegresar'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -142,204 +136,204 @@ export default {
|
||||
Carrera: {},
|
||||
Status: {},
|
||||
},
|
||||
idServicio: localStorage.getItem("idServicio"),
|
||||
idServicio: localStorage.getItem('idServicio'),
|
||||
token: {
|
||||
headers: {
|
||||
token: localStorage.getItem("token"),
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
},
|
||||
linkCartaAceptacion: "",
|
||||
linkCartaTermino: "",
|
||||
linkInformeGlobal: "",
|
||||
linkCartaAceptacion: '',
|
||||
linkCartaTermino: '',
|
||||
linkInformeGlobal: '',
|
||||
enviarMensaje: false,
|
||||
enviarCancel: false,
|
||||
mensaje: "",
|
||||
mensajeCancel: "",
|
||||
mensaje: '',
|
||||
mensajeCancel: '',
|
||||
isLoading: false,
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
mostrarConfirmar1() {
|
||||
if (this.alumno.Status.idStatus === 1) return true;
|
||||
return false;
|
||||
if (this.alumno.Status.idStatus === 1) return true
|
||||
return false
|
||||
},
|
||||
mostrarConfirmar2() {
|
||||
if (this.alumno.Status.idStatus === 5) {
|
||||
if (!this.alumno.acatlanContigo) return true;
|
||||
else if (this.alumno.vistoBueno) return true;
|
||||
if (!this.alumno.acatlanContigo) return true
|
||||
else if (this.alumno.vistoBueno) return true
|
||||
}
|
||||
return false;
|
||||
return false
|
||||
},
|
||||
mostrarCancelar() {
|
||||
if (
|
||||
this.alumno.Status.idStatus === 10 ||
|
||||
this.alumno.Status.idStatus === 6
|
||||
)
|
||||
return false;
|
||||
return true;
|
||||
return false
|
||||
return true
|
||||
},
|
||||
mostrarEditar() {
|
||||
if (this.alumno.Status.idStatus === 10) return false;
|
||||
return true;
|
||||
if (this.alumno.Status.idStatus === 10) return false
|
||||
return true
|
||||
},
|
||||
mostrarVistoBueno() {
|
||||
if (!this.alumno.Programa.acatlan) return true;
|
||||
if (this.alumno.vistoBuenoAcatlan) return true;
|
||||
return false;
|
||||
if (!this.alumno.Programa.acatlan) return true
|
||||
if (this.alumno.vistoBuenoAcatlan) return true
|
||||
return false
|
||||
},
|
||||
editar() {
|
||||
localStorage.setItem("idStatus", this.alumno.Status.idStatus);
|
||||
this.$router.push("servicio/modificar");
|
||||
localStorage.setItem('idStatus', this.alumno.Status.idStatus)
|
||||
this.$router.push('servicio/modificar')
|
||||
},
|
||||
obtenerRegistro() {
|
||||
this.isLoading = true;
|
||||
this.isLoading = true
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/admin?idServicio=${this.idServicio}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.alumno = res.data;
|
||||
this.alumno.creditos = Number(res.data.creditos);
|
||||
this.alumno = res.data
|
||||
this.alumno.creditos = Number(res.data.creditos)
|
||||
if (this.alumno.cartaAceptacion)
|
||||
this.linkCartaAceptacion = `https://drive.google.com/file/d/${this.alumno.cartaAceptacion}/view?usp=sharing`;
|
||||
this.linkCartaAceptacion = `https://drive.google.com/file/d/${this.alumno.cartaAceptacion}/view?usp=sharing`
|
||||
if (this.alumno.cartaTermino)
|
||||
this.linkCartaTermino = `https://drive.google.com/file/d/${this.alumno.cartaTermino}/view?usp=sharing`;
|
||||
this.linkCartaTermino = `https://drive.google.com/file/d/${this.alumno.cartaTermino}/view?usp=sharing`
|
||||
if (this.alumno.informeGlobal)
|
||||
this.linkInformeGlobal = `https://drive.google.com/file/d/${this.alumno.informeGlobal}/view?usp=sharing`;
|
||||
this.linkInformeGlobal = `https://drive.google.com/file/d/${this.alumno.informeGlobal}/view?usp=sharing`
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
cancelarDialog() {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Cancelar sevicio",
|
||||
message: "¿Seguro(a) que quiere cancelar este servicio?",
|
||||
confirmText: "Cancelar servicio",
|
||||
cancelText: "No",
|
||||
type: "is-danger",
|
||||
title: 'Cancelar sevicio',
|
||||
message: '¿Seguro(a) que quiere cancelar este servicio?',
|
||||
confirmText: 'Cancelar servicio',
|
||||
cancelText: 'No',
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
onConfirm: () => this.cancelar(),
|
||||
});
|
||||
})
|
||||
},
|
||||
confirmarDialog(a) {
|
||||
this.$buefy.dialog.confirm({
|
||||
title: "Confimar servicio",
|
||||
message: "¿Seguro(a) que quiere confirmar este servicio?",
|
||||
confirmText: "Confirmar",
|
||||
cancelText: "Cancelar",
|
||||
type: "is-success",
|
||||
title: 'Confimar servicio',
|
||||
message: '¿Seguro(a) que quiere confirmar este servicio?',
|
||||
confirmText: 'Confirmar',
|
||||
cancelText: 'Cancelar',
|
||||
type: 'is-success',
|
||||
hasIcon: true,
|
||||
onConfirm: () => {
|
||||
switch (a) {
|
||||
case 1:
|
||||
this.confirmarRegistro();
|
||||
break;
|
||||
this.confirmarRegistro()
|
||||
break
|
||||
case 2:
|
||||
this.confirmarLiberacion();
|
||||
break;
|
||||
this.confirmarLiberacion()
|
||||
break
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
cancelar() {
|
||||
this.isLoading = true;
|
||||
const data = { idServicio: this.idServicio, mensaje: this.mensajeCancel };
|
||||
this.isLoading = true
|
||||
const data = { idServicio: this.idServicio, mensaje: this.mensajeCancel }
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/cancelar`, data, this.token)
|
||||
.then((res) => {
|
||||
this.$buefy.dialog.alert("El servicio ha sido cancelado con éxito");
|
||||
localStorage.removeItem("idServicio");
|
||||
this.$router.push("/admin");
|
||||
this.$buefy.dialog.alert('El servicio ha sido cancelado con éxito')
|
||||
localStorage.removeItem('idServicio')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
confirmarRegistro() {
|
||||
this.isLoading = true;
|
||||
const data = { idServicio: this.idServicio };
|
||||
this.isLoading = true
|
||||
const data = { idServicio: this.idServicio }
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/registro`, data, this.token)
|
||||
.then((res) => {
|
||||
this.$buefy.dialog.alert("El servicio ha sido aprobado");
|
||||
localStorage.removeItem("idServicio");
|
||||
this.$router.push("/admin");
|
||||
this.$buefy.dialog.alert('El servicio ha sido aprobado')
|
||||
localStorage.removeItem('idServicio')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
confirmarLiberacion() {
|
||||
this.isLoading = true;
|
||||
const data = { idServicio: this.idServicio };
|
||||
this.isLoading = true
|
||||
const data = { idServicio: this.idServicio }
|
||||
if (this.alumno.vistoBuenoAcatlan)
|
||||
data.vistoBuenoAcatlan = this.alumno.vistoBuenoAcatlan;
|
||||
data.vistoBuenoAcatlan = this.alumno.vistoBuenoAcatlan
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/liberacion`, data, this.token)
|
||||
.then((res) => {
|
||||
this.$buefy.dialog.alert("El servicio ha sido liberado");
|
||||
localStorage.removeItem("idServicio");
|
||||
this.$router.push("/admin");
|
||||
this.$buefy.dialog.alert('El servicio ha sido liberado')
|
||||
localStorage.removeItem('idServicio')
|
||||
this.$router.push('/admin')
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false;
|
||||
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;
|
||||
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",
|
||||
title: 'Error',
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
icon: 'alert-circle',
|
||||
iconPack: 'mdi',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
if (salir == true) {
|
||||
localStorage.clear();
|
||||
this.$router.push(`/`);
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.obtenerRegistro();
|
||||
await this.obtenerRegistro()
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user