FIX_Keystackholder

This commit is contained in:
VE10-Sanjeev 2024-05-14 05:20:36 +00:00
parent 64f30ecf28
commit 829f88d8a8

View File

@ -70,40 +70,45 @@ export class FormComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.pd_all_details);
console.log(this.pd_all_details.pdmaster_details.product_abbr);
console.log(this.pd_all_details.form_id);
//this.getSectionData() //this.getSectionData()
if(this.pd_all_details.form_id=='5' && (this.pd_all_details.pdmaster_details.product_abbr=='LFMP' || this.pd_all_details.pdmaster_details.product_abbr=='MLAP')) if(this.pd_all_details.form_id=='5' && (this.pd_all_details.pdmaster_details.product_abbr=='LFMP' || this.pd_all_details.pdmaster_details.product_abbr=='MLAP'))
{ {
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id}; let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id}
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{ this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
console.log(result);
if(result['dataStatus']) { if(result['dataStatus']) {
let records = result['records']; let records = result['records']
let formValues:any ={}; let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) { if(records && records.hasOwnProperty('json') && records.json) {
formValues = JSON.parse(records.json); formValues = JSON.parse(records.json)
console.log(formValues); console.log(formValues)
if(formValues.key_stakeholders[0].stakeholder_length != '0') if(formValues.key_stakeholders[0].stakeholder_length)
{ {
let controlcount=formValues.key_stakeholders[0].stakeholder_length; let controlcount=formValues.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount); this.quesService.ques_length(controlcount)
this.loadTemplate(); this.loadTemplate()
}else{
let controlcount1='3';
this.quesService.ques_length(controlcount1);
this.loadTemplate();
} }
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined"){} else
{
let controlcount1='3';
this.quesService.ques_length(controlcount1)
this.loadTemplate()
}
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined")
// {
// }
} }
} }
else else
{ {
console.log("in else part");
let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id} let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{ this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) { if(result['dataStatus']) {
@ -111,7 +116,7 @@ export class FormComponent implements OnInit {
let formValues1:any ={}; let formValues1:any ={};
if(records) { if(records) {
formValues1 = records formValues1 = records
if(formValues1.key_stakeholders[0].stakeholder_length != 0) if(formValues1.key_stakeholders[0].stakeholder_length)
{ {
let controlcount=formValues1.key_stakeholders[0].stakeholder_length; let controlcount=formValues1.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount) this.quesService.ques_length(controlcount)
@ -125,6 +130,10 @@ export class FormComponent implements OnInit {
} }
} }
} }
else{
this.getSectionData();
this.loadTemplate();
}
}) })
} }
}) })
@ -137,7 +146,9 @@ export class FormComponent implements OnInit {
} }
}else{ }
else
{
this.loadTemplate() this.loadTemplate()
if(this.pd_all_details.is_answered == '1') { if(this.pd_all_details.is_answered == '1') {
@ -148,7 +159,6 @@ export class FormComponent implements OnInit {
} }
} }
} }
loadTemplate() { loadTemplate() {
console.log(this.pd_all_details); console.log(this.pd_all_details);
@ -166,7 +176,6 @@ export class FormComponent implements OnInit {
if(result.dataStatus) { if(result.dataStatus) {
console.log('records'); console.log('records');
console.log(result.records); console.log(result.records);
console.log(result.records.template);
let question_template: any = result.records let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined if (question_template && question_template != null && question_template != undefined
) { ) {
@ -174,7 +183,6 @@ export class FormComponent implements OnInit {
// question_template = JSON.parse(question_template) // question_template = JSON.parse(question_template)
if (question_template.hasOwnProperty('template') && question_template.template) { if (question_template.hasOwnProperty('template') && question_template.template) {
question_template =JSON.parse(question_template.template); question_template =JSON.parse(question_template.template);
console.log(question_template);
this.commonFormGroup = new FormGroup({}) this.commonFormGroup = new FormGroup({})
this.questions_JSON = question_template; this.questions_JSON = question_template;
console.log(this.questions_JSON) console.log(this.questions_JSON)