latest issues fixed

This commit is contained in:
gayathri1990 2021-01-20 21:06:56 +05:30
parent 882ff75252
commit eb8a232abf
8 changed files with 36 additions and 17 deletions

Binary file not shown.

View File

@ -26,10 +26,10 @@ export class PdStatusChangeDialogueComponent implements OnInit {
{ {
this.notifier = notifier; this.notifier = notifier;
this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to Self' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion'; this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to Self' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion';
this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Are you allocate this PD to yourself ?' : this.data.pd_status=='BOUNCED' ? 'Are you going to Reject the PD' : 'Change Discussion'; this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Do you want to allocate the PD to yourself ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion';
this.enableAddonPD = false; this.enableAddonPD = false;
this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true; this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true;
this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false; this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false;
this.dialogType = this.data.dialogType this.dialogType = this.data.dialogType
} }

View File

@ -23,10 +23,11 @@
<div *ngIf="parent_ques.is_repeatable == '1'"> <div *ngIf="parent_ques.is_repeatable == '1'">
<!-- {{form_group_name.value[parent_ques.group_key] | json}} --> <!-- {{form_group_name.value[parent_ques.group_key] | json}} -->
<div [formArrayName]="parent_ques.group_key" *ngIf="parent_ques.group_type != '6'" > <div [formArrayName]="parent_ques.group_key" *ngIf="parent_ques.group_type != '6'" >
<div *ngFor="let group_ques of form_group_name.get(parent_ques.group_key)['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<!-- {{g_i}} {{g_l}} --> <!-- {{g_i}} {{g_l}} -->
<mat-accordion *ngIf="parent_ques.group_type != '6' && parent_ques.group_questions[g_i]" #accordion="matAccordion" > <mat-accordion *ngIf="parent_ques.group_type != '6'" #accordion="matAccordion" [multi]="true">
<div *ngFor="let group_ques of form_group_name.get(parent_ques.group_key)['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel" > <mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel" >
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title *ngIf="parent_ques.group_title_shown != '0'"> <mat-panel-title *ngIf="parent_ques.group_title_shown != '0'">
@ -34,7 +35,7 @@
</mat-panel-title> </mat-panel-title>
<!-- <mat-panel-description> <!-- <mat-panel-description>
Type your name and age Type your name and age
</mat-panel-description> --> </mat-panel-description> -->
</mat-expansion-panel-header> </mat-expansion-panel-header>
<!-- {{json_answers[parent_ques.group_key][0] | json}} --> <!-- {{json_answers[parent_ques.group_key][0] | json}} -->
<div *ngFor="let singleQues of parent_ques.group_questions[g_i];let s_i=index" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="singleQues.hasOwnProperty('field_width') && singleQues.field_width ? singleQues.field_width : '100'" <div *ngFor="let singleQues of parent_ques.group_questions[g_i];let s_i=index" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="singleQues.hasOwnProperty('field_width') && singleQues.field_width ? singleQues.field_width : '100'"
@ -70,8 +71,9 @@
</div> </div>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
</div>
</mat-accordion> </mat-accordion>
</div>
</div> </div>
<!-- IS REPEATABLE --> <!-- IS REPEATABLE -->
</div> </div>

View File

@ -1,6 +1,6 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core'; import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { MatExpansionPanel } from '@angular/material'; import { MatExpansionPanel,MatAccordion } from '@angular/material';
import { QuesFormService } from '../ques-form/ques-form.service'; import { QuesFormService } from '../ques-form/ques-form.service';
@ -17,9 +17,11 @@ export class DynamicFormComponent implements OnInit {
@Input() json_answers:any; @Input() json_answers:any;
step: number=0; step: number=0;
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel @ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
@ViewChild('accordion') Accordion: MatAccordion
constructor(private _fb:FormBuilder,private questionService:QuesFormService) { } constructor(private _fb:FormBuilder,private questionService:QuesFormService) { }
ngOnInit() { ngOnInit() {
// this.form_group_name=new FormGroup({questions:this._fb.array([])}) // this.form_group_name=new FormGroup({questions:this._fb.array([])})
console.log(this.questions_JSON,this.json_answers,this.questionService); console.log(this.questions_JSON,this.json_answers,this.questionService);
this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions) this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions)
@ -28,7 +30,7 @@ export class DynamicFormComponent implements OnInit {
this.generateGroupControls(); this.generateGroupControls();
} }
generateGroupControls() { generateGroupControls() {
if(this.json_answers && this.json_answers != null ){ if(this.json_answers && this.json_answers != null ){
this.questions_JSON.questions.forEach(parent_ques=>{ this.questions_JSON.questions.forEach(parent_ques=>{
console.log(parent_ques); console.log(parent_ques);
// debugger; // debugger;
@ -125,5 +127,11 @@ export class DynamicFormComponent implements OnInit {
this.matExpansionPanel.open() this.matExpansionPanel.open()
} }
} }
openAllPanels(){
this.Accordion.openAll();
console.log(this.Accordion);
return;
}
} }

View File

@ -11,7 +11,7 @@
</div> </div>
</h2> </h2>
<!-- <form [formGroup]="docsCollectedForm"> --> <!-- <form [formGroup]="docsCollectedForm"> -->
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;" >
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0">No Templates Found</h5> <h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0">No Templates Found</h5>
<mat-card *ngIf="questions_JSON.questions.length > 0"> <mat-card *ngIf="questions_JSON.questions.length > 0">
<!-- <mat-card-header> <!-- <mat-card-header>
@ -20,7 +20,7 @@
</mat-card-title> </mat-card-title>
</mat-card-header> --> </mat-card-header> -->
<mat-card-content> <mat-card-content>
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="form_answers"></app-dynamic-form> <app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="form_answers"></app-dynamic-form>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</mat-dialog-content> </mat-dialog-content>

View File

@ -75,7 +75,7 @@ export class FormComponent implements OnInit {
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} 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=>{ this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{
if(!environment.production){ if(!environment.production){
// result.dataStatus = false // result.dataStatus = false
} }
if(result.dataStatus) { if(result.dataStatus) {
let question_template: any = result.records let question_template: any = result.records
@ -211,12 +211,15 @@ export class FormComponent implements OnInit {
for(let val in invalidFields){ for(let val in invalidFields){
if( invalidFields[val].nodeName == 'MAT-FORM-FIELD' || invalidFields[val].nodeName == 'MAT-SELECT' || invalidFields[val].nodeName == 'TEXTAREA' || invalidFields[val].nodeName == 'MAT-RADIO-GROUP' ){ //INPUT FOR INPUT FIELD if( invalidFields[val].nodeName == 'MAT-FORM-FIELD' || invalidFields[val].nodeName == 'MAT-SELECT' || invalidFields[val].nodeName == 'TEXTAREA' || invalidFields[val].nodeName == 'MAT-RADIO-GROUP' ){ //INPUT FOR INPUT FIELD
firstInvalidField=invalidFields[val] firstInvalidField=invalidFields[val]
break; break;
} }
} }
if(firstInvalidField != undefined){ if(firstInvalidField != undefined){
// firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"}) // firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
this.formComponent.openMatExpansionPanel() this.formComponent.openMatExpansionPanel()
setTimeout(()=>{ setTimeout(()=>{
firstInvalidField.scrollIntoView({block: "start", inline: "nearest"}) firstInvalidField.scrollIntoView({block: "start", inline: "nearest"})
setTimeout(()=>{ setTimeout(()=>{
@ -256,6 +259,8 @@ export class FormComponent implements OnInit {
return invalid; return invalid;
} }
saveForm() { saveForm() {
console.log("values",this.commonFormGroup.getRawValue(),this.questions_JSON) console.log("values",this.commonFormGroup.getRawValue(),this.questions_JSON)
if(this.commonFormGroup.invalid) { if(this.commonFormGroup.invalid) {
this.commonFormGroup.markAsDirty(); this.commonFormGroup.markAsDirty();
@ -264,6 +269,7 @@ export class FormComponent implements OnInit {
let invalidfield = this.findInvalidControls() let invalidfield = this.findInvalidControls()
console.log("Invalid field",invalidfield) console.log("Invalid field",invalidfield)
this.notifier.notify("info","Please fill all the required fields"); this.notifier.notify("info","Please fill all the required fields");
this.formComponent.openAllPanels()
return return
} }
let checkProperty=this.onSubmitProperty() let checkProperty=this.onSubmitProperty()

View File

@ -113,7 +113,7 @@
"question_key":"borrower_age", "question_key":"borrower_age",
"type":"1", "type":"1",
"field_type":"num", "field_type":"num",
"field_width":"45", "field_width":"50",
"api_properties":null, "api_properties":null,
"answers":null, "answers":null,
"onchange_properties":null, "onchange_properties":null,
@ -139,10 +139,11 @@
], ],
"questions":[ "questions":[
{ {
"question":"Met / Not Met", "question":"Mett / Not Met",
"question_key":"borrower_met", "question_key":"borrower_met",
"type":"2", "type":"2",
"field_width":"100",
"field_width":"20",
"api_properties":null, "api_properties":null,
"answers":[ "answers":[
{ {
@ -162,6 +163,7 @@
{ {
"name":"required", "name":"required",
"isactive":"1", "isactive":"1",
"validator":"Validators.required", "validator":"Validators.required",
"message":"Field Required", "message":"Field Required",
"value":null "value":null

View File

@ -63,7 +63,8 @@
"question":"Met / Not Met", "question":"Met / Not Met",
"question_key":"borrower_met", "question_key":"borrower_met",
"type":"2", "type":"2",
"field_width":"100", "field_width":"20",
"api_properties":null, "api_properties":null,
"answers":[ "answers":[
{ {
@ -173,7 +174,7 @@
"question_key":"borrower_age", "question_key":"borrower_age",
"type":"1", "type":"1",
"field_type":"num", "field_type":"num",
"field_width":"45", "field_width":"50",
"api_properties":null, "api_properties":null,
"answers":null, "answers":null,
"onchange_properties":null, "onchange_properties":null,