falta probar subir logo y desactivar cuentas
This commit is contained in:
parent
46e4d8e4b8
commit
6d35ea4fe3
@ -8,11 +8,21 @@
|
||||
/>
|
||||
|
||||
<TablaAdmins
|
||||
:admins="admins"
|
||||
:admins="operadores"
|
||||
:isLoadingTable="isLoadingTable"
|
||||
:onPageChange="onPageChange"
|
||||
:total="total"
|
||||
:page="page"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 2"
|
||||
/>
|
||||
|
||||
<TablaOperadores
|
||||
:operadores="operadores"
|
||||
:isLoadingTable="isLoadingTable"
|
||||
:onPageChange="onPageChange"
|
||||
:total="total"
|
||||
:page="page"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -21,16 +31,17 @@
|
||||
import axios from 'axios'
|
||||
import BuscarInstitucion from '@/components/buscar/BuscarInstitucion'
|
||||
import TablaAdmins from '@/components/tablas/TablaAdmins'
|
||||
import TablaOperadores from '@/components/tablas/TablaOperadores'
|
||||
|
||||
export default {
|
||||
components: { BuscarInstitucion, TablaAdmins },
|
||||
components: { BuscarInstitucion, TablaAdmins, TablaOperadores },
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admins: [],
|
||||
operadores: [],
|
||||
isLoadingTable: false,
|
||||
page: 1,
|
||||
total: 0,
|
||||
@ -39,7 +50,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerAdmins() {
|
||||
obtenerOperadores(idTipoUsuario) {
|
||||
this.isLoadingTable = true
|
||||
if (this.institucion.id_institucion != this.lastSearch.idInstitucion) {
|
||||
this.page = 1
|
||||
@ -47,11 +58,11 @@ export default {
|
||||
}
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/operador/operadores?pagina=${this.page}&id_tipo_usuario=3&id_institucion=${this.institucion.id_institucion}`,
|
||||
`${process.env.api}/operador/operadores?pagina=${this.page}&id_tipo_usuario=${idTipoUsuario}&id_institucion=${this.institucion.id_institucion}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.admins = res.data[0]
|
||||
this.operadores = res.data[0]
|
||||
this.total = res.data[1]
|
||||
this.isLoadingTable = false
|
||||
})
|
||||
@ -62,7 +73,9 @@ export default {
|
||||
},
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerAdmins()
|
||||
if (this.admin.tipoUsuario.id_tipo_usuario === 3)
|
||||
this.obtenerOperadores(4)
|
||||
else this.obtenerOperadores(3)
|
||||
},
|
||||
updateInstitucion(institucion) {
|
||||
this.institucion = institucion
|
||||
@ -70,9 +83,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
institucion() {
|
||||
if (this.institucion.id_institucion) this.obtenerAdmins()
|
||||
if (this.institucion.id_institucion) {
|
||||
if (this.admin.tipoUsuario.id_tipo_usuario === 3)
|
||||
this.obtenerOperadores(4)
|
||||
else this.obtenerOperadores(3)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
||||
|
@ -131,7 +131,7 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
|
||||
export default {
|
||||
components: { TablaPrestamo },
|
||||
|
@ -42,7 +42,7 @@
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BuscarEquipo from '@/components/buscar/BuscarEquipo'
|
||||
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
import TablaMotivos from '@/components/operador/TablaMotivos'
|
||||
|
||||
export default {
|
||||
|
@ -138,7 +138,7 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
|
||||
export default {
|
||||
components: { TablaPrestamo },
|
||||
|
@ -1,422 +0,0 @@
|
||||
<template>
|
||||
<b-table
|
||||
:data="data"
|
||||
:total="total"
|
||||
:current-page="page"
|
||||
:per-page="25"
|
||||
:loading="isLoadingTable"
|
||||
:row-class="(row, index) => pintarFila(row)"
|
||||
@page-change="onPageChange"
|
||||
class="mb-6"
|
||||
hoverable
|
||||
striped
|
||||
paginated
|
||||
backend-pagination
|
||||
>
|
||||
<b-table-column
|
||||
v-if="columnaIdPrestamo"
|
||||
field="id_prestamo"
|
||||
label="Id de Préstamo"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
{{ props.row.id_prestamo }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="fecha_inicio" label="Fecha" v-slot="props" centered>
|
||||
<span>
|
||||
{{ fechaHora(props.row.fecha_inicio) }}
|
||||
</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="numeroCuenta"
|
||||
label="Número de Cuenta/Trabajador"
|
||||
v-slot="props"
|
||||
v-if="columnaNumeroCuenta"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.usuario.usuario }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="nombre"
|
||||
label="Nombre"
|
||||
v-slot="props"
|
||||
v-if="columnaNombre"
|
||||
centered
|
||||
>
|
||||
<span> {{ props.row.usuario.nombre }} </span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="carrera"
|
||||
label="Carrera"
|
||||
v-slot="props"
|
||||
v-if="columnaCarrera"
|
||||
centered
|
||||
>
|
||||
<span v-for="(i, index) in props.row.usuario.instituciones" :key="index">
|
||||
{{ i.institucionCarrera.carrera.carrera }}
|
||||
</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="operadorEntrega"
|
||||
label="Operador Entrega"
|
||||
v-slot="props"
|
||||
v-if="columnaOperadores"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.operadorEntrega">
|
||||
{{ props.row.operadorEntrega.operador }}
|
||||
</span>
|
||||
|
||||
<span v-else>-</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="operadorRegreso"
|
||||
label="Operador Regreso"
|
||||
v-slot="props"
|
||||
v-if="columnaOperadores"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.OperadorRegreso">
|
||||
{{ props.row.OperadorRegreso.operador }}
|
||||
</span>
|
||||
|
||||
<span v-else>-</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="modulo"
|
||||
label="Módulo"
|
||||
v-slot="props"
|
||||
v-if="columnaModulo"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.equipo.carrito.modulo.modulo }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="carrito"
|
||||
label="Carrito"
|
||||
v-slot="props"
|
||||
v-if="columnaCarrito"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.equipo.carrito.carrito }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="equipo"
|
||||
label="Equipo"
|
||||
v-slot="props"
|
||||
v-if="columnaEquipo"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.equipo.equipo }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="numero_inventario"
|
||||
label="Número de Inventario"
|
||||
v-slot="props"
|
||||
v-if="columnaNumeroInventario"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.equipo.numero_inventario }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="tipo_carrito"
|
||||
label="Tipo"
|
||||
v-slot="props"
|
||||
v-if="columnaTipo"
|
||||
centered
|
||||
>
|
||||
<span>{{ props.row.equipo.carrito.tipoCarrito.tipo_carrito }}</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="hora_inicio"
|
||||
label="Hora Inicio"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.hora_inicio">{{
|
||||
hora(props.row.hora_inicio)
|
||||
}}</span>
|
||||
|
||||
<span v-else>-</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="hora_fin"
|
||||
label="Hora Fin"
|
||||
v-slot="props"
|
||||
v-if="columnaHoraFin"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.hora_fin">
|
||||
{{ hora(props.row.hora_fin) }}
|
||||
</span>
|
||||
|
||||
<span v-else>-</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="fecha_entrega"
|
||||
label="Fecha Regreso"
|
||||
v-slot="props"
|
||||
v-if="columnaHoraRegreso"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.fecha_entrega">
|
||||
{{ fechaHora(props.row.fecha_entrega) }}
|
||||
</span>
|
||||
|
||||
<span v-else>-</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="enUso"
|
||||
label="En Uso"
|
||||
v-slot="props"
|
||||
v-if="columnaEnUso"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.equipo.status.id_status === 3">
|
||||
<b-icon icon="check" class="tag is-success" />
|
||||
</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cancelar"
|
||||
label="Cancelar"
|
||||
v-slot="props"
|
||||
v-if="columnaBotonCancelar"
|
||||
centered
|
||||
>
|
||||
<ColumnaCancelarPrestamo
|
||||
:operador="operador"
|
||||
:prestamo="props.row"
|
||||
:updateIsLoadingPage="updateIsLoadingPage"
|
||||
/>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cancelado_operador"
|
||||
label="Cancelación Operador"
|
||||
v-slot="props"
|
||||
v-if="columnaCanceladoOperador"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.cancelado_operador">
|
||||
<b-icon icon="check" class="tag is-danger" />
|
||||
</span>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="cancelado_usuario"
|
||||
label="Cancelación Usuario"
|
||||
v-slot="props"
|
||||
v-if="columnaCanceladoUsuario"
|
||||
centered
|
||||
>
|
||||
<span v-if="props.row.cancelado_usuario">
|
||||
<b-icon icon="check" class="tag is-danger" />
|
||||
</span>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import ColumnaCancelarPrestamo from '@/components/operador/ColumnaCancelarPrestamo'
|
||||
|
||||
export default {
|
||||
components: { ColumnaCancelarPrestamo },
|
||||
props: {
|
||||
operador: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => ({}),
|
||||
},
|
||||
isLoadingTable: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
onPageChange: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
columnaNumeroCuenta: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaNombre: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaCarrera: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaOperadores: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaNumeroInventario: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaTipo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaCarrito: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaEquipo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaModulo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaHoraRegreso: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaHoraFin: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaIdPrestamo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaEnUso: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaBotonCancelar: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaCanceladoOperador: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
columnaCanceladoUsuario: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
filaRetraso: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
filaActivo: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
updateIsLoadingPage: {
|
||||
type: Function,
|
||||
required: false,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
hora(date) {
|
||||
const fecha = moment(date)
|
||||
|
||||
return fecha.isValid() ? fecha.format('HH:mm') : ''
|
||||
},
|
||||
fechaHora(date) {
|
||||
const fecha = moment(date)
|
||||
|
||||
return fecha.isValid() ? fecha.format('YYYY-MM-DD HH:mm') : ''
|
||||
},
|
||||
pintarFila(row) {
|
||||
if (this.filaRetraso) return this.retraso(row)
|
||||
else if (this.filaActivo) return this.activo(row)
|
||||
return ''
|
||||
},
|
||||
retraso(row) {
|
||||
const now = moment()
|
||||
const horaFin = moment(row.horaFin)
|
||||
const quinceMin = moment(row.horaFin).add(15, 'm')
|
||||
|
||||
if (now > horaFin) {
|
||||
if (now < quinceMin) return 'posible-multa'
|
||||
return 'retraso'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
activo(row) {
|
||||
if (row.activo) return 'activo'
|
||||
return ''
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.retraso {
|
||||
background: #ff7373 !important;
|
||||
}
|
||||
|
||||
.retraso:hover {
|
||||
background: #e06464 !important;
|
||||
}
|
||||
|
||||
.posible-multa {
|
||||
background: #ffe08a !important;
|
||||
}
|
||||
|
||||
.posible-multa:hover {
|
||||
background: #fbdb7d !important;
|
||||
}
|
||||
|
||||
.activo {
|
||||
background-color: #3fc36d !important;
|
||||
}
|
||||
|
||||
.activo:hover {
|
||||
background-color: #35a058 !important;
|
||||
}
|
||||
</style>
|
@ -42,7 +42,7 @@
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BuscarUsuario from '@/components/operador/usuarios/BuscarUsuario'
|
||||
import TablaPrestamo from '@/components/operador/TablaPrestamo'
|
||||
import TablaPrestamo from '@/components/tablas/TablaPrestamos'
|
||||
import TablaMultas from '@/components/operador/usuarios/TablaMultas'
|
||||
|
||||
export default {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<b-table
|
||||
class="mb-6"
|
||||
:current-page="page"
|
||||
:data="data"
|
||||
:data="operadores"
|
||||
:loading="isLoadingTable"
|
||||
:per-page="25"
|
||||
:total="total"
|
||||
@ -12,6 +12,17 @@
|
||||
paginated
|
||||
striped
|
||||
>
|
||||
<b-table-column field="operador" label="Operador" v-slot="props" centered>
|
||||
<p>{{ props.row.operador }}</p>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="operador" label="Nombre" v-slot="props" centered>
|
||||
<p>{{ props.row.nombre }}</p>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="operador" label="Correo" v-slot="props" centered>
|
||||
<p>{{ props.row.correo }}</p>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
</template>
|
||||
|
||||
@ -19,7 +30,7 @@
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
data: { type: Array, required: true, default: () => [] },
|
||||
operadores: { type: Array, required: true, default: () => [] },
|
||||
isLoadingTable: { type: Boolean, required: true, default: false },
|
||||
onPageChange: { type: Function, required: true, default: () => {} },
|
||||
total: { type: Number, required: true, default: 0 },
|
||||
|
Loading…
Reference in New Issue
Block a user