diff --git a/components/admin/CrearAdmin.vue b/components/admin/CrearAdmin.vue index 3fca84b..44660f8 100644 --- a/components/admin/CrearAdmin.vue +++ b/components/admin/CrearAdmin.vue @@ -17,7 +17,7 @@ @keyup.enter.native=" $alertsGenericos.imprimirWarning( $buefy, - '¿Esta segur@ de querer crear este operador?', + '¿Esta segur@ de querer crear este admin?', crearAdmin ) " @@ -26,19 +26,36 @@ /> - + + + + + @@ -49,11 +66,11 @@ @click=" $alertsGenericos.imprimirWarning( $buefy, - '¿Esta segur@ de querer crear este operador?', + '¿Esta segur@ de querer crear este admin?', crearAdmin ) " - :disabled="!operador || !password || !idInstitucion" + :disabled="!operador || !idInstitucion || !correo || !nombre" expanded rounded > @@ -78,19 +95,21 @@ export default { }, data() { return { + correo: '', idInstitucion: 0, + nombre: '', operador: '', - password: '', } }, methods: { crearAdmin() { - if (this.password && this.operador && this.idInstitucion) { + if (this.operador && this.idInstitucion && this.correo && this.nombre) { const data = { + correo: this.correo, id_institucion: this.idInstitucion, id_tipo_usuario: 3, + nombre: this.nombre, operador: this.operador, - password: this.password, } this.updateIsLoading(true) @@ -99,7 +118,8 @@ export default { .then((res) => { this.idInstitucion = 0 this.operador = '' - this.password = '' + this.correo = '' + this.nombre = '' this.updateIsLoading(false) this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message) this.updateActualizarTabla(true) diff --git a/components/admin/CrearOperador.vue b/components/admin/CrearOperador.vue index bcd6530..60e60d8 100644 --- a/components/admin/CrearOperador.vue +++ b/components/admin/CrearOperador.vue @@ -21,6 +21,40 @@ /> + + + + + + + + @@ -71,16 +105,20 @@ export default { }, data() { return { + correo: '', + nombre: '', operador: '', password: '', } }, methods: { crearOperador() { - if (this.password && this.operador) { + if (this.password && this.operador && this.correo && this.nombre) { let data = { + correo: this.correo, id_institucion: this.admin.institucion.id_institucion, id_tipo_usuario: 4, + nombre: this.nombre, operador: this.operador, password: this.password, } @@ -91,6 +129,8 @@ export default { .then((res) => { this.operador = '' this.password = '' + this.correo = '' + this.nombre = '' this.updateActualizarTabla(true) this.updateIsLoading(false) this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)