FIX_Keystackholder

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

View File

@ -70,85 +70,95 @@ export class FormComponent implements OnInit {
}
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()
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};
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
console.log(result);
if(result['dataStatus']) {
let records = result['records'];
let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) {
formValues = JSON.parse(records.json);
console.log(formValues);
if(formValues.key_stakeholders[0].stakeholder_length != '0')
{
let controlcount=formValues.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount);
this.loadTemplate();
}else{
let controlcount1='3';
this.quesService.ques_length(controlcount1);
this.loadTemplate();
}
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined"){}
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}
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
if(result['dataStatus']) {
let records = result['records']
let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) {
formValues = JSON.parse(records.json)
console.log(formValues)
if(formValues.key_stakeholders[0].stakeholder_length)
{
let controlcount=formValues.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount)
this.loadTemplate()
}
else
{
let controlcount1='3';
this.quesService.ques_length(controlcount1)
this.loadTemplate()
}
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined")
// {
// }
}
}
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}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) {
let records = result['records']
let formValues1:any ={};
if(records) {
formValues1 = records
if(formValues1.key_stakeholders[0].stakeholder_length)
{
let controlcount=formValues1.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount)
this.loadTemplate()
}
else
{
let controlcount1='3';
this.quesService.ques_length(controlcount1)
this.loadTemplate()
}
}
}
else{
this.getSectionData();
this.loadTemplate();
}
})
}
})
if(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
}
else
{
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=>{
if(result['dataStatus']) {
let records = result['records']
let formValues1:any ={};
if(records) {
formValues1 = records
if(formValues1.key_stakeholders[0].stakeholder_length != 0)
{
let controlcount=formValues1.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount)
this.loadTemplate()
}
else
{
let controlcount1='3';
this.quesService.ques_length(controlcount1)
this.loadTemplate()
}
}
}
})
}
else
{
this.loadTemplate()
if(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
})
if(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
}else{
this.loadTemplate()
if(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
}
}
loadTemplate() {
console.log(this.pd_all_details);
@ -166,7 +176,6 @@ export class FormComponent implements OnInit {
if(result.dataStatus) {
console.log('records');
console.log(result.records);
console.log(result.records.template);
let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined
) {
@ -174,7 +183,6 @@ export class FormComponent implements OnInit {
// question_template = JSON.parse(question_template)
if (question_template.hasOwnProperty('template') && question_template.template) {
question_template =JSON.parse(question_template.template);
console.log(question_template);
this.commonFormGroup = new FormGroup({})
this.questions_JSON = question_template;
console.log(this.questions_JSON)