Gustavo Baz Front
This commit is contained in:
+2
-2
@@ -34,8 +34,8 @@ export default {
|
||||
},
|
||||
env: {
|
||||
// api: "http://localhost:3000",
|
||||
api: "https://venus.acatlan.unam.mx/ss-pruebas",
|
||||
// api: "https://venus.acatlan.unam.mx/ss-pruebas",
|
||||
// api: "https://890af9d598a4.ngrok.io"
|
||||
// api: "https://venus.acatlan.unam.mx/serviciosocial",
|
||||
api: "https://venus.acatlan.unam.mx/serviciosocial",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -91,7 +91,38 @@
|
||||
disabled
|
||||
>Descargar reporte</b-button
|
||||
>
|
||||
|
||||
<p class="is-size-2 mb-5">Gustavo Baz Prada</p>
|
||||
<p class="is-size-3">Seleccione un año:</p>
|
||||
<b-select
|
||||
class="my-5 is-medium"
|
||||
v-model="selectedYearGustavoBaz"
|
||||
expanded
|
||||
placeholder="Seleccione un año: "
|
||||
>
|
||||
<option v-for="year in years" v-bind:key="year" :value="year">
|
||||
{{ year }}
|
||||
</option>
|
||||
</b-select>
|
||||
<b-button
|
||||
class="is-info mb-5"
|
||||
v-if="selectedYearGustavoBaz"
|
||||
@click="crearGustavoBaz()"
|
||||
>Crear Gustavo Baz</b-button
|
||||
>
|
||||
<b-button class="is-info mb-5" v-else disabled>Crear Gustavo Baz</b-button>
|
||||
<a :href="link3" target="_blank">
|
||||
<b-button
|
||||
class="is-info mb-5"
|
||||
v-if="selectedYearGustavoBaz && gustavoListo"
|
||||
>Descargar</b-button
|
||||
>
|
||||
</a>
|
||||
<b-button
|
||||
class="is-info"
|
||||
v-if="!(selectedYearGustavoBaz && gustavoListo)"
|
||||
disabled
|
||||
>Descargar</b-button
|
||||
>
|
||||
<b-loading
|
||||
:is-full-page="true"
|
||||
v-model="isLoading"
|
||||
@@ -111,15 +142,18 @@ export default {
|
||||
return {
|
||||
years: [],
|
||||
selectedYear: null,
|
||||
selectedYearGustavoBaz: null,
|
||||
selectedCuestionario: null,
|
||||
selectedInicio: null,
|
||||
selectedFin: null,
|
||||
botonDos: false,
|
||||
reporteListo: false,
|
||||
gustavoListo: false,
|
||||
minDate: new Date("January 1, 2020"),
|
||||
maxDate: new Date(),
|
||||
link: "",
|
||||
link2: "",
|
||||
link3: "",
|
||||
isLoading: false,
|
||||
token: {
|
||||
headers: {
|
||||
@@ -170,6 +204,24 @@ export default {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
crearGustavoBaz() {
|
||||
this.isLoading = true;
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/gustavo_bas_prada?year=${this.selectedYearGustavoBaz}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.link3 = `${process.env.api}/${this.selectedYearGustavoBaz}_gustavo_baz_prada.csv`;
|
||||
this.gustavoListo = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error(err.response.data.message);
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false;
|
||||
switch (msj) {
|
||||
|
||||
Reference in New Issue
Block a user