info responsable listo
This commit is contained in:
@@ -88,7 +88,7 @@ export default {
|
||||
.post(
|
||||
`${process.env.api}/programa/carga_masiva`,
|
||||
formData,
|
||||
this.admin.token
|
||||
this.admin.tokenArchivo
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</b-field>
|
||||
|
||||
<b-field label="Clave de programa:">
|
||||
<b-select v-model="programaSeleccionado" expanded>
|
||||
<b-select v-model="programaSelected" expanded>
|
||||
<option value="" disabled>Elija una clave de programa:</option>
|
||||
<option v-for="(p, i) in programas" :key="i" :value="i">
|
||||
{{ p.clavePrograma }}
|
||||
@@ -31,18 +31,14 @@
|
||||
<p class="input">{{ programa.programa }}</p>
|
||||
</b-field>
|
||||
|
||||
<div>
|
||||
<b-button
|
||||
type="is-link"
|
||||
class="my-5"
|
||||
tag="router-link"
|
||||
to="/admin/responsables/infoResponsable/modificar"
|
||||
>
|
||||
Editar información
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading" />
|
||||
<b-button
|
||||
type="is-link"
|
||||
class="my-5"
|
||||
tag="router-link"
|
||||
to="/admin/responsables/infoResponsable/modificar"
|
||||
>
|
||||
Editar información
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -56,8 +52,7 @@ export default {
|
||||
responsable: {},
|
||||
programas: [],
|
||||
programa: {},
|
||||
programaSeleccionado: '',
|
||||
isLoading: false,
|
||||
programaSelected: '',
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@@ -65,10 +60,11 @@ export default {
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
methods: {
|
||||
obtenerResponsable() {
|
||||
this.isLoading = true
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/usuario/responsable?idUsuario=${this.idResponsable}`,
|
||||
@@ -76,10 +72,10 @@ export default {
|
||||
)
|
||||
.then((res) => {
|
||||
this.responsable = res.data
|
||||
this.isLoading = false
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
this.updateIsLoading(false)
|
||||
this.error(err.response.data.message)
|
||||
})
|
||||
},
|
||||
@@ -98,13 +94,13 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
programaSeleccionado() {
|
||||
this.programa = this.programas[this.programaSeleccionado]
|
||||
programaSelected() {
|
||||
this.programa = this.programas[this.programaSelected]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.idResponsable = localStorage.getItem('idResponsable')
|
||||
if (this.admin.idTipoUsuario === 1) {
|
||||
if (this.admin.idTipoUsuario === 1 && this.idResponsable) {
|
||||
this.obtenerResponsable()
|
||||
this.obtenerProgramas()
|
||||
}
|
||||
|
||||
@@ -105,6 +105,12 @@ export default {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
this.admin.tokenArchivo = {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<BotonRegresar
|
||||
path="/admin/responsables"
|
||||
:deleteFromLocalStorage="['idResponsable']"
|
||||
/>
|
||||
|
||||
<b-loading :is-full-page="true" :can-cancel="false" v-model="isLoading" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -31,9 +34,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
admin: {},
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(booleanValue) {
|
||||
this.isLoading = booleanValue
|
||||
},
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
|
||||
Reference in New Issue
Block a user