tabla de multas en el usuario
This commit is contained in:
parent
561bb12bed
commit
0eef64e321
@ -48,6 +48,7 @@
|
|||||||
:page="page"
|
:page="page"
|
||||||
:total="total"
|
:total="total"
|
||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
|
:columnaUsuario="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
field="usuario"
|
field="usuario"
|
||||||
label="Número de cuenta/trabajador"
|
label="Número de cuenta/trabajador"
|
||||||
v-slot="props"
|
v-slot="props"
|
||||||
|
v-if="columnaUsuario"
|
||||||
centered
|
centered
|
||||||
>
|
>
|
||||||
<span>{{ props.row.prestamo.usuario.usuario }}</span>
|
<span>{{ props.row.prestamo.usuario.usuario }}</span>
|
||||||
@ -86,20 +87,12 @@ export default {
|
|||||||
components: { TablaEquiCarritos },
|
components: { TablaEquiCarritos },
|
||||||
props: {
|
props: {
|
||||||
operador: { type: Object, required: true },
|
operador: { type: Object, required: true },
|
||||||
multas: { type: Array, require: true },
|
multas: { type: Array, required: true },
|
||||||
isLoadingTable: { type: Boolean, require: true },
|
page: { type: Number, required: true },
|
||||||
page: {
|
total: { type: Number, required: true },
|
||||||
type: Number,
|
onPageChange: { type: Function, required: true },
|
||||||
required: true,
|
isLoadingTable: { type: Boolean, required: true },
|
||||||
},
|
columnaUsuario: { type: Boolean, required: true },
|
||||||
onPageChange: {
|
|
||||||
type: Function,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
total: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
:updateUsuario="updateUsuario"
|
:updateUsuario="updateUsuario"
|
||||||
:usuario="usuario"
|
:usuario="usuario"
|
||||||
/>
|
/>
|
||||||
|
<b-tabs>
|
||||||
|
<b-tab-item label="Prestamos">
|
||||||
<TablaPrestamo
|
<TablaPrestamo
|
||||||
:isLoadingTable="isLoading"
|
:isLoadingTable="isLoading"
|
||||||
:data="data"
|
:data="data"
|
||||||
:page="page"
|
:page="page"
|
||||||
|
:total="totalP"
|
||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:total="total"
|
|
||||||
:columnaNumeroInventario="true"
|
:columnaNumeroInventario="true"
|
||||||
:columnaTipo="true"
|
:columnaTipo="true"
|
||||||
:columnaEquipo="true"
|
:columnaEquipo="true"
|
||||||
@ -21,6 +22,20 @@
|
|||||||
:columnaHoraRegreso="true"
|
:columnaHoraRegreso="true"
|
||||||
:columnaIdPrestamo="true"
|
:columnaIdPrestamo="true"
|
||||||
/>
|
/>
|
||||||
|
</b-tab-item>
|
||||||
|
|
||||||
|
<b-tab-item label="Multas">
|
||||||
|
<TablaMultas
|
||||||
|
:operador="operador"
|
||||||
|
:multas="multas"
|
||||||
|
:page="page"
|
||||||
|
:total="totalM"
|
||||||
|
:onPageChange="onPageChange"
|
||||||
|
:isLoadingTable="isLoading"
|
||||||
|
:columnaUsuario="false"
|
||||||
|
/>
|
||||||
|
</b-tab-item>
|
||||||
|
</b-tabs>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -28,9 +43,10 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import BuscarUsuario from '@/components/operador/usuarios/BuscarUsuario'
|
import BuscarUsuario from '@/components/operador/usuarios/BuscarUsuario'
|
||||||
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
||||||
|
import TablaMultas from '@/components/operador/usuarios/TablaMultas'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { BuscarUsuario, TablaPrestamo },
|
components: { BuscarUsuario, TablaPrestamo, TablaMultas },
|
||||||
props: {
|
props: {
|
||||||
operador: { type: Object, required: true },
|
operador: { type: Object, required: true },
|
||||||
updateIsLoading: { type: Function, required: true },
|
updateIsLoading: { type: Function, required: true },
|
||||||
@ -38,8 +54,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: [],
|
data: [],
|
||||||
|
multas: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
total: 0,
|
totalP: 0,
|
||||||
|
totalM: 0,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
usuario: { instituciones: [], tipoUsuario: {} },
|
usuario: { instituciones: [], tipoUsuario: {} },
|
||||||
}
|
}
|
||||||
@ -62,7 +80,7 @@ export default {
|
|||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.data = res.data[0]
|
this.data = res.data[0]
|
||||||
this.total = res.data[1]
|
this.totalP = res.data[1]
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -70,10 +88,27 @@ export default {
|
|||||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
obtenerMultas() {
|
||||||
|
this.isLoadingTable = true
|
||||||
|
axios
|
||||||
|
.get(
|
||||||
|
`${process.env.api}/multa/multas-usuario?pagina=${this.page}&id_usuario=${this.usuario.id_usuario}`
|
||||||
|
)
|
||||||
|
.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, err.response.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
usuario() {
|
usuario() {
|
||||||
this.obtenerPrestamos()
|
this.obtenerPrestamos()
|
||||||
|
this.obtenerMultas()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user