|
|
@@ -3,6 +3,8 @@ import { InstrumentComponent } from "@app/components/investment-proposals/instru
|
|
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|
|
import { IAngularMyDpOptions, IMyDateModel } from "angular-mydatepicker";
|
|
|
import { formatDate, DatePipe } from "@angular/common";
|
|
|
+import { Router } from "@angular/router";
|
|
|
+import { FormInvestmentProposalService } from "@app/services/form-investment-proposal.service";
|
|
|
|
|
|
@Component({
|
|
|
selector: "app-depositos",
|
|
|
@@ -47,9 +49,11 @@ export class DepositosComponent implements InstrumentComponent {
|
|
|
myDateInit: boolean = true;
|
|
|
model: IMyDateModel = null;
|
|
|
|
|
|
- constructor(private formBuilder: FormBuilder) {
|
|
|
- console.log("init");
|
|
|
-
|
|
|
+ constructor(
|
|
|
+ private formBuilder: FormBuilder,
|
|
|
+ private router: Router,
|
|
|
+ private formDataService: FormInvestmentProposalService
|
|
|
+ ) {
|
|
|
this.investmentProposalForm = this.formBuilder.group({
|
|
|
monto_inversion: ["", Validators.required],
|
|
|
plazo_dias: ["", Validators.required],
|
|
|
@@ -61,4 +65,22 @@ export class DepositosComponent implements InstrumentComponent {
|
|
|
fecha_vencimiento: ["", Validators.required]
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ save(form: any): boolean {
|
|
|
+ /*if (!form.valid) {
|
|
|
+ return false;
|
|
|
+ }*/
|
|
|
+ console.log(this.investmentProposalForm.value);
|
|
|
+ this.formDataService.setWork(this.investmentProposalForm.value);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ goToNext(form: any) {
|
|
|
+ if (this.save(form)) {
|
|
|
+ console.log("all good");
|
|
|
+ // Navigate to the work page
|
|
|
+ //console.log(this.formDataService.getInstrumentData());
|
|
|
+ this.router.navigate(["/address"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|