2022-05-31 04:22:49 +00:00
|
|
|
<template>
|
|
|
|
<section class="mb-5">
|
|
|
|
<BuscarEquipo
|
|
|
|
:operador="operador"
|
|
|
|
:equipo="equipo"
|
|
|
|
:updateIsLoading="updateIsLoading"
|
2022-07-05 05:33:43 +00:00
|
|
|
:obtenerMotivos="obtenerMotivos"
|
2022-05-31 04:22:49 +00:00
|
|
|
:updateEquipo="updateEquipo"
|
|
|
|
/>
|
|
|
|
|
2022-07-05 05:33:43 +00:00
|
|
|
<b-tabs>
|
2022-07-07 04:25:06 +00:00
|
|
|
<b-tab-item label="Historial">
|
2022-05-31 04:22:49 +00:00
|
|
|
<TablaPrestamos
|
|
|
|
:isLoadingTable="isLoadingTable"
|
|
|
|
:data="dataPrestamos"
|
|
|
|
:page="pagePrestamos"
|
|
|
|
:onPageChange="onPrestamosPageChange"
|
|
|
|
:total="totalPrestamos"
|
|
|
|
:columnaNumeroCuenta="true"
|
|
|
|
:columnaIdPrestamo="true"
|
|
|
|
:columnaHoraRegreso="true"
|
|
|
|
:columnaCanceladoOperador="true"
|
|
|
|
:columnaCanceladoUsuario="true"
|
|
|
|
:columnaOperadores="true"
|
|
|
|
:filaActivo="true"
|
|
|
|
/>
|
2022-07-07 04:25:06 +00:00
|
|
|
</b-tab-item>
|
2022-05-31 04:22:49 +00:00
|
|
|
|
2022-07-05 05:33:43 +00:00
|
|
|
<!-- <b-tab-item label="Reportes">
|
2022-05-31 04:22:49 +00:00
|
|
|
<TablaReportes
|
|
|
|
:data="dataReportes"
|
|
|
|
:page="pageReportes"
|
|
|
|
:total="totalReportes"
|
|
|
|
:isLoading="isLoadingTable"
|
|
|
|
:onPageChange="onReportesPageChange"
|
|
|
|
/>
|
2022-07-05 05:33:43 +00:00
|
|
|
</b-tab-item> -->
|
2022-05-31 04:22:49 +00:00
|
|
|
|
|
|
|
<b-tab-item label="Motivos">
|
|
|
|
<TablaMotivos
|
|
|
|
:data="dataMotivos"
|
|
|
|
:page="pageMotivos"
|
|
|
|
:total="totalMotivos"
|
|
|
|
:isLoading="isLoadingTable"
|
|
|
|
:onPageChange="onMotivosPageChange"
|
|
|
|
/>
|
|
|
|
</b-tab-item>
|
2022-07-05 05:33:43 +00:00
|
|
|
</b-tabs>
|
2022-05-31 04:22:49 +00:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
|
|
|
import BuscarEquipo from '@/components/operador/BuscarEquipo'
|
|
|
|
import TablaPrestamos from '@/components/operador/TablaPrestamos'
|
|
|
|
import TablaReportes from '@/components/operador/TablaReportes'
|
|
|
|
import TablaMotivos from '@/components/operador/TablaMotivos'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: { TablaPrestamos, BuscarEquipo, TablaReportes, TablaMotivos },
|
2022-07-11 19:23:06 +00:00
|
|
|
props: {
|
|
|
|
operador: { type: Object, required: true },
|
|
|
|
updateIsLoading: { type: Function, required: true },
|
|
|
|
},
|
2022-05-31 04:22:49 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
equipo: {
|
2022-07-05 04:48:43 +00:00
|
|
|
carrito: { modulo: {}, tipoCarrito: {} },
|
2022-07-07 23:20:54 +00:00
|
|
|
programas: [],
|
2022-07-05 04:48:43 +00:00
|
|
|
status: {},
|
2022-07-07 23:20:54 +00:00
|
|
|
tiposEntradas: [],
|
2022-05-31 04:22:49 +00:00
|
|
|
},
|
|
|
|
dataPrestamos: [],
|
|
|
|
pagePrestamos: 1,
|
|
|
|
totalPrestamos: 0,
|
|
|
|
dataReportes: [],
|
|
|
|
pageReportes: 1,
|
|
|
|
totalReportes: 0,
|
|
|
|
dataMotivos: [],
|
|
|
|
pageMotivos: 1,
|
|
|
|
totalMotivos: 0,
|
|
|
|
isLoadingTable: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onPrestamosPageChange(page) {
|
|
|
|
this.pagePrestamos = page
|
|
|
|
this.obtenerPrestamos()
|
|
|
|
},
|
|
|
|
onReportesPageChange(page) {
|
|
|
|
this.pageReportes = page
|
|
|
|
this.obtenerReportes()
|
|
|
|
},
|
|
|
|
onMotivosPageChange(page) {
|
|
|
|
this.pageMotivos = page
|
|
|
|
this.obtenerMotivos()
|
|
|
|
},
|
|
|
|
updateEquipo(valorObject) {
|
|
|
|
this.equipo = valorObject
|
|
|
|
},
|
2022-07-05 04:48:43 +00:00
|
|
|
// obtenerPrestamos() {
|
|
|
|
// this.isLoadingTable = true
|
|
|
|
// axios
|
|
|
|
// .get(
|
|
|
|
// `${process.env.api}/prestamo/historial_equipo?pagina=${this.pagePrestamos}&idEquipo=${this.equipo.idEquipo}`,
|
2022-07-19 16:41:33 +00:00
|
|
|
// this.$getToken.token()
|
2022-07-05 04:48:43 +00:00
|
|
|
// )
|
|
|
|
// .then((res) => {
|
|
|
|
// this.dataPrestamos = res.data.rows
|
|
|
|
// this.totalPrestamos = res.data.count
|
|
|
|
// 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-05 04:48:43 +00:00
|
|
|
// })
|
|
|
|
// },
|
|
|
|
// obtenerReportes() {
|
|
|
|
// this.isLoadingTable = true
|
|
|
|
// axios
|
|
|
|
// .get(
|
|
|
|
// `${process.env.api}/multa/historial_multas_equipo?pagina=${this.pageReportes}&idEquipo=${this.equipo.idEquipo}`,
|
2022-07-19 16:41:33 +00:00
|
|
|
// this.$getToken.token()
|
2022-07-05 04:48:43 +00:00
|
|
|
// )
|
|
|
|
// .then((res) => {
|
|
|
|
// this.dataReportes = res.data.rows
|
|
|
|
// this.totalReportes = res.data.count
|
|
|
|
// 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-05 04:48:43 +00:00
|
|
|
// })
|
|
|
|
// },
|
2022-07-05 05:33:43 +00:00
|
|
|
obtenerMotivos() {
|
|
|
|
this.isLoadingTable = true
|
|
|
|
axios
|
|
|
|
.get(
|
|
|
|
`${process.env.api}/motivo?pagina=${this.pageMotivos}&id_equipo=${this.equipo.id_equipo}`,
|
2022-07-19 16:41:33 +00:00
|
|
|
this.$getToken.token()
|
2022-07-05 05:33:43 +00:00
|
|
|
)
|
|
|
|
.then((res) => {
|
|
|
|
this.dataMotivos = res.data[0]
|
|
|
|
this.totalMotivos = 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-05 05:33:43 +00:00
|
|
|
})
|
|
|
|
},
|
2022-05-31 04:22:49 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|