From 75aa6d884db890ae4cc4bb2657bc21520917e266 Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Fri, 14 May 2021 09:51:43 -0500 Subject: [PATCH] =?UTF-8?q?quitando=20c=C3=B3digo=20de=20table=20inecesari?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/layouts/Logout.vue | 9 +- components/responsable/inputTable.vue | 351 ++++++++++---------------- 2 files changed, 136 insertions(+), 224 deletions(-) diff --git a/components/layouts/Logout.vue b/components/layouts/Logout.vue index 4bd767b..492a8c0 100644 --- a/components/layouts/Logout.vue +++ b/components/layouts/Logout.vue @@ -3,8 +3,13 @@
-

{{ usuario }}

- {{ usuario }} + + Cerrar Sesión
diff --git a/components/responsable/inputTable.vue b/components/responsable/inputTable.vue index c78b2cf..4bca1b8 100644 --- a/components/responsable/inputTable.vue +++ b/components/responsable/inputTable.vue @@ -46,167 +46,118 @@ -
-
- + + {{ props.row.Usuario.nombre }} + + + + {{ props.row.Usuario.usuario }} + + + + {{ props.row.Carrera.carrera }} + + + + {{ fecha(props.row.fechaInicio) }} + + + + {{ fecha(props.row.fechaFin) }} + + + + {{ + props.row.Status.status + }} + + + +
- - {{ props.row.nombre }} - {{ props.row.nombre }} - + + + - - {{ props.row.numeroCuenta }} - {{ props.row.numeroCuenta }} - + Carta Término + +
+
- +
+ + + + + - {{ props.row.carrera }} - {{ props.row.carrera }} - - - - {{ fecha(props.row.fechaInicio) }} - {{ fecha(props.row.fechaInicio) }} - - - - {{ fecha(props.row.fechaFin) }} - {{ fecha(props.row.fechaFin) }} - - - - {{ props.row.status }} - {{ - props.row.status - }} - - - -
- - - - - - Carta Término - -
-
- - -
- - - - - - Cuestionario - -
-
- -
-
+ Cuestionario + + + + @@ -243,25 +194,18 @@ export default { this.obtenerDatos() }, types(idStatus) { - if (idStatus === 1) { - return 'is-dark' - } else if (idStatus === 2) { - return 'is-info' - } else if (idStatus === 3) { - return 'is-warning' - } else if (idStatus === 4) { - return 'is-link' - } else if (idStatus === 5) { - return 'is-success' - } else if (idStatus === 6) { - return 'is-success is-light' - } else if (idStatus === 7) { - return 'is-danger' - } else if (idStatus === 8) { - return 'is-danger' - } else if (idStatus === 9) { - return 'is-danger' - } + let style = 'tag' + + if (idStatus === 1) style += ' is-dark' + else if (idStatus === 2) style += ' is-info' + else if (idStatus === 3) style += ' is-warning' + else if (idStatus === 4) style += ' is-link' + else if (idStatus === 5) style += ' is-success' + else if (idStatus === 6) style += ' is-success is-light' + else if (idStatus === 7) style += ' is-danger' + else if (idStatus === 8) style += ' is-danger' + else if (idStatus === 9) style += ' is-danger' + return style }, botonCarta(cartaTermino, idServicio) { window.localStorage.setItem('idServicio', idServicio) @@ -306,24 +250,11 @@ export default { this.token ) .then((res) => { - const servicios = res.data.servicios + const servicios = res.data.serviciosResponsable + + this.data = res.data.serviciosResponsable + console.log(this.data) - if (servicios.length !== 0) { - for (let i = 0; i < servicios.length; i++) { - this.data.push({ - nombre: servicios[i].Usuario.nombre, - numeroCuenta: servicios[i].Usuario.usuario, - carrera: servicios[i].Carrera.carrera, - fechaInicio: servicios[i].fechaInicio, - fechaFin: servicios[i].fechaFin, - status: servicios[i].Status.status, - idStatus: servicios[i].Status.idStatus, - cuestionario: servicios[i].idCuestionarioPrograma, - cartaTermino: servicios[i].cartaTermino, - idServicio: servicios[i].idServicio, - }) - } - } let currentTotal = servicios.length let contador @@ -356,26 +287,6 @@ export default { } }, error(msj) { - let salir = false - switch (msj) { - case 'invalid signature': - msj = 'Tu token no es valido, inicia sesión de nuevo.' - salir = true - break - case 'jwt expired': - msj = 'Tu sesión ha expirado, inicia sesión de nuevo.' - salir = true - break - case 'jwt malformed': - msj = 'No se encontro tu token, inicia sesión de nuevo.' - salir = true - break - case 'No hay token': - msj = 'Ocurrio un error al enviar tu token, inicia sesión de nuevo.' - salir = true - break - } - this.$buefy.dialog.alert({ title: 'Error', message: msj, @@ -386,16 +297,16 @@ export default { ariaRole: 'alertdialog', ariaModal: true, }) - if (salir == true) { localStorage.clear() this.$router.push(`/`) - } }, obtenerStatus() { - axios.get(`${process.env.api}/status`, this.token).then((res) => { - console.log(res.data) - this.status = res.data - }) + axios + .get(`${process.env.api}/status`, this.token) + .then((res) => { + this.status = res.data + }) + .catch((err) => {}) }, }, created() { @@ -425,8 +336,4 @@ export default { background-color: #1b3d70; border-color: #1b3d70; } - -.cursorR { - cursor: pointer; -}