smc credit pd changes
This commit is contained in:
parent
4804b63ebd
commit
0f931e79d9
@ -29,7 +29,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
||||
public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(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;
|
||||
|
||||
@ -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{
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
</mat-card-title>
|
||||
</mat-card-header> -->
|
||||
<mat-card-content>
|
||||
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="form_answers"></app-dynamic-form>
|
||||
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="quesService.formanswers"></app-dynamic-form>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-dialog-content>
|
||||
|
||||
@ -37,8 +37,9 @@ export class FormComponent implements OnInit {
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
private dialogRef: MatDialogRef<FormComponent>,
|
||||
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)
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(){};
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user