68 lines
1.4 KiB
Vue
68 lines
1.4 KiB
Vue
<template>
|
|
<b-tab-item label="Equipos">
|
|
<TablaEquipos
|
|
:equipos="equipos"
|
|
:page="page"
|
|
:total="total"
|
|
:onPageChange="onPageChange"
|
|
:isLoadingTable="isLoadingTable"
|
|
:operador="operador"
|
|
/>
|
|
</b-tab-item>
|
|
</template>
|
|
|
|
<script>
|
|
import axios from 'axios'
|
|
import TablaEquipos from '@/components/tablas/TablaEquipos'
|
|
|
|
export default {
|
|
components: { TablaEquipos },
|
|
props: {
|
|
carrito: { type: Object, required: true, default: () => ({}) },
|
|
operador: { type: Object, required: true, default: () => ({}) },
|
|
},
|
|
data() {
|
|
return {
|
|
equipos: [],
|
|
isLoadingTable: false,
|
|
page: 1,
|
|
total: 0,
|
|
}
|
|
},
|
|
methods: {
|
|
obtenerEquipos() {
|
|
this.isLoadingTable = true
|
|
return axios
|
|
.get(
|
|
`${process.env.api}/equipo/equipos?pagina=${this.page}&id_carrito=${this.carrito.id_carrito}`,
|
|
this.$getToken.token()
|
|
)
|
|
.then((res) => {
|
|
this.equipos = res.data[0]
|
|
this.total = res.data[1]
|
|
this.isLoadingTable = false
|
|
})
|
|
.catch((err) => {
|
|
this.isLoadingTable = false
|
|
this.$alertsGenericos.imprimirError(
|
|
this.$buefy,
|
|
this.$router,
|
|
err.response.data
|
|
)
|
|
})
|
|
},
|
|
onPageChange(page) {
|
|
this.page = page
|
|
this.obtenerEquipos()
|
|
},
|
|
},
|
|
watch: {
|
|
carrito() {
|
|
this.obtenerEquipos()
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style></style>
|