|
@@ -242,40 +242,18 @@ export class PBURCostsComponent implements OnInit {
|
|
|
this.instrumentService
|
|
this.instrumentService
|
|
|
.projectionCalc(this.investmentProposalID, this.form.value)
|
|
.projectionCalc(this.investmentProposalID, this.form.value)
|
|
|
.subscribe(
|
|
.subscribe(
|
|
|
- resp => {
|
|
|
|
|
- this.investmentsService
|
|
|
|
|
- .updateInstrumentProjection(
|
|
|
|
|
- this.investmentProposalID,
|
|
|
|
|
- objProjection
|
|
|
|
|
- )
|
|
|
|
|
- .subscribe(
|
|
|
|
|
- success => {
|
|
|
|
|
- if (success) {
|
|
|
|
|
- Swal.fire({
|
|
|
|
|
- allowOutsideClick: false,
|
|
|
|
|
- icon: "success",
|
|
|
|
|
- showCancelButton: false,
|
|
|
|
|
- title: "Exito",
|
|
|
|
|
- confirmButtonText: "La información ha sido actualizada"
|
|
|
|
|
- }).then(result => {
|
|
|
|
|
- this.proyecciones = result["result"];
|
|
|
|
|
-
|
|
|
|
|
- this.form = new FormArray(
|
|
|
|
|
- this.buildForm(this.proyecciones)
|
|
|
|
|
- );
|
|
|
|
|
- Swal.close();
|
|
|
|
|
- //window.location.reload();
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- err => {
|
|
|
|
|
- Swal.fire({
|
|
|
|
|
- icon: "error",
|
|
|
|
|
- title: "Error al guardar",
|
|
|
|
|
- text: err.message
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ result => {
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ allowOutsideClick: false,
|
|
|
|
|
+ icon: "success",
|
|
|
|
|
+ showCancelButton: false,
|
|
|
|
|
+ title: "Exito"
|
|
|
|
|
+ });
|
|
|
|
|
+ this.proyecciones = result["result"]["proyecciones"];
|
|
|
|
|
+ this.form.clear();
|
|
|
|
|
+ this.form = new FormArray(this.buildForm(this.proyecciones));
|
|
|
|
|
+ Swal.close();
|
|
|
|
|
+ //window.location.reload();
|
|
|
},
|
|
},
|
|
|
err => {
|
|
err => {
|
|
|
Swal.fire({
|
|
Swal.fire({
|
|
@@ -297,37 +275,19 @@ export class PBURCostsComponent implements OnInit {
|
|
|
Swal.showLoading();
|
|
Swal.showLoading();
|
|
|
|
|
|
|
|
this.instrumentService
|
|
this.instrumentService
|
|
|
- .projectionModification(this.investmentProposalID, this.form.value)
|
|
|
|
|
|
|
+ .projectionModification(this.investmentProposalID, objProjection)
|
|
|
.subscribe(
|
|
.subscribe(
|
|
|
resp => {
|
|
resp => {
|
|
|
- this.investmentsService
|
|
|
|
|
- .updateInstrumentProjection(
|
|
|
|
|
- this.investmentProposalID,
|
|
|
|
|
- objProjection
|
|
|
|
|
- )
|
|
|
|
|
- .subscribe(
|
|
|
|
|
- success => {
|
|
|
|
|
- if (success) {
|
|
|
|
|
- Swal.fire({
|
|
|
|
|
- allowOutsideClick: false,
|
|
|
|
|
- icon: "success",
|
|
|
|
|
- showCancelButton: false,
|
|
|
|
|
- title: "Exito",
|
|
|
|
|
- confirmButtonText: "La información ha sido actualizada"
|
|
|
|
|
- }).then(result => {
|
|
|
|
|
- Swal.close();
|
|
|
|
|
- //window.location.reload();
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- err => {
|
|
|
|
|
- Swal.fire({
|
|
|
|
|
- icon: "error",
|
|
|
|
|
- title: "Error al guardar",
|
|
|
|
|
- text: err.message
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ allowOutsideClick: false,
|
|
|
|
|
+ icon: "success",
|
|
|
|
|
+ showCancelButton: false,
|
|
|
|
|
+ title: "Exito",
|
|
|
|
|
+ confirmButtonText: "La información ha sido actualizada"
|
|
|
|
|
+ }).then(result => {
|
|
|
|
|
+ Swal.close();
|
|
|
|
|
+ //window.location.reload();
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
err => {
|
|
err => {
|
|
|
Swal.fire({
|
|
Swal.fire({
|
|
@@ -338,7 +298,6 @@ export class PBURCostsComponent implements OnInit {
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
buildForm(items: any[]): FormGroup[] {
|
|
buildForm(items: any[]): FormGroup[] {
|
|
|
return items.map(x => this.buildItem(x));
|
|
return items.map(x => this.buildItem(x));
|
|
|
}
|
|
}
|