nuevo formateo

This commit is contained in:
Lemuel Marquez
2021-05-13 14:22:56 -05:00
parent eaf298c4a9
commit 24cd81c73d
61 changed files with 2227 additions and 2271 deletions
+64 -72
View File
@@ -3,10 +3,8 @@
v-if="alumno.Status.idServicio != 11 || alumno.Status.idServicio != 12"
class="footter"
>
<p
class="is-size-2 mb-3"
v-if="alumno.Status">
{{ alumno.Status.status }}
<p class="is-size-2 mb-3" v-if="alumno.Status">
{{ alumno.Status.status }}
</p>
<p class="is-size-3"><b>Datos personales</b></p>
<p class="is-size-5 mt-3">
@@ -17,22 +15,16 @@
<p class="is-size-5 mt-3"><b>Correo: </b> {{ alumno.correo }}</p>
<p class="is-size-5 mt-3"><b>Dirección: </b> {{ alumno.direccion }}</p>
<p class="is-size-5 mt-3"><b>Teléfono: </b> {{ alumno.telefono }}</p>
<p
class="is-size-5 mt-3"
v-if="alumno.motivo">
<b>Motivo: </b>{{ motivo(alumno.motivo) }}
<p class="is-size-5 mt-3" v-if="alumno.motivo">
<b>Motivo: </b>{{ motivo(alumno.motivo) }}
</p>
<p
class="is-size-5 mt-3"
v-if="alumno.institucion">
<b>Institución: </b>{{ alumno.institucion }}
<p class="is-size-5 mt-3" v-if="alumno.institucion">
<b>Institución: </b>{{ alumno.institucion }}
</p>
<p
class="is-size-5 mt-3"
v-if="alumno.dependencia">
<b>Dependencia: </b>{{ alumno.dependencia }}
<p class="is-size-5 mt-3" v-if="alumno.dependencia">
<b>Dependencia: </b>{{ alumno.dependencia }}
</p>
<p class="is-size-5 mt-3"><b>Créditos: </b> {{ alumno.creditos + "%" }}</p>
<p class="is-size-5 mt-3"><b>Créditos: </b> {{ alumno.creditos + '%' }}</p>
<p class="is-size-5 mt-3">
<b>Fecha de nacimiento: </b>
{{ fecha(alumno.fechaNacimiento) }}
@@ -70,32 +62,32 @@
</template>
<script>
import moment from "moment";
import axios from "axios";
import moment from 'moment'
import axios from 'axios'
export default {
data() {
return {
alumno: {
fechaNacimiento: "",
fechaInicio: "",
fechaFin: "",
fechaNacimiento: '',
fechaInicio: '',
fechaFin: '',
Usuario: {},
Carrera: {},
Status: {},
},
token: {
headers: {
token: localStorage.getItem("token"),
token: localStorage.getItem('token'),
},
},
idCasoEspecial: localStorage.getItem("idCasoEspecial"),
idCasoEspecial: localStorage.getItem('idCasoEspecial'),
isLoading: false,
};
}
},
methods: {
editar(){
this.$router.push("/admin/especial/casoEspecial/editar");
editar() {
this.$router.push('/admin/especial/casoEspecial/editar')
},
obtenerDatos() {
return axios
@@ -104,85 +96,85 @@ export default {
this.token
)
.then((res) => {
this.alumno = res.data;
this.alumno = res.data
})
.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 = { idCasoEspecial: this.idCasoEspecial };
this.isLoading = true
const data = { idCasoEspecial: this.idCasoEspecial }
axios
.put(`${process.env.api}/caso_especial/liberacion`, data, this.token)
.then((res) => {
this.$buefy.dialog.alert("El servicio ha sido liberado");
localStorage.removeItem("idCasoEspecial");
this.$router.push("/admin/especial");
this.$buefy.dialog.alert('El servicio ha sido liberado')
localStorage.removeItem('idCasoEspecial')
this.$router.push('/admin/especial')
})
.catch((err) => {
this.error(err.response.data.message);
this.error(err.response.data.message)
})
.finally(() => {
this.isLoading = false;
});
this.isLoading = false
})
},
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()}`
},
motivo(n) {
if(n == 1) {
return "Tercera edad"
}else if(n == 2) {
return "Capacidades diferentes"
if (n == 1) {
return 'Tercera edad'
} else if (n == 2) {
return 'Capacidades diferentes'
}
},
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(`/`)
}
},
},
created() {
this.obtenerDatos();
this.obtenerDatos()
},
};
}
</script>
<style>
+90 -89
View File
@@ -53,15 +53,11 @@
:placeholder="fecha(viejo.fechaNacimiento)"
icon="calendar-today"
v-model="nuevo.fechaNacimiento"
>
>
</b-datepicker>
</b-field>
<b-field label="Motivo" v-if="viejo.motivo">
<b-select
class="my-4"
expanded
v-model="nuevo.motivo"
>
<b-select class="my-4" expanded v-model="nuevo.motivo">
<option value="1">Tercera edad</option>
<option value="2">Capacidades diferentes</option>
</b-select>
@@ -83,13 +79,16 @@
</b-input>
</b-field>
</div>
<b-button
v-if="mostrar()"
<b-button
v-if="mostrar()"
@click="actualizarDialog()"
class="my-5 is-success">
Actualizar Datos
</b-button>
<b-button v-else disabled class="is-success my-5">Actualizar Datos</b-button>
class="my-5 is-success"
>
Actualizar Datos
</b-button>
<b-button v-else disabled class="is-success my-5"
>Actualizar Datos</b-button
>
<b-loading
:is-full-page="true"
v-model="isLoading"
@@ -99,37 +98,37 @@
</template>
<script>
import axios from "axios";
import moment from "moment";
import validator from "validator";
import axios from 'axios'
import moment from 'moment'
import validator from 'validator'
export default {
data() {
return {
idCasoEspecial: localStorage.getItem("idCasoEspecial"),
idCasoEspecial: localStorage.getItem('idCasoEspecial'),
isLoading: false,
minDate1: new Date("2020-01-01"),
minDate1: new Date('2020-01-01'),
viejo: {},
nuevo: {
idCasoEspecial: null,
correo: "",
telefono: "",
correo: '',
telefono: '',
fechaInicio: null,
fechaFin: null,
fechaNacimiento: null,
institucion: "",
dependencia: "",
motivo: "",
direccion: "",
institucion: '',
dependencia: '',
motivo: '',
direccion: '',
},
token: {
headers: {
token: window.localStorage.getItem("token"),
token: window.localStorage.getItem('token'),
},
},
};
}
},
methods: {
mostrar(){
mostrar() {
if (
validator.isEmail(this.nuevo.correo) ||
this.nuevo.direccion ||
@@ -142,123 +141,125 @@ 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
}
},
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(),
});
})
},
actualizar() {
this.isLoading = true;
const data = { idCasoEspecial: this.idCasoEspecial };
this.isLoading = true
const data = { idCasoEspecial: this.idCasoEspecial }
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.motivo) data.motivo = this.nuevo.motivo;
if (this.nuevo.dependencia) data.dependencia = this.nuevo.dependencia;
if (this.nuevo.institucion) data.institucion = this.nuevo.institucion;
if (this.nuevo.fechaInicio) data.fechaInicio = moment(this.nuevo.fechaInicio);
if (this.nuevo.fechaFin) data.fechaFin = moment(this.nuevo.fechaFin);
if (this.nuevo.fechaNacimiento) data.fechaNacimiento = moment(this.nuevo.fechaNacimiento);
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.motivo) data.motivo = this.nuevo.motivo
if (this.nuevo.dependencia) data.dependencia = this.nuevo.dependencia
if (this.nuevo.institucion) data.institucion = this.nuevo.institucion
if (this.nuevo.fechaInicio)
data.fechaInicio = moment(this.nuevo.fechaInicio)
if (this.nuevo.fechaFin) data.fechaFin = moment(this.nuevo.fechaFin)
if (this.nuevo.fechaNacimiento)
data.fechaNacimiento = moment(this.nuevo.fechaNacimiento)
axios
.put(`${process.env.api}/caso_especial/update`, data, this.token)
.then((res) => {
this.$buefy.dialog.alert("Los datos han sido actualizados");
this.$router.push("/admin/especial/casoEspecial");
this.$buefy.dialog.alert('Los datos han sido actualizados')
this.$router.push('/admin/especial/casoEspecial')
})
.catch((err) => {
this.error(err.response.data.message);
this.error(err.response.data.message)
})
.finally(() => {
this.isLoading = false;
});
this.isLoading = false
})
},
obtenerDatos() {
this.isLoading = true;
this.isLoading = true
return axios
.get(
`${process.env.api}/caso_especial/?idCasoEspecial=${this.idCasoEspecial}`,
this.token
)
.then((res) => {
console.log(res.data);
this.viejo = res.data;
console.log(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
})
},
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.nuevo.fechaInicio);
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate());
const min = new Date(this.nuevo.fechaInicio)
return new Date(min.getFullYear(), min.getMonth() + 6, min.getDate())
},
},
created() {
this.obtenerDatos();
this.obtenerDatos()
},
};
}
</script>
<style scoped>
@@ -269,4 +270,4 @@ export default {
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
</style>
</style>
@@ -28,7 +28,7 @@
</b-field>
</div>
<div class="column is-3 mb-4 pb-4 ">
<div class="column is-3 mb-4 pb-4">
<b-field>
<b-select
placeholder="Status"
@@ -38,7 +38,7 @@
v-model="idStatus"
>
<optgroup>
<option value=""> Status </option>
<option value="">Status</option>
<option value="11">Artículo 52</option>
<option value="12">Artículo 91</option>
<option value="13">Liberación Articulo 52</option>
@@ -122,71 +122,71 @@
</template>
<script>
import axios from "axios";
import moment from "moment";
import axios from 'axios'
import moment from 'moment'
export default {
data() {
return {
idUsuario: "",
idTipoUsuario: "",
tipoUsuario: "",
idUsuario: '',
idTipoUsuario: '',
tipoUsuario: '',
data: [],
total: "",
total: '',
isLoading: false,
page: 1,
perPage: 25,
numeroCuenta: "",
nombre: "",
idStatus: "",
numeroCuenta: '',
nombre: '',
idStatus: '',
token: {
headers: {
token: window.localStorage.getItem("token"),
token: window.localStorage.getItem('token'),
},
},
};
}
},
methods: {
onPageChange(page) {
this.page = page;
this.obtenerDatos();
this.page = page
this.obtenerDatos()
},
types(idStatus) {
if (idStatus === 1) {
return "is-dark";
return 'is-dark'
} else if (idStatus === 2) {
return "is-info";
return 'is-info'
} else if (idStatus === 3) {
return "is-link";
return 'is-link'
} else if (idStatus === 4) {
return "is-warning";
return 'is-warning'
} else if (idStatus === 5) {
return "is-success";
return 'is-success'
} else if (idStatus === 6) {
return "is-link";
return 'is-link'
} else if (
idStatus === 7 ||
idStatus === 8 ||
idStatus === 9 ||
idStatus === 10
) {
return "is-danger";
return 'is-danger'
} else if (idStatus === 11) {
return "is-link is-light";
return 'is-link is-light'
} else if (idStatus === 12) {
return "is-danger is-light";
return 'is-danger is-light'
} else if (idStatus === 13 || idStatus === 14) {
return "is-success is-light";
return 'is-success is-light'
}
},
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()}`
},
obtenerDatos(idStatus) {
this.isLoading = true;
this.data = [];
this.isLoading = true
this.data = []
axios
.get(
@@ -194,7 +194,7 @@ export default {
this.token
)
.then((res) => {
const servicios = res.data.servicios;
const servicios = res.data.servicios
if (servicios.length !== 0) {
for (let i = 0; i < servicios.length; i++) {
@@ -206,83 +206,83 @@ export default {
diaCreado: servicios[i].createdAt,
idStatus: servicios[i].Status.idStatus,
idCasoEspecial: servicios[i].idCasoEspecial,
});
})
}
}
let currentTotal = servicios.length;
let contador;
let currentTotal = servicios.length
let contador
for (let i = 0; i < res.data.registros / 25 + 1; i++) {
contador = i;
contador = i
}
currentTotal = this.perPage * contador;
this.total = currentTotal;
currentTotal = this.perPage * contador
this.total = currentTotal
})
.catch((error) => {
this.error(error.response.data.message);
this.error(error.response.data.message)
})
.finally(() => {
this.isLoading = false;
});
this.isLoading = false
})
},
servicios(idCasoEspecial) {
window.localStorage.setItem("idCasoEspecial", idCasoEspecial);
this.$router.push("/admin/especial/casoEspecial");
window.localStorage.setItem('idCasoEspecial', idCasoEspecial)
this.$router.push('/admin/especial/casoEspecial')
},
getIdLocal() {
this.idUsuario = 1; //localStorage.getItem("idUsuario");
this.idTipoUsuario = 1; //localStorage.getItem("idTipoUsuario");
this.tipoUsuario = "admin"; //localStorage.getItem("tipoUsuario");
this.idUsuario = 1 //localStorage.getItem("idUsuario");
this.idTipoUsuario = 1 //localStorage.getItem("idTipoUsuario");
this.tipoUsuario = 'admin' //localStorage.getItem("tipoUsuario");
if (this.idTipoUsuario != 1 && this.tipoUsuario != "admin") {
localStorage.clear();
this.$router.push("/");
if (this.idTipoUsuario != 1 && this.tipoUsuario != 'admin') {
localStorage.clear()
this.$router.push('/')
}
},
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(`/`)
}
},
},
created() {
this.getIdLocal();
this.obtenerDatos(0);
this.getIdLocal()
this.obtenerDatos(0)
},
};
}
</script>
<style>
+75 -75
View File
@@ -28,7 +28,7 @@
</b-field>
</div>
<div class="column is-3 mb-4 pb-4 ">
<div class="column is-3 mb-4 pb-4">
<b-field>
<b-select
placeholder="Status"
@@ -38,7 +38,7 @@
v-model="idStatus"
>
<optgroup>
<option value=""> Status </option>
<option value="">Status</option>
<option value="1">Pre-registro</option>
<option value="2">Pre-registro Validado</option>
<option value="3">Registro</option>
@@ -151,68 +151,68 @@
</template>
<script>
import axios from "axios";
import moment from "moment";
import axios from 'axios'
import moment from 'moment'
export default {
data() {
return {
idUsuario: "",
idTipoUsuario: "",
tipoUsuario: "",
idUsuario: '',
idTipoUsuario: '',
tipoUsuario: '',
data: [],
total: "",
total: '',
isLoading: false,
page: 1,
perPage: 25,
numeroCuenta: "",
nombre: "",
idStatus: "",
numeroCuenta: '',
nombre: '',
idStatus: '',
token: {
headers: {
token: window.localStorage.getItem("token"),
token: window.localStorage.getItem('token'),
},
},
};
}
},
methods: {
onPageChange(page) {
this.page = page;
this.obtenerDatos();
this.page = page
this.obtenerDatos()
},
types(idStatus) {
if (idStatus === 1) {
return "is-dark";
return 'is-dark'
} else if (idStatus === 2) {
return "is-info";
return 'is-info'
} else if (idStatus === 3) {
return "is-warning";
return 'is-warning'
} else if (idStatus === 4) {
return "is-link";
return 'is-link'
} else if (idStatus === 5) {
return "is-success";
return 'is-success'
} else if (idStatus === 6) {
return "is-success is-light";
return 'is-success is-light'
} else if (idStatus === 7) {
return "is-danger";
return 'is-danger'
} else if (idStatus === 8) {
return "is-danger";
return 'is-danger'
} else if (idStatus === 9) {
return "is-danger";
return 'is-danger'
} else if (idStatus === 10) {
// admin
return "is-danger";
return 'is-danger'
}
},
fecha(date) {
const fecha = moment(date.substr(0, 10));
const fecha = moment(date.substr(0, 10))
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
},
obtenerDatos(idStatus) {
this.isLoading = true;
this.data = [];
this.isLoading = true
this.data = []
axios
.get(
@@ -220,7 +220,7 @@ export default {
this.token
)
.then((res) => {
const servicios = res.data.servicios;
const servicios = res.data.servicios
if (servicios.length !== 0) {
for (let i = 0; i < servicios.length; i++) {
@@ -234,83 +234,83 @@ export default {
diaCreado: servicios[i].createdAt,
idStatus: servicios[i].Status.idStatus,
idServicio: servicios[i].idServicio,
});
})
}
}
let currentTotal = servicios.length;
let contador;
let currentTotal = servicios.length
let contador
for (let i = 0; i < res.data.registros / 25 + 1; i++) {
contador = i;
contador = i
}
currentTotal = this.perPage * contador;
this.total = currentTotal;
currentTotal = this.perPage * contador
this.total = currentTotal
})
.catch((error) => {
this.error(error.response.data.message);
this.error(error.response.data.message)
})
.finally(() => {
this.isLoading = false;
});
this.isLoading = false
})
},
servicios(idServicio) {
window.localStorage.setItem("idServicio", idServicio);
this.$router.push("/admin/servicio");
window.localStorage.setItem('idServicio', idServicio)
this.$router.push('/admin/servicio')
},
getIdLocal() {
this.idUsuario = localStorage.getItem("idUsuario");
this.idTipoUsuario = localStorage.getItem("idTipoUsuario");
this.tipoUsuario = localStorage.getItem("tipoUsuario");
this.idUsuario = localStorage.getItem('idUsuario')
this.idTipoUsuario = localStorage.getItem('idTipoUsuario')
this.tipoUsuario = localStorage.getItem('tipoUsuario')
if (this.idTipoUsuario != 1 && this.tipoUsuario != "admin") {
localStorage.clear();
this.$router.push("/");
if (this.idTipoUsuario != 1 && this.tipoUsuario != 'admin') {
localStorage.clear()
this.$router.push('/')
}
},
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(`/`)
}
},
},
created() {
this.getIdLocal();
this.obtenerDatos(0);
this.getIdLocal()
this.obtenerDatos(0)
},
};
}
</script>
<style>
+54 -54
View File
@@ -16,7 +16,7 @@
</p>
<p>
{{
csv.name || "Arrastra aquí tu archivo o da click para buscar"
csv.name || 'Arrastra aquí tu archivo o da click para buscar'
}}
</p>
</div>
@@ -36,108 +36,108 @@
</template>
<script>
import axios from "axios";
import axios from 'axios'
export default {
data() {
return {
csv: {},
token: {
headers: {
token: window.localStorage.getItem("token"),
token: window.localStorage.getItem('token'),
},
},
isLoading: false,
toastType: null,
toastMessage: null,
};
}
},
methods: {
validarExt() {
const extPermitidas = /(.csv)$/i;
const extPermitidas = /(.csv)$/i
if (!extPermitidas.exec(this.csv.name)) {
this.toastType = "is-danger";
this.toastMessage = "Asegurate de ingresar un archivo .CSV";
this.toast();
this.csv = {};
this.toastType = 'is-danger'
this.toastMessage = 'Asegurate de ingresar un archivo .CSV'
this.toast()
this.csv = {}
}
},
toast() {
this.$buefy.toast.open({
message: this.toastMessage,
type: this.toastType,
});
})
},
dialog() {
this.$buefy.dialog.confirm({
title: "Carga masiva",
message: "¿Seguro(a) que quiere enviar este archivo?",
confirmText: "Confirmar",
cancelText: "Cancelar",
type: "is-success",
title: 'Carga masiva',
message: '¿Seguro(a) que quiere enviar este archivo?',
confirmText: 'Confirmar',
cancelText: 'Cancelar',
type: 'is-success',
hasIcon: true,
onConfirm: () => this.enviarCargaMasiva(),
});
})
},
enviarCargaMasiva() {
const formData = new FormData();
const formData = new FormData()
this.isLoading = true;
formData.append("csv", this.csv);
this.isLoading = true
formData.append('csv', this.csv)
axios
.post(`${process.env.api}/programa/carga_masiva`, formData, {
headers: {
"Content-Type": "multipart/form-data",
'Content-Type': 'multipart/form-data',
token: this.token.headers.token,
},
})
.then((res) => {
this.isLoading = false;
this.toastType = "is-success";
this.toastMessage = "Se ha enviado la carga masiva con éxito";
this.toast();
this.$router.push("/admin");
this.isLoading = false
this.toastType = 'is-success'
this.toastMessage = 'Se ha enviado la carga masiva con éxito'
this.toast()
this.$router.push('/admin')
})
.catch((err) => {
this.isLoading = false;
this.error(err.response.data.message);
});
this.isLoading = false
this.error(err.response.data.message)
})
},
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(`/`)
}
},
},
};
}
</script>
+56 -56
View File
@@ -61,122 +61,122 @@
</template>
<script>
import axios from "axios";
import axios from 'axios'
export default {
data() {
return {
idUsuario: "",
idUsuario: '',
data: [],
total: "",
total: '',
loading: false,
page: 1,
perPage: 25,
correo: "",
nombre: "",
correo: '',
nombre: '',
idStatus: 1,
token: {
headers: {
token: window.localStorage.getItem("token"),
token: window.localStorage.getItem('token'),
},
},
};
}
},
methods: {
onPageChange(page) {
this.page = page;
this.obtenerDatos();
this.page = page
this.obtenerDatos()
},
obtenerDatos(idStatus) {
this.loading = true;
this.data = [];
this.loading = true
this.data = []
axios
.get(
`${process.env.api}/usuario/responsable?pagina=${this.page}&nombre=${this.nombre}&correo=${this.correo}`,
this.token
)
.then((res) => {
const servicios = res.data.servicios;
const servicios = res.data.servicios
if (servicios.length !== 0) {
for (let i = 0; i < servicios.length; i++) {
this.data.push({
nombre: servicios[i].nombre,
usuario: servicios[i].usuario,
idUsuario: servicios[i].idUsuario,
});
})
}
}
let currentTotal = servicios.length;
let contador;
let currentTotal = servicios.length
let contador
for (let i = 0; i < res.data.registros / this.perPage + 1; i++) {
contador = i;
contador = i
}
currentTotal = this.perPage * contador;
this.total = currentTotal;
this.loading = false;
currentTotal = this.perPage * contador
this.total = currentTotal
this.loading = false
})
.catch((err) => {
this.loading = false;
this.error(err.response.data.message);
});
this.loading = false
this.error(err.response.data.message)
})
},
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(`/`)
}
},
insertIdLocal() {
this.idUsuario = localStorage.getItem("idUsuario");
this.idUsuario = localStorage.getItem('idUsuario')
},
verRegistro(responsable) {
localStorage.setItem("correo", responsable.usuario);
localStorage.setItem("idResponsable", responsable.idUsuario);
localStorage.setItem("nombre", responsable.nombre);
this.$router.push("/admin/programa/infoResponsable");
localStorage.setItem('correo', responsable.usuario)
localStorage.setItem('idResponsable', responsable.idUsuario)
localStorage.setItem('nombre', responsable.nombre)
this.$router.push('/admin/programa/infoResponsable')
},
},
computed: {
busquedaNombreResponsable() {
return this.responsables.filter((responsables) =>
responsables.nombreResp.includes(this.buscarNombreResponsable)
);
)
},
},
async created() {
await this.obtenerDatos();
this.insertIdLocal();
await this.obtenerDatos()
this.insertIdLocal()
},
};
}
</script>
<style scoped>
@@ -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>
+1 -1
View File
@@ -24,5 +24,5 @@ export default {
props: {
programa: Object,
},
};
}
</script>
+84 -88
View File
@@ -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>
+119 -119
View File
@@ -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>
+7 -19
View File
@@ -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>
+4 -10
View File
@@ -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>
+109 -115
View File
@@ -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>