login listo
This commit is contained in:
parent
bc9bbf600c
commit
7f651631ad
@ -1,45 +1,41 @@
|
||||
<template>
|
||||
<div
|
||||
class="full-h is-flex is-justify-content-center is-align-items-center my-5"
|
||||
>
|
||||
<form class="box">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">PC Puma</h2>
|
||||
</div>
|
||||
<form class="box">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">PC Puma</h2>
|
||||
</div>
|
||||
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
v-model="usuario"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
v-model="usuario"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
type="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<recaptcha />
|
||||
</b-field>
|
||||
<b-field>
|
||||
<recaptcha />
|
||||
</b-field>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !usuario || !password"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !usuario || !password"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -47,9 +43,7 @@ import jwt_decode from 'jwt-decode'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
props: { updateIsLoading: { type: Function, required: true } },
|
||||
data() {
|
||||
return {
|
||||
error: '',
|
||||
@ -117,10 +111,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.full-h {
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 30rem;
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
<b-field class="column pb-0" :class="columnSize">
|
||||
<b-button
|
||||
type="is-success"
|
||||
@click="buscar()"
|
||||
:disabled="disabled"
|
||||
@click="buscar()"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
@ -16,7 +16,7 @@
|
||||
export default {
|
||||
props: {
|
||||
disabled: { type: Boolean, required: false, default: true },
|
||||
buscar: { type: Function, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
export default {
|
||||
props: {
|
||||
disabled: { type: Boolean, required: true, default: false },
|
||||
crear: { type: Function, required: true },
|
||||
crear: { type: Function, required: true, default: () => {} },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<b-field :label="labelDisabled ? 'Status' : ''">
|
||||
<b-button
|
||||
:type="row.activo || row.mostrar ? 'is-success' : 'is-danger'"
|
||||
:disabled="disabled"
|
||||
:type="row.activo || row.mostrar ? 'is-success' : 'is-danger'"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
@ -22,9 +22,9 @@ export default {
|
||||
props: {
|
||||
disabled: { type: Boolean, required: false, default: false },
|
||||
labelDisabled: { type: Boolean, required: false, default: false },
|
||||
activarDesactivar: { type: Function, required: true },
|
||||
activarDesactivar: { type: Function, required: true, default: () => {} },
|
||||
row: { type: Object, required: true, default: () => ({}) },
|
||||
msjWarning: { type: String, required: true },
|
||||
msjWarning: { type: String, required: true, default: '' },
|
||||
},
|
||||
methods: {
|
||||
llamarActivarDesactivar() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
export default {
|
||||
props: {
|
||||
column: { type: Boolean, required: false, default: false },
|
||||
editar: { type: Function, required: true },
|
||||
editar: { type: Function, required: true, default: () => {} },
|
||||
row: { type: Object, required: false, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ export default {
|
||||
props: {
|
||||
eliminar: { type: Function, required: true, default: () => {} },
|
||||
row: { type: Object, required: true, default: () => ({}) },
|
||||
msjWarning: { type: String, required: true },
|
||||
msjWarning: { type: String, required: true, default: '' },
|
||||
},
|
||||
methods: {
|
||||
llamarEliminar() {
|
||||
|
@ -18,8 +18,8 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
admin: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
|
@ -18,10 +18,10 @@ export default {
|
||||
props: {
|
||||
column: { type: Boolean, required: false, default: false },
|
||||
disabled: { type: Boolean, required: false, default: true },
|
||||
guardar: { type: Function, required: true },
|
||||
guardar: { type: Function, required: true, default: () => {} },
|
||||
row: { type: Object, required: false, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
msjWarning: { type: String, required: true },
|
||||
msjWarning: { type: String, required: true, default: '' },
|
||||
},
|
||||
methods: {
|
||||
llamarGuardar() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Estas segur@ de querer reenviar la contraseña de este operador?',
|
||||
`¿Estas segur@ de querer reenviar la contraseña de este ${campo}?`,
|
||||
updatePassword
|
||||
)
|
||||
"
|
||||
@ -21,8 +21,9 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
operador: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
operador: { type: Object, required: true, default: () => ({}) },
|
||||
campo: { type: String, required: true, default: '' },
|
||||
},
|
||||
methods: {
|
||||
updatePassword() {
|
||||
|
@ -20,35 +20,35 @@
|
||||
/>
|
||||
|
||||
<SelectCarrito
|
||||
:idCarritoPadre="idCarrito"
|
||||
:idInstitucion="
|
||||
operador.institucion
|
||||
? operador.institucion.id_institucion
|
||||
: idInstitucion
|
||||
"
|
||||
:idModulo="idModulo"
|
||||
:idCarritoPadre="idCarrito"
|
||||
@carrito-seleccionado="(nuevoCarrito) => (idCarrito = nuevoCarrito)"
|
||||
/>
|
||||
|
||||
<BotonBuscar
|
||||
:buscar="buscar"
|
||||
:disabled="!idCarrito || idCarrito === carrito.id_carrito"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<InformacionCarrito
|
||||
:operador="operador"
|
||||
:carrito="carrito"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:carrito="carrito"
|
||||
:operador="operador"
|
||||
/>
|
||||
|
||||
<AdminCarrito
|
||||
:operador="operador"
|
||||
:carrito="carrito"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:carrito="carrito"
|
||||
:operador="operador"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -73,25 +73,25 @@ export default {
|
||||
SelectModulo,
|
||||
},
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
carrito: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
updateCarrito: { type: Function, required: true },
|
||||
updateCarrito: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
carrito: { type: Object, required: true, default: () => ({}) },
|
||||
operador: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
carritoParam: null,
|
||||
idCarrito: 0,
|
||||
idInstitucion: 0,
|
||||
idModulo: 0,
|
||||
carritoParam: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
buscar() {
|
||||
this.updateIsLoading(true)
|
||||
this.carritoParam = parseInt(this.$route.params.carrito)
|
||||
if (this.idCarrito != this.carritoParam)
|
||||
this.$router.push(`/carritos/buscar_carrito/${this.idCarrito}`)
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/carrito/carrito?id_carrito=${this.idCarrito}`,
|
||||
|
@ -3,36 +3,36 @@
|
||||
<div class="columns is-align-items-flex-end">
|
||||
<b-field class="column is-4 pb-0 mb-0" label="Número de Inventario">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Número de Inventario"
|
||||
icon="laptop"
|
||||
v-model="numeroInventario"
|
||||
placeholder="Número de Inventario"
|
||||
type="text"
|
||||
@keyup.enter.native="buscar()"
|
||||
v-model="numeroInventario"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonBuscar
|
||||
columnSize="is-4"
|
||||
:buscar="buscar"
|
||||
:disabled="
|
||||
!numeroInventario || numeroInventario === equipo.numero_inventario
|
||||
"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<InformacionEquipo
|
||||
:equipo="equipo"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:equipo="equipo"
|
||||
/>
|
||||
|
||||
<AdminEquipo
|
||||
:operador="operador"
|
||||
:equipo="equipo"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:equipo="equipo"
|
||||
:operador="operador"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -47,10 +47,10 @@ import InformacionEquipo from '@/components/informacion/InformacionEquipo'
|
||||
export default {
|
||||
components: { AdminEquipo, BotonBuscar, InformacionEquipo },
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
equipo: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
updateEquipo: { type: Function, required: true },
|
||||
updateEquipo: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
equipo: { type: Object, required: true, default: () => ({}) },
|
||||
operador: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -60,10 +60,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buscar() {
|
||||
this.updateIsLoading(true)
|
||||
this.numeroInventarioParam = this.$route.params.equipo
|
||||
if (this.numeroInventario != this.numeroInventarioParam)
|
||||
this.$router.push(`/equipos/buscar_equipo/${this.numeroInventario}`)
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/equipo/equipo?id_institucion=${this.operador.institucion.id_institucion}&numero_inventario=${this.numeroInventario}`,
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
<BotonBuscar
|
||||
columnSize="is-4"
|
||||
:buscar="buscar"
|
||||
:disabled="
|
||||
!idInstitucion || idInstitucion === institucion.id_institucion
|
||||
"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
/>
|
||||
|
||||
<InformacionInstitucion
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:admin="admin"
|
||||
:institucion="institucion"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
|
||||
<AdminInstitucionA
|
||||
|
@ -22,24 +22,24 @@
|
||||
|
||||
<BotonBuscar
|
||||
columnSize="is-4"
|
||||
:buscar="buscar"
|
||||
:disabled="!idModulo || idModulo === modulo.id_modulo"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<InformacionModulo
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:admin="admin"
|
||||
:modulo="modulo"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
|
||||
<AdminModulo
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:admin="admin"
|
||||
:modulo="modulo"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,12 +76,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buscar() {
|
||||
this.updateIsLoading(true)
|
||||
this.moduloParam = parseInt(this.$route.params.modulo)
|
||||
if (this.idModulo != this.moduloParam)
|
||||
this.$router.push(
|
||||
`/admin/administrador/modulos/buscar_modulo/${this.idModulo}`
|
||||
)
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/modulo/modulo?id_modulo=${this.idModulo}`,
|
||||
|
@ -31,40 +31,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BotonDesactivar from '@/components/botones/BotonDesactivar'
|
||||
|
||||
export default {
|
||||
components: { BotonDesactivar },
|
||||
props: {
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
carrito: { type: Object, required: true },
|
||||
operador: { type: Object, required: true },
|
||||
},
|
||||
methods: {
|
||||
activarDesactivar() {
|
||||
const data = {
|
||||
id_carrito: this.carrito.id_carrito,
|
||||
activo: !this.carrito.activo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/carrito`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.buscar()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
props: { carrito: { type: Object, required: true } },
|
||||
}
|
||||
</script>
|
||||
|
@ -71,9 +71,9 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
buscar: { type: Function, required: true },
|
||||
equipo: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
equipo: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -82,10 +82,10 @@ import BotonDesactivar from '@/components/botones/BotonDesactivar'
|
||||
export default {
|
||||
components: { BotonDesactivar },
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
institucion: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
institucion: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
methods: {
|
||||
activarDesactivar() {
|
||||
|
@ -33,10 +33,10 @@ import BotonDesactivar from '@/components/botones/BotonDesactivar'
|
||||
export default {
|
||||
components: { BotonDesactivar },
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
modulo: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
modulo: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -1,75 +1,68 @@
|
||||
<template>
|
||||
<div
|
||||
class="full-h is-flex is-justify-content-center is-align-items-center my-5"
|
||||
>
|
||||
<form class="box">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">PC Puma</h2>
|
||||
</div>
|
||||
<form class="box">
|
||||
<div class="has-text-centered">
|
||||
<h2 class="is-size-1">PC Puma</h2>
|
||||
</div>
|
||||
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
v-model="usuario"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
v-model="usuario"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
type="password"
|
||||
password-reveal
|
||||
v-model="password"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
autocomplete="off"
|
||||
type="password"
|
||||
password-reveal
|
||||
v-model="password"
|
||||
@keyup.enter.native="login()"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Institucion" :type="error">
|
||||
<b-select v-model="idInstitucion" expanded>
|
||||
<option value="" disabled>Institucion</option>
|
||||
<SelectInstitucion
|
||||
:activas="true"
|
||||
:column="false"
|
||||
:idInstitucionPadre="idInstitucion"
|
||||
@institucion-seleccionada="
|
||||
(nuevaInstitucion) => (idInstitucion = nuevaInstitucion)
|
||||
"
|
||||
/>
|
||||
|
||||
<option
|
||||
v-for="(ins, i) in instituciones"
|
||||
:key="i"
|
||||
:value="ins.id_institucion"
|
||||
>
|
||||
{{ ins.institucion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
<SelectModulo
|
||||
:activos="true"
|
||||
:column="false"
|
||||
:deshabilitarOptVacia="false"
|
||||
:idInstitucion="idInstitucion"
|
||||
:idModuloPadre="idModulo"
|
||||
@modulo-seleccionado="(nuevoModulo) => (idModulo = nuevoModulo)"
|
||||
/>
|
||||
|
||||
<b-field label="Modulo" :type="error">
|
||||
<b-select v-model="idModulo" expanded>
|
||||
<option value="" disabled>Módulo</option>
|
||||
<b-field class="mt-2">
|
||||
<recaptcha />
|
||||
</b-field>
|
||||
|
||||
<option v-for="(m, i) in modulos" :key="i" :value="m.id_modulo">
|
||||
{{ m.modulo }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<recaptcha />
|
||||
</b-field>
|
||||
|
||||
<b-field class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !usuario || !password || !idModulo"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</b-field>
|
||||
</form>
|
||||
</div>
|
||||
<b-field class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !usuario || !password || !idModulo"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
</b-field>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import SelectInstitucion from '@/components/selects/SelectInstitucion'
|
||||
import SelectModulo from '@/components/selects/SelectModulo'
|
||||
|
||||
export default {
|
||||
components: { SelectInstitucion, SelectModulo },
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
@ -78,10 +71,8 @@ export default {
|
||||
error: '',
|
||||
usuario: '',
|
||||
password: '',
|
||||
idModulo: '',
|
||||
idInstitucion: '',
|
||||
modulos: [],
|
||||
instituciones: [],
|
||||
idModulo: 0,
|
||||
idInstitucion: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -125,36 +116,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
obtenerCatalogoInstitucion() {
|
||||
axios
|
||||
.get(`${process.env.api}/institucion/instituciones-activas`)
|
||||
.then((res) => {
|
||||
this.instituciones = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
obtenerCatalogoModulo() {
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/modulo/modulos-activos?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.modulos = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
password() {
|
||||
@ -163,12 +124,6 @@ export default {
|
||||
usuario() {
|
||||
if (this.error) this.error = ''
|
||||
},
|
||||
idInstitucion() {
|
||||
this.obtenerCatalogoModulo()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoInstitucion()
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$recaptcha.destroy()
|
||||
@ -177,10 +132,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.full-h {
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 30rem;
|
||||
}
|
||||
|
@ -2,45 +2,36 @@
|
||||
<div class="column is-4">
|
||||
<h3 class="is-size-4 mb-4">Administrador</h3>
|
||||
|
||||
<b-field
|
||||
:label="`Motivo de ${carrito.activo ? 'desactivación' : 'activación'}:`"
|
||||
>
|
||||
<b-input
|
||||
icon="list-status"
|
||||
maxlength="200"
|
||||
type="textarea"
|
||||
:disabled="!carrito.id_carrito"
|
||||
v-model="motivo"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonDesactivar
|
||||
:disabled="
|
||||
!carrito.id_carrito || operador.tipoUsuario.id_tipo_usuario === 2
|
||||
"
|
||||
:disabled="!motivo"
|
||||
:activarDesactivar="activarDesactivar"
|
||||
:row="carrito"
|
||||
:msjWarning="`¿Estas segur@ de querer ${
|
||||
carrito.activo ? 'desactivar' : 'activar'
|
||||
} este carrito?`"
|
||||
labelDisabled
|
||||
/>
|
||||
|
||||
<!-- <b-field
|
||||
label="Cambiar nombre del carrito"
|
||||
v-if="carrito.tipoCarrito.id_tipo_carrito"
|
||||
>
|
||||
<b-input
|
||||
icon="list-status"
|
||||
v-model="nuevoNombreCarrito"
|
||||
placeholder="Nuevo nombre del carrito"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonGuardar
|
||||
:disabled="dominio || diasMultaRetraso || tiempoPrestamo ? false : true"
|
||||
:guardar="actualizarDatos"
|
||||
msjWarning="¿Estas segur@ de querer guardar estos cambios?"
|
||||
/> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonDesactivar from '@/components/botones/BotonDesactivar'
|
||||
import BotonGuardar from '@/components/botones/BotonGuardar'
|
||||
|
||||
export default {
|
||||
components: { BotonDesactivar, BotonGuardar },
|
||||
components: { BotonDesactivar },
|
||||
props: {
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
@ -48,43 +39,21 @@ export default {
|
||||
operador: { type: Object, required: true },
|
||||
},
|
||||
data() {
|
||||
return { nuevoNombreCarrito: '' }
|
||||
return { motivo: '' }
|
||||
},
|
||||
methods: {
|
||||
activarDesactivar() {
|
||||
const data = {
|
||||
id_carrito: this.carrito.id_carrito,
|
||||
activo: !this.carrito.activo,
|
||||
motivo: this.motivo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/carrito`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.buscar()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
guradar() {
|
||||
const data = {
|
||||
id_carrito: this.carrito.id_carrito,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
if (this.nuevoNombreCarrito) data.carrito = this.this.nuevoNombreCarrito
|
||||
axios
|
||||
.put(`${process.env.api}/carrito`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.this.nuevoNombreCarrito = ''
|
||||
this.motivo = ''
|
||||
this.buscar()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
|
@ -102,10 +102,10 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
equipo: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
equipo: { type: Object, required: true, default: () => ({}) },
|
||||
operador: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -47,7 +47,7 @@
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="file">
|
||||
<!-- <b-field class="file">
|
||||
<b-upload v-model="logo" expanded accept=".png,.jpeg,.jpg">
|
||||
<a class="button is-primary is-fullwidth">
|
||||
<b-icon icon="upload" />
|
||||
@ -55,24 +55,22 @@
|
||||
<span>{{ logo.name || 'Click para subir el logo' }}</span>
|
||||
</a>
|
||||
</b-upload>
|
||||
</b-field>
|
||||
</b-field> -->
|
||||
|
||||
<BotonGuardar
|
||||
:disabled="
|
||||
dominio ||
|
||||
diasMultaRetraso ||
|
||||
tiempoPrestamo ||
|
||||
tiempoRecoger ||
|
||||
tiempoEntrega ||
|
||||
logo.name
|
||||
? false
|
||||
: true
|
||||
!dominio &&
|
||||
!diasMultaRetraso &&
|
||||
!tiempoPrestamo &&
|
||||
!tiempoRecoger &&
|
||||
!tiempoEntrega &&
|
||||
!logo.name
|
||||
"
|
||||
:guardar="actualizarDatos"
|
||||
msjWarning="¿Estas segur@ de querer guardar estos cambios?"
|
||||
/>
|
||||
|
||||
<BotonFinSemestre :updateIsLoading="updateIsLoading" :admin="admin" />
|
||||
<!-- <BotonFinSemestre :updateIsLoading="updateIsLoading" :admin="admin" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -107,37 +105,45 @@ export default {
|
||||
const data = { id_institucion: this.institucion.id_institucion }
|
||||
|
||||
this.updateIsLoading(true)
|
||||
if (Object.entries(this.logo).length != 0) return this.subirLogo()
|
||||
if (this.dominio) {
|
||||
data.email_institucional = true
|
||||
data.dominio = this.dominio
|
||||
if (Object.entries(this.logo).length != 0) this.subirLogo()
|
||||
if (
|
||||
this.dominio ||
|
||||
this.diasMultaRetraso ||
|
||||
this.tiempoRecoger ||
|
||||
this.tiempoEntrega ||
|
||||
this.tiempoPrestamo
|
||||
) {
|
||||
if (this.dominio) {
|
||||
data.email_institucional = true
|
||||
data.dominio = this.dominio
|
||||
}
|
||||
if (this.diasMultaRetraso)
|
||||
data.dias_multa_retraso = Number(this.diasMultaRetraso)
|
||||
if (this.tiempoRecoger) data.tiempo_recoger = Number(this.tiempoRecoger)
|
||||
if (this.tiempoEntrega) data.tiempo_entrega = Number(this.tiempoEntrega)
|
||||
if (this.tiempoPrestamo)
|
||||
data.tiempo_prestamo = Number(this.tiempoPrestamo)
|
||||
axios
|
||||
.put(`${process.env.api}/institucion`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.dominio = ''
|
||||
this.diasMultaRetraso = ''
|
||||
this.tiempoRecoger = ''
|
||||
this.tiempoEntrega = ''
|
||||
this.tiempoPrestamo = ''
|
||||
this.buscar()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
}
|
||||
if (this.diasMultaRetraso)
|
||||
data.dias_multa_retraso = Number(this.diasMultaRetraso)
|
||||
if (this.tiempoRecoger) data.tiempo_recoger = Number(this.tiempoRecoger)
|
||||
if (this.tiempoEntrega) data.tiempo_entrega = Number(this.tiempoEntrega)
|
||||
if (this.tiempoPrestamo)
|
||||
data.tiempo_prestamo = Number(this.tiempoPrestamo)
|
||||
axios
|
||||
.put(`${process.env.api}/institucion`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.dominio = ''
|
||||
this.diasMultaRetraso = ''
|
||||
this.tiempoRecoger = ''
|
||||
this.tiempoEntrega = ''
|
||||
this.tiempoPrestamo = ''
|
||||
this.buscar()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
subirLogo() {
|
||||
const formData = new FormData()
|
||||
|
@ -50,7 +50,7 @@
|
||||
</b-field>
|
||||
|
||||
<BotonGuardar
|
||||
:disabled="responsable || correo || telefono || ubicacion ? false : true"
|
||||
:disabled="!responsable && !correo && !telefono && !ubicacion"
|
||||
:guardar="actualizarDatos"
|
||||
msjWarning="¿Estas segur@ de querer guardar estos cambios?"
|
||||
/>
|
||||
@ -64,10 +64,10 @@ import BotonGuardar from '@/components/botones/BotonGuardar'
|
||||
export default {
|
||||
components: { BotonGuardar },
|
||||
props: {
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
admin: { type: Object, required: true },
|
||||
institucion: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
institucion: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -13,7 +13,7 @@
|
||||
</b-field>
|
||||
|
||||
<BotonGuardar
|
||||
:disabled="nuevoNombreModulo ? false : true"
|
||||
:disabled="!nuevoNombreModulo"
|
||||
:guardar="actualizarDatos"
|
||||
msjWarning="¿Estas segur@ de querer cambiar el nombre al módulo?"
|
||||
/>
|
||||
@ -27,15 +27,13 @@ import BotonGuardar from '@/components/botones/BotonGuardar'
|
||||
export default {
|
||||
components: { BotonGuardar },
|
||||
props: {
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
admin: { type: Object, required: true },
|
||||
modulo: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true, default: () => {} },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
modulo: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nuevoNombreModulo: '',
|
||||
}
|
||||
return { nuevoNombreModulo: '' }
|
||||
},
|
||||
methods: {
|
||||
actualizarDatos() {
|
||||
|
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Institución" :class="columnSize">
|
||||
<b-field
|
||||
class="mb-0 pb-0"
|
||||
label="Institución"
|
||||
:class="column ? `column ${columnSize}` : ''"
|
||||
>
|
||||
<b-select
|
||||
icon="home"
|
||||
:loading="isLoadingSelect"
|
||||
@ -27,6 +31,8 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
activas: { typeof: Boolean, required: false, default: false },
|
||||
column: { type: Boolean, required: false, default: true },
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
idInstitucionPadre: { type: Number, required: true, default: 0 },
|
||||
@ -53,6 +59,20 @@ export default {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
obtenerInstitucionesActivas() {
|
||||
this.isLoadingSelect = true
|
||||
this.instituciones = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion/instituciones-activas`)
|
||||
.then((res) => {
|
||||
this.instituciones = res.data
|
||||
this.$emit('catalogo-instituciones', this.instituciones)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion() {
|
||||
@ -64,7 +84,8 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.idInstitucionPadre) this.idInstitucion = this.idInstitucionPadre
|
||||
this.obtenerInstituciones()
|
||||
if (this.activas) this.obtenerInstitucionesActivas()
|
||||
else this.obtenerInstituciones()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Módulo" :class="columnSize">
|
||||
<b-field
|
||||
class="mb-0 pb-0"
|
||||
label="Módulo"
|
||||
:class="column ? `column ${columnSize}` : ''"
|
||||
>
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
@ -27,6 +31,8 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
activos: { typeof: Boolean, required: false, default: false },
|
||||
column: { type: Boolean, required: false, default: true },
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
idModuloPadre: { type: Number, required: true, default: 0 },
|
||||
@ -57,10 +63,32 @@ export default {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
obtenerModulosActivos() {
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/modulo/modulos-activos?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.modulos = res.data
|
||||
this.$emit('catalogo-modulos', this.modulos)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion(nuevoIdInstitucion) {
|
||||
if (nuevoIdInstitucion) this.obtenerModulos()
|
||||
if (nuevoIdInstitucion) {
|
||||
if (this.activos) this.obtenerModulosActivos()
|
||||
else this.obtenerModulos()
|
||||
}
|
||||
},
|
||||
idModulo(moduloSeleccionado) {
|
||||
this.$emit('modulo-seleccionado', moduloSeleccionado)
|
||||
@ -71,7 +99,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.idModuloPadre) this.idModulo = this.idModuloPadre
|
||||
if (this.idInstitucion) this.obtenerModulos()
|
||||
if (this.idInstitucion) {
|
||||
if (this.activos) this.obtenerModulosActivos()
|
||||
else this.obtenerModulos()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
<TablaBuscadorAdmin
|
||||
:actualizarTabla="actualizarTabla"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:updateActualizarTabla="updateActualizarTabla"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -18,18 +18,13 @@ import CrearAdmin from '@/components/crear/CrearAdmin'
|
||||
import TablaBuscadorAdmin from '@/components/tablaBuscador/TablaBuscadorAdmin'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CrearAdmin,
|
||||
TablaBuscadorAdmin,
|
||||
},
|
||||
components: { CrearAdmin, TablaBuscadorAdmin },
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
admin: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actualizarTabla: false,
|
||||
}
|
||||
return { actualizarTabla: false }
|
||||
},
|
||||
methods: {
|
||||
updateActualizarTabla(valorBooleano) {
|
||||
|
@ -35,6 +35,7 @@
|
||||
:isLoadingTable="isLoadingTable"
|
||||
:obtenerAdmins="obtenerAdmins"
|
||||
:onPageChange="onPageChange"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:total="total"
|
||||
:page="page"
|
||||
columnaActivo
|
||||
@ -53,8 +54,13 @@ import TablaAdmins from '@/components/tablas/TablaAdmins'
|
||||
export default {
|
||||
components: { BotonBuscar, SelectInstitucion, TablaAdmins },
|
||||
props: {
|
||||
actualizarTabla: { type: Boolean, required: true },
|
||||
updateActualizarTabla: { type: Function, required: true },
|
||||
actualizarTabla: { type: Boolean, required: true, default: false },
|
||||
updateActualizarTabla: {
|
||||
type: Function,
|
||||
required: true,
|
||||
default: () => {},
|
||||
},
|
||||
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -65,6 +65,7 @@
|
||||
<BotonUpdatePassword
|
||||
:operador="props.row"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
campo="admin"
|
||||
/>
|
||||
</b-table-column>
|
||||
</b-table>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<Header />
|
||||
|
||||
<Menu />
|
||||
<div class="full-h container px-4">
|
||||
<div class="container full-h px-4">
|
||||
<nuxt />
|
||||
</div>
|
||||
|
||||
@ -25,7 +25,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.full-h {
|
||||
min-height: 75vh;
|
||||
}
|
||||
|
@ -2,7 +2,11 @@
|
||||
<div>
|
||||
<Header />
|
||||
|
||||
<nuxt />
|
||||
<div
|
||||
class="container full-h is-flex is-justify-content-center is-align-items-center my-5"
|
||||
>
|
||||
<nuxt />
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
@ -20,4 +24,8 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.full-h {
|
||||
min-height: 75vh;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section class="container">
|
||||
<section>
|
||||
<Login :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
@ -22,8 +22,14 @@ export default {
|
||||
},
|
||||
created() {
|
||||
const token = this.$getToken.tokenStr()
|
||||
const operador = token ? jwt_decode(token) : null
|
||||
let operador
|
||||
|
||||
try {
|
||||
if (token) operador = jwt_decode(token)
|
||||
} catch (err) {
|
||||
operador = null
|
||||
console.log(err)
|
||||
}
|
||||
if (
|
||||
token &&
|
||||
operador &&
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section class="container">
|
||||
<section>
|
||||
<Login :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
@ -22,8 +22,14 @@ export default {
|
||||
},
|
||||
created() {
|
||||
const token = this.$getToken.tokenStr()
|
||||
const operador = token ? jwt_decode(token) : null
|
||||
let operador
|
||||
|
||||
try {
|
||||
if (token) operador = jwt_decode(token)
|
||||
} catch (err) {
|
||||
operador = null
|
||||
console.log(err)
|
||||
}
|
||||
if (
|
||||
token &&
|
||||
operador &&
|
||||
|
Loading…
Reference in New Issue
Block a user