From d88d07cec943abd6b6a3e3bee068fd2180f0155a Mon Sep 17 00:00:00 2001
From: xXpuma99Xx <51341582+xXpuma99Xx@users.noreply.github.com>
Date: Tue, 19 Jul 2022 15:27:58 -0500
Subject: [PATCH] tabla admins en institucion
---
components/admin/Institucion.vue | 143 +++++++++++++++++++++++--------
components/admin/TablaAdmins.vue | 2 +-
2 files changed, 106 insertions(+), 39 deletions(-)
diff --git a/components/admin/Institucion.vue b/components/admin/Institucion.vue
index 806c8af..41ab392 100644
--- a/components/admin/Institucion.vue
+++ b/components/admin/Institucion.vue
@@ -1,44 +1,72 @@
-
-
+
+
+
+
+
+
+ Buscar
+
+
+
+
+
+
+
+
-
+
+ {{ props.row.operador }}
+
-
-
- Buscar
-
-
-
+
+ {{ props.row.nombre }}
+
-
+
+ {{ props.row.correo }}
+
+
@@ -55,12 +83,25 @@ export default {
updateIsLoading: { type: Function, required: true },
},
data() {
- return { institucion: {}, idInstitucion: 0, modulo: { institucion: {} } }
+ return {
+ institucion: {},
+ idInstitucion: 0,
+ data: [],
+ isLoadingTable: false,
+ page: 1,
+ total: 0,
+ lastSearch: {},
+ search: { idInstitucion: 0 },
+ }
},
methods: {
updateIdInstitucion(idInstitucion) {
this.idInstitucion = idInstitucion
},
+ onPageChange(page) {
+ this.page = page
+ this.obtenerAdmins()
+ },
buscar() {
this.updateIsLoading(true)
axios
@@ -75,12 +116,38 @@ export default {
this.$router.push(
`/admin/configuracion/instituciones/${this.idInstitucion}`
)
+ return this.obtenerAdmins()
})
.catch((err) => {
this.updateIsLoading(false)
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
})
},
+ obtenerAdmins() {
+ let data = ''
+
+ this.isLoadingTable = true
+ if (this.search.idInstitucion != this.lastSearch.idInstitucion) {
+ this.page = 1
+ this.lastSearch.idInstitucion = this.search.idInstitucion
+ }
+ if (this.search.idInstitucion)
+ data = `&id_institucion=${this.search.idInstitucion}`
+ axios
+ .get(
+ `${process.env.api}/operador/operadores?pagina=${this.page}&id_tipo_usuario=3${data}`,
+ this.$getToken.token()
+ )
+ .then((res) => {
+ this.data = res.data[0]
+ this.total = res.data[1]
+ this.isLoadingTable = false
+ })
+ .catch((err) => {
+ this.isLoadingTable = false
+ this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
+ })
+ },
},
created() {
if (this.$route.params.institucion)
diff --git a/components/admin/TablaAdmins.vue b/components/admin/TablaAdmins.vue
index 81019b7..0416a50 100644
--- a/components/admin/TablaAdmins.vue
+++ b/components/admin/TablaAdmins.vue
@@ -58,7 +58,7 @@
{{ props.row.nombre }}
-
+
{{ props.row.correo }}