listo tabs usuario
This commit is contained in:
parent
e319e58b83
commit
ceda60583f
@ -95,7 +95,7 @@
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonDesactivar from '@/components/operador/BotonDesactivar'
|
||||
import MultaModalAdmin from '@/components/operador/usuarios/MultaModalAdmin'
|
||||
import MultaModalAdmin from '@/components/operador/MultaModalAdmin'
|
||||
|
||||
export default {
|
||||
components: { BotonDesactivar, MultaModalAdmin },
|
@ -40,8 +40,8 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import AdminUsuario from '@/components/operador/usuarios/AdminUsuario'
|
||||
import InfoUsuario from '@/components/operador/usuarios/InfoUsuario'
|
||||
import AdminUsuario from '@/components/admin/AdminUsuario'
|
||||
import InfoUsuario from '@/components/informacion/InfoUsuario'
|
||||
|
||||
export default {
|
||||
components: { AdminUsuario, InfoUsuario },
|
@ -8,7 +8,7 @@
|
||||
/>
|
||||
|
||||
<b-tabs>
|
||||
<TabPrestamo :equipo="equipo" />
|
||||
<TabPrestamosEquipo :equipo="equipo" />
|
||||
|
||||
<TabMotivos :equipo="equipo" />
|
||||
</b-tabs>
|
||||
@ -18,13 +18,13 @@
|
||||
<script>
|
||||
import BuscarEquipo from '@/components/buscar/BuscarEquipo'
|
||||
import TabMotivos from '@/components/operador/TabMotivos'
|
||||
import TabPrestamo from '@/components/operador/TabPrestamo'
|
||||
import TabPrestamosEquipo from '@/components/operador/TabPrestamosEquipo'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BuscarEquipo,
|
||||
TabMotivos,
|
||||
TabPrestamo,
|
||||
TabPrestamosEquipo,
|
||||
},
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
|
60
components/operador/TabMultas.vue
Normal file
60
components/operador/TabMultas.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<b-tab-item label="Incidencias">
|
||||
<TablaMultas
|
||||
:multas="multas"
|
||||
:page="page"
|
||||
:total="total"
|
||||
:isLoadingTable="isLoadingTable"
|
||||
:onPageChange="onPageChange"
|
||||
/>
|
||||
</b-tab-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaMultas from '@/components/tablas/TablaMultas'
|
||||
|
||||
export default {
|
||||
components: { TablaMultas },
|
||||
props: {
|
||||
usuario: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
multas: [],
|
||||
page: 1,
|
||||
total: 0,
|
||||
isLoadingTable: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerMultas()
|
||||
},
|
||||
obtenerMultas() {
|
||||
this.isLoadingTable = true
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/multa/multas-usuario?pagina=${this.page}&id_usuario=${this.usuario.id_usuario}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.multas = res.data[0]
|
||||
this.total = res.data[1]
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
usuario() {
|
||||
this.obtenerMultas()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
71
components/operador/TabPrestamosUsuario.vue
Normal file
71
components/operador/TabPrestamosUsuario.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<b-tab-item label="Historial">
|
||||
<TablaPrestamo
|
||||
:prestamos="prestamos"
|
||||
:isLoadingTable="isLoadingTable"
|
||||
:page="page"
|
||||
:total="total"
|
||||
:onPageChange="onPageChange"
|
||||
columnaNumeroInventario
|
||||
columnaTipo
|
||||
columnaEquipo
|
||||
columnaCarrito
|
||||
columnaModulo
|
||||
columnaHoraRegreso
|
||||
columnaIdPrestamo
|
||||
columnaOperadores
|
||||
columnaCanceladoUsuario
|
||||
columnaCanceladoOperador
|
||||
filaActivo
|
||||
/>
|
||||
</b-tab-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
|
||||
export default {
|
||||
components: { TablaPrestamo },
|
||||
props: {
|
||||
usuario: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
prestamos: [],
|
||||
page: 1,
|
||||
total: 0,
|
||||
isLoadingTable: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerPrestamos()
|
||||
},
|
||||
obtenerPrestamos() {
|
||||
this.isLoadingTable = true
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/prestamo/historial-usuario?pagina=${this.page}&id_usuario=${this.usuario.id_usuario}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.prestamos = res.data[0]
|
||||
this.total = res.data[1]
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
usuario() {
|
||||
this.obtenerPrestamos()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
40
components/operador/Usuario.vue
Normal file
40
components/operador/Usuario.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<section class="mb-5">
|
||||
<BuscarUsuario
|
||||
:operador="operador"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:updateUsuario="updateUsuario"
|
||||
:usuario="usuario"
|
||||
/>
|
||||
|
||||
<b-tabs>
|
||||
<TabPrestamosUsuario :usuario="usuario" />
|
||||
|
||||
<TabMultas :usuario="usuario" />
|
||||
</b-tabs>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BuscarUsuario from '@/components/buscar/BuscarUsuario'
|
||||
import TabPrestamosUsuario from '@/components/operador/TabPrestamosUsuario'
|
||||
import TabMultas from '@/components/operador/TabMultas'
|
||||
|
||||
export default {
|
||||
components: { BuscarUsuario, TabPrestamosUsuario, TabMultas },
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
usuario: { instituciones: [], tipoUsuario: {} },
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateUsuario(valorObject) {
|
||||
this.usuario = valorObject
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,124 +0,0 @@
|
||||
<template>
|
||||
<section class="mb-5">
|
||||
<BuscarUsuario
|
||||
:operador="operador"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:updateUsuario="updateUsuario"
|
||||
:usuario="usuario"
|
||||
/>
|
||||
<b-tabs>
|
||||
<b-tab-item label="Prestamos">
|
||||
<TablaPrestamo
|
||||
:isLoadingTable="isLoading"
|
||||
:data="data"
|
||||
:page="page"
|
||||
:total="totalP"
|
||||
:onPageChange="onPageChange"
|
||||
:columnaNumeroInventario="true"
|
||||
:columnaTipo="true"
|
||||
:columnaEquipo="true"
|
||||
:columnaCarrito="true"
|
||||
:columnaModulo="true"
|
||||
:columnaHoraRegreso="true"
|
||||
:columnaIdPrestamo="true"
|
||||
/>
|
||||
</b-tab-item>
|
||||
|
||||
<b-tab-item label="Incidencias">
|
||||
<TablaMultas
|
||||
:operador="operador"
|
||||
:multas="multas"
|
||||
:page="page"
|
||||
:total="totalM"
|
||||
:onPageChange="onPageChange"
|
||||
:isLoadingTable="isLoading"
|
||||
:columnaUsuario="false"
|
||||
/>
|
||||
</b-tab-item>
|
||||
</b-tabs>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BuscarUsuario from '@/components/operador/usuarios/BuscarUsuario'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
import TablaMultas from '@/components/tablas/TablaMultas'
|
||||
|
||||
export default {
|
||||
components: { BuscarUsuario, TablaPrestamo, TablaMultas },
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
multas: [],
|
||||
page: 1,
|
||||
totalP: 0,
|
||||
totalM: 0,
|
||||
isLoading: false,
|
||||
usuario: { instituciones: [], tipoUsuario: {} },
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateUsuario(valorObject) {
|
||||
this.usuario = valorObject
|
||||
},
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerPrestamos()
|
||||
},
|
||||
obtenerPrestamos() {
|
||||
this.isLoading = true
|
||||
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/prestamo/historial-usuario?pagina=${this.page}&id_usuario=${this.usuario.id_usuario}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.data = res.data[0]
|
||||
this.totalP = res.data[1]
|
||||
this.isLoading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
obtenerMultas() {
|
||||
this.isLoadingTable = true
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/multa/multas-usuario?pagina=${this.page}&id_usuario=${this.usuario.id_usuario}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then(async (res) => {
|
||||
this.multas = res.data[0]
|
||||
this.totalM = res.data[1]
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingTable = false
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
usuario() {
|
||||
this.obtenerPrestamos()
|
||||
this.obtenerMultas()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<Title title="Buscar Usuario" :operador="operador" />
|
||||
<Title title="Buscar usuario" :operador="operador" />
|
||||
|
||||
<Usuario :operador="operador" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<script>
|
||||
import jwt_decode from 'jwt-decode'
|
||||
import Title from '@/components/layouts/Title'
|
||||
import Usuario from '@/components/operador/usuarios/Usuario'
|
||||
import Usuario from '@/components/operador/Usuario'
|
||||
|
||||
export default {
|
||||
components: { Title, Usuario },
|
||||
|
Loading…
Reference in New Issue
Block a user