listo select programa
This commit is contained in:
parent
ff4ba8787c
commit
132d6889ec
@ -14,12 +14,14 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<SelectPrograma
|
<SelectPrograma
|
||||||
:programaPadre="programa"
|
:idProgramaPadre="idPrograma"
|
||||||
@programa-seleccionado="(nuevoPrograma) => (programa = nuevoPrograma)"
|
@programa-seleccionado="
|
||||||
|
(nuevoPrograma) => (idPrograma = nuevoPrograma)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BotonCrear
|
<BotonCrear
|
||||||
:disabled="!idInstitucionCarrera || !programa.id_programa"
|
:disabled="!idInstitucionCarrera || !idPrograma"
|
||||||
:crear="warning"
|
:crear="warning"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -47,14 +49,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
idInstitucionCarrera: 0,
|
idInstitucionCarrera: 0,
|
||||||
programa: {},
|
idPrograma: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
crearCarreraPrograma() {
|
crearCarreraPrograma() {
|
||||||
const data = {
|
const data = {
|
||||||
id_institucion_carrera: this.idInstitucionCarrera,
|
id_institucion_carrera: this.idInstitucionCarrera,
|
||||||
id_programa: this.programa.id_programa,
|
id_programa: this.idPrograma,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateIsLoading(true)
|
this.updateIsLoading(true)
|
||||||
@ -66,7 +68,7 @@ export default {
|
|||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.idInstitucionCarrera = 0
|
this.idInstitucionCarrera = 0
|
||||||
this.programa = {}
|
this.idPrograma = 0
|
||||||
this.obtenerCarrerasProgramas()
|
this.obtenerCarrerasProgramas()
|
||||||
this.updateIsLoading(false)
|
this.updateIsLoading(false)
|
||||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||||
@ -77,7 +79,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
warning() {
|
warning() {
|
||||||
if (this.idInstitucionCarrera && this.programa.id_programa)
|
if (this.idInstitucionCarrera && this.idPrograma)
|
||||||
this.$alertsGenericos.imprimirWarning(
|
this.$alertsGenericos.imprimirWarning(
|
||||||
this.$buefy,
|
this.$buefy,
|
||||||
'¿Estas segur@ de querer asignar este software a esta carrera?',
|
'¿Estas segur@ de querer asignar este software a esta carrera?',
|
||||||
|
@ -59,9 +59,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
idInstitucion(nuevoIdInstitucion) {
|
|
||||||
if (nuevoIdInstitucion) this.obtenerInstitucionCarreras()
|
|
||||||
},
|
|
||||||
idInstitucionCarrera(institucionCarreraSeleccionada) {
|
idInstitucionCarrera(institucionCarreraSeleccionada) {
|
||||||
this.$emit(
|
this.$emit(
|
||||||
'institucion-carrera-seleccionada',
|
'institucion-carrera-seleccionada',
|
||||||
@ -73,7 +70,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.obtenerInstitucionCarreras()
|
if (this.idInstitucion) this.obtenerInstitucionCarreras()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,15 +3,19 @@
|
|||||||
<b-select
|
<b-select
|
||||||
icon="store"
|
icon="store"
|
||||||
:loading="isLoadingSelect"
|
:loading="isLoadingSelect"
|
||||||
v-model="programa"
|
v-model="idPrograma"
|
||||||
expanded
|
expanded
|
||||||
rounded
|
rounded
|
||||||
>
|
>
|
||||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
<option :disabled="deshabilitarOptVacia" :value="0">
|
||||||
Selecciona una opción
|
Selecciona una opción
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
<option v-for="(p, index) in programas" :key="index" :value="p">
|
<option
|
||||||
|
v-for="(p, index) in programas"
|
||||||
|
:key="index"
|
||||||
|
:value="p.id_programa"
|
||||||
|
>
|
||||||
{{ p.programa }}
|
{{ p.programa }}
|
||||||
</option>
|
</option>
|
||||||
</b-select>
|
</b-select>
|
||||||
@ -24,15 +28,14 @@ import axios from 'axios'
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
deshabilitarOptVacia: { typeof: Boolean, required: false, default: true },
|
||||||
programaPadre: { type: Object, required: true, default: () => ({}) },
|
idProgramaPadre: { type: Number, required: true, default: 0 },
|
||||||
columnSize: { typeof: String, required: false, default: '' },
|
columnSize: { typeof: String, required: false, default: '' },
|
||||||
},
|
},
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
programas: [],
|
programas: [],
|
||||||
isLoadingSelect: false,
|
isLoadingSelect: false,
|
||||||
programa: {},
|
idPrograma: 0,
|
||||||
objVacio: {},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -52,16 +55,14 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
programa(programaSeleccionado) {
|
idPrograma(programaSeleccionado) {
|
||||||
this.$emit('programa-seleccionado', programaSeleccionado)
|
this.$emit('programa-seleccionado', programaSeleccionado)
|
||||||
},
|
},
|
||||||
programaPadre(nuevoPrograma) {
|
idProgramaPadre(nuevoPrograma) {
|
||||||
if (this.$funcionesGlobales.objIsEmpty(nuevoPrograma))
|
this.idPrograma = nuevoPrograma
|
||||||
this.programa = this.objVacio
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.programa = this.objVacio
|
|
||||||
this.obtenerProgramas()
|
this.obtenerProgramas()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user