2022-07-25 12:49:16 +00:00
|
|
|
<template>
|
|
|
|
<b-table
|
2022-07-29 01:04:17 +00:00
|
|
|
class="pb-6"
|
2022-07-25 12:49:16 +00:00
|
|
|
:current-page="page"
|
2022-07-26 00:18:10 +00:00
|
|
|
:data="equipos"
|
2022-07-25 12:49:16 +00:00
|
|
|
:loading="isLoadingTable"
|
|
|
|
:per-page="25"
|
2022-07-25 22:59:36 +00:00
|
|
|
:row-class="(row, index) => 'pointer'"
|
|
|
|
:selected.sync="equipoSeleccionado"
|
2022-07-25 12:49:16 +00:00
|
|
|
:total="total"
|
|
|
|
@page-change="onPageChange"
|
|
|
|
backend-pagination
|
|
|
|
hoverable
|
|
|
|
paginated
|
|
|
|
striped
|
|
|
|
>
|
2022-07-25 22:59:36 +00:00
|
|
|
<b-table-column field="equipo" label="Equipo" centered v-slot="props">
|
|
|
|
<p>{{ props.row.equipo }}</p>
|
|
|
|
</b-table-column>
|
|
|
|
|
|
|
|
<b-table-column
|
|
|
|
field="numeroInventario"
|
|
|
|
label="Número de Inventario"
|
|
|
|
centered
|
|
|
|
v-slot="props"
|
|
|
|
>
|
|
|
|
<p>{{ props.row.numero_inventario }}</p>
|
|
|
|
</b-table-column>
|
|
|
|
|
|
|
|
<b-table-column field="carrito" label="Carrito" centered v-slot="props">
|
|
|
|
<p>{{ props.row.carrito.carrito }}</p>
|
|
|
|
</b-table-column>
|
|
|
|
|
|
|
|
<b-table-column field="modulo" label="Módulo" centered v-slot="props">
|
|
|
|
<p>{{ props.row.carrito.modulo.modulo }}</p>
|
|
|
|
</b-table-column>
|
|
|
|
|
|
|
|
<b-table-column
|
|
|
|
field="tipoCarrito"
|
|
|
|
label="Tipo de equipo"
|
|
|
|
centered
|
|
|
|
v-slot="props"
|
|
|
|
>
|
|
|
|
<p>{{ props.row.carrito.tipoCarrito.tipo_carrito }}</p>
|
|
|
|
</b-table-column>
|
|
|
|
|
|
|
|
<b-table-column field="status" label="Status" centered v-slot="props">
|
|
|
|
<p class="is-size-6 tag" :class="chooseTag(props.row.status.id_status)">
|
|
|
|
{{ props.row.status.status }}
|
|
|
|
</p>
|
|
|
|
</b-table-column>
|
2022-07-25 12:49:16 +00:00
|
|
|
</b-table>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2022-07-26 00:18:10 +00:00
|
|
|
equipos: { type: Array, required: true, default: () => [] },
|
2022-07-25 12:49:16 +00:00
|
|
|
isLoadingTable: { type: Boolean, required: true, default: false },
|
2022-07-26 00:18:10 +00:00
|
|
|
onPageChange: { type: Function, required: true, default: () => {} },
|
|
|
|
page: { type: Number, required: true, default: 1 },
|
2022-07-25 12:49:16 +00:00
|
|
|
total: { type: Number, required: true, default: 0 },
|
|
|
|
},
|
|
|
|
data() {
|
2022-07-25 22:59:36 +00:00
|
|
|
return {
|
|
|
|
equipoSeleccionado: {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
chooseTag(idStatus) {
|
|
|
|
switch (idStatus) {
|
|
|
|
case 1:
|
|
|
|
return 'is-info'
|
|
|
|
case 2:
|
|
|
|
return 'is-link'
|
|
|
|
case 3:
|
|
|
|
return 'is-primary'
|
|
|
|
case 4:
|
|
|
|
return 'is-success'
|
|
|
|
case 5:
|
|
|
|
return 'is-warning'
|
|
|
|
case 6:
|
|
|
|
return 'is-danger'
|
|
|
|
case 7:
|
|
|
|
return 'is-black'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
equipoSeleccionado() {
|
|
|
|
this.$router.push(
|
|
|
|
`/operador/equipos/buscar_equipo/${this.equipoSeleccionado.numero_inventario}`
|
|
|
|
)
|
|
|
|
},
|
2022-07-25 12:49:16 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|