diff --git a/components/crear/CrearCarreraPrograma.vue b/components/crear/CrearCarreraPrograma.vue index cea2a94..9f14e2b 100644 --- a/components/crear/CrearCarreraPrograma.vue +++ b/components/crear/CrearCarreraPrograma.vue @@ -14,12 +14,14 @@ /> @@ -47,14 +49,14 @@ export default { data() { return { idInstitucionCarrera: 0, - programa: {}, + idPrograma: 0, } }, methods: { crearCarreraPrograma() { const data = { id_institucion_carrera: this.idInstitucionCarrera, - id_programa: this.programa.id_programa, + id_programa: this.idPrograma, } this.updateIsLoading(true) @@ -66,7 +68,7 @@ export default { ) .then((res) => { this.idInstitucionCarrera = 0 - this.programa = {} + this.idPrograma = 0 this.obtenerCarrerasProgramas() this.updateIsLoading(false) this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message) @@ -77,7 +79,7 @@ export default { }) }, warning() { - if (this.idInstitucionCarrera && this.programa.id_programa) + if (this.idInstitucionCarrera && this.idPrograma) this.$alertsGenericos.imprimirWarning( this.$buefy, '¿Estas segur@ de querer asignar este software a esta carrera?', diff --git a/components/selects/SelectCarrera.vue b/components/selects/SelectCarrera.vue index 27c8743..ea6d0ad 100644 --- a/components/selects/SelectCarrera.vue +++ b/components/selects/SelectCarrera.vue @@ -59,9 +59,6 @@ export default { }, }, watch: { - idInstitucion(nuevoIdInstitucion) { - if (nuevoIdInstitucion) this.obtenerInstitucionCarreras() - }, idInstitucionCarrera(institucionCarreraSeleccionada) { this.$emit( 'institucion-carrera-seleccionada', @@ -73,7 +70,7 @@ export default { }, }, created() { - this.obtenerInstitucionCarreras() + if (this.idInstitucion) this.obtenerInstitucionCarreras() }, } diff --git a/components/selects/SelectPrograma.vue b/components/selects/SelectPrograma.vue index 0c8ef86..df01ead 100644 --- a/components/selects/SelectPrograma.vue +++ b/components/selects/SelectPrograma.vue @@ -3,15 +3,19 @@ - - @@ -24,15 +28,14 @@ import axios from 'axios' export default { props: { 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: '' }, }, data: () => { return { programas: [], isLoadingSelect: false, - programa: {}, - objVacio: {}, + idPrograma: 0, } }, methods: { @@ -52,16 +55,14 @@ export default { }, }, watch: { - programa(programaSeleccionado) { + idPrograma(programaSeleccionado) { this.$emit('programa-seleccionado', programaSeleccionado) }, - programaPadre(nuevoPrograma) { - if (this.$funcionesGlobales.objIsEmpty(nuevoPrograma)) - this.programa = this.objVacio + idProgramaPadre(nuevoPrograma) { + this.idPrograma = nuevoPrograma }, }, created() { - this.programa = this.objVacio this.obtenerProgramas() }, }