hot fix marco
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
<b-input
|
||||
type="number"
|
||||
:placeholder="viejo.telefono"
|
||||
v-model="nuevo.telefono"
|
||||
maxlength="10"
|
||||
></b-input>
|
||||
</b-field>
|
||||
@@ -139,9 +140,6 @@
|
||||
>Actualizar Datos</b-button
|
||||
>
|
||||
<b-button v-else disabled class="is-info">Actualizar Datos</b-button>
|
||||
<div>
|
||||
<BotonRegresar :path="'/admin/servicio'" />
|
||||
</div>
|
||||
<b-loading
|
||||
:is-full-page="true"
|
||||
v-model="isLoading"
|
||||
@@ -262,39 +260,26 @@ export default {
|
||||
}
|
||||
},
|
||||
actualizar() {
|
||||
this.isLoading = true;
|
||||
const data = { idServicio: this.idServicio };
|
||||
if (this.nuevo.direccion) {
|
||||
data.direccion = this.nuevo.direccion;
|
||||
}
|
||||
if (this.nuevo.correo) {
|
||||
data.correo = this.nuevo.correo;
|
||||
}
|
||||
if (this.nuevo.telefono) {
|
||||
data.telefono = this.nuevo.telefono;
|
||||
}
|
||||
if (this.nuevo.fechaInicioFinal) {
|
||||
data.fechaInicio = this.nuevo.fechaInicioFinal;
|
||||
}
|
||||
if (this.nuevo.fechaFinFinal) {
|
||||
data.fechaFin = this.nuevo.fechaFinFinal;
|
||||
}
|
||||
if (this.nuevo.fechaNacimientoFinal) {
|
||||
data.fechaNacimiento = this.nuevo.fechaNacimientoFinal;
|
||||
}
|
||||
const formData = new FormData();
|
||||
if (this.cartaAceptacion) {
|
||||
formData.append("cartaAceptacion", this.cartaAceptacion);
|
||||
}
|
||||
if (this.cartaTermino) {
|
||||
formData.append("cartaTermino", this.cartaTermino);
|
||||
}
|
||||
if (this.informeGlobal) {
|
||||
formData.append("informeGlobal", this.informeGlobal);
|
||||
}
|
||||
if (data) {
|
||||
formData.append("data", JSON.stringify(data));
|
||||
}
|
||||
const data = { idServicio: this.idServicio };
|
||||
|
||||
this.isLoading = true;
|
||||
if (this.nuevo.direccion) data.direccion = this.nuevo.direccion;
|
||||
if (this.nuevo.correo) data.correo = this.nuevo.correo;
|
||||
if (this.nuevo.telefono) data.telefono = this.nuevo.telefono;
|
||||
if (this.nuevo.fechaInicioFinal)
|
||||
data.fechaInicio = this.nuevo.fechaInicioFinal;
|
||||
if (this.nuevo.fechaFinFinal) data.fechaFin = this.nuevo.fechaFinFinal;
|
||||
if (this.nuevo.fechaNacimientoFinal)
|
||||
data.fechaNacimiento = this.nuevo.fechaNacimientoFinal;
|
||||
formData.append("data", JSON.stringify(data));
|
||||
if (this.nuevo.cartaAceptacion)
|
||||
formData.append("cartaAceptacion", this.nuevo.cartaAceptacion);
|
||||
if (this.nuevo.cartaTermino)
|
||||
formData.append("cartaTermino", this.nuevo.cartaTermino);
|
||||
if (this.nuevo.informeGlobal)
|
||||
formData.append("informeGlobal", this.nuevo.informeGlobal);
|
||||
|
||||
axios
|
||||
.put(`${process.env.api}/servicio/update`, formData, {
|
||||
headers: {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</section>
|
||||
</b-upload>
|
||||
</b-field>
|
||||
<b-button v-if="csv.name" @click="actualizarDialog()" class="is-info"
|
||||
<b-button v-if="csv.name" @click="dialog()" class="is-info"
|
||||
>Enviar archivo</b-button
|
||||
>
|
||||
<b-button v-else disabled class="is-info">Enviar archivo</b-button>
|
||||
@@ -79,13 +79,12 @@ export default {
|
||||
});
|
||||
},
|
||||
enviarCargaMasiva() {
|
||||
this.isLoading = true;
|
||||
const formData = new FormData();
|
||||
if (this.cartaAceptacion) {
|
||||
formData.append("cartaAceptacion", this.cartaAceptacion);
|
||||
}
|
||||
|
||||
this.isLoading = true;
|
||||
formData.append("csv", this.csv);
|
||||
axios
|
||||
.put(`${process.env.api}/programa/carga_masiva`, formData, {
|
||||
.post(`${process.env.api}/programa/carga_masiva`, formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
token: this.token.headers.token,
|
||||
@@ -96,11 +95,11 @@ export default {
|
||||
this.toastType = "is-success";
|
||||
this.toastMessage = "Se ha enviado la carga masiva con éxito";
|
||||
this.toast();
|
||||
this.$$router.push("/admin");
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false;
|
||||
this.error(err.response.data.message);
|
||||
console.log(err.response.data.message);
|
||||
});
|
||||
},
|
||||
error(msj) {
|
||||
|
||||
Generated
+14884
-9
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user