2022-07-06 02:16:03 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2022-07-07 04:17:11 +00:00
|
|
|
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
|
|
|
<b-field class="column mb-0 pb-0" field="carrito" label="Carrito">
|
|
|
|
<b-input
|
|
|
|
placeholder="Carrito"
|
|
|
|
v-model="carrito"
|
|
|
|
rounded
|
2022-07-13 05:43:59 +00:00
|
|
|
@keyup.enter.native="obtenerEquipos(1)"
|
2022-07-07 04:17:11 +00:00
|
|
|
/>
|
|
|
|
</b-field>
|
|
|
|
|
|
|
|
<b-field class="column mb-0 pb-0" field="equipo" label="Equipo">
|
|
|
|
<b-input
|
|
|
|
placeholder="Equipo"
|
|
|
|
v-model="equipo"
|
|
|
|
rounded
|
2022-07-13 05:43:59 +00:00
|
|
|
@keyup.enter.native="obtenerEquipos(1)"
|
2022-07-07 04:17:11 +00:00
|
|
|
/>
|
|
|
|
</b-field>
|
|
|
|
|
|
|
|
<b-button
|
|
|
|
class="column mb-0"
|
|
|
|
type="is-info"
|
2022-07-13 05:43:59 +00:00
|
|
|
@click="obtenerEquipos(1)"
|
2022-07-07 21:05:32 +00:00
|
|
|
expanded
|
2022-07-07 04:17:11 +00:00
|
|
|
rounded
|
|
|
|
>Buscar</b-button
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
|
2022-07-13 05:42:23 +00:00
|
|
|
<TablaEquipos
|
2022-07-06 02:16:03 +00:00
|
|
|
:data="data"
|
|
|
|
:total="total"
|
2022-07-13 05:42:23 +00:00
|
|
|
:obtenerEquipos="obtenerEquipos"
|
|
|
|
:isLoadingTable="isLoadingTable"
|
|
|
|
/>
|
2022-07-06 02:16:03 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
2022-07-13 05:42:23 +00:00
|
|
|
import TablaEquipos from '@/components/operador/TablaEquipos'
|
2022-07-06 02:16:03 +00:00
|
|
|
export default {
|
2022-07-13 05:42:23 +00:00
|
|
|
components: {
|
|
|
|
TablaEquipos,
|
|
|
|
},
|
2022-07-07 21:05:32 +00:00
|
|
|
props: {
|
2022-07-13 05:42:23 +00:00
|
|
|
operador: { type: Object, required: true },
|
2022-07-07 21:05:32 +00:00
|
|
|
},
|
2022-07-06 02:16:03 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
data: [],
|
|
|
|
total: 0,
|
|
|
|
isLoadingTable: false,
|
2022-07-07 04:17:11 +00:00
|
|
|
carrito: '',
|
|
|
|
equipo: '',
|
2022-07-06 02:16:03 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2022-07-13 05:42:23 +00:00
|
|
|
obtenerEquipos(pagina) {
|
2022-07-07 04:17:11 +00:00
|
|
|
let carrito = ''
|
|
|
|
let equipo = ''
|
|
|
|
if (this.carrito != '') carrito = '&carrito=' + this.carrito
|
|
|
|
if (this.equipo != '') equipo = '&equipo=' + this.equipo
|
|
|
|
|
2022-07-06 02:16:03 +00:00
|
|
|
axios
|
2022-07-07 04:17:11 +00:00
|
|
|
.get(
|
2022-07-13 05:42:23 +00:00
|
|
|
`${process.env.api}/equipo/equipos?pagina=${pagina}${carrito}${equipo}`
|
2022-07-07 04:17:11 +00:00
|
|
|
)
|
2022-07-06 02:16:03 +00:00
|
|
|
.then((res) => {
|
|
|
|
this.data = res.data[0]
|
|
|
|
this.total = res.data[1]
|
|
|
|
this.isLoadingTable = false
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
this.isLoadingTable = false
|
2022-07-11 14:15:10 +00:00
|
|
|
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
2022-07-06 02:16:03 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
2022-07-13 05:42:23 +00:00
|
|
|
this.obtenerEquipos(1)
|
2022-07-06 02:16:03 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|