Merge branch 'smc_credit_pd_new' of https://bitbucket.org/venbaittech/sparq-lender into smc_credit_pd_new
This commit is contained in:
commit
a3b9437220
@ -22,6 +22,7 @@ export class DynamicFormComponent implements OnInit {
|
||||
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
|
||||
@ViewChild('accordion') Accordion: MatAccordion
|
||||
queries_docs: any;
|
||||
records: { addtional_requirements: any; createdby: string; pdid: any; };
|
||||
constructor(private _fb:FormBuilder,private questionService:QuesFormService,private pdTriggerService:PdTrigerService) { }
|
||||
|
||||
ngOnInit() {
|
||||
@ -203,7 +204,7 @@ export class DynamicFormComponent implements OnInit {
|
||||
// REMOVE OF CHILD REPEATABLE OBJ
|
||||
removeSecondLevelChild(index,json_obj,parent_group) {
|
||||
|
||||
// debugger;
|
||||
|
||||
let control = parent_group.get(json_obj.group_key)
|
||||
control.removeAt(index)
|
||||
json_obj.questions_level_two.splice(index,1)
|
||||
@ -214,19 +215,45 @@ export class DynamicFormComponent implements OnInit {
|
||||
removeData(index,json_obj) {
|
||||
|
||||
// debugger;
|
||||
console.log(json_obj)
|
||||
console.log(json_obj.group_key)
|
||||
console.log(this.json_answers);
|
||||
console.log(json_obj);
|
||||
|
||||
|
||||
let control = this.form_group_name.get(json_obj.group_key) as FormArray
|
||||
console.log(control)
|
||||
control.removeAt(index)
|
||||
if(this.json_answers){
|
||||
console.log(this.json_answers[json_obj.group_key])
|
||||
if(this.json_answers.cm_queries instanceof Array){
|
||||
this.json_answers.cm_queries.splice(index,1)
|
||||
console.log(this.json_answers.cm_queries[index].question);
|
||||
let data = localStorage.getItem('pd_additional_requirements');
|
||||
console.log(JSON.parse(data));
|
||||
let additional_requirements;
|
||||
let tmp = JSON.parse(data)
|
||||
if(tmp.length != 0){
|
||||
tmp.forEach(element => {
|
||||
if(element.add_requirement == this.json_answers.cm_queries[index].question){
|
||||
element.isactive = '0'
|
||||
|
||||
}
|
||||
tmp.forEach(element => {
|
||||
element.is_insert_json ="1"
|
||||
});
|
||||
console.log(tmp);
|
||||
additional_requirements = tmp;
|
||||
});
|
||||
localStorage.setItem('pd_additional_requirements', JSON.stringify( additional_requirements));
|
||||
localStorage.setItem('check', '1');
|
||||
|
||||
console.log(additional_requirements);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(this.json_answers[json_obj.group_key] != null && this.json_answers[json_obj.group_key] instanceof Array){
|
||||
this.json_answers[json_obj.group_key].splice(index,1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
console.log(control)
|
||||
json_obj.group_questions.splice(index,1)
|
||||
this.step = control.length-1
|
||||
@ -245,4 +272,4 @@ export class DynamicFormComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -227,9 +227,11 @@ else
|
||||
console.log(pdid)
|
||||
this.pdTriggerService.getAdditionalRequirements(pdid).subscribe(res=>{
|
||||
console.log(res)
|
||||
|
||||
if(res['dataStatus']){
|
||||
this.additional_query =[];
|
||||
this.queries_value=res['records'].pd_additional_requirements
|
||||
localStorage.setItem('pd_additional_requirements', JSON.stringify( this.queries_value));
|
||||
|
||||
}
|
||||
})
|
||||
@ -433,13 +435,35 @@ else
|
||||
});
|
||||
this.additional_requirements = this.queries_value
|
||||
|
||||
console.log(queries_docs);
|
||||
|
||||
this.records ={
|
||||
"addtional_requirements": this.additional_requirements,
|
||||
"createdby":"",
|
||||
"pdid": this.pdid ,
|
||||
}
|
||||
console.log(this.queries_value);
|
||||
|
||||
let check = localStorage.getItem('check');
|
||||
if(check == "1"){
|
||||
let data = localStorage.getItem('pd_additional_requirements');
|
||||
console.log(JSON.parse(data));
|
||||
let additional_requirements = JSON.parse(data)
|
||||
this.additional_requirements.forEach(element => {
|
||||
element.is_insert_json ="1"
|
||||
});
|
||||
this.records ={
|
||||
"addtional_requirements": additional_requirements,
|
||||
"createdby":"",
|
||||
"pdid": this.pdid ,
|
||||
}
|
||||
localStorage.setItem('check', '0');
|
||||
|
||||
}else{
|
||||
this.queries_value.forEach(element => {
|
||||
element.is_insert_json ="1"
|
||||
});
|
||||
this.additional_requirements = this.queries_value
|
||||
this.records = {
|
||||
"addtional_requirements": this.additional_requirements,
|
||||
"createdby":"",
|
||||
"pdid": this.pdid ,
|
||||
}
|
||||
}
|
||||
|
||||
console.log(this.commonFormGroup);
|
||||
console.log('data');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user