70 lines
2.0 KiB
Vue
70 lines
2.0 KiB
Vue
<template>
|
|
<b-table
|
|
class="mb-6"
|
|
:data="carrerasProgramas"
|
|
:loading="isLoadingTable"
|
|
:per-page="25"
|
|
:total="total"
|
|
hoverable
|
|
paginated
|
|
striped
|
|
>
|
|
<b-table-column field="carrera" label="Carrera" v-slot="props" centered>
|
|
<p>{{ props.row.institucionCarrera.carrera.carrera }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="programa" label="Programa" v-slot="props" centered>
|
|
<p>{{ props.row.programa.programa }}</p>
|
|
</b-table-column>
|
|
|
|
<b-table-column field="eliminar" label="Eliminar" v-slot="props" centered>
|
|
<BotonEliminar
|
|
:eliminar="eliminarCarreraPrograma"
|
|
:row="props.row"
|
|
:msjWarning="`¿Estás segur@ de querer eliminar esta asignación de software?`"
|
|
/>
|
|
</b-table-column>
|
|
</b-table>
|
|
</template>
|
|
|
|
<script>
|
|
import axios from 'axios'
|
|
import BotonEliminar from '@/components/botones/BotonEliminar'
|
|
|
|
export default {
|
|
components: { BotonEliminar },
|
|
props: {
|
|
carrerasProgramas: { type: Array, required: true, default: () => [] },
|
|
isLoadingTable: { type: Boolean, required: true, default: false },
|
|
obtenerCarrerasProgramas: {
|
|
type: Function,
|
|
required: true,
|
|
default: () => {},
|
|
},
|
|
updateIsLoading: { type: Function, required: true, default: () => {} },
|
|
total: { type: Number, required: true, default: 0 },
|
|
},
|
|
methods: {
|
|
eliminarCarreraPrograma(carreraPrograma) {
|
|
this.updateIsLoading(true)
|
|
axios
|
|
.delete(
|
|
`${process.env.api}/carrera-programa`,
|
|
this.$getToken.tokenDelete({
|
|
id_carrera_programa: carreraPrograma.id_carrera_programa,
|
|
})
|
|
)
|
|
.then((res) => {
|
|
this.obtenerCarrerasProgramas()
|
|
this.updateIsLoading(false)
|
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
|
})
|
|
.catch((err) => {
|
|
this.updateIsLoading(false)
|
|
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|