From 0f931e79d97cb071eadb1c40f601d3fcda2b77fe Mon Sep 17 00:00:00 2001 From: gayathri1990 Date: Thu, 13 May 2021 14:33:19 +0530 Subject: [PATCH] smc credit pd changes --- .../dynamic-question-template.component.ts | 5 ++-- .../ques-form/ques-form.service.ts | 12 ++++++--- .../start-pd/forms/form/form.component.html | 2 +- .../start-pd/forms/form/form.component.ts | 25 +++++++++++-------- .../pd-service/pd-triger.service.ts | 2 +- ng6-seed/src/main.ts | 6 ++--- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts index eb59530..f77a095 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts @@ -29,7 +29,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { public ngxFilteredValue:ReplaySubject = new ReplaySubject(1); constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog) { } - ngOnInit() { + ngOnInit() { this.parent_ques = this.currFormArrayObj if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) { this.autoCompleteAns =this.formGroupN.get(this.parent_ques.question_key).valueChanges.pipe( @@ -98,7 +98,8 @@ export class DynamicQuestionTemplateComponent implements OnInit { // setTimeout(()=>{ // this.json_answers = null // },700) - } + this.quesService.formanswers=null; + } // console.log(this.parent_ques,this.formGroupN,this.whole_json ,this.json_answers); // debugger; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 854abf0..c633897 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import { Injectable, Testability } from '@angular/core'; import { FormGroup, FormArray, FormBuilder, FormControl, Validators } from '@angular/forms'; import { HttpClient, HttpParams } from '@angular/common/http'; import { environment } from 'environments/environment'; @@ -10,7 +10,7 @@ const apiUrl = environment.apiEndpoint providedIn: 'root' }) export class QuesFormService { - + formanswers=null; pd_all_details:any= {} datepipe: DatePipe; constructor(private _fb:FormBuilder,private http:HttpClient) { @@ -323,9 +323,12 @@ export class QuesFormService { { temp[val] = this.pd_all_details.pdmaster_details.random_string } - + //param = param.set(val,params[val]) }) + // console.log('13may'); + // console.log(temp); + // console.log('13may'); if(params.hasOwnProperty("records")) { params.records=temp @@ -335,7 +338,8 @@ export class QuesFormService { params=temp; } } - + console.log('may13'); + console.log(params); return this.http.post(apiUrl+api_name,params) } else{ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.html index 4a89ac5..9ac7a0e 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.html @@ -20,7 +20,7 @@ --> - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts index 2ad755c..65c03e8 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts @@ -37,8 +37,9 @@ export class FormComponent implements OnInit { private router: Router, private _pd: PdTrigerService, private dialogRef: MatDialogRef, - private dialog: MatDialog, private quesService:QuesFormService, + private dialog: MatDialog, public quesService:QuesFormService, @Inject(MAT_DIALOG_DATA) public pd_all_details: any, + private pdTriggerService:PdTrigerService, private awsService:AwsService,private loaderService:LoaderService) { // console.log(this.pd_all_details) @@ -48,6 +49,7 @@ export class FormComponent implements OnInit { this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.notifier = notifier; + this.quesService.formanswers=null; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; @@ -60,7 +62,8 @@ export class FormComponent implements OnInit { } ngOnInit() { - + //alert(this.formanswers) + //alert(this.quesService.formanswers); console.log("answered",this.pd_all_details.is_answered) if(this.pd_all_details.is_answered == '1') { this.getSectionData() @@ -77,7 +80,7 @@ export class FormComponent implements OnInit { let params = {"fk_entity_id":this.pd_all_details.pdmaster_details.fk_lender_id,"fk_product_id":this.pd_all_details.pdmaster_details.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id} this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{ if(!environment.production){ - // result.dataStatus = false + //result.dataStatus = false } if(result.dataStatus) { let question_template: any = result.records @@ -130,10 +133,10 @@ export class FormComponent implements OnInit { if(records && records.hasOwnProperty('json') && records.json) { formValues = JSON.parse(records.json) // console.log(this.form) - this.form_answers= formValues - setTimeout(()=>{ - this.form_answers = null - },2000) + this.quesService.formanswers= formValues + // setTimeout(()=>{ + // this.quesService.formanswers = null + // },2000) // this.commonFormGroup.patchValue(formValues) } } @@ -166,10 +169,10 @@ export class FormComponent implements OnInit { this.commonFormGroup.patchValue(formValues) } else { - this.form_answers= formValues - setTimeout(()=>{ - this.form_answers = null - },2500) + this.quesService.formanswers= formValues + // setTimeout(()=>{ + // this.quesService.formanswers = null + // },2500) } // this.commonFormGroup.patchValue(formValues) } diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index ff8c53d..80ae4c7 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -826,7 +826,7 @@ uploadSMCDataFile(file,pd_id ?) { } loadTemplate(form_id) { return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/'+form_id+'.json').map(rr=>{ - // return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/NBFCMFI/1.json').map(rr=>{ + //return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/WCTL/1.json').map(rr=>{ let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}} // this.raw_credit_pd_template= returnValue.records.template return returnValue diff --git a/ng6-seed/src/main.ts b/ng6-seed/src/main.ts index 7307b26..329b9a1 100644 --- a/ng6-seed/src/main.ts +++ b/ng6-seed/src/main.ts @@ -6,9 +6,9 @@ import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); - if(window){ - window.console.log = function(){}; - } + // if(window){ + // window.console.log = function(){}; + // } }