Merge branch 'dev' of https://repositorio.acatlan.unam.mx/CIDWA/pcpuma_unam_operador into saavedra
This commit is contained in:
commit
6ab72d0a07
@ -63,28 +63,72 @@
|
||||
<b-input
|
||||
type="text"
|
||||
@keyup.enter.native="actualizarDatos()"
|
||||
:placeholder="institucion.ubicacion"
|
||||
:placeholder="institucion.dominio"
|
||||
:disabled="!institucion.id_institucion"
|
||||
v-model="dominio"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
label="Días de multa por retraso"
|
||||
v-show="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="actualizarDatos()"
|
||||
:placeholder="institucion.dias_multa_retraso"
|
||||
:disabled="!institucion.id_institucion"
|
||||
v-model="dias_multa_retraso"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
label="Tiempo para recoger equipo"
|
||||
v-show="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="actualizarDatos()"
|
||||
:placeholder="institucion.tiempo_recoger"
|
||||
:disabled="!institucion.id_institucion"
|
||||
v-model="tiempo_recoger"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
label="Tiempo para entregar equipo"
|
||||
v-show="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="actualizarDatos()"
|
||||
:placeholder="institucion.tiempo_entrega"
|
||||
:disabled="!institucion.id_institucion"
|
||||
v-model="tiempo_entrega"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<b-button
|
||||
type="is-info"
|
||||
:disabled="!responsable && !correo && !telefono && !ubicacion"
|
||||
:disabled="
|
||||
responsable ||
|
||||
correo ||
|
||||
telefono ||
|
||||
ubicacion ||
|
||||
dominio ||
|
||||
dias_multa_retraso ||
|
||||
tiempo_recoger ||
|
||||
tiempo_entrega
|
||||
? false
|
||||
: true
|
||||
"
|
||||
@click="actualizarDatos()"
|
||||
expanded
|
||||
>
|
||||
Guardar
|
||||
</b-button>
|
||||
</b-field>
|
||||
|
||||
<b-field v-show="admin.tipoUsuario.id_tipo_usuario === 2">
|
||||
<b-button type="is-link" @click="activarDesactivar()" expanded>
|
||||
Activar/Desactivar
|
||||
</b-button>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -107,29 +151,12 @@ export default {
|
||||
telefono: '',
|
||||
ubicacion: '',
|
||||
dominio: '',
|
||||
dias_multa_retraso: '',
|
||||
tiempo_recoger: '',
|
||||
tiempo_entrega: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activarDesactivar() {
|
||||
const data = {
|
||||
id_institucion: this.institucion.id_institucion,
|
||||
activo: !this.institucion.activo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
console.log(data)
|
||||
axios
|
||||
.put(`${process.env.api}/institucion`, data)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.buscar()
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
actualizarDatos() {
|
||||
const data = { id_institucion: this.institucion.id_institucion }
|
||||
|
||||
@ -138,20 +165,25 @@ export default {
|
||||
if (this.responsable) data.responsable = this.responsable
|
||||
if (this.telefono) data.telefono = this.telefono
|
||||
if (this.ubicacion) data.ubicacion = this.ubicacion
|
||||
// if (this.dominio) {
|
||||
// data.email_institucional = true
|
||||
// data.dominio = this.dominio
|
||||
// } else if ((!this.dominio, this.admin.institucion.id_institucion === 3)) {
|
||||
// data.email_institucional = false
|
||||
// data.dominio = this.dominio
|
||||
// }
|
||||
if (this.dominio) {
|
||||
data.email_institucional = true
|
||||
data.dominio = this.dominio
|
||||
}
|
||||
if (this.dias_multa_retraso) this.data.dias_multa_retraso = ''
|
||||
if (this.tiempo_recoger) this.data.tiempo_recoger = ''
|
||||
if (this.tiempo_entrega) this.data.tiempo_entrega = ''
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/institucion`, data)
|
||||
.then((res) => {
|
||||
if (this.correo) this.correo = ''
|
||||
if (this.responsable) this.responsable = ''
|
||||
if (this.telefono) this.telefono = ''
|
||||
if (this.dominio) this.dominio = ''
|
||||
if (this.ubicacion) this.ubicacion = ''
|
||||
if (this.dias_multa_retraso) this.dias_multa_retraso = ''
|
||||
if (this.tiempo_recoger) this.tiempo_recoger = ''
|
||||
if (this.tiempo_entrega) this.tiempo_entrega = ''
|
||||
this.updateIsLoading(false)
|
||||
this.buscar()
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
|
@ -5,7 +5,9 @@
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<InstitucionSelect
|
||||
:idInstitucion="idInstitucion"
|
||||
:idInstitucion="
|
||||
typeof idInstitucion === 'undefined' ? 0 : idInstitucion
|
||||
"
|
||||
:updateIdInstitucion="updateIdInstitucion"
|
||||
/>
|
||||
|
||||
|
@ -30,17 +30,26 @@
|
||||
<p class="input">{{ institucion.dominio || '' }}</p>
|
||||
</b-field>
|
||||
|
||||
<!-- <b-field label="Días de multa por retraso" v-if="">
|
||||
<b-field
|
||||
label="Días de multa por retraso"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<p class="input">{{ institucion.dias_multa_retraso }}</p>
|
||||
</b-field> -->
|
||||
</b-field>
|
||||
|
||||
<!-- <b-field label="Tiempo para recoger equipo" v-if="">
|
||||
<b-field
|
||||
label="Tiempo para recoger equipo"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<p class="input">{{ institucion.tiempo_recoger }}</p>
|
||||
</b-field> -->
|
||||
</b-field>
|
||||
|
||||
<!-- <b-field label="Tiempo para entregar equipo" v-if="">
|
||||
<b-field
|
||||
label="Tiempo para entregar equipo"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
>
|
||||
<p class="input">{{ institucion.tiempo_entrega }}</p>
|
||||
</b-field> -->
|
||||
</b-field>
|
||||
|
||||
<b-field label="Activo/Inactivo">
|
||||
<p
|
||||
@ -53,15 +62,31 @@
|
||||
{{ sA.texto }}
|
||||
</p>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
v-show="
|
||||
admin.tipoUsuario.id_tipo_usuario === 2 &&
|
||||
institucion.id_institucion
|
||||
"
|
||||
>
|
||||
<b-button type="is-link" @click="activarDesactivar()" expanded>
|
||||
Activar/Desactivar
|
||||
</b-button>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
admin: { type: Object, required: true },
|
||||
institucion: { type: Object, required: true },
|
||||
buscar: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -75,6 +100,27 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activarDesactivar() {
|
||||
const data = {
|
||||
id_institucion: this.institucion.id_institucion,
|
||||
activo: !this.institucion.activo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/institucion`, data)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.buscar()
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end">
|
||||
<div
|
||||
class="columns is-align-items-flex-end"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 2"
|
||||
>
|
||||
<InstitucionSelect
|
||||
:updateIdInstitucion="updateIdInstitucion"
|
||||
:idInstitucion="idInstitucion"
|
||||
:idInstitucion="
|
||||
typeof idInstitucion === 'undefined' ? 0 : idInstitucion
|
||||
"
|
||||
/>
|
||||
|
||||
<b-field class="column">
|
||||
@ -27,7 +32,12 @@
|
||||
:institucion="institucion"
|
||||
/>
|
||||
|
||||
<InfoInstitucion :institucion="institucion" />
|
||||
<InfoInstitucion
|
||||
:admin="admin"
|
||||
:institucion="institucion"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -60,9 +70,10 @@ export default {
|
||||
.then((res) => {
|
||||
this.institucion = res.data
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push(
|
||||
`/admin/configuracion/instituciones/${this.idInstitucion}`
|
||||
)
|
||||
if (this.admin.tipoUsuario.id_tipo_usuario === 2)
|
||||
this.$router.push(
|
||||
`/admin/configuracion/instituciones/${this.idInstitucion}`
|
||||
)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
@ -73,6 +84,8 @@ export default {
|
||||
created() {
|
||||
if (this.$route.params.institucion)
|
||||
this.idInstitucion = parseInt(this.$route.params.institucion)
|
||||
else if (this.admin.institucion)
|
||||
this.idInstitucion = this.admin.institucion.id_institucion
|
||||
if (this.idInstitucion) this.buscar()
|
||||
},
|
||||
}
|
||||
|
@ -53,7 +53,8 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion() {
|
||||
idInstitucion(v) {
|
||||
console.log(v)
|
||||
if (!this.idInstitucion) this.institucion = this.objVacio
|
||||
},
|
||||
institucion() {
|
||||
|
@ -17,14 +17,7 @@
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<TablaModulos
|
||||
:admin="admin"
|
||||
:data="data"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:obtenerCatalogoModulo="obtenerCatalogoModulo"
|
||||
:updateActualizarTabla="updateActualizarTabla"
|
||||
:actualizarTabla="actualizarTabla"
|
||||
/>
|
||||
<TablaModulos :admin="admin" :data="data" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -36,7 +29,6 @@ export default {
|
||||
},
|
||||
props: {
|
||||
admin: { typeof: Object, require: true },
|
||||
updateIsLoading: { type: Function, require: true },
|
||||
updateActualizarTabla: { type: Function, required: true },
|
||||
actualizarTabla: { type: Boolean, required: true },
|
||||
},
|
||||
|
@ -224,6 +224,13 @@
|
||||
/>
|
||||
</template>
|
||||
|
||||
<b-menu-item
|
||||
:label="idTipoUsuario === 3 ? 'Institución' : 'Instituciones'"
|
||||
:icon="icono('/admin/configuracion/instituciones')"
|
||||
:disabled="activo('/admin/configuracion/instituciones')"
|
||||
@click="opcionMenu('/admin/configuracion/instituciones')"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Horario de Servicio"
|
||||
:icon="icono('/admin/configuracion/institucion-dia')"
|
||||
@ -288,14 +295,6 @@
|
||||
v-if="idTipoUsuario === 3"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Instituciones"
|
||||
:icon="icono('/admin/configuracion/instituciones')"
|
||||
:disabled="activo('/admin/configuracion/instituciones')"
|
||||
@click="opcionMenu('/admin/configuracion/instituciones')"
|
||||
v-if="idTipoUsuario === 2"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Crear Nuevas opciones"
|
||||
:icon="icono('/admin/configuracion/crear_nuevas_opciones')"
|
||||
|
@ -1,6 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<Title title="Buscar Institución" :operador="admin" />
|
||||
<Title
|
||||
:title="
|
||||
admin.tipoUsuario.id_tipo_usuario === 2
|
||||
? 'Buscar Institución'
|
||||
: 'Institución'
|
||||
"
|
||||
:operador="admin"
|
||||
/>
|
||||
|
||||
<Institucion :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
@ -34,8 +41,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getLocalhostInfo()
|
||||
if (this.admin.tipoUsuario.id_tipo_usuario != 2)
|
||||
this.$router.push('/operador/prestamo_devolucion')
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user