FIX_dynamic form - KeyStakeholder required removed : ps

This commit is contained in:
VE10-Sanjeev 2024-05-13 09:36:30 +00:00
parent 4c22bcb7be
commit 3b4a2327d9
2 changed files with 711 additions and 607 deletions

View File

@ -72,7 +72,7 @@ export class FormComponent implements OnInit {
ngOnInit() {
//this.getSectionData()
if(this.pd_all_details.form_id=='5' && this.pd_all_details.pdmaster_details.product_abbr=='LFMP')
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')
{
@ -82,17 +82,16 @@ export class FormComponent implements OnInit {
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
console.log(result)
if(result['dataStatus']) {
let records = result['records']
let formValues:any ={};
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=='2')
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='2';
let controlcount=formValues.key_stakeholders[0].stakeholder_length;
this.quesService.ques_length(controlcount)
this.loadTemplate()
}
@ -118,18 +117,18 @@ export class FormComponent implements OnInit {
let formValues1:any ={};
if(records ) {
formValues1 = records
if(formValues1.key_stakeholders[0].stakeholder_length=='2')
{
let controlcount='2';
this.quesService.ques_length(controlcount)
this.loadTemplate()
}
else
{
let controlcount1='3';
this.quesService.ques_length(controlcount1)
this.loadTemplate()
}
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()
}
}
}
})
@ -174,6 +173,7 @@ else
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
) {
@ -181,6 +181,7 @@ else
// 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)