2022-07-05 06:03:20 +00:00
|
|
|
<template>
|
|
|
|
<section class="mb-5">
|
|
|
|
<BuscarCarrito
|
|
|
|
:operador="operador"
|
|
|
|
:carrito="carrito"
|
|
|
|
:updateIsLoading="updateIsLoading"
|
|
|
|
:updateCarrito="updateCarrito"
|
|
|
|
/>
|
2022-07-13 05:42:23 +00:00
|
|
|
|
|
|
|
<TablaEquipos
|
2022-07-29 20:40:03 +00:00
|
|
|
:equipos="equipos"
|
|
|
|
:page="page"
|
2022-07-13 05:42:23 +00:00
|
|
|
:total="total"
|
|
|
|
:obtenerEquipos="obtenerEquipos"
|
2022-07-29 20:40:03 +00:00
|
|
|
:onPageChange="onPageChange"
|
2022-07-13 05:42:23 +00:00
|
|
|
:isLoadingTable="isLoadingTable"
|
|
|
|
/>
|
2022-07-05 06:03:20 +00:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-07-13 05:42:23 +00:00
|
|
|
import axios from 'axios'
|
2022-07-27 02:33:41 +00:00
|
|
|
import BuscarCarrito from '@/components/buscar/BuscarCarrito'
|
2022-07-29 20:40:03 +00:00
|
|
|
import TablaEquipos from '@/components/tablas/TablaEquipos'
|
2022-07-05 06:03:20 +00:00
|
|
|
|
|
|
|
export default {
|
2022-07-13 05:42:23 +00:00
|
|
|
components: { BuscarCarrito, TablaEquipos },
|
2022-07-05 06:03:20 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2022-07-22 21:53:27 +00:00
|
|
|
equipos: [],
|
2022-07-29 20:40:03 +00:00
|
|
|
isLoadingTable: false,
|
|
|
|
page: 1,
|
2022-07-13 05:42:23 +00:00
|
|
|
total: 0,
|
2022-07-05 06:03:20 +00:00
|
|
|
carrito: { modulo: {}, tipoCarrito: {} },
|
|
|
|
}
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
operador: { type: Object, required: true },
|
|
|
|
updateIsLoading: { type: Function, required: true },
|
|
|
|
},
|
|
|
|
methods: {
|
2022-07-29 20:40:03 +00:00
|
|
|
obtenerEquipos() {
|
2022-07-13 05:42:23 +00:00
|
|
|
axios
|
|
|
|
.get(
|
2022-07-29 20:40:03 +00:00
|
|
|
`${process.env.api}/equipo/equipos?pagina=${this.page}&id_carrito=${this.carrito.id_carrito}`,
|
2022-07-19 16:41:33 +00:00
|
|
|
this.$getToken.token()
|
2022-07-13 05:42:23 +00:00
|
|
|
)
|
|
|
|
.then((res) => {
|
2022-07-22 21:53:27 +00:00
|
|
|
this.equipos = res.data[0]
|
2022-07-13 05:42:23 +00:00
|
|
|
this.total = res.data[1]
|
|
|
|
this.isLoadingTable = false
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
this.isLoadingTable = false
|
|
|
|
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
|
|
|
})
|
|
|
|
},
|
2022-07-29 20:40:03 +00:00
|
|
|
onPageChange(page) {
|
|
|
|
this.page = page
|
|
|
|
this.obtenerEquipos()
|
|
|
|
},
|
|
|
|
updateCarrito(valorObject) {
|
|
|
|
this.carrito = valorObject
|
|
|
|
},
|
2022-07-13 05:42:23 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
carrito() {
|
2022-07-29 20:40:03 +00:00
|
|
|
this.obtenerEquipos()
|
2022-07-13 05:42:23 +00:00
|
|
|
},
|
2022-07-05 06:03:20 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|