modulos crear listo
This commit is contained in:
parent
d168c86dd0
commit
29465fef79
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Carreras">
|
||||
<b-select v-model="idInstitucionCarrera" expanded rounded>
|
||||
<option value="" disabled>Selecciona una opción</option>
|
||||
@ -46,7 +46,7 @@
|
||||
Crear
|
||||
</b-button>
|
||||
</b-field>
|
||||
</dir>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Infracción">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -33,7 +33,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Software">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -33,7 +33,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Marca">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -32,7 +32,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
@ -61,7 +61,7 @@
|
||||
/>
|
||||
</b-collapse>
|
||||
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Modelo">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -93,7 +93,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Marca">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -32,7 +32,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
@ -61,7 +61,7 @@
|
||||
/>
|
||||
</b-collapse>
|
||||
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Modelo">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -93,7 +93,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Nombre del módulo">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -34,7 +34,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de carrito">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -51,7 +51,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de conector">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -33,7 +33,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de usuario">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -33,7 +33,7 @@
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button type="is-link" @click="pedirReporte()">Descargar</b-button>
|
||||
<b-button type="is-link" @click="pedivReporte()">Descargar</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -53,7 +53,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pedirReporte() {
|
||||
pedivReporte() {
|
||||
// this.updateIsLoading(true)
|
||||
// axios
|
||||
// .get(
|
||||
|
@ -57,8 +57,8 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import SelectInstitucion from '@/components/selects/SelectInstitucion'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import SelectInstitucion from '@/components/selects/SelectInstitucion'
|
||||
|
||||
export default {
|
||||
components: { BotonCrear, SelectInstitucion },
|
||||
@ -75,19 +75,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
warning() {
|
||||
if (
|
||||
this.institucion.id_institucion &&
|
||||
this.admin &&
|
||||
this.correo &&
|
||||
this.nombre
|
||||
)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este admin?',
|
||||
this.crearAdmin
|
||||
)
|
||||
},
|
||||
crearAdmin() {
|
||||
const data = {
|
||||
correo: this.correo,
|
||||
@ -114,6 +101,19 @@ export default {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (
|
||||
this.institucion.id_institucion &&
|
||||
this.admin &&
|
||||
this.correo &&
|
||||
this.nombre
|
||||
)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este admin?',
|
||||
this.crearAdmin
|
||||
)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,77 +1,58 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Carreras">
|
||||
<b-select v-model="idInstitucionCarrera" expanded rounded>
|
||||
<option value="" disabled>Selecciona una opción</option>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear</h3>
|
||||
|
||||
<option
|
||||
v-for="(c, index) in carreras"
|
||||
:key="index"
|
||||
:value="c.id_institucion_carrera"
|
||||
>
|
||||
{{ c.carrera.carrera }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column mb-0 pb-0" label="Software">
|
||||
<b-select v-model="idPrograma" expanded rounded>
|
||||
<option value="" disabled>Selecciona una opción</option>
|
||||
|
||||
<option
|
||||
v-for="(p, index) in programas"
|
||||
:key="index"
|
||||
:value="p.id_programa"
|
||||
>
|
||||
{{ p.programa }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column">
|
||||
<b-button
|
||||
type="is-info"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Estas segur@ de querer asignar este software a esa carrera?',
|
||||
asociarCarreraPrograma
|
||||
)
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<SelectCarrera
|
||||
:idInstitucion="idInstitucion"
|
||||
:institucionCarreraPadre="institucionCarrera"
|
||||
@institucion-carrera-seleccionada="
|
||||
(nuevaInstitucionCarrera) =>
|
||||
(institucionCarrera = nuevaInstitucionCarrera)
|
||||
"
|
||||
:disabled="!idInstitucionCarrera || !idPrograma"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</b-field>
|
||||
</dir>
|
||||
</div>
|
||||
/>
|
||||
|
||||
<SelectPrograma
|
||||
:programaPadre="programa"
|
||||
@programa-seleccionado="(nuevoPrograma) => (programa = nuevoPrograma)"
|
||||
/>
|
||||
|
||||
<BotonCrear
|
||||
:disabled="
|
||||
!institucionCarrera.id_institucion_carrera || !programa.id_programa
|
||||
"
|
||||
:crear="warning"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import SelectCarrera from '@/components/selects/SelectCarrera'
|
||||
import SelectPrograma from '@/components/selects/SelectPrograma'
|
||||
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
export default {
|
||||
components: { BotonCrear, SelectCarrera, SelectPrograma },
|
||||
props: {
|
||||
updateActualizarTabla: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
carreras: [],
|
||||
programas: [],
|
||||
idInstitucionCarrera: '',
|
||||
idPrograma: '',
|
||||
institucionCarrera: {},
|
||||
programa: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
asociarCarreraPrograma() {
|
||||
crearCarreraPrograma() {
|
||||
const data = {
|
||||
id_institucion_carrera: this.idInstitucionCarrera,
|
||||
id_programa: this.idPrograma,
|
||||
id_institucion_carrera: this.institucionCarrera.id_institucion_carrera,
|
||||
id_programa: this.programa.id_programa,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
@ -82,8 +63,8 @@ export default {
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.idInstitucionCarrera = ''
|
||||
this.idPrograma = ''
|
||||
this.institucionCarrera = {}
|
||||
this.programa = {}
|
||||
this.updateActualizarTabla(true)
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
@ -93,33 +74,17 @@ export default {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCarreras() {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/institucion-carrera?id_institucion=${this.admin.institucion.id_institucion}`,
|
||||
this.$getToken.token()
|
||||
warning() {
|
||||
if (
|
||||
!this.institucionCarrera.id_institucion_carrera &&
|
||||
!this.programa.id_programa
|
||||
)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Estas segur@ de querer asignar este software a esta carrera?',
|
||||
this.crearCarreraPrograma
|
||||
)
|
||||
.then((res) => {
|
||||
this.carreras = res.data
|
||||
return this.obtenerProgramas()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerProgramas() {
|
||||
return axios
|
||||
.get(`${process.env.api}/institucion-programa`, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.programas = res.data
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCarreras()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,62 +0,0 @@
|
||||
<template>
|
||||
<div class="mb-4">
|
||||
<p class="subtitle is-4">Crear infracción</p>
|
||||
|
||||
<CrearInfraccion :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Crear tipo de software</p>
|
||||
|
||||
<CrearInstiPrograma :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Crear tipo de conector</p>
|
||||
|
||||
<CrearTipoEntrada :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Crear tipo de carrito</p>
|
||||
|
||||
<CrearTipoCarrito :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Carrito</p>
|
||||
|
||||
<CrearMarcaModeloC :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Equipo</p>
|
||||
|
||||
<CrearMarcaModeloE :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
|
||||
<p class="subtitle is-4">Crear tipo de usuario</p>
|
||||
|
||||
<CrearTipoUsuario :admin="admin" :updateIsLoading="updateIsLoading" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CrearInfraccion from '@/components/admin/CrearInfraccion'
|
||||
import CrearInstiPrograma from '@/components/admin/CrearInstiProgra'
|
||||
import CrearTipoEntrada from '@/components/admin/CrearTipoEntrada'
|
||||
import CrearTipoCarrito from '@/components/admin/CrearTipoCarrito'
|
||||
import CrearMarcaModeloC from '@/components/admin/CrearMarcaModeloC'
|
||||
import CrearMarcaModeloE from '@/components/admin/CrearMarcaModeloE'
|
||||
import CrearTipoUsuario from '@/components/admin/CrearTipoUsuario'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CrearInfraccion,
|
||||
CrearTipoEntrada,
|
||||
CrearInstiPrograma,
|
||||
CrearTipoCarrito,
|
||||
CrearMarcaModeloC,
|
||||
CrearTipoUsuario,
|
||||
CrearMarcaModeloE,
|
||||
},
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {},
|
||||
created() {},
|
||||
}
|
||||
</script>
|
@ -1,84 +1,67 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Infracción">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre de la infracción"
|
||||
v-model="infraccion"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear esta infracción?',
|
||||
crearInfraccion
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Infracción</h3>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column is-4"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este infracción?',
|
||||
crearInfraccion
|
||||
)
|
||||
"
|
||||
:disabled="!infraccion"
|
||||
expanded
|
||||
rounded
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Infracción">
|
||||
<b-input
|
||||
placeholder="Nombre de la infracción"
|
||||
type="text"
|
||||
@keyup.enter.native="warning()"
|
||||
v-model="infraccion"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!infraccion" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">Tabla de infracciones</p>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
animation="slide"
|
||||
v-model="active"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="card-header"
|
||||
role="button"
|
||||
aria-controls="contentIdForA11y3"
|
||||
:aria-expanded="active"
|
||||
>
|
||||
<p class="card-header-title">Tabla de infracciones</p>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="active ? 'menu-down' : 'menu-up'"> </b-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="active"
|
||||
:data="infracciones"
|
||||
:columnaInfraccion="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="infracciones"
|
||||
:columnaInfraccion="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TablaOpcionesCreadas,
|
||||
},
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: false,
|
||||
infracciones: [],
|
||||
activo: false,
|
||||
infraccion: '',
|
||||
}
|
||||
},
|
||||
@ -100,6 +83,7 @@ export default {
|
||||
const data = {
|
||||
infraccion: this.infraccion,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
@ -108,16 +92,24 @@ export default {
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.infraccion = ''
|
||||
this.obtenerCatalogoInfracciones()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.obtenerCatalogoInfracciones()
|
||||
this.infraccion = ''
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.infraccion)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear esta infracción?',
|
||||
this.crearInfraccion
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoInfracciones()
|
||||
|
@ -1,123 +0,0 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Software">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre del software"
|
||||
v-model="programa"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear este software?',
|
||||
crearInstitucionPrograma
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column is-4"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este software?',
|
||||
crearInstitucionPrograma
|
||||
)
|
||||
"
|
||||
:disabled="!programa"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
animation="slide"
|
||||
v-model="active"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="card-header"
|
||||
role="button"
|
||||
aria-controls="contentIdForA11y3"
|
||||
:aria-expanded="active"
|
||||
>
|
||||
<p class="card-header-title">Tabla de software</p>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="active ? 'menu-down' : 'menu-up'"> </b-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="active"
|
||||
:data="programas"
|
||||
:columnaPrograma="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
export default {
|
||||
components: {
|
||||
TablaOpcionesCreadas,
|
||||
},
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: false,
|
||||
programas: [],
|
||||
programa: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerCatalogoProgramas() {
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-programa/`, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.programas = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
crearInstitucionPrograma() {
|
||||
const data = {
|
||||
programa: this.programa,
|
||||
}
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
`${process.env.api}/institucion-programa/`,
|
||||
data,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.obtenerCatalogoProgramas()
|
||||
this.programa = ''
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoProgramas()
|
||||
},
|
||||
}
|
||||
</script>
|
116
components/crear/CrearMarca.vue
Normal file
116
components/crear/CrearMarca.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Marca">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre de la marca"
|
||||
v-model="marca"
|
||||
@keyup.enter.native="warning()"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!marca" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">
|
||||
Tabla de marcas de {{ tipo === 'e' ? 'equipos' : 'carritos' }}
|
||||
</p>
|
||||
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="marcas"
|
||||
:columnaMarcaC="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
tipo: { type: String, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activo: false,
|
||||
marcas: [],
|
||||
marca: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerMarcas() {
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/marca?tipo=${this.tipo}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.marcas = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
crearMarca() {
|
||||
const data = {
|
||||
marca: this.marca,
|
||||
tipo: this.tipo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/marca/`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.marca = ''
|
||||
this.obtenerMarcas()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.marca)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
`¿Está segur@ de querer crear esta marca de ${
|
||||
this.tipo === 'e' ? 'equipo' : 'carrito'
|
||||
}?`,
|
||||
this.crearMarca
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerMarcas()
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Marca">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -32,7 +32,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
@ -61,7 +61,7 @@
|
||||
/>
|
||||
</b-collapse>
|
||||
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Modelo">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -93,7 +93,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Marca">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -32,7 +32,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
@ -61,7 +61,7 @@
|
||||
/>
|
||||
</b-collapse>
|
||||
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Modelo">
|
||||
<b-input
|
||||
type="text"
|
||||
@ -93,7 +93,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
|
116
components/crear/CrearModelo.vue
Normal file
116
components/crear/CrearModelo.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4 mt-4">
|
||||
<b-field class="column mb-0 pb-0" label="Modelo">
|
||||
<b-input
|
||||
placeholder="Nombre de la modelo"
|
||||
type="text"
|
||||
@keyup.enter.native="warning()"
|
||||
v-model="modelo"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!modelo" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">
|
||||
Tabla de modelos de {{ tipo === 'e' ? 'equipos' : 'carritos' }}
|
||||
</p>
|
||||
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="modelos"
|
||||
:columnaModeloC="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
tipo: { type: String, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activo: false,
|
||||
modelos: [],
|
||||
modelo: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerModelos() {
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/modelo?tipo=${this.tipo}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.modelos = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
crearModelo() {
|
||||
const data = {
|
||||
modelo: this.modelo,
|
||||
tipo: this.tipo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/modelo/`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.modelo = ''
|
||||
this.obtenerModelos()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.modelo)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
`¿Está segur@ de querer crear este modelo de ${
|
||||
this.tipo === 'e' ? 'equipo' : 'carrito'
|
||||
}?`,
|
||||
this.crearModelo
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerModelos()
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,78 +1,70 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Nombre del módulo">
|
||||
<b-input
|
||||
type="text"
|
||||
icon="storefront-outline"
|
||||
placeholder="Nombre del módulo"
|
||||
v-model="nombreModulo"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este módulo?',
|
||||
crearModulo
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Módulo</h3>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este módulo?',
|
||||
crearModulo
|
||||
)
|
||||
"
|
||||
:disabled="!nombreModulo"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Módulo">
|
||||
<b-input
|
||||
icon="storefront-outline"
|
||||
placeholder="Nombre del módulo"
|
||||
type="text"
|
||||
@keyup.enter.native="warning()"
|
||||
v-model="modulo"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!modulo" :crear="warning" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
|
||||
export default {
|
||||
components: { BotonCrear },
|
||||
props: {
|
||||
institucion: { type: Object, required: true },
|
||||
updateActualizarTabla: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nombreModulo: '',
|
||||
modulo: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
crearModulo() {
|
||||
if (this.nombreModulo) {
|
||||
let data = {
|
||||
id_institucion: this.institucion.id_institucion,
|
||||
modulo: this.nombreModulo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/modulo`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.nombreModulo = ''
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.updateActualizarTabla(true)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
let data = {
|
||||
id_institucion: this.idInstitucion,
|
||||
modulo: this.modulo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/modulo`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.modulo = ''
|
||||
this.updateActualizarTabla(true)
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.modulo)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este módulo?',
|
||||
this.crearModulo
|
||||
)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -77,14 +77,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
warning() {
|
||||
if (this.correo && this.nombre && this.operador)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este admin?',
|
||||
this.crearAdmin
|
||||
)
|
||||
},
|
||||
crearAdmin() {
|
||||
const data = {
|
||||
correo: this.correo,
|
||||
@ -102,15 +94,23 @@ export default {
|
||||
this.nombre = ''
|
||||
this.operador = ''
|
||||
this.password = ''
|
||||
this.updateActualizarTabla(true)
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.updateActualizarTabla(true)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.correo && this.nombre && this.operador && this.password)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este operador?',
|
||||
this.crearAdmin
|
||||
)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
115
components/crear/CrearPrograma.vue
Normal file
115
components/crear/CrearPrograma.vue
Normal file
@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Software</h3>
|
||||
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Software">
|
||||
<b-input
|
||||
placeholder="Nombre del software"
|
||||
type="text"
|
||||
@keyup.enter.native="warning()"
|
||||
v-model="programa"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!programa" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">Tabla de software</p>
|
||||
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="programas"
|
||||
:columnaPrograma="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activo: false,
|
||||
programas: [],
|
||||
programa: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerCatalogoProgramas() {
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-programa/`, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.programas = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
crearPrograma() {
|
||||
const data = {
|
||||
programa: this.programa,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
`${process.env.api}/institucion-programa/`,
|
||||
data,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.programa = ''
|
||||
this.obtenerCatalogoProgramas()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.programa)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este software?',
|
||||
this.crearPrograma
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoProgramas()
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,102 +1,79 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de carrito">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre del tipo de carrito"
|
||||
v-model="tipoCarrito"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de carrito?',
|
||||
crearTipoCarrito
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Tipo de Carrito</h3>
|
||||
|
||||
<b-field class="column mb-0 pb-0" label="Identificador">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Identificador"
|
||||
maxlength="1"
|
||||
v-model="letra"
|
||||
:has-counter="false"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de carrito?',
|
||||
crearTipoCarrito
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de carrito">
|
||||
<b-input
|
||||
placeholder="Nombre del tipo de carrito"
|
||||
type="text"
|
||||
@keyup.enter.native="Warning()"
|
||||
v-model="tipoCarrito"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column is-4"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este tipo de carrito?',
|
||||
crearTipoCarrito
|
||||
)
|
||||
"
|
||||
:disabled="!tipoCarrito"
|
||||
expanded
|
||||
rounded
|
||||
<b-field class="column mb-0 pb-0" label="Identificador">
|
||||
<b-input
|
||||
maxlength="1"
|
||||
placeholder="Identificador"
|
||||
type="text"
|
||||
:has-counter="false"
|
||||
@keyup.enter.native="Warning()"
|
||||
v-model="letra"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!tipoCarrito" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de carritos</p>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
animation="slide"
|
||||
v-model="active"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="card-header"
|
||||
role="button"
|
||||
aria-controls="contentIdForA11y3"
|
||||
:aria-expanded="active"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de carritos</p>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="active ? 'menu-down' : 'menu-up'"> </b-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="active"
|
||||
:data="tipoCarritos"
|
||||
:columnaTipoCarrito="true"
|
||||
:columnaLetra="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="tipoCarritos"
|
||||
:columnaTipoCarrito="true"
|
||||
:columnaLetra="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TablaOpcionesCreadas,
|
||||
},
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: false,
|
||||
activo: false,
|
||||
tipoCarritos: [],
|
||||
tipoCarrito: '',
|
||||
letra: '',
|
||||
@ -121,6 +98,7 @@ export default {
|
||||
tipo_carrito: this.tipoCarrito,
|
||||
letra: this.letra,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
@ -129,17 +107,25 @@ export default {
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.letra = ''
|
||||
this.tipoCarrito = ''
|
||||
this.obtenerCatalogoTipoCarrito()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.obtenerCatalogoTipoCarrito()
|
||||
this.tipoCarrito = ''
|
||||
this.letra = ''
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.tipoCarrito)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de carrito?',
|
||||
this.crearTipoCarrito
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoTipoCarrito()
|
||||
|
@ -1,83 +1,66 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de conector">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre del tipo de conector"
|
||||
v-model="tipoEntrada"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de conector?',
|
||||
crearTipoEntrada
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Tipo de Conector</h3>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column is-4"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este tipo de conector?',
|
||||
crearTipoEntrada
|
||||
)
|
||||
"
|
||||
:disabled="!tipoEntrada"
|
||||
expanded
|
||||
rounded
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de conector">
|
||||
<b-input
|
||||
placeholder="Nombre del tipo de conector"
|
||||
v-model="tipoEntrada"
|
||||
type="text"
|
||||
@keyup.enter.native="warning()"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!tipoEntrada" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de conectores</p>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
animation="slide"
|
||||
v-model="active"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="card-header"
|
||||
role="button"
|
||||
aria-controls="contentIdForA11y3"
|
||||
:aria-expanded="active"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de conectores</p>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="active ? 'menu-down' : 'menu-up'"> </b-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="active"
|
||||
:data="tipoEntradas"
|
||||
:columnaTipoEntrada="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="tipoEntradas"
|
||||
:columnaTipoEntrada="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TablaOpcionesCreadas,
|
||||
},
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: false,
|
||||
activo: false,
|
||||
tipoEntradas: [],
|
||||
tipoEntrada: '',
|
||||
}
|
||||
@ -100,6 +83,7 @@ export default {
|
||||
const data = {
|
||||
tipo_entrada: this.tipoEntrada,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
@ -108,16 +92,24 @@ export default {
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.tipoEntrada = ''
|
||||
this.obtenerCatalogoTipoEntrada()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.obtenerCatalogoTipoEntrada()
|
||||
this.tipoEntrada = ''
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.tipoEntrada)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Esta segur@ de querer crear este tipo de conector?',
|
||||
this.crearTipoEntrada
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoTipoEntrada()
|
||||
|
@ -1,83 +1,66 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de usuario">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre del tipo de usuario"
|
||||
v-model="tipoUsuario"
|
||||
rounded
|
||||
@keyup.enter.native="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de usuario?',
|
||||
crearTipousuario
|
||||
)
|
||||
"
|
||||
/>
|
||||
</b-field>
|
||||
<section class="mb-6">
|
||||
<h3 class="is-size-4 mb-3">Crear Tipo de Usuario</h3>
|
||||
|
||||
<b-button
|
||||
type="is-info"
|
||||
class="column is-4"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer crear este tipo de usuario?',
|
||||
crearTipoUsuario
|
||||
)
|
||||
"
|
||||
:disabled="!tipoUsuario"
|
||||
expanded
|
||||
rounded
|
||||
<div class="box">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de usuario">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Nombre del tipo de usuario"
|
||||
v-model="tipoUsuario"
|
||||
rounded
|
||||
@keyup.enter.native="warning()"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<BotonCrear :disabled="!tipoUsuario" :crear="warning" />
|
||||
</div>
|
||||
|
||||
<b-collapse
|
||||
animation="slide"
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
v-model="activo"
|
||||
>
|
||||
Crear
|
||||
</b-button>
|
||||
</dir>
|
||||
<template #trigger>
|
||||
<div
|
||||
aria-controls="contentIdForA11y3"
|
||||
class="card-header"
|
||||
role="button"
|
||||
:aria-expanded="activo"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de usuarios</p>
|
||||
|
||||
<b-collapse
|
||||
aria-id="contentIdForA11y3"
|
||||
class="card"
|
||||
animation="slide"
|
||||
v-model="active"
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="card-header"
|
||||
role="button"
|
||||
aria-controls="contentIdForA11y3"
|
||||
:aria-expanded="active"
|
||||
>
|
||||
<p class="card-header-title">Tabla de tipo de usuarios</p>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="active ? 'menu-down' : 'menu-up'"> </b-icon>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<a class="card-header-icon">
|
||||
<b-icon :icon="activo ? 'menu-down' : 'menu-up'" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<TablaOpcionesCreadas
|
||||
v-if="active"
|
||||
:data="tipoUsuarios"
|
||||
:columnaTipoUsuario="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
<TablaOpcionesCreadas
|
||||
v-if="activo"
|
||||
:data="tipoUsuarios"
|
||||
:columnaTipoUsuario="true"
|
||||
/>
|
||||
</b-collapse>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import BotonCrear from '@/components/botones/BotonCrear'
|
||||
import TablaOpcionesCreadas from '@/components/admin/TablaOpcionesCreadas'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TablaOpcionesCreadas,
|
||||
},
|
||||
components: { BotonCrear, TablaOpcionesCreadas },
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: false,
|
||||
activo: false,
|
||||
tipoUsuarios: [],
|
||||
tipoUsuario: '',
|
||||
}
|
||||
@ -97,20 +80,29 @@ export default {
|
||||
const data = {
|
||||
tipo_usuario: this.tipoUsuario,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/tipo-usuario/`, data, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.tipoUsuario = ''
|
||||
this.obtenerCatalogoTipoUsuario()
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||
this.obtenerCatalogoTipoUsuario()
|
||||
this.tipoUsuario = ''
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
||||
})
|
||||
},
|
||||
warning() {
|
||||
if (this.tipoUsuario)
|
||||
this.$alertsGenericos.imprimirWarning(
|
||||
this.$buefy,
|
||||
'¿Está segur@ de querer crear este tipo de usuario?',
|
||||
this.crearTipoUsuario
|
||||
)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoTipoUsuario()
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<dir class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||
<b-field class="column mb-0 pb-0" field="modulo" label="Módulo">
|
||||
<b-select v-model="idModulo" icon="storefront-outline" rounded expanded>
|
||||
<option disabled :value="null">Módulo</option>
|
||||
@ -72,7 +72,7 @@
|
||||
expanded
|
||||
rounded
|
||||
/>
|
||||
</dir>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="carrera"
|
||||
v-model="institucionCarrera"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
@ -11,8 +11,12 @@
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(c, index) in carreras" :key="index" :value="c">
|
||||
{{ c.carrera.carrera }}
|
||||
<option
|
||||
v-for="(ic, index) in institucionCarreras"
|
||||
:key="index"
|
||||
:value="ic"
|
||||
>
|
||||
{{ ic.carrera.carrera }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
@ -25,28 +29,32 @@ export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
carreraPadre: { type: Object, required: true, default: () => ({}) },
|
||||
institucionCarreraPadre: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
carreras: [],
|
||||
institucionCarreras: [],
|
||||
isLoadingSelect: false,
|
||||
carrera: {},
|
||||
institucionCarrera: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerCarreras() {
|
||||
obtenerInstitucionCarreras() {
|
||||
this.isLoadingSelect = true
|
||||
this.carreras = []
|
||||
this.institucionCarreras = []
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/institucion-carrera?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.carreras = res.data
|
||||
this.$emit('catalogo-carreras', this.carreras)
|
||||
this.institucionCarreras = res.data
|
||||
this.$emit('catalogo-institucion-carreras', this.institucionCarreras)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
@ -56,17 +64,21 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
idInstitucion(nuevoIdInstitucion) {
|
||||
if (nuevoIdInstitucion) this.obtenerCarreras()
|
||||
if (nuevoIdInstitucion) this.obtenerInstitucionCarreras()
|
||||
},
|
||||
carrera(carreraSeleccionada) {
|
||||
this.$emit('carrera-seleccionada', carreraSeleccionada)
|
||||
institucionCarrera(institucionCarreraSeleccionada) {
|
||||
this.$emit(
|
||||
'institucion-carrera-seleccionada',
|
||||
institucionCarreraSeleccionada
|
||||
)
|
||||
},
|
||||
carreraPadre(nuevaCarrera) {
|
||||
if (this.$objIsEmpty(nuevaCarrera)) this.carrera = this.objVacio
|
||||
institucionCarreraPadre(nuevaInstitucionCarrera) {
|
||||
if (this.$objIsEmpty(nuevaInstitucionCarrera))
|
||||
this.institucionCarrera = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.carrera = this.objVacio
|
||||
this.institucionCarrera = this.objVacio
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user