live issues changes

This commit is contained in:
venbatechnologies@gmail.com 2022-01-05 13:15:11 +05:30
parent 8e3b351457
commit 69f4475137
8 changed files with 145 additions and 74 deletions

View File

@ -40,7 +40,8 @@ export class DynamicFormComponent implements OnInit {
generateGroupControls() {
console.log(this.json_answers);
console.log('answers');
if(this.json_answers && this.json_answers != null){
this.isDefaultGenerated = true;
this.questions_JSON.questions.forEach(parent_ques=>{

View File

@ -47,81 +47,84 @@ export class DynamicQuestionTemplateComponent implements OnInit {
}
ngOnChanges() {
//alert('ans');
this.parent_ques = this.currFormArrayObj
this.json_answers1=[{
stakeholder_name0: "SUMIT KHANDELWAL",
share_holding0: 10,
vintage_in_current_biz0: 5,
total_work_exp0: 10,
started_biz0: "",
// this.json_answers1=[{
// stakeholder_name0: "SUMIT KHANDELWAL",
// share_holding0: 10,
// vintage_in_current_biz0: 5,
// total_work_exp0: 10,
// started_biz0: "",
stakeholder_name1: "RAM",
share_holding1: 10.5,
vintage_in_current_biz1: 8,
total_work_exp1: 5,
started_biz1: "",
// stakeholder_name1: "RAM",
// share_holding1: 10.5,
// vintage_in_current_biz1: 8,
// total_work_exp1: 5,
// started_biz1: "",
stakeholder_name2: "VIGNESH",
share_holding2: 55,
vintage_in_current_biz2: 6,
total_work_exp2: 0,
started_biz2: "",
stakeholder_length:'2',
company_name: 3},
{
stakeholder_name0: "SUMIT KHANDELWAL",
share_holding0: 15,
vintage_in_current_biz0: 6,
total_work_exp0: 11,
started_biz0: "",
// stakeholder_name2: "VIGNESH",
// share_holding2: 55,
// vintage_in_current_biz2: 6,
// total_work_exp2: 0,
// started_biz2: "",
// stakeholder_length:'2',
// company_name: 3},
// {
// stakeholder_name0: "SUMIT KHANDELWAL",
// share_holding0: 15,
// vintage_in_current_biz0: 6,
// total_work_exp0: 11,
// started_biz0: "",
stakeholder_name1: "RAM",
share_holding1: 0,
vintage_in_current_biz1: 10,
total_work_exp1: 9,
started_biz1: "",
// stakeholder_name1: "RAM",
// share_holding1: 0,
// vintage_in_current_biz1: 10,
// total_work_exp1: 9,
// started_biz1: "",
stakeholder_name2: "VIGNESH",
share_holding2: 25,
vintage_in_current_biz2: 12,
total_work_exp2: 8,
started_biz2: "",
// stakeholder_name2: "VIGNESH",
// share_holding2: 25,
// vintage_in_current_biz2: 12,
// total_work_exp2: 8,
// started_biz2: "",
stakeholder_length:'2',
company_name: 2},{
stakeholder_name0: "SUMIT KHANDELWAL",
share_holding0: 25,
vintage_in_current_biz0: 7,
total_work_exp0: 12,
started_biz0: "",
// stakeholder_length:'2',
// company_name: 2},{
// stakeholder_name0: "SUMIT KHANDELWAL",
// share_holding0: 25,
// vintage_in_current_biz0: 7,
// total_work_exp0: 12,
// started_biz0: "",
stakeholder_name1: "RAM",
share_holding1: 25.5,
vintage_in_current_biz1: 15,
total_work_exp1: 0,
started_biz1: "",
// stakeholder_name1: "RAM",
// share_holding1: 25.5,
// vintage_in_current_biz1: 15,
// total_work_exp1: 0,
// started_biz1: "",
stakeholder_name2: "VIGNESH",
share_holding2: 0,
vintage_in_current_biz2: 10,
total_work_exp2: 9,
started_biz2: "",
// stakeholder_name2: "VIGNESH",
// share_holding2: 0,
// vintage_in_current_biz2: 10,
// total_work_exp2: 9,
// started_biz2: "",
stakeholder_length:'2',
company_name: 1}
// stakeholder_length:'2',
// company_name: 1}
]
// ]
this.json_answers1=[{"question":"a","answer":"a"},{"question":"b","answer":"b"},{"question":"c","answer":"c"}]
console.log('answers');
console.log(this.json_answers);
//console.log(this.group_key);
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
// setTimeout(()=>{
@ -138,16 +141,20 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// debugger;
this.formGroupN.get(this.parent_ques.question_key)
this.whole_form.get(this.group_key).patchValue(this.json_answers)
if(this.json_answers.length > 1) {
this.generateGroupControls.emit()
}
// console.log('answers');
// console.log(this.json_answers);
this.json_answers.forEach((value,index)=>{
let keys= Object.keys(value)
keys.forEach(vv=>{
@ -259,8 +266,9 @@ export class DynamicQuestionTemplateComponent implements OnInit {
control.removeAt(i);
}
}
//onchange properties function --json onchange properties//
onChangeProperty(event,sec_control,question_key,options?,sec_index?,from?){
// alert('datatamil');
if(!from && from != 'TS' && this.quesService.formanswers != null) {
console.log("Value changes",from);
this.quesService.formanswers = null

View File

@ -57,7 +57,7 @@ export class QuesFormService {
assignFormControl_array(formgroup: FormGroup, ques_data: any) {
let pdid = JSON.parse(localStorage.getItem('pdid'))
const control: any = formgroup
const control: any = formgroup
console.log(ques_data);
console.log('quesdata');
ques_data.forEach((val, index) => {
@ -92,8 +92,7 @@ export class QuesFormService {
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
"validations":[
]
},
{
@ -722,6 +721,14 @@ export class QuesFormService {
//ques_data[index].group_questions1 = []
// console.log(val.question[0].answers.length);
console.log('maran');
console.log(val.question[0].answers);
// if(val.question[0].company_length=='1')
// {
// alert('1');
// }
ques_data[index].group_questions.push(val.question)
val.group_questions[0].forEach((group_indi, arr_index) => {

View File

@ -154,6 +154,7 @@ else
}
loadTemplate() {
console.log(this.pd_all_details);
this.is_loading = true
// let localId = this.getLocalFormId()
// console.log("d",this.pd_all_details.form_id,Number(this.pd_all_details.form_id))
@ -161,9 +162,13 @@ else
let params = {"fk_entity_id":this.pd_all_details.pdmaster_details.fk_lender_id,"fk_product_id":this.pd_all_details.pdmaster_details.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id}
this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{
if(!environment.production){
//result.dataStatus = false
//result.dataStatus = false
//comment pannirundha api template ..
//comment pannalana local json..
}
if(result.dataStatus) {
console.log('records');
console.log(result.records);
let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined
) {

View File

@ -32,7 +32,7 @@
<strong>QC Complete</strong>
</button>
<button *ngIf="is_agency_logged_in == false" mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong>
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}}</strong>
</button>
<button *ngIf="is_agency_logged_in == true && (LenderRoleID == '28'||LenderRoleID == '29')" mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
<strong> {{master.vendor_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.vendor_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.vendor_status | titlecase}}</strong>
@ -206,7 +206,7 @@
<div fxLayout="row nowrap">
<div fxFlex="100">
<div *ngIf="is_agency_logged_in == false" fxFlex="40" align="left" style="color: #e00201">
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status | titlecase}}
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status==pdStatusCheck.ALLOCATED_TO_FIA ?'Allocated to vendor':master.pd_status | titlecase}}
</div>
<div *ngIf="is_agency_logged_in == true" fxFlex="40" align="left" style="color: #e00201">
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status | titlecase}}
@ -399,7 +399,7 @@
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<!-- <span *ngIf="userRoleID == 10 || userRoleID == 3"><button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button></span> -->
<!--<span><button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button></span>-->
<span><button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button></span>
</div>
</mat-card-header>
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">

View File

@ -178,10 +178,12 @@
"validator": "",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": "(String('estimated_quantity') === String(''))",
"validation_to": "estimated_stock_value",
"validation_to": "estimated_uom",
"value_keys": [
"estimated_quantity",
"estimated_stock_value"
"estimated_stock_value",
"estimated_uom"
]
}
]
@ -192,7 +194,13 @@
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": null
}
]
},
{
@ -217,16 +225,39 @@
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field required",
"value": null
}
]
},
{
"question": "Estimated value of stock observed",
"question_key": "estimated_stock_value",
"type": "1",
"field_type": "numtoword",
"field_type": "num",
"field_width": "100",
"api_properties": null,
"onchange_properties": [
{
"purpose": "validations",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": "(String('estimated_stock_value') === String(''))",
"validation_to": "estimated_uom",
"value_keys": [
"estimated_stock_value"
]
}
]
},
{
"purpose": "validations",
"validations": [

View File

@ -41,7 +41,7 @@
}
]
}
]
]
}
]
},
@ -208,10 +208,12 @@
"validator": "",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": "(String('estimated_quantity') === String(''))",
"validation_to": "estimated_stock_value",
"validation_to": "estimated_uom",
"value_keys": [
"estimated_quantity",
"estimated_stock_value"
"estimated_stock_value",
"estimated_uom"
]
}
]
@ -270,6 +272,22 @@
"field_width": "100",
"api_properties": null,
"onchange_properties": [
{
"purpose": "validations",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": "(String('estimated_stock_value') === String(''))",
"validation_to": "estimated_uom",
"value_keys": [
"estimated_stock_value"
]
}
]
},
{
"purpose": "validations",
"validations": [

View File

@ -10,6 +10,7 @@
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"company_length":"1",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",