quitando código de table inecesario
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
<div
|
||||
class="container is-flex is-justify-content-space-between is-align-items-center"
|
||||
>
|
||||
<h2 class="has-text-white">{{ usuario }}</h2>
|
||||
<b-button @click="cerrarSesion()" type="is-danger" class="m-2 rojo"
|
||||
<h2 class="m-2 has-text-white">{{ usuario }}</h2>
|
||||
|
||||
<b-button
|
||||
type="is-danger"
|
||||
size="is-small"
|
||||
class="m-2 rojo"
|
||||
@click="cerrarSesion()"
|
||||
>Cerrar Sesión</b-button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -46,167 +46,118 @@
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<section class="column is-12">
|
||||
<b-table
|
||||
:data="data"
|
||||
:loading="isLoading"
|
||||
hoverable
|
||||
striped
|
||||
paginated
|
||||
backend-pagination
|
||||
:total="total"
|
||||
:per-page="perPage"
|
||||
@page-change="onPageChange"
|
||||
<b-table
|
||||
:data="data"
|
||||
:loading="isLoading"
|
||||
hoverable
|
||||
striped
|
||||
paginated
|
||||
backend-pagination
|
||||
:total="total"
|
||||
:per-page="perPage"
|
||||
@page-change="onPageChange"
|
||||
>
|
||||
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
||||
<span>{{ props.row.Usuario.nombre }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="numeroCuenta"
|
||||
label="Número de Cuenta"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.Usuario.usuario }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
||||
<span>{{ props.row.Carrera.carrera }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="fechaInicio"
|
||||
label="Fecha Inicio"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span>{{ fecha(props.row.fechaInicio) }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="fechaFin"
|
||||
label="Fecha Fin"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span>{{ fecha(props.row.fechaFin) }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="status" label="Status" v-slot="props" centered>
|
||||
<span :class="types(props.row.Status.idStatus)">{{
|
||||
props.row.Status.status
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cartaTermino"
|
||||
label="Carta Término"
|
||||
v-slot="props"
|
||||
centered
|
||||
v-if="idTipoUsuario == 2"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
props.row.Status.idStatus >= 4 && props.row.Status.idStatus != 7
|
||||
"
|
||||
>
|
||||
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
||||
<span
|
||||
class="cursorR"
|
||||
v-if="props.row.idStatus == 7"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ props.row.nombre }}</span
|
||||
>
|
||||
<span v-else>{{ props.row.nombre }}</span>
|
||||
</b-table-column>
|
||||
<span v-if="props.row.cartaTermino">
|
||||
<b-icon
|
||||
:icon="iconoCarta(props.row.cartaTermino)"
|
||||
class="tag is-success"
|
||||
></b-icon>
|
||||
</span>
|
||||
|
||||
<b-table-column
|
||||
field="numeroCuenta"
|
||||
label="Número de Cuenta"
|
||||
v-slot="props"
|
||||
centered
|
||||
width="100"
|
||||
<b-button
|
||||
v-else
|
||||
size="is-small"
|
||||
@click="botonCarta(props.row.cartaTermino, props.row.idServicio)"
|
||||
class="tag is-danger"
|
||||
:icon="iconoCarta(props.row.cartaTermino)"
|
||||
>
|
||||
<span
|
||||
class="cursorR"
|
||||
v-if="props.row.idStatus == 7"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ props.row.numeroCuenta }}</span
|
||||
>
|
||||
<span v-else>{{ props.row.numeroCuenta }}</span>
|
||||
</b-table-column>
|
||||
Carta Término
|
||||
</b-button>
|
||||
</div>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="carrera"
|
||||
label="Carrera"
|
||||
v-slot="props"
|
||||
centered
|
||||
<b-table-column
|
||||
field="cuestionario"
|
||||
label="Cuestionario"
|
||||
v-slot="props"
|
||||
centered
|
||||
v-if="idTipoUsuario == 2"
|
||||
>
|
||||
<div v-if="props.row.idStatus >= 4 && props.row.idStatus != 7">
|
||||
<span v-if="props.row.cuestionario != null">
|
||||
<b-icon
|
||||
:icon="iconoCuestionario(props.row.cuestionario)"
|
||||
class="tag is-success"
|
||||
></b-icon>
|
||||
</span>
|
||||
|
||||
<b-button
|
||||
v-if="props.row.cuestionario === null"
|
||||
size="is-small"
|
||||
@click="
|
||||
botonCuestionario(props.row.cuestionario, props.row.idServicio)
|
||||
"
|
||||
class="tag is-danger"
|
||||
:icon="iconoCuestionario(props.row.cuestionario)"
|
||||
>
|
||||
<span
|
||||
class="cursorR"
|
||||
v-if="props.row.idStatus == 7"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ props.row.carrera }}</span
|
||||
>
|
||||
<span v-else>{{ props.row.carrera }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="fechaInicio"
|
||||
truncate="10"
|
||||
label="Fecha Inicio"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span
|
||||
class="cursorR"
|
||||
v-if="props.row.idStatus == 7"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ fecha(props.row.fechaInicio) }}</span
|
||||
>
|
||||
<span v-else>{{ fecha(props.row.fechaInicio) }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="fechaFin"
|
||||
label="Fecha Fin"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span
|
||||
class="cursorR"
|
||||
v-if="props.row.idStatus == 7"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ fecha(props.row.fechaFin) }}</span
|
||||
>
|
||||
<span v-else>{{ fecha(props.row.fechaFin) }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="status" label="Status" v-slot="props" centered>
|
||||
<span
|
||||
v-if="props.row.idStatus == 7"
|
||||
class="cursorR tag"
|
||||
:class="types(props.row.idStatus)"
|
||||
@click="cartaAceptacion(props.row.idServicio, props.row.idStatus)"
|
||||
>{{ props.row.status }}</span
|
||||
>
|
||||
<span v-else class="tag" :class="types(props.row.idStatus)">{{
|
||||
props.row.status
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cartaTermino"
|
||||
label="Carta Término"
|
||||
v-slot="props"
|
||||
centered
|
||||
v-if="idTipoUsuario == 2"
|
||||
>
|
||||
<div v-if="props.row.idStatus >= 4 && props.row.idStatus != 7">
|
||||
<span v-if="props.row.cartaTermino">
|
||||
<b-icon
|
||||
:icon="iconoCarta(props.row.cartaTermino)"
|
||||
class="tag is-success"
|
||||
></b-icon>
|
||||
</span>
|
||||
|
||||
<b-button
|
||||
v-else
|
||||
size="is-small"
|
||||
@click="
|
||||
botonCarta(props.row.cartaTermino, props.row.idServicio)
|
||||
"
|
||||
class="tag is-danger"
|
||||
:icon="iconoCarta(props.row.cartaTermino)"
|
||||
>
|
||||
Carta Término
|
||||
</b-button>
|
||||
</div>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cuestionario"
|
||||
label="Cuestionario"
|
||||
v-slot="props"
|
||||
centered
|
||||
v-if="idTipoUsuario == 2"
|
||||
>
|
||||
<div v-if="props.row.idStatus >= 4 && props.row.idStatus != 7">
|
||||
<span v-if="props.row.cuestionario != null">
|
||||
<b-icon
|
||||
:icon="iconoCuestionario(props.row.cuestionario)"
|
||||
class="tag is-success"
|
||||
></b-icon>
|
||||
</span>
|
||||
|
||||
<b-button
|
||||
v-if="props.row.cuestionario === null"
|
||||
size="is-small"
|
||||
@click="
|
||||
botonCuestionario(
|
||||
props.row.cuestionario,
|
||||
props.row.idServicio
|
||||
)
|
||||
"
|
||||
class="tag is-danger"
|
||||
:icon="iconoCuestionario(props.row.cuestionario)"
|
||||
>
|
||||
Cuestionario
|
||||
</b-button>
|
||||
</div>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</section>
|
||||
</div>
|
||||
Cuestionario
|
||||
</b-button>
|
||||
</div>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user