selects
This commit is contained in:
parent
ebe7fd7547
commit
b325604411
74
components/selects/SelectCarrera.vue
Normal file
74
components/selects/SelectCarrera.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Carrera" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="carrera"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(c, index) in carreras" :key="index" :value="c">
|
||||
{{ c.carrera.carrera }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
carreraPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
carreras: [],
|
||||
isLoadingSelect: false,
|
||||
carrera: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerCarreras() {
|
||||
this.isLoadingSelect = true
|
||||
this.carreras = []
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/institucion-carrera?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.carreras = res.data
|
||||
this.$emit('catalogo-carreras', this.carreras)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion(nuevoIdInstitucion) {
|
||||
if (nuevoIdInstitucion) this.obtenerCarreras()
|
||||
},
|
||||
carrera(carreraSeleccionada) {
|
||||
this.$emit('carrera-seleccionada', carreraSeleccionada)
|
||||
},
|
||||
carreraPadre(nuevaCarrera) {
|
||||
if (this.$objIsEmpty(nuevaCarrera)) this.carrera = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.carrera = this.objVacio
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
74
components/selects/SelectInfraccion.vue
Normal file
74
components/selects/SelectInfraccion.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Infracción" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="infraccion"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(i, index) in infracciones" :key="index" :value="i">
|
||||
{{ i.infraccion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
infraccionPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
infracciones: [],
|
||||
isLoadingSelect: false,
|
||||
infraccion: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerInfracciones() {
|
||||
this.isLoadingSelect = true
|
||||
this.infracciones = []
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/institucion-infraccion/infracciones?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.infracciones = res.data
|
||||
this.$emit('catalogo-infracciones', this.infracciones)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion(nuevoIdInstitucion) {
|
||||
if (nuevoIdInstitucion) this.obtenerInfracciones()
|
||||
},
|
||||
infraccion(infraccionSeleccionada) {
|
||||
this.$emit('infraccion-seleccionada', infraccionSeleccionada)
|
||||
},
|
||||
infraccionPadre(nuevaInfraccion) {
|
||||
if (this.$objIsEmpty(nuevaInfraccion)) this.infraccion = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.infraccion = this.objVacio
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
67
components/selects/SelectInstitucion.vue
Normal file
67
components/selects/SelectInstitucion.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Institución" :class="columnSize">
|
||||
<b-select
|
||||
icon="school-outline"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="institucion"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(i, index) in instituciones" :key="index" :value="i">
|
||||
{{ i.institucion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
institucionPadre: { type: Object, required: true },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
instituciones: [],
|
||||
isLoadingSelect: false,
|
||||
institucion: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerInstituciones() {
|
||||
this.isLoadingSelect = true
|
||||
this.instituciones = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion`, this.$getToken.token())
|
||||
.then((res) => {
|
||||
this.instituciones = res.data
|
||||
this.$emit('catalogo-instituciones', this.instituciones)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
institucion(institucionSeleccionada) {
|
||||
this.$emit('institucion-seleccionada', institucionSeleccionada)
|
||||
},
|
||||
institucionPadre(nuevaInstitucion) {
|
||||
if (this.$objIsEmpty(nuevaInstitucion)) this.modulo = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.institucion = this.objVacio
|
||||
this.obtenerInstituciones()
|
||||
},
|
||||
}
|
||||
</script>
|
70
components/selects/SelectMarca.vue
Normal file
70
components/selects/SelectMarca.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Marca" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="marca"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(m, index) in marcas" :key="index" :value="m">
|
||||
{{ m.marca }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
marcaPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
tipo: { typeof: String, required: true, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
marcas: [],
|
||||
isLoadingSelect: false,
|
||||
marca: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerMarcas() {
|
||||
this.isLoadingSelect = true
|
||||
this.marcas = []
|
||||
axios
|
||||
.get(`${process.env.api}/marca?tipo=${this.tipo}`)
|
||||
.then((res) => {
|
||||
this.marcas = res.data
|
||||
this.$emit('catalogo-marcas', this.marcas)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
marca(marcaSeleccionada) {
|
||||
this.$emit('marca-seleccionada', marcaSeleccionada)
|
||||
},
|
||||
marcaPadre(nuevaMarca) {
|
||||
if (this.$objIsEmpty(nuevaMarca)) this.marca = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.marca = this.objVacio
|
||||
this.obtenerMarcas()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
70
components/selects/SelectModelo.vue
Normal file
70
components/selects/SelectModelo.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Modelo" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="modelo"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(m, index) in modelos" :key="index" :value="m">
|
||||
{{ m.modelo }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
modeloPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
tipo: { typeof: String, required: true, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
modelos: [],
|
||||
isLoadingSelect: false,
|
||||
modelo: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerModelos() {
|
||||
this.isLoadingSelect = true
|
||||
this.modelos = []
|
||||
axios
|
||||
.get(`${process.env.api}/modelo?tipo=${this.tipo}`)
|
||||
.then((res) => {
|
||||
this.modelos = res.data
|
||||
this.$emit('catalogo-modelos', this.modelos)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
modelo(modeloSeleccionado) {
|
||||
this.$emit('modelo-seleccionado', modeloSeleccionado)
|
||||
},
|
||||
modeloPadre(nuevoModelo) {
|
||||
if (this.$objIsEmpty(nuevoModelo)) this.modelo = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.modelo = this.objVacio
|
||||
this.obtenerModelos()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
74
components/selects/SelectModulo.vue
Normal file
74
components/selects/SelectModulo.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Módulo" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="modulo"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(m, index) in modulos" :key="index" :value="m">
|
||||
{{ m.modulo }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
moduloPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
modulos: [],
|
||||
isLoadingSelect: false,
|
||||
modulo: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerModulos() {
|
||||
this.isLoadingSelect = true
|
||||
this.modulos = []
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/modulo/modulos?id_institucion=${this.idInstitucion}`
|
||||
)
|
||||
.then((res) => {
|
||||
this.modulos = res.data
|
||||
this.$emit('catalogo-modulos', this.modulos)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idInstitucion(nuevoIdInstitucion) {
|
||||
if (nuevoIdInstitucion) this.obtenerModulos()
|
||||
},
|
||||
modulo(moduloSeleccionado) {
|
||||
this.$emit('modulo-seleccionado', moduloSeleccionado)
|
||||
},
|
||||
moduloPadre(nuevoModulo) {
|
||||
if (this.$objIsEmpty(nuevoModulo)) this.modulo = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.modulo = this.objVacio
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
68
components/selects/SelectPrograma.vue
Normal file
68
components/selects/SelectPrograma.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Software" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="programa"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(p, index) in programas" :key="index" :value="p">
|
||||
{{ p.programa }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
programaPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
programas: [],
|
||||
isLoadingSelect: false,
|
||||
programa: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerProgramas() {
|
||||
this.isLoadingSelect = true
|
||||
this.programas = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-programa`)
|
||||
.then((res) => {
|
||||
this.programas = res.data
|
||||
this.$emit('catalogo-programas', this.programas)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
programa(programaSeleccionado) {
|
||||
this.$emit('programa-seleccionado', programaSeleccionado)
|
||||
},
|
||||
programaPadre(nuevoPrograma) {
|
||||
if (this.$objIsEmpty(nuevoPrograma)) this.programa = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.programa = this.objVacio
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
70
components/selects/SelectStatus.vue
Normal file
70
components/selects/SelectStatus.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Status" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="status"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(s, index) in catalogoStatus" :key="index" :value="s">
|
||||
{{ s.status }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
idInstitucion: { type: Number, required: true, default: 0 },
|
||||
statusPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
catalogoStatus: [],
|
||||
isLoadingSelect: false,
|
||||
status: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerCatalogoStatus() {
|
||||
this.isLoadingSelect = true
|
||||
this.catalogoStatus = []
|
||||
axios
|
||||
.get(`${process.env.api}/status`)
|
||||
.then((res) => {
|
||||
this.catalogoStatus = res.data
|
||||
this.$emit('catalogo-status', this.catalogoStatus)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
status(statusSeleccionado) {
|
||||
this.$emit('status-seleccionado', statusSeleccionado)
|
||||
},
|
||||
statusPadre(nuevoStatus) {
|
||||
if (this.$objIsEmpty(nuevoStatus)) this.status = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.status = this.objVacio
|
||||
this.obtenerCatalogoStatus()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
69
components/selects/SelectTipoCarrito.vue
Normal file
69
components/selects/SelectTipoCarrito.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de carrito" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="tipoCarrito"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(tc, index) in tiposCarritos" :key="index" :value="tc">
|
||||
{{ tc.tipo_carrito }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
tipoCarritoPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
tiposCarritos: [],
|
||||
isLoadingSelect: false,
|
||||
tipoCarrito: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerTiposCarritos() {
|
||||
this.isLoadingSelect = true
|
||||
this.tiposCarritos = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-tipo-carrito`)
|
||||
.then((res) => {
|
||||
this.tiposCarritos = res.data
|
||||
this.$emit('catalogo-tipos-carritos', this.tiposCarritos)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
tipoCarrito(tipoCarritoSeleccionado) {
|
||||
this.$emit('tipo-carrito-seleccionado', tipoCarritoSeleccionado)
|
||||
},
|
||||
tipoCarritoPadre(nuevoTipoCarrito) {
|
||||
if (this.$objIsEmpty(nuevoTipoCarrito)) this.tipoCarrito = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.tipoCarrito = this.objVacio
|
||||
this.obtenerTiposCarritos()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
73
components/selects/SelectTipoEntrada.vue
Normal file
73
components/selects/SelectTipoEntrada.vue
Normal file
@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<b-field
|
||||
class="column mb-0 pb-0"
|
||||
label="Tipo de conector"
|
||||
:class="columnSize"
|
||||
>
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="tipoEntrada"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(te, index) in tiposEntradas" :key="index" :value="te">
|
||||
{{ te.tipo_entrada }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
tipoEntradaPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
tiposEntradas: [],
|
||||
isLoadingSelect: false,
|
||||
tipoEntrada: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerTiposEntradas() {
|
||||
this.isLoadingSelect = true
|
||||
this.tiposEntradas = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-tipo-entrada`)
|
||||
.then((res) => {
|
||||
this.tiposEntradas = res.data
|
||||
this.$emit('catalogo-tipos-entradas', this.tiposEntradas)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
tipoEntrada(tipoEntradaSeleccionada) {
|
||||
this.$emit('tipo-entrada-seleccionada', tipoEntradaSeleccionada)
|
||||
},
|
||||
tipoEntradaPadre(nuevoTipoEntrada) {
|
||||
if (this.$objIsEmpty(nuevoTipoEntrada)) this.tipoEntrada = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.tipoEntrada = this.objVacio
|
||||
this.obtenerTiposEntradas()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
69
components/selects/SelectTipoUsuario.vue
Normal file
69
components/selects/SelectTipoUsuario.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<b-field class="column mb-0 pb-0" label="Tipo de usuario" :class="columnSize">
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="tipoUsuario"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
Selecciona una opción
|
||||
</option>
|
||||
|
||||
<option v-for="(te, index) in tiposUsuarios" :key="index" :value="te">
|
||||
{{ te.tipo_usuario }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||
tipoUsuarioPadre: { type: Object, required: true, default: () => ({}) },
|
||||
columnSize: { typeof: String, required: false, default: '' },
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
tiposUsuarios: [],
|
||||
isLoadingSelect: false,
|
||||
tipoUsuario: {},
|
||||
objVacio: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerTiposUsuarios() {
|
||||
this.isLoadingSelect = true
|
||||
this.tiposUsuarios = []
|
||||
axios
|
||||
.get(`${process.env.api}/institucion-tipo-entrada`)
|
||||
.then((res) => {
|
||||
this.tiposUsuarios = res.data
|
||||
this.$emit('catalogo-tipos-entradas', this.tiposUsuarios)
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoadingSelect = false
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
tipoUsuario(tipoUsuarioSeleccionado) {
|
||||
this.$emit('tipo-usuario-seleccionado', tipoUsuarioSeleccionado)
|
||||
},
|
||||
tipoUsuarioPadre(nuevoTipoUsuario) {
|
||||
if (this.$objIsEmpty(nuevoTipoUsuario)) this.tipoUsuario = this.objVacio
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.tipoUsuario = this.objVacio
|
||||
this.obtenerTiposUsuarios()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@ -9,6 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaCarritos from '@/components/tablas/TablaCarritos'
|
||||
|
||||
export default {
|
||||
|
@ -9,6 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaEquipos from '@/components/tablas/TablaEquipos'
|
||||
|
||||
export default {
|
||||
|
@ -39,17 +39,17 @@
|
||||
</p>
|
||||
</b-table-column>
|
||||
|
||||
<!-- <template #detail="props">
|
||||
<TablaEquipos :equipo="props.row" />
|
||||
</template> -->
|
||||
<template #detail="props">
|
||||
<EquiposCarrito :carrito="props.row" />
|
||||
</template>
|
||||
</b-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TablaEquipos from '@/components/tablas/TablaEquipos'
|
||||
import EquiposCarrito from '@/components/tablas/EquiposCarrito'
|
||||
|
||||
export default {
|
||||
components: { TablaEquipos },
|
||||
components: { EquiposCarrito },
|
||||
props: {
|
||||
carritos: { type: Array, required: true, default: () => [] },
|
||||
isLoadingTable: { type: Boolean, required: true, default: false },
|
||||
|
Loading…
Reference in New Issue
Block a user