diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 6ef8ff3..ab72d95 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -115,604 +115,707 @@ export class QuesFormService { // } // }) } - if(this.len=='3' && val.form_name=='Key Stakeholders in Business') - { + // if(this.len=='3' && val.form_name=='Key Stakeholders in Business') + // { - val.question.push({ - "question":"", - "question_key":"stakeholder_name1", - "place_holder":"Enter text", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Name Required", - "value":null - } - ] + // val.question.push({ + // "question":"", + // "question_key":"stakeholder_name1", + // "place_holder":"Enter text", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Name Required", + // "value":null + // } + // ] - }, - { - "question":"", - "question_key":"share_holding1", - "place_holder":"Enter number", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Share value Required", - "value":null - }, - { - "name":"max", - "validator":"100", - "isactive":"1", - "message":"Number must be less than 100", - "value":null - } - ] - }, - { - "question":"", - "question_key":"vintage_in_current_biz1", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Current vintage Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz1", - "expression":"(total_work_exp1 > vintage_in_current_biz1)", - "value_keys":[ - "total_work_exp1", - "vintage_in_current_biz1" - ], - "questions":[ - { - "question_key":"previous_experience_details1", - "question":"Previous Experience Details", - "place_holder":"Enter text", - "type":"1", + // }, + // { + // "question":"", + // "question_key":"share_holding1", + // "place_holder":"Enter number", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Share value Required", + // "value":null + // }, + // { + // "name":"max", + // "validator":"100", + // "isactive":"1", + // "message":"Number must be less than 100", + // "value":null + // } + // ] + // }, + // { + // "question":"", + // "question_key":"vintage_in_current_biz1", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Current vintage Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz1", + // "expression":"(total_work_exp1 > vintage_in_current_biz1)", + // "value_keys":[ + // "total_work_exp1", + // "vintage_in_current_biz1" + // ], + // "questions":[ + // { + // "question_key":"previous_experience_details1", + // "question":"Previous Experience Details", + // "place_holder":"Enter text", + // "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"vintage_in_current_biz1", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"total_work_exp1", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Total experience Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz1", - "expression":"(total_work_exp1 > vintage_in_current_biz1)", - "value_keys":[ - "total_work_exp1", - "vintage_in_current_biz1" - ], - "questions":[ - { - "question":"Previous Experience Details", - "question_key":"previous_experience_details1", - "place_holder":"Enter text", - "type":"1", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"vintage_in_current_biz1", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"total_work_exp1", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Total experience Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz1", + // "expression":"(total_work_exp1 > vintage_in_current_biz1)", + // "value_keys":[ + // "total_work_exp1", + // "vintage_in_current_biz1" + // ], + // "questions":[ + // { + // "question":"Previous Experience Details", + // "question_key":"previous_experience_details1", + // "place_holder":"Enter text", + // "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"total_work_exp1", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"started_biz1", - "type":"2", - "field_width":"19", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "answers":[ - { - "answer_id":"Yes", - "answer":"Yes" - }, - { - "answer_id":"No", - "answer":"No" - } - ], - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Started Business Required", - "value":null - } - ] + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"total_work_exp1", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"started_biz1", + // "type":"2", + // "field_width":"19", + // "api_properties":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "answers":[ + // { + // "answer_id":"Yes", + // "answer":"Yes" + // }, + // { + // "answer_id":"No", + // "answer":"No" + // } + // ], + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Started Business Required", + // "value":null + // } + // ] - },{ - "question":"", - "question_key":"stakeholder_name2", - "place_holder":"Enter text", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Name Required", - "value":null - } - ] + // },{ + // "question":"", + // "question_key":"stakeholder_name2", + // "place_holder":"Enter text", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Name Required", + // "value":null + // } + // ] - }, - { - "question":"", - "question_key":"share_holding2", - "place_holder":"Enter number", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Share value Required", - "value":null - }, - { - "name":"max", - "validator":"100", - "isactive":"1", - "message":"Number must be less than 100", - "value":null - } - ] - }, - { - "question":"", - "question_key":"vintage_in_current_biz2", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Current vintage Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz2", - "expression":"(total_work_exp2 > vintage_in_current_biz2)", - "value_keys":[ - "total_work_exp2", - "vintage_in_current_biz2" - ], - "questions":[ - { - "question_key":"previous_experience_details2", - "question":"Previous Experience Details", - "place_holder":"Enter text", - "type":"1", + // }, + // { + // "question":"", + // "question_key":"share_holding2", + // "place_holder":"Enter number", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Share value Required", + // "value":null + // }, + // { + // "name":"max", + // "validator":"100", + // "isactive":"1", + // "message":"Number must be less than 100", + // "value":null + // } + // ] + // }, + // { + // "question":"", + // "question_key":"vintage_in_current_biz2", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Current vintage Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz2", + // "expression":"(total_work_exp2 > vintage_in_current_biz2)", + // "value_keys":[ + // "total_work_exp2", + // "vintage_in_current_biz2" + // ], + // "questions":[ + // { + // "question_key":"previous_experience_details2", + // "question":"Previous Experience Details", + // "place_holder":"Enter text", + // "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"vintage_in_current_biz2", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"total_work_exp2", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Total experience Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz2", - "expression":"(total_work_exp2 > vintage_in_current_biz2)", - "value_keys":[ - "total_work_exp2", - "vintage_in_current_biz2" - ], - "questions":[ - { - "question":"Previous Experience Details", - "question_key":"previous_experience_details2", - "place_holder":"Enter text", - "type":"1", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"vintage_in_current_biz2", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"total_work_exp2", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Total experience Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz2", + // "expression":"(total_work_exp2 > vintage_in_current_biz2)", + // "value_keys":[ + // "total_work_exp2", + // "vintage_in_current_biz2" + // ], + // "questions":[ + // { + // "question":"Previous Experience Details", + // "question_key":"previous_experience_details2", + // "place_holder":"Enter text", + // "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"total_work_exp2", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"started_biz2", - "type":"2", - "field_width":"19", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "answers":[ - { - "answer_id":"Yes", - "answer":"Yes" - }, - { - "answer_id":"No", - "answer":"No" - } - ], - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Started Business Required", - "value":null - } - ] + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"total_work_exp2", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"started_biz2", + // "type":"2", + // "field_width":"19", + // "api_properties":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "answers":[ + // { + // "answer_id":"Yes", + // "answer":"Yes" + // }, + // { + // "answer_id":"No", + // "answer":"No" + // } + // ], + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Started Business Required", + // "value":null + // } + // ] - } - ) - } - else if(this.len=='2' && val.form_name=='Key Stakeholders in Business') - { + // } + // ) + // } + // else if(this.len=='2' && val.form_name=='Key Stakeholders in Business') + // { - val.question.push({ - "question":"", - "question_key":"stakeholder_name1", - "place_holder":"Enter text", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Name Required", - "value":null - } - ] + // val.question.push({ + // "question":"", + // "question_key":"stakeholder_name1", + // "place_holder":"Enter text", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Name Required", + // "value":null + // } + // ] - }, - { - "question":"", - "question_key":"share_holding1", - "place_holder":"Enter number", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Share value Required", - "value":null - }, - { - "name":"max", - "validator":"100", - "isactive":"1", - "message":"Number must be less than 100", - "value":null - } - ] - }, - { - "question":"", - "question_key":"vintage_in_current_biz1", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Current vintage Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz1", - "expression":"(total_work_exp1 > vintage_in_current_biz1)", - "value_keys":[ - "total_work_exp1", - "vintage_in_current_biz1" - ], - "questions":[ - { - "question_key":"previous_experience_details1", - "question":"Previous Experience Details", - "place_holder":"Enter text", - "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"vintage_in_current_biz1", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"total_work_exp1", - "place_holder":"Enter in years", - "type":"1", - "field_width":"19", - "api_properties":null, - "answers":null, - "is_repeatable":null, - "field_type":"num", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Total experience Required", - "value":null - } - ], - "onchange_properties":[ - { - "purpose":"FORM_CTRL", - "form_controls":[ - { - "insert_index":"started_biz1", - "expression":"(total_work_exp1 > vintage_in_current_biz1)", - "value_keys":[ - "total_work_exp1", - "vintage_in_current_biz1" - ], - "questions":[ - { - "question":"Previous Experience Details", - "question_key":"previous_experience_details1", - "place_holder":"Enter text", - "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "parent_question_key":"total_work_exp1", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Previous Experience Required", - "value":null - } - ] - } - ] - } - ] - } - ] - }, - { - "question":"", - "question_key":"started_biz1", - "type":"2", - "field_width":"19", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "answers":[ - { - "answer_id":"Yes", - "answer":"Yes" - }, - { - "answer_id":"No", - "answer":"No" - } - ], - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Started Business Required", - "value":null - } - ] + // }, + // { + // "question":"", + // "question_key":"share_holding1", + // "place_holder":"Enter number", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Share value Required", + // "value":null + // }, + // { + // "name":"max", + // "validator":"100", + // "isactive":"1", + // "message":"Number must be less than 100", + // "value":null + // } + // ] + // }, + // { + // "question":"", + // "question_key":"vintage_in_current_biz1", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Current vintage Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz1", + // "expression":"(total_work_exp1 > vintage_in_current_biz1)", + // "value_keys":[ + // "total_work_exp1", + // "vintage_in_current_biz1" + // ], + // "questions":[ + // { + // "question_key":"previous_experience_details1", + // "question":"Previous Experience Details", + // "place_holder":"Enter text", + // "type":"1", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"vintage_in_current_biz1", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"total_work_exp1", + // "place_holder":"Enter in years", + // "type":"1", + // "field_width":"19", + // "api_properties":null, + // "answers":null, + // "is_repeatable":null, + // "field_type":"num", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Total experience Required", + // "value":null + // } + // ], + // "onchange_properties":[ + // { + // "purpose":"FORM_CTRL", + // "form_controls":[ + // { + // "insert_index":"started_biz1", + // "expression":"(total_work_exp1 > vintage_in_current_biz1)", + // "value_keys":[ + // "total_work_exp1", + // "vintage_in_current_biz1" + // ], + // "questions":[ + // { + // "question":"Previous Experience Details", + // "question_key":"previous_experience_details1", + // "place_holder":"Enter text", + // "type":"1", + // "api_properties":null, + // "answers":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "field_type":"string", + // "parent_question_key":"total_work_exp1", + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Previous Experience Required", + // "value":null + // } + // ] + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // "question":"", + // "question_key":"started_biz1", + // "type":"2", + // "field_width":"19", + // "api_properties":null, + // "onchange_properties":null, + // "is_repeatable":null, + // "answers":[ + // { + // "answer_id":"Yes", + // "answer":"Yes" + // }, + // { + // "answer_id":"No", + // "answer":"No" + // } + // ], + // "validations":[ + // { + // "name":"required", + // "isactive":"1", + // "validator":"Validators.required", + // "message":"Started Business Required", + // "value":null + // } + // ] + + // }) + // } + if(this.len=='3' && val.form_name=='Key Stakeholders in Business') { + val.question.push({ "question":"", "question_key":"stakeholder_name1", +"place_holder":"Enter text", "type":"1", "field_width":"19", +"api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"string", "validations":[] }, { +"question":"", "question_key":"share_holding1", "place_holder":"Enter number", +"type":"1", "field_width":"19", "api_properties":null, "answers":null, +"onchange_properties":null, "is_repeatable":null, "field_type":"num", +"validations":[ { "name":"max", "validator":"100", "isactive":"1", +"message":"Number must be less than 100", "value":null } ] }, { "question":"", +"question_key":"vintage_in_current_biz1", "place_holder":"Enter in years", +"type":"1", "field_width":"19", "api_properties":null, "answers":null, +"is_repeatable":null, "field_type":"num", "validations":[], +"onchange_properties":[ { "purpose":"FORM_CTRL", "form_controls":[ { +"insert_index":"started_biz1", "expression":"(total_work_exp1 > vintage_in_current_biz1)", "value_keys":[ "total_work_exp1", "vintage_in_current_biz1" ], "questions":[ { +"question_key":"previous_experience_details1", "question":"Previous Experience Details", "place_holder":"Enter text", "type":"1", "api_properties":null, +"answers":null, "onchange_properties":null, "is_repeatable":null, +"field_type":"string", "parent_question_key":"vintage_in_current_biz1", +"validations":[] } ] } ] } ] }, { "question":"", +"question_key":"total_work_exp1", "place_holder":"Enter in years", "type":"1", +"field_width":"19", "api_properties":null, "answers":null, "is_repeatable":null, +"field_type":"num", "validations":[], "onchange_properties":[ { +"purpose":"FORM_CTRL", "form_controls":[ { "insert_index":"started_biz1", +"expression":"(total_work_exp1 > vintage_in_current_biz1)", "value_keys":[ +"total_work_exp1", "vintage_in_current_biz1" ], "questions":[ { +"question":"Previous Experience Details", +"question_key":"previous_experience_details1", "place_holder":"Enter text", +"type":"1", "api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"string", +"parent_question_key":"total_work_exp1", "validations":[] } ] } ] } ] }, { +"question":"", "question_key":"started_biz1", "type":"2", "field_width":"19", +"api_properties":null, "onchange_properties":null, "is_repeatable":null, +"answers":[ { "answer_id":"Yes", "answer":"Yes" }, { "answer_id":"No", +"answer":"No" } ], "validations":[] },{ "question":"", +"question_key":"stakeholder_name2", "place_holder":"Enter text", "type":"1", +"field_width":"19", "api_properties":null, "answers":null, +"onchange_properties":null, "is_repeatable":null, "field_type":"string", +"validations":[] }, { "question":"", "question_key":"share_holding2", +"place_holder":"Enter number", "type":"1", "field_width":"19", +"api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"num", "validations":[ { "name":"max", +"validator":"100", "isactive":"1", "message":"Number must be less than 100", +"value":null } ] }, { "question":"", "question_key":"vintage_in_current_biz2", +"place_holder":"Enter in years", "type":"1", "field_width":"19", +"api_properties":null, "answers":null, "is_repeatable":null, "field_type":"num", +"validations":[], "onchange_properties":[ { "purpose":"FORM_CTRL", +"form_controls":[ { "insert_index":"started_biz2", +"expression":"(total_work_exp2 > vintage_in_current_biz2)", "value_keys":[ +"total_work_exp2", "vintage_in_current_biz2" ], "questions":[ { +"question_key":"previous_experience_details2", "question":"Previous Experience Details", "place_holder":"Enter text", "type":"1", "api_properties":null, +"answers":null, "onchange_properties":null, "is_repeatable":null, +"field_type":"string", "parent_question_key":"vintage_in_current_biz2", +"validations":[] } ] } ] } ] }, { "question":"", +"question_key":"total_work_exp2", "place_holder":"Enter in years", "type":"1", +"field_width":"19", "api_properties":null, "answers":null, "is_repeatable":null, +"field_type":"num", "validations":[], "onchange_properties":[ { +"purpose":"FORM_CTRL", "form_controls":[ { "insert_index":"started_biz2", +"expression":"(total_work_exp2 > vintage_in_current_biz2)", "value_keys":[ +"total_work_exp2", "vintage_in_current_biz2" ], "questions":[ { +"question":"Previous Experience Details", +"question_key":"previous_experience_details2", "place_holder":"Enter text", +"type":"1", "api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"string", +"parent_question_key":"total_work_exp2", "validations":[] } ] } ] } ] }, { +"question":"", "question_key":"started_biz2", "type":"2", "field_width":"19", +"api_properties":null, "onchange_properties":null, "is_repeatable":null, +"answers":[ { "answer_id":"Yes", "answer":"Yes" }, { "answer_id":"No", +"answer":"No" } ], "validations":[] } ) } else if(this.len=='2' && +val.form_name=='Key Stakeholders in Business') { val.question.push({ +"question":"", "question_key":"stakeholder_name1", "place_holder":"Enter text", +"type":"1", "field_width":"19", "api_properties":null, "answers":null, +"onchange_properties":null, "is_repeatable":null, "field_type":"string", +"validations":[] }, { "question":"", "question_key":"share_holding1", +"place_holder":"Enter number", "type":"1", "field_width":"19", +"api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"num", "validations":[ { "name":"max", +"validator":"100", "isactive":"1", "message":"Number must be less than 100", +"value":null } ] }, { "question":"", "question_key":"vintage_in_current_biz1", +"place_holder":"Enter in years", "type":"1", "field_width":"19", +"api_properties":null, "answers":null, "is_repeatable":null, "field_type":"num", +"validations":[], "onchange_properties":[ { "purpose":"FORM_CTRL", +"form_controls":[ { "insert_index":"started_biz1", +"expression":"(total_work_exp1 > vintage_in_current_biz1)", "value_keys":[ +"total_work_exp1", "vintage_in_current_biz1" ], "questions":[ { +"question_key":"previous_experience_details1", "question":"Previous Experience Details", "place_holder":"Enter text", "type":"1", "api_properties":null, +"answers":null, "onchange_properties":null, "is_repeatable":null, +"field_type":"string", "parent_question_key":"vintage_in_current_biz1", +"validations":[] } ] } ] } ] }, { "question":"", +"question_key":"total_work_exp1", "place_holder":"Enter in years", "type":"1", +"field_width":"19", "api_properties":null, "answers":null, "is_repeatable":null, +"field_type":"num", "validations":[], "onchange_properties":[ { +"purpose":"FORM_CTRL", "form_controls":[ { "insert_index":"started_biz1", +"expression":"(total_work_exp1 > vintage_in_current_biz1)", "value_keys":[ +"total_work_exp1", "vintage_in_current_biz1" ], "questions":[ { +"question":"Previous Experience Details", +"question_key":"previous_experience_details1", "place_holder":"Enter text", +"type":"1", "api_properties":null, "answers":null, "onchange_properties":null, +"is_repeatable":null, "field_type":"string", +"parent_question_key":"total_work_exp1", "validations":[] } ] } ] } ] }, { +"question":"", "question_key":"started_biz1", "type":"2", "field_width":"19", +"api_properties":null, "onchange_properties":null, "is_repeatable":null, +"answers":[ { "answer_id":"Yes", "answer":"Yes" }, { "answer_id":"No", +"answer":"No" } ], "validations":[] }) } - }) - } - // let sub_childControl: any = childControl.controls[0].get('questions') as FormArray diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts index 62ed5cc..1c94be0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts @@ -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)