listo select programa
This commit is contained in:
parent
ff4ba8787c
commit
132d6889ec
@ -14,12 +14,14 @@
|
||||
/>
|
||||
|
||||
<SelectPrograma
|
||||
:programaPadre="programa"
|
||||
@programa-seleccionado="(nuevoPrograma) => (programa = nuevoPrograma)"
|
||||
:idProgramaPadre="idPrograma"
|
||||
@programa-seleccionado="
|
||||
(nuevoPrograma) => (idPrograma = nuevoPrograma)
|
||||
"
|
||||
/>
|
||||
|
||||
<BotonCrear
|
||||
:disabled="!idInstitucionCarrera || !programa.id_programa"
|
||||
:disabled="!idInstitucionCarrera || !idPrograma"
|
||||
:crear="warning"
|
||||
/>
|
||||
</div>
|
||||
@ -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?',
|
||||
|
@ -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()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -3,15 +3,19 @@
|
||||
<b-select
|
||||
icon="store"
|
||||
:loading="isLoadingSelect"
|
||||
v-model="programa"
|
||||
v-model="idPrograma"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option :disabled="deshabilitarOptVacia" :value="objVacio">
|
||||
<option :disabled="deshabilitarOptVacia" :value="0">
|
||||
Selecciona una opción
|
||||
</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 }}
|
||||
</option>
|
||||
</b-select>
|
||||
@ -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()
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user