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() { generateGroupControls() {
console.log(this.json_answers);
console.log('answers');
if(this.json_answers && this.json_answers != null){ if(this.json_answers && this.json_answers != null){
this.isDefaultGenerated = true; this.isDefaultGenerated = true;
this.questions_JSON.questions.forEach(parent_ques=>{ this.questions_JSON.questions.forEach(parent_ques=>{

View File

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

View File

@ -93,7 +93,6 @@ export class QuesFormService {
"is_repeatable":null, "is_repeatable":null,
"field_type":"string", "field_type":"string",
"validations":[ "validations":[
] ]
}, },
{ {
@ -722,6 +721,14 @@ export class QuesFormService {
//ques_data[index].group_questions1 = [] //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) ques_data[index].group_questions.push(val.question)
val.group_questions[0].forEach((group_indi, arr_index) => { val.group_questions[0].forEach((group_indi, arr_index) => {

View File

@ -154,6 +154,7 @@ else
} }
loadTemplate() { loadTemplate() {
console.log(this.pd_all_details);
this.is_loading = true this.is_loading = true
// let localId = this.getLocalFormId() // let localId = this.getLocalFormId()
// console.log("d",this.pd_all_details.form_id,Number(this.pd_all_details.form_id)) // console.log("d",this.pd_all_details.form_id,Number(this.pd_all_details.form_id))
@ -162,8 +163,12 @@ else
this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{ this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{
if(!environment.production){ if(!environment.production){
//result.dataStatus = false //result.dataStatus = false
//comment pannirundha api template ..
//comment pannalana local json..
} }
if(result.dataStatus) { if(result.dataStatus) {
console.log('records');
console.log(result.records);
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
) { ) {

View File

@ -32,7 +32,7 @@
<strong>QC Complete</strong> <strong>QC Complete</strong>
</button> </button>
<button *ngIf="is_agency_logged_in == false" mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;"> <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>
<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;"> <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> <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 fxLayout="row nowrap">
<div fxFlex="100"> <div fxFlex="100">
<div *ngIf="is_agency_logged_in == false" fxFlex="40" align="left" style="color: #e00201"> <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>
<div *ngIf="is_agency_logged_in == true" fxFlex="40" align="left" style="color: #e00201"> <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}} {{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>
<div fxFlex="30" align="end" style="padding: 10px !important;"> <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 *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> </div>
</mat-card-header> </mat-card-header>
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement"> <mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">

View File

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

View File

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

View File

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