92 lines
2.3 KiB
Vue
92 lines
2.3 KiB
Vue
<template>
|
|
<b-table
|
|
class="pb-6"
|
|
:current-page="page"
|
|
:data="usuarios"
|
|
:loading="isLoadingTable"
|
|
:per-page="25"
|
|
:row-class="(row, index) => 'pointer'"
|
|
:selected.sync="usuarioSeleccionado"
|
|
:total="total"
|
|
@page-change="onPageChange"
|
|
backend-pagination
|
|
detailed
|
|
hoverable
|
|
paginated
|
|
show-detail-icon
|
|
striped
|
|
>
|
|
<b-table-column
|
|
field="usuario"
|
|
label="Número de cuenta/trabajador"
|
|
v-slot="props"
|
|
centered
|
|
>
|
|
<p>{{ props.row.usuario }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
|
<p>{{ props.row.nombre }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="tipo" label="Tipo" v-slot="props" centered>
|
|
<p>{{ props.row.tipoUsuario.tipo_usuario }}</p>
|
|
</b-table-column>
|
|
|
|
<template #detail="props">
|
|
<b-table :data="props.row.instituciones" hoverable striped>
|
|
<b-table-column
|
|
field="institucion"
|
|
label="Institución"
|
|
v-slot="props"
|
|
centered
|
|
>
|
|
<p>{{ props.row.institucionCarrera.institucion.institucion }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
|
<p>{{ props.row.institucionCarrera.carrera.carrera }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="activo" label="Status" v-slot="props" centered>
|
|
<p
|
|
class="tag is-size-6"
|
|
:class="props.row.activo ? 'is-success' : 'is-danger'"
|
|
>
|
|
{{ props.row.activo ? "Activo" : "Inactivo" }}
|
|
</p>
|
|
</b-table-column>
|
|
</b-table>
|
|
</template>
|
|
</b-table>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
usuarios: { type: Array, required: true, default: () => [] },
|
|
isLoadingTable: { type: Boolean, required: true, default: false },
|
|
onPageChange: { type: Function, required: true, default: () => {} },
|
|
page: { type: Number, required: true, default: 1 },
|
|
total: { type: Number, required: true, default: 0 },
|
|
},
|
|
data() {
|
|
return { usuarioSeleccionado: {} }
|
|
},
|
|
watch: {
|
|
usuarioSeleccionado() {
|
|
this.$router.push(
|
|
`/usuarios/buscar_usuario/${this.usuarioSeleccionado.usuario}`
|
|
)
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.pointer {
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
|