logo
This commit is contained in:
parent
ddf0e3fc5c
commit
54de0944b9
@ -121,7 +121,7 @@
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="file">
|
||||
<b-field class="file" v-if="admin.tipoUsuario.id_tipo_usuario === 3">
|
||||
<b-upload v-model="logo" expanded accept=".png,.jpeg,.jpg">
|
||||
<a class="button is-primary is-fullwidth">
|
||||
<b-icon icon="upload"></b-icon>
|
||||
@ -143,7 +143,7 @@
|
||||
tiempoPrestamo ||
|
||||
tiempoRecoger ||
|
||||
tiempoEntrega ||
|
||||
logo
|
||||
Object.entries(logo).length === 0
|
||||
? false
|
||||
: true
|
||||
"
|
||||
@ -187,7 +187,7 @@ export default {
|
||||
const data = { id_institucion: this.institucion.id_institucion }
|
||||
|
||||
this.updateIsLoading(true)
|
||||
if (this.logo) return this.subirLogo()
|
||||
if (Object.entries(this.logo).length != 0) return this.subirLogo()
|
||||
if (this.correo) data.correo = this.correo
|
||||
if (this.responsable) data.responsable = this.responsable
|
||||
if (this.telefono) data.telefono = this.telefono
|
||||
|
@ -31,6 +31,7 @@
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:admin="admin"
|
||||
:institucion="institucion"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 2"
|
||||
/>
|
||||
|
||||
<InfoInstitucion
|
||||
@ -39,6 +40,14 @@
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:buscar="buscar"
|
||||
/>
|
||||
|
||||
<AdminInstitucion
|
||||
:buscar="buscar"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
:admin="admin"
|
||||
:institucion="institucion"
|
||||
v-if="admin.tipoUsuario.id_tipo_usuario === 3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,71 +0,0 @@
|
||||
<template>
|
||||
<div class="column has-text-centered pb-5">
|
||||
<b-field>
|
||||
<b-upload v-model="logo" drag-drop expanded accept=".png,.jpeg,.jpg">
|
||||
<section
|
||||
class="section is-flex is-align-items-center is-justify-content-center drag-drop"
|
||||
>
|
||||
<div class="content has-text-centered">
|
||||
<p>
|
||||
<b-icon icon="upload" size="is-large"> </b-icon>
|
||||
</p>
|
||||
|
||||
<p>{{ logo.name || 'Adjunta el logo de la Institución' }}</p>
|
||||
</div>
|
||||
</section>
|
||||
</b-upload>
|
||||
</b-field>
|
||||
|
||||
<b-button
|
||||
type="is-success"
|
||||
:disabled="!logo.name"
|
||||
@click="
|
||||
$alertsGenericos.imprimirWarning(
|
||||
$buefy,
|
||||
'¿Esta segur@ de querer subir este archivo?',
|
||||
subirLogo
|
||||
)
|
||||
"
|
||||
>
|
||||
Subir
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
props: {
|
||||
admin: { type: Object, require: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
subirLogo() {
|
||||
const formData = new FormData()
|
||||
|
||||
this.updateIsLoading(true)
|
||||
formData.append('logo', this.logo)
|
||||
axios
|
||||
.post(
|
||||
`${process.env.api}/upload-file/upload-logo?id_institucion=${this.admin.institucion.id_institucion}`,
|
||||
formData,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
this.dropFiles = []
|
||||
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>
|
Loading…
Reference in New Issue
Block a user