This commit is contained in:
venbatechnologies@gmail.com 2022-01-19 22:39:42 +05:30
commit 9c8f8d2133
167 changed files with 42587 additions and 16560 deletions

16595
ng6-seed/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
"dependencies": {
"@agm/core": "^1.0.0-beta.2",
"@angular/animations": "^6.1.10",
"@angular/cdk": "^6.0.0-rc.5",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.1.10",
"@angular/compiler": "^6.1.10",
"@angular/core": "^6.1.10",
@ -71,7 +71,7 @@
"ngx-socket-io": "^3.0.1",
"ngx-spinner": "^7.2.0",
"ngx-viewer": "^1.0.5",
"node-sass": "^4.13.0",
"node-sass": "^4.14.1",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.3.7",
"recordrtc": "^5.5.9",

View File

@ -65,6 +65,7 @@ import { PushNotifyService } from './shared/push-notify.service';
import { MatVideoModule } from 'mat-video';
import { ReqTokenInterceptor } from './_guard/req-token.interceptor';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}

View File

@ -4,6 +4,7 @@ import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { CognitoService} from './AwsService/cognito.service';
import { AuthGuard } from './_guard/auth.guard';
export const AppRoutes: Routes = [{
path: '',
redirectTo: 'home',
@ -25,6 +26,9 @@ export const AppRoutes: Routes = [{
},{
path:'template',
loadChildren:'./template/template.module#TemplateModule'
},{
path:'template2',
loadChildren:'./template2/template2.module#Template2Module'
},
{
path:'quality_check_discussion',

View File

@ -0,0 +1,75 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 1% !important;">
Add New Address
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<!-- <button *ngIf="data.fk_pd_type == 2" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate Vendor" matTooltipPosition="above" (click)="viewVendorOfficer()"><mat-icon>verified_user</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" mat-dialog-close matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content class="mat-typography" style="border-bottom: 2px solid #e2412f8f;">
<form [formGroup]="newAddressForm">
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap.xs="0" fxLayoutGap="10px">
<mat-form-field [appearance]="field_appearance" fxFlex="100%" >
<mat-label>Address</mat-label>
<textarea matInput formControlName="address" placeholder="Enter the address"></textarea>
<mat-error *ngIf="newAddressForm.get('address').hasError('required')">Required</mat-error>
</mat-form-field>
<mat-form-field [appearance]="field_appearance" fxFlex="30%" fxFlex.xs="100%">
<mat-label>State</mat-label>
<mat-select formControlName="state" (selectionChange)="getCityList($event.value.state_id)">
<mat-option>
<ngx-mat-select-search [formControl]="stateSearch"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredstateList | async" [value]="SL">
{{SL.name}}
</mat-option>
</mat-select>
<mat-error *ngIf="newAddressForm.get('state').hasError('required')">Required</mat-error>
</mat-form-field>
<mat-form-field [appearance]="field_appearance" fxFlex="45%" fxFlex.xs="100%">
<mat-label>City</mat-label>
<mat-select formControlName="city">
<mat-option>
<ngx-mat-select-search [formControl]="citySearch"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of filteredcityList | async" [value]="CL">
{{CL.city_name}}
</mat-option>
</mat-select>
<mat-error *ngIf="newAddressForm.get('city').hasError('required')">Required</mat-error>
</mat-form-field>
<mat-form-field [appearance]="field_appearance" fxFlex="20%" fxFlex.xs="100%">
<mat-label>Pincode</mat-label>
<mat-select formControlName="pincode">
<mat-option>
<ngx-mat-select-search [formControl]="pinSearch"
[placeholderLabel]="'Search Pincode...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let PL of filteredpincodeList | async" [value]="PL">{{PL.pincode}}</mat-option>
</mat-select>
<mat-error *ngIf="newAddressForm.get('pincode').hasError('required')">Required</mat-error>
</mat-form-field>
</div>
</form>
</mat-dialog-content>
<mat-dialog-actions align="end">
<div fxFlex="50" align="left">
<p *ngIf="errormsg" style="color: red;">{{errormsg}}</p>
</div>
<div fxFlex="50" align="right">
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button> -->
<button mat-raised-button mat-icon-button (click)="addNewAddress()" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Submit" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AnswerOptionCreateDialogComponent } from './answer-option-create-dialog.component';
describe('AnswerOptionCreateDialogComponent', () => {
let component: AnswerOptionCreateDialogComponent;
let fixture: ComponentFixture<AnswerOptionCreateDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AnswerOptionCreateDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AnswerOptionCreateDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,183 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { ReplaySubject } from 'rxjs';
import { QuesFormService } from '../dynamic-form/ques-form/ques-form.service';
@Component({
selector: 'app-answer-option-create-dialog',
templateUrl: './answer-option-create-dialog.component.html',
styleUrls: ['./answer-option-create-dialog.component.scss']
})
export class AnswerOptionCreateDialogComponent implements OnInit {
stateList:any = []
cityList:any = []
pincodeList:any = []
filteredstateList:ReplaySubject<any>= new ReplaySubject<any>(1)
filteredcityList:ReplaySubject<any> = new ReplaySubject<any>(1)
filteredpincodeList:ReplaySubject<any> = new ReplaySubject<any>(1)
stateSearch:FormControl = new FormControl('')
citySearch:FormControl = new FormControl('')
pinSearch:FormControl = new FormControl('')
newAddressForm:FormGroup;
field_appearance="outline"
errormsg: string = null;
constructor(@Inject(MAT_DIALOG_DATA) public data:any, private _pdService:PdTrigerService, private _fb:FormBuilder,
private dialogRef:MatDialogRef<AnswerOptionCreateDialogComponent>, private quesService:QuesFormService) {
this.newAddressForm = this._fb.group({
address:['',Validators.required],
state:['',Validators.required],
city:['',Validators.required],
pincode:['',Validators.required]
})
console.log(this.data)
}
ngOnInit() {
this._pdService.getAllMasterDatas('STATE').subscribe(
data => {
if (data.status == 200) {
this.stateList = data.records.filter(item => item.isactive == 1);
this.filteredstateList.next(this.stateList);
}
});
this.filterList()
}
filterList() {
this.stateSearch.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.stateSearch.value,this.filteredstateList,this.stateList,'name')
})
this.citySearch.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.citySearch.value,this.filteredcityList,this.cityList,'city_name')
})
this.pinSearch.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.pinSearch.value,this.filteredpincodeList,this.pincodeList,'pincode')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
//get city list details based on state id
getCityList(stateID: string) {
this._pdService.getStateWiseCities(stateID).subscribe(data => {
if (data.status == 200) {
this.cityList = data.records.cities;
this.pincodeList = data.records.pincode;
this.filteredcityList.next(this.cityList)
this.filteredpincodeList.next(this.pincodeList)
}
});
}
addNewAddress() {
console.log(this.newAddressForm.getRawValue())
if(this.newAddressForm.invalid) {
this.showMsg("Please Fill all the fields")
// this.findInvalidControls()
return;
}
let formValue=this.newAddressForm.getRawValue()
let params = {pd_id:this.data.pd_all_details.pdmaster_details.pd_id,file_id:null, addressline:formValue.address, state:formValue.state.state_id, city:formValue.city.city_id, pincode:formValue.pincode.pincode_id}
let display_address= formValue.address+ ', '+formValue.state.name+', '+formValue.city.city_name+', '+formValue.pincode.pincode
console.log(this.newAddressForm.getRawValue(),display_address)
this._pdService.saveNewSMCTempAddresses(params).subscribe(res=>{
if(res['dataStatus']) {
this._pdService.getSMCTempAddresses(this.data.pd_all_details.pdmaster_details.pd_id).subscribe(rr=>{
if(rr && rr['dataStatus'] && rr['records']) {
let address_data = this.quesService.convertArrayNames(["display","display"],rr['records'])
this.dialogRef.close({update:true, address_for_display:address_data})
}
else {
this.dialogRef.close({update:false, error_msg:"Unable to get the address"})
}
},err=> {
this.dialogRef.close({update:false, error_msg:"Network error. Unable to get the address"})
})
// this.dialogRef.close({update:true, address_for_display:display_address})
}
else {
this.showMsg("Something went wrong")
}
},err=>{
this.showMsg("Network Error")
})
}
showMsg(msg) {
this.errormsg = msg
setTimeout(()=>{
this.errormsg = null
}, 3000)
}
public findInvalidControls() {
const invalid = [];
for (const name in <any>(this.newAddressForm.controls)) {
console.log(this.newAddressForm.controls[name],name)
if (this.newAddressForm.controls[name].invalid) {
invalid.push(name);
let invalidFields = [].slice.call(document.getElementsByClassName('ng-invalid'));
let firstInvalidField;
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
firstInvalidField=invalidFields[val]
break;
}
}
if(firstInvalidField != undefined){
// firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
setTimeout(()=>{
firstInvalidField.scrollIntoView({block: "start", inline: "nearest"})
setTimeout(()=>{
firstInvalidField.focus()
},0)
// firstInvalidField.style.background = 'red'
firstInvalidField.classList.remove('field_highlight')
setTimeout(()=>{
firstInvalidField.classList.add('field_highlight')
},300)
},300)
}
break
}
}
// }
// }
// let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
// const controls = this.getQuestionControl().at(1)['controls']
// for (const name in controls) {
// if (controls[name].invalid) {
// invalid.push(name);
// }
// }
return invalid;
}
}

View File

@ -0,0 +1,188 @@
<div *ngIf="questions_JSON.questions.length > 0" #whole_form>
<form [formGroup]="form_group_name" fxLayout="row wrap" fxLayoutWrap fxFlex="100" fxLayout.xs="column" fxLayoutGap="33px">
<!-- <form [formGroup]="form_group_name" fxLayout="row wrap" fxLayoutWrap fxFlex="100" fxLayoutAlign="space-between" fxLayout.xs="column" fxLayoutGap="33px"> -->
<!-- {{form_group_name.value | json}} -->
<!-- <div *ngIf="form_group_name.controls['questions']"> -->
<!-- <section formArrayName="questions">fxFlex.md="33" fxFlex.lg="33" fxFlex.xl="33" -->
<!-- {{form_group_name.value | json}} -->
<div *ngFor="let parent_ques of questions_JSON.questions;let p_i =index; let p_last=last" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'"
[fxLayoutGap.xs]="(parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword') ? '5%' : '0' ">
<!-- {{parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'}} -->
<!-- <div *ngFor="let parent_ques of form_group_name.controls['questions']['controls'];let p_i=index; let p_l=last" [formGroupName]="p_i"> -->
<!-- {{parent_ques | json}} -->
<!-- <div *ngIf="parent_ques.sub_title" fxLayout="row" >
<mat-card-subtitle *ngIf="parent_ques.sub_title" fxFlex="100%">
{{parent_ques.sub_title}}
</mat-card-subtitle>
<br style="clear: both;"/>
</div> -->
<div *ngIf="parent_ques.is_repeatable != '1'" >
<app-dynamic-question-template [currFormArrayObj]="parent_ques" [json_answers] = "json_answers" [formGroupN]="form_group_name"
[whole_json]="questions_JSON.questions" [json_index]="p_i"></app-dynamic-question-template>
</div>
<div *ngIf="parent_ques.is_repeatable == '1' && parent_ques.disable != true">
<!-- {{form_group_name.value[parent_ques.group_key] | json}} -->
<div [formArrayName]="parent_ques.group_key" *ngIf="parent_ques.group_type != '6'" >
<!-- {{g_i}} {{g_l}} -->
<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-header>
<mat-panel-title *ngIf="parent_ques.group_title_shown != '0'">
{{parent_ques.group_title}} {{g_i+1}}
</mat-panel-title>
<!-- <mat-panel-description>
Type your name and age
</mat-panel-description> -->
</mat-expansion-panel-header>
<!-- {{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'"
[ngStyle.xs]="{'margin-bottom' : (singleQues.field_type == 'numtoword' || singleQues.field_type == 'str&numtoword') ? '5%' : '0' }">
<!-- {{s_i}} -->
<!-- {{json_answers[parent_ques.group_key][s_i] | json}} -->
<div *ngIf="singleQues.is_repeatable != '2'">
<app-dynamic-question-template [group_key] = parent_ques.group_key [currFormArrayObj]="singleQues" [json_answers] = "json_answers != null && json_answers ? json_answers[parent_ques.group_key] : null" [formGroupN]="group_ques" [whole_form]="form_group_name"
[whole_json]="parent_ques.group_questions[g_i]" [json_index]="g_i" (generateGroupControls) = generateGroupControls($event)></app-dynamic-question-template>
</div>
<!-- Child REPEATABLE QUES -->
<div *ngIf="singleQues.is_repeatable == '2'">
<!-- {{singleQues.questions_level_two | json}} -->
<!-- {{form_group_name.value[parent_ques.group_key] | json}} -->
<div [formArrayName]="singleQues.group_key" *ngIf="singleQues.group_type != '6'" >
<!-- {{g_i}} {{g_l}} -->
<mat-accordion *ngIf="singleQues.group_type != '6'" #accordion="matAccordion" [multi]="true">
<!-- {{group_ques.value | json}} -->
<div *ngFor="let group_ques_child of group_ques.get(singleQues.group_key)['controls'];let g_c_i=index;let g_c_l=last"
[formGroupName]="g_c_i">
<!-- {{group_ques_child.value | json}} -->
<mat-expansion-panel [expanded]="step_child === g_c_i" #mapanel="matExpansionPanel" >
<mat-expansion-panel-header>
<mat-panel-title *ngIf="singleQues.group_title_shown != '0'">
{{singleQues.group_title}} {{g_c_i+1}}
</mat-panel-title>
<!-- <mat-panel-description>
Type your name and age
</mat-panel-description> -->
</mat-expansion-panel-header>
<!-- {{json_answers[parent_ques.group_key][0] | json}} -->
<div *ngFor="let singleQues_child of singleQues.questions_level_two[g_c_i];let s_i=index" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="singleQues_child.hasOwnProperty('field_width') && singleQues_child.field_width ? singleQues_child.field_width : '100'"
[ngStyle.xs]="{'margin-bottom' : (singleQues_child.field_type == 'numtoword' || singleQues_child.field_type == 'str&numtoword') ? '5%' : '0' }">
<!-- {{s_i}} -->
<!-- {{json_answers[parent_ques.group_key][s_i] | json}} -->
<!-- {{singleQues_child | json}} -->
<app-dynamic-question-template [group_key] = singleQues.group_key [currFormArrayObj]="singleQues_child" [json_answers] = "json_answers != null && json_answers ? json_answers[parent_ques.group_key] : null" [formGroupN]="group_ques_child" [whole_form]="group_ques"
[whole_json]="singleQues.questions_level_two[g_c_i]" [json_index]="g_c_i" (generateGroupControls) = generateGroupControls($event)></app-dynamic-question-template>
</div>
<br/>
<div fxLayout="row" fxLayoutAlign="flex-end" fxFlex="100" style="margin-top: 3%;">
<div >
<!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<ion-icon style="font-size: 22px" name="md-trash"></ion-icon>
</ion-button> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete"
matTooltipPosition="above" *ngIf="group_ques.get(singleQues.group_key).length > 1" (click)="removeSecondLevelChild(g_c_i,singleQues,group_ques)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div>
<!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_l"
(click)="addData(g_i,parent_ques,$event)">
<ion-icon style="font-size: 24px" name="add-circle"></ion-icon>
</ion-button> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Add More"
matTooltipPosition="above" *ngIf="g_c_l"
(click)="addSecondLevelChild(g_c_i,singleQues,group_ques)">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</mat-expansion-panel>
</div>
</mat-accordion>
</div>
<!-- IS REPEATABLE -->
</div>
</div>
<br/>
<div fxLayout="row" fxLayoutAlign="flex-end" fxFlex="100" style="margin-top: 3%;">
<div >
<!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<ion-icon style="font-size: 22px" name="md-trash"></ion-icon>
</ion-button> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete"
matTooltipPosition="above" *ngIf="form_group_name.get(parent_ques.group_key).length > 1" (click)="removeData(g_i,parent_ques)">
<mat-icon>delete</mat-icon>
</button>
</div>
<div>
<!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_l"
(click)="addData(g_i,parent_ques,$event)">
<ion-icon style="font-size: 24px" name="add-circle"></ion-icon>
</ion-button> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button [disabled]="parent_ques.disable == true"
mat-icon-button matTooltip="Add More"
matTooltipPosition="above" *ngIf="g_l"
(click)="addData(g_i,parent_ques)">
<mat-icon>add</mat-icon>
</button>
</div>
</div>
</mat-expansion-panel>
</div>
</mat-accordion>
</div>
<!-- IS REPEATABLE -->
</div>
<!-- </div> -->
<!-- </section> -->
</div>
</form>
</div>
<!-- <mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding>
<button mat-icon-button disabled></button>
<mat-checkbox class="checklist-leaf-node"
[checked]="checklistSelection.isSelected(node)"
(change)="todoLeafItemSelectionToggle(node)">{{node.item}}</mat-checkbox>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasNoContent" matTreeNodePadding>
<button mat-icon-button disabled></button>
<mat-form-field>
<input matInput #itemValue placeholder="New item...">
</mat-form-field>
<button mat-button (click)="saveNode(node, itemValue.value)">Save</button>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
<button mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.filename">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<mat-checkbox [checked]="descendantsAllSelected(node)"
[indeterminate]="descendantsPartiallySelected(node)"
(change)="todoItemSelectionToggle(node)">{{node.item}}</mat-checkbox>
<button mat-icon-button (click)="addNewItem(node)"><mat-icon>add</mat-icon></button>
</mat-tree-node>
</mat-tree> -->

View File

@ -0,0 +1,15 @@
::ng-deep {
.mat-expansion-panel-body{
flex-flow: wrap;
}
form{
flex-flow: row wrap;
box-sizing: border-box;
display: flex;
/* place-content: stretch space-between; */
align-items: stretch;
flex: 1 1 100%;
max-width: 100%;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DynamicFormComponent } from './dynamic-form.component';
describe('DynamicFormComponent', () => {
let component: DynamicFormComponent;
let fixture: ComponentFixture<DynamicFormComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DynamicFormComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DynamicFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,566 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { MatExpansionPanel,MatAccordion } from '@angular/material';
import { QuesFormService } from '../ques-form/ques-form.service';
import {SelectionModel} from '@angular/cdk/collections';
import {FlatTreeControl} from '@angular/cdk/tree';
import {Injectable} from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {BehaviorSubject} from 'rxjs';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
/**
* Node for to-do item
*/
export class TodoItemNode {
children: TodoItemNode[];
item: string;
}
/** Flat to-do item node with expandable and level information */
export class TodoItemFlatNode {
item: string;
level: number;
expandable: boolean;
}
/**
* The Json object for to-do list data.
*/
/**
* Checklist database, it can build a tree structured Json object.
* Each node in Json object represents a to-do item or a category.
* If a node is a category, it has children items and new items can be added under the category.
*/
@Injectable()
export class ChecklistDatabase {
dataChange = new BehaviorSubject<TodoItemNode[]>([]);
commonFormGroup: FormGroup;
questions_JSON: any = {questions:[],section_name:''};
val: any;
get data(): TodoItemNode[] { return this.dataChange.value; }
constructor( private questionService:QuesFormService) {
this.questionService.currentMessageSubscriber.subscribe((data : any)=>{
console.log(data)
this.val = data
})
this.initialize()
}
initialize() {
// Build the tree nodes from Json object. The result is a list of `TodoItemNode` with nested
// file node as children.
let TREE_DATA;
if(this.val.questions[0].question instanceof Array){
let tmp =[]
this.val.questions[0].question.forEach(element => {
console.log( element.question)
tmp.push(element.question)
});
TREE_DATA = {
Group_Questions: tmp,
Questions:[this.val.questions[1].question],
};
}else{
let tmp =[]
this.val.questions.forEach(element => {
console.log( element.question)
tmp.push(element.question)
});
TREE_DATA = {
Questions:tmp,
};
}
console.log( this.val)
// console.log( this.val.questions[0].group_questions)
console.log( this.val.questions[0].question)
console.log( this.val.questions[1].question)
// console.log(tmp)
// this.val.forEach(element => {
// element.questions.forEach(e => {
// e.question.forEach(s => {
// console.log( s.question)
// });
// });
// });
const data = this.buildFileTree(TREE_DATA, 0);
console.log(TREE_DATA)
console.log(data)
// Notify the change.
this.dataChange.next(data);
}
/**
* Build the file structure tree. The `value` is the Json object, or a sub-tree of a Json object.
* The return value is the list of `TodoItemNode`.
*/
buildFileTree(obj: {[key: string]: any}, level: number): TodoItemNode[] {
return Object.keys(obj).reduce<TodoItemNode[]>((accumulator, key) => {
const value = obj[key];
const node = new TodoItemNode();
node.item = key;
if (value != null) {
if (typeof value === 'object') {
node.children = this.buildFileTree(value, level + 1);
} else {
node.item = value;
}
}
return accumulator.concat(node);
}, []);
}
/** Add an item to to-do list */
insertItem(parent: TodoItemNode, name: string) {
if (parent.children) {
parent.children.push({item: name} as TodoItemNode);
this.dataChange.next(this.data);
}
}
updateItem(node: TodoItemNode, name: string) {
node.item = name;
this.dataChange.next(this.data);
}
}
/**
* @title Tree with checkboxes
*/
@Component({
selector: 'app-dynamic-form',
templateUrl: './dynamic-form.component.html',
styleUrls: ['./dynamic-form.component.scss'],
providers: [ChecklistDatabase]
})
export class DynamicFormComponent {
/** Map from flat node to nested node. This helps us finding the nested node to be modified */
flatNodeMap = new Map<TodoItemFlatNode, TodoItemNode>();
/** Map from nested node to flattened node. This helps us to keep the same object for selection */
nestedNodeMap = new Map<TodoItemNode, TodoItemFlatNode>();
/** A selected parent node to be inserted */
selectedParent: TodoItemFlatNode | null = null;
/** The new item's name */
newItemName = '';
treeControl: FlatTreeControl<TodoItemFlatNode>;
treeFlattener: MatTreeFlattener<TodoItemNode, TodoItemFlatNode>;
dataSource: MatTreeFlatDataSource<TodoItemNode, TodoItemFlatNode>;
/** The selection for checklist */
checklistSelection = new SelectionModel<TodoItemFlatNode>(true /* multiple */);
// form_group_name: FormGroup;
@Input() form_group_name:FormGroup;
@Input() questions_JSON:any;
@Input() json_answers:any;
length:any;
step: number=0;
isDefaultGenerated:boolean = false
step_child:number = 0
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
@ViewChild('accordion') Accordion: MatAccordion
vr: boolean = false;
constructor(private _fb:FormBuilder,private questionService:QuesFormService,private database: ChecklistDatabase) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel,
this.isExpandable, this.getChildren);
this.treeControl = new FlatTreeControl<TodoItemFlatNode>(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
console.log(this.dataSource)
database.dataChange.subscribe(data => {
this.dataSource.data = data;
console.log(this.dataSource)
});
this.questionService.currentMessageSubscriber.subscribe((data : any)=>{
console.log(data)
})
}
ngOnInit() {
this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions)
this.generateGroupControls();
console.log( this.questions_JSON.questions)
this.questionService.notify(this.questions_JSON)
if(this.questions_JSON.questions){
this.questions_JSON.questions.forEach(element => {
if(element.question instanceof Array){
element.question.forEach(e => {
console.log(e.question)
});
}else{
console.log(this.questions_JSON.questions)
}
});
}
}
generateGroupControls() {
if(this.json_answers && this.json_answers != null){
this.isDefaultGenerated = true;
console.log( this.questions_JSON.questions)
this.questions_JSON.questions.forEach(parent_ques=>{
// debugger;
// FOR ADDING THE GROUP QUES TO DISPLAY WITHOUT CONSIDERING INDEX 0
if(parent_ques.is_repeatable == '1'){
if(this.json_answers[parent_ques.group_key] && this.json_answers[parent_ques.group_key].length > this.form_group_name.value[parent_ques.group_key].length) {
// this.json_answers[parent_ques.group_key].mobile_numbers= [{mobile_no:93299},{mobile_no:948392}]
this.json_answers[parent_ques.group_key].forEach((group_ques,g_i)=>{
// debugger;
if(g_i != 0){
// let parent_control=this.form_group_name
// if(parent_control.value.hasOwnProperty('questions_group')){
this.addData(g_i,parent_ques)
// }
}
// FOR CHILD REPEATABLE
let keys= Object.keys(group_ques)
keys.forEach((vv,key_index)=>{
if(typeof(group_ques[vv]) != 'string') {
if(group_ques[vv] && group_ques[vv].length > 0) {
//
group_ques[vv].forEach((child_val,child_index)=>{
if(child_index != 0) {
let find_json = parent_ques.group_questions[g_i].filter(val=>val.hasOwnProperty('group_key') && val.group_key == vv)
if(find_json.length > 0) {
find_json = find_json[0]
this.addSecondLevelChild(g_i,find_json,this.form_group_name.get(parent_ques.group_key)['controls'][g_i])
}
}
})
}
}
})
})
}
}
})
}
}
ngOnChanges() {
// console.log(this.questions_JSON,this.json_answers,this.questionService);
// debugger
// if(this.json_answers && this.json_answers != null ){
// this.questions_JSON.questions.forEach(parent_ques=>{
// console.log(parent_ques);
// // debugger;
// // FOR ADDING THE GROUP QUES TO DISPLAY WITHOUT CONSIDERING INDEX 0
// if(parent_ques.is_repeatable == '1'){
// console.log(this.json_answers[parent_ques.group_key]);
// debugger;
// this.json_answers[parent_ques.group_key].forEach((group_ques,g_i)=>{
// console.log(parent_ques,g_i)
// debugger;
// if(g_i != 0){
// // let parent_control=this.form_group_name
// // if(parent_control.value.hasOwnProperty('questions_group')){
// this.addData(g_i,parent_ques)
// // }
// }
// })
// }
// })
// }
// this.form_group_name=new FormGroup({questions:this._fb.array([])})
// this.form_group_name.valueChanges.subscribe(()=>{
// this.form_group_name.updateValueAndValidity();
// })
// debugger;
// this.form_group_name.patchValue(this.json_answers)
}
addData(index,json_obj) {
let control_names:any= {}
let control = this.form_group_name.get(json_obj.group_key) as FormArray
json_obj.question.map(val=>{
// FOR CHILD REPEATABLE
if(val.is_repeatable == '2') {
val.question.map(rr=>{
control_names[val.group_key]=this._fb.array([this._fb.group({[rr.question_key]:''})])
// control_names[val.group_key].push({[rr.question_key]:''})
})
}
else {
control_names[val.question_key] = ''
}
})
// debugger;
json_obj.group_questions.push(json_obj.question);
control.push(this._fb.group(control_names))
json_obj.question.forEach((group_indi,arr_index)=>{
if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) {
group_indi.questions_level_two[0].forEach((child_val,child_index)=> {
// console.log("sd",group_indi,arr_index,control.at(control.length-1),control)
// debugger;
let child_control = control.at(control.length-1).get(group_indi.group_key) as FormArray
this.questionService.addAdditionalControl(child_val, child_control.controls[child_control.length-1], child_index)
})
}
else{
this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index)
}
})
json_obj.question = JSON.parse(JSON.stringify(json_obj.question))
control.updateValueAndValidity();
control.controls[control.length-1].updateValueAndValidity();
this.form_group_name.updateValueAndValidity();
this.step = control.length-1
// debugger;
}
// ADDING A CHILD REPEATABLE OBJ IN A EXISTING FORM ARRYA
addSecondLevelChild(index,json_obj,parent_group) {
let control_names:any= {}
let control = parent_group.get(json_obj.group_key) as FormArray
json_obj.question.map(val=>{
control_names[val.question_key] = ''
})
json_obj.questions_level_two.push(json_obj.question);
control.push(this._fb.group(control_names))
json_obj.question.forEach((group_indi,arr_index)=>{
// console.log("sd",childControl)
this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index)
})
json_obj.question = JSON.parse(JSON.stringify(json_obj.question))
control.updateValueAndValidity();
control.controls[control.length-1].updateValueAndValidity();
parent_group.updateValueAndValidity();
this.step_child = control.length-1
// debugger;
}
// REMOVE OF CHILD REPEATABLE OBJ
removeSecondLevelChild(index,json_obj,parent_group) {
// debugger;
let control = parent_group.get(json_obj.group_key)
control.removeAt(index)
json_obj.questions_level_two.splice(index,1)
this.step_child = control.length-1
}
removeData(index,json_obj) {
// debugger;
let control = this.form_group_name.get(json_obj.group_key) as FormArray
control.removeAt(index)
json_obj.group_questions.splice(index,1)
this.step = control.length-1
}
openMatExpansionPanel() {
if(this.matExpansionPanel!= undefined){
this.matExpansionPanel.open()
}
}
openAllPanels(){
this.Accordion.openAll();
return;
}
updateAllComplete(a,b){
console.log(a)
console.log(b.checked)
if(b.checked){
this.vr = true
}else{
this.vr = false
}
}
getLevel = (node: TodoItemFlatNode) => node.level;
isExpandable = (node: TodoItemFlatNode) => node.expandable;
getChildren = (node: TodoItemNode): TodoItemNode[] => node.children;
hasChild = (_: number, _nodeData: TodoItemFlatNode) => _nodeData.expandable;
hasNoContent = (_: number, _nodeData: TodoItemFlatNode) => _nodeData.item === '';
/**
* Transformer to convert nested node to flat node. Record the nodes in maps for later use.
*/
transformer = (node: TodoItemNode, level: number) => {
const existingNode = this.nestedNodeMap.get(node);
const flatNode = existingNode && existingNode.item === node.item
? existingNode
: new TodoItemFlatNode();
flatNode.item = node.item;
flatNode.level = level;
flatNode.expandable = !!node.children;
this.flatNodeMap.set(flatNode, node);
this.nestedNodeMap.set(node, flatNode);
return flatNode;
}
/** Whether all the descendants of the node are selected. */
descendantsAllSelected(node: TodoItemFlatNode): boolean {
const descendants = this.treeControl.getDescendants(node);
const descAllSelected = descendants.every(child =>
this.checklistSelection.isSelected(child)
);
return descAllSelected;
}
/** Whether part of the descendants are selected */
descendantsPartiallySelected(node: TodoItemFlatNode): boolean {
const descendants = this.treeControl.getDescendants(node);
const result = descendants.some(child => this.checklistSelection.isSelected(child));
return result && !this.descendantsAllSelected(node);
}
/** Toggle the to-do item selection. Select/deselect all the descendants node */
todoItemSelectionToggle(node: TodoItemFlatNode): void {
this.checklistSelection.toggle(node);
const descendants = this.treeControl.getDescendants(node);
this.checklistSelection.isSelected(node)
? this.checklistSelection.select(...descendants)
: this.checklistSelection.deselect(...descendants);
// Force update for the parent
descendants.every(child =>
this.checklistSelection.isSelected(child)
);
this.checkAllParentsSelection(node);
}
/** Toggle a leaf to-do item selection. Check all the parents to see if they changed */
todoLeafItemSelectionToggle(node: TodoItemFlatNode): void {
this.checklistSelection.toggle(node);
this.checkAllParentsSelection(node);
}
/* Checks all the parents when a leaf node is selected/unselected */
checkAllParentsSelection(node: TodoItemFlatNode): void {
let parent: TodoItemFlatNode | null = this.getParentNode(node);
while (parent) {
this.checkRootNodeSelection(parent);
parent = this.getParentNode(parent);
}
}
/** Check root node checked state and change it accordingly */
checkRootNodeSelection(node: TodoItemFlatNode): void {
const nodeSelected = this.checklistSelection.isSelected(node);
const descendants = this.treeControl.getDescendants(node);
const descAllSelected = descendants.every(child =>
this.checklistSelection.isSelected(child)
);
if (nodeSelected && !descAllSelected) {
this.checklistSelection.deselect(node);
} else if (!nodeSelected && descAllSelected) {
this.checklistSelection.select(node);
}
}
/* Get the parent node of a node */
getParentNode(node: TodoItemFlatNode): TodoItemFlatNode | null {
const currentLevel = this.getLevel(node);
if (currentLevel < 1) {
return null;
}
const startIndex = this.treeControl.dataNodes.indexOf(node) - 1;
for (let i = startIndex; i >= 0; i--) {
const currentNode = this.treeControl.dataNodes[i];
if (this.getLevel(currentNode) < currentLevel) {
return currentNode;
}
}
return null;
}
/** Select the category so we can insert the new item. */
addNewItem(node: TodoItemFlatNode) {
const parentNode = this.flatNodeMap.get(node);
this.database.insertItem(parentNode!, '');
this.treeControl.expand(node);
}
/** Save the node to database */
saveNode(node: TodoItemFlatNode, itemValue: string) {
const nestedNode = this.flatNodeMap.get(node);
this.database.updateItem(nestedNode!, itemValue);
console.log(this.dataSource)
}
}

View File

@ -0,0 +1,230 @@
<section [formGroup]="formGroupN">
<!-- <mat-checkbox [checked]="check == true || false" (change)="updateAllComplete(parent_ques.question_key,$event)"> -->
<div *ngIf="parent_ques.title" fxLayout="row" style=" width: 100%" >
<mat-card-header>
<mat-card-title> {{parent_ques.title}} </mat-card-title>
</mat-card-header>
<br />
<br style="clear: both;"/>
</div>
<div *ngIf="parent_ques.sub_title" fxLayout="row" >
<mat-card-subtitle style="font-size: 12px;"*ngIf="parent_ques.sub_title" >
{{parent_ques.sub_title}}
</mat-card-subtitle>
<br />
<br style="clear: both;"/>
</div>
<!-- {{formGroupN.value | json}} -->
<mat-card-content>
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != true && parent_ques.type == '1' && !parent_ques.is_hidden"
>
<mat-label>{{parent_ques.question}}</mat-label>
<input matInput
[type]="parent_ques.field_type == 'num' || parent_ques.field_type == 'numtoword' ? 'number' : parent_ques.field_type== 'string' ? 'text' : parent_ques.field_type"
[formControlName]="parent_ques.question_key" [placeholder]="parent_ques.place_holder" autocomplete="off"
(change)="onChangeProperty($event,parent_ques,parent_ques.question_key)">
<!-- [placeholder]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'Entert the Number' : 'Enter the Text'" -->
<mat-hint
*ngIf="formGroupN.value[parent_ques.question_key] != '' && (parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword')"
align="end" style="font-size: 12px;">{{"&#8377;"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}}
</mat-hint>
<!-- <mat-hint align="end" style="font-size: 11.5px;color: gray;" *ngIf="parent_ques.get('is_amt_in_words').value == true">One Lack</mat-hint> -->
<!-- {{formGroupN.value | json}} -->
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width:100%"
*ngIf="parent_ques.disable != true && parent_ques.type == '9'" >
<mat-label>{{parent_ques.question}}</mat-label>
<input matInput [type]="parent_ques.field_type == 'num' || parent_ques.field_type == 'numtoword' ? 'number' : parent_ques.field_type== 'string' || parent_ques.field_type == 'str&numtoword' ? 'text' : parent_ques.field_type"
[formControlName]="parent_ques.question_key" [placeholder]="parent_ques.place_holder"
(change)="onChangeProperty($event,parent_ques,parent_ques.question_key)"
[matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete" (optionSelected) = "onChangeProperty($event,parent_ques,parent_ques.question_key)">
<mat-option *ngFor="let val of autoCompleteAns | async" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
>
<span>{{val.answer}}</span>
</mat-option>
</mat-autocomplete>
<mat-hint
*ngIf="formGroupN.value[parent_ques.question_key] != '' && (parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword')"
align="end" style="font-size: 12px;">{{"&#8377;"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}}
</mat-hint>
<!-- <mat-hint align="end" style="font-size: 11.5px;color: gray;" *ngIf="parent_ques.get('is_amt_in_words').value == true">One Lack</mat-hint> -->
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<!-- <mat-form-field> -->
<div class="radio-gap" *ngIf="parent_ques.disable != true && parent_ques.type == '2'">
<mat-label >{{parent_ques.question}}</mat-label><br />
<mat-radio-group aria-label="Select an option" [formControlName]="parent_ques.question_key"
(change)="onChangeProperty($event,parent_ques,'','','')">
<mat-radio-button class="radio-btn-gap" *ngFor="let val of parent_ques.answers"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-radio-button><br /><br />
</mat-radio-group>
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error style="font-size:12px" align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != true && parent_ques.type == '3'">
<mat-label>{{parent_ques.question}}</mat-label>
<mat-select [formControlName]="parent_ques.question_key" (selectionChange)="onChangeProperty($event,parent_ques,'','','')">
<mat-option>Select</mat-option>
<mat-option *ngFor="let val of parent_ques.answers"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon *ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
</mat-select>
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" [formArrayName]="parent_ques.question_key" *ngIf=" parent_ques.disable != true && parent_ques.type == '5'">
<mat-label>{{parent_ques.question}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.answers;let i=index"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
(change)="onChange_checkbox($event,parent_ques);onChangeProperty($event,parent_ques,'','','')">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
<!-- {{formGroupN.value[parent_ques.question_key] | json}} -->
</div>
<div class="toggle" fxLayout="row nowrap" *ngIf=" parent_ques.disable != true && parent_ques.type == '12'">
<mat-label>{{parent_ques.question}}</mat-label>&nbsp;&nbsp;
<mat-slide-toggle [formControlName]="parent_ques.question_key" color="primary"></mat-slide-toggle>
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != true && parent_ques.type == '11'">
<mat-label>{{parent_ques.question}}</mat-label>&nbsp;&nbsp;
<input matInput [formControlName]="parent_ques.question_key" [matDatepicker]="picker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != true && parent_ques.type == '4'">
<mat-label>{{parent_ques.question}}</mat-label>
<mat-select multiple [formControlName]="parent_ques.question_key"
(selectionChange)="onChangeProperty($event,parent_ques,'','','')">
<!-- <mat-option>Select</mat-option> -->
<mat-option *ngFor="let val of parent_ques.answers"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<!-- <div *ngIf="parent_ques.type == '6'">
<ion-grid>
<ion-row>
<ion-col col-6 no-padding align-self: center text-center>
<div>
<img *ngIf="parent_ques.get('answer_value').value != ''" [src]="parent_ques.get('answer_value').value"
imageViewer class="doc-image-bucket"><br />
<label><strong>{{parent_ques.get('question').value}}</strong></label>
</div>
<ion-row style="justify-content: center">
<ion-col col-8>
<button ion-button clear color="optblue" [disabled]="sales_pd_type == '2'"
(click)="captureImg('',parent_ques)">
<ion-icon style="font-size: 30px" name="md-camera"></ion-icon>
</button>
</ion-col>
<ion-col col-4 *ngIf="parent_ques.get('is_image_status').value == true">
<ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(parent_ques)" *ngIf="parent_ques.get('is_loader').value == true">
</ion-spinner>
<ion-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="parent_ques.get('is_saved').value == true" name="checkmark-circle-outline">
</ion-icon>
<span style="margin:0px;" *ngIf="(parent_ques.get('is_saved').value == false &&
parent_ques.get('is_loader').value == false) && (parent_ques.value.hasOwnProperty('is_saved') &&
parent_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(parent_ques)">
<ion-row style="margin-top: -17px;padding:0px;"><button ion-button clear>
<ion-icon style="color:lightcoral;" name="refresh-circle"></ion-icon>
</button></ion-row>
<ion-row style="margin-top: -20px;padding:0px;">
<p style="font-size: 10px">Click to ReUpload</p>
</ion-row>
</span>
</ion-col>
</ion-row>
</ion-col>
<hr />
</ion-row>
</ion-grid>
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</div> -->
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != true && parent_ques.type == '7'" >
<mat-label>{{parent_ques.question}}</mat-label>
<textarea matInput type="text" rows="3" [formControlName]="parent_ques.question_key" placeholder="Enter the Text"
autocomplete="off"></textarea>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="parent_ques.disable != 'true' && parent_ques.type == '8'" (click)="ngxFilteredValue.next(parent_ques.answers)">
<mat-label>{{parent_ques.question}}</mat-label>
<mat-select [formControlName]="parent_ques.question_key" (selectionChange)="onChangeProperty($event,parent_ques,'','','')">
<mat-option>
<ngx-mat-select-search [formControl]="commonFilterCtrl" [placeholderLabel]="'Search'"
[noEntriesFoundLabel]="'No Matching Result'" >
<mat-icon ngxMatSelectSearchClear>close</mat-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option>
<mat-option
*ngFor="let val of ngxFilteredValue | async"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon *ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
</mat-select>
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
</mat-card-content>
<!-- </mat-checkbox> -->
</section>

View File

@ -0,0 +1,90 @@
mat-radio-button,mat-checkbox{
margin-top: 13px;
}
mat-form-field {
width: 100%;
}
.radio-gap{
margin-top: 10px;
margin-bottom: 10px;
}
.radio-btn-gap{
margin:10px;
}
::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{
border-color:rgb(212, 15, 15);
}
::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{
color:rgb(212, 15, 15);
background-color:rgb(212, 15, 15);
}
::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element {
background-color:rgba(224, 22, 22, 0.308);
}
input {
// width: 100px;
// border-radius: 4px;
// border-color: gray;
// font-size: 12px;
height: 31px;
}
.mat-select, .text-area {
margin-top: 8px;
}
@-webkit-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@-moz-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@-ms-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
.field_highlight {
-webkit-animation: highlight-fade 4s ease-out;
-moz-animation: highlight-fade 4s ease-out;
-o-animation: highlight-fade 4s ease-out;
animation: highlight-fade 4s ease-out;
// background: blue;
}
::ng-deep .mat-form-field-label{
white-space: pre-wrap;
}
.large-select-option {
height: unset !important;
line-height: 1.2em !important;
padding-top: 0.9em !important;
padding-bottom: 0.9em !important;
span {
white-space: normal;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DynamicQuestionTemplateComponent } from './dynamic-question-template.component';
describe('DynamicQuestionTemplateComponent', () => {
let component: DynamicQuestionTemplateComponent;
let fixture: ComponentFixture<DynamicQuestionTemplateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DynamicQuestionTemplateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DynamicQuestionTemplateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,913 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormArray, FormControl, FormBuilder } from '@angular/forms';
import { QuesFormService } from '../ques-form/ques-form.service';
import { startWith, map } from 'rxjs/operators';
import { Observable, ReplaySubject } from 'rxjs';
import { MatDialog } from '@angular/material';
import { AnswerOptionCreateDialogComponent } from '../../answer-option-create-dialog/answer-option-create-dialog.component';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-dynamic-question-template',
templateUrl: './dynamic-question-template.component.html',
styleUrls: ['./dynamic-question-template.component.scss'],
})
export class DynamicQuestionTemplateComponent implements OnInit {
@Input() formGroupN : FormGroup;
@Input() currFormArrayObj;
parent_ques: any;
fileredSearchValue: any=[];
@Input() whole_json:any;
@Input() json_index:any;
@Input() whole_form:FormGroup;
@Input() json_answers:any;
@Input()group_key:any;
length:any;
@Output() generateGroupControls= new EventEmitter()
local_city: any;
local_pincode: any;
json_answers1:any;
autoCompleteAns:Observable<string[]>
public commonFilterCtrl:FormControl = new FormControl();
public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(1);
vr: boolean;
check: boolean = false;
constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog, private loaderService:LoaderService) { }
ngOnInit() {
this.quesService.currentMessageSubscriber.subscribe((data : any)=>{
console.log(data)
if(data){
this.check = true
}else{
this.check = false
}
// output : {msg : 'do something'}
})
console.log( this.whole_json)
this.parent_ques = this.currFormArrayObj
if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) {
this.autoCompleteAns =this.formGroupN.get(this.parent_ques.question_key).valueChanges.pipe(
startWith(''),
map(value => this.autoCompleteFilter(value))
)
}
//let length=this.quesService.ans_length()
}
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: "",
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_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_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_name2: "VIGNESH",
share_holding2: 0,
vintage_in_current_biz2: 10,
total_work_exp2: 9,
started_biz2: "",
stakeholder_length:'2',
company_name: 1}
]
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
// setTimeout(()=>{
// console.clear()
if(this.json_answers!=null && this.json_answers!= undefined && this.json_answers&& !this.group_key) {
this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'','','','TS')
}
else if(this.json_answers!=null && this.json_answers != undefined && this.json_answers){
// this.formGroupN.patchValue((this.json_answers[this.group_key] || ''))
// 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()
}
this.json_answers.forEach((value,index)=>{
let keys= Object.keys(value)
keys.forEach(vv=>{
// debugger;
if(typeof(value[vv])== 'string') {
if(this.whole_form.get(this.group_key) && this.whole_json.length > 0) {
let curr_obj=this.whole_json.filter(vl=>vl.question_key == vv)[0]
this.onChangeProperty({value:value[vv]},curr_obj,'','','','TS')
}
}
})
})
// debugger;
}
// this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
// setTimeout(()=>{
// console.log("last on change fun",this.json_answers[this.parent_ques.question_key],this.parent_ques.question_key)
// debugger;
// this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'')
// },1000)
// this.formGroupN.patchValue(this.json_answers)
// })
this.loaderService.closeMatSpinnerDialog();
// this.formGroupN.get(this.parent_ques.question_key).patchValue(this.json_answers[this.parent_ques.question_key])
// this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'')
// setTimeout(()=>{
// this.json_answers = null
// },700)
// if(this.json_answers == )
// console.log("KEY TO BE FIND",this.json_index,this.whole_json)
setTimeout(() => {
// this.quesService.formanswers=null;
this.loaderService.closeMatSpinnerDialog();
},0)
}
// console.log(this.parent_ques,this.formGroupN,this.whole_json ,this.json_answers);
// debugger;
if(this.parent_ques.type == '8') {
if(this.parent_ques.answers && this.parent_ques.answers.length > 0){
this.ngxFilteredValue.next(this.parent_ques.answers.slice())
// this.filterList()
}
else{
setTimeout(()=>{
if(this.parent_ques.answers && this.parent_ques.answers.length > 0){
this.ngxFilteredValue.next(this.parent_ques.answers.slice())
// this.filterList()
}
},1600)
}
this.filterList()
}
}
filterList() {
this.commonFilterCtrl.valueChanges.pipe().subscribe(()=>{
if(this.parent_ques.type == '8' && this.parent_ques.answers && this.parent_ques.answers.length > 0) {
this.applyFilter(this.commonFilterCtrl.value,this.ngxFilteredValue,this.parent_ques.answers,'answer')
}
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
autoCompleteFilter(value:string): string[] {
if(value) {
const filterValue = value.toLowerCase();
return this.parent_ques.answers.filter(option => option.answer.toLowerCase().indexOf(filterValue) === 0);
}
else {
return this.parent_ques.answers
}
}
onChange_checkbox(event,sec_control){
const control=this.formGroupN.get(sec_control.question_key) as FormArray
if(event.checked) {
control.push(new FormControl(event.source.value))
} else {
const i = control.controls.findIndex(x => x.value === event.source.value);
control.removeAt(i);
}
}
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
}
// this.fileredSearchValue=[]
if(sec_control && sec_control.answers!= null && sec_control.answers.length > 0){
// this.creatSubField(sec_control,event.value)
}
//FOR API CALLS
// console.log(sec_control.value);
if(sec_control && sec_control.onchange_properties != null && sec_control.onchange_properties.length >0){
let onChangeProperties_value=sec_control.onchange_properties
// let new_name=`{
// "purpose":"FORM_CTRL",
// "form_controls":[
// {
// "insert_index":"total_work_exp",
// "expression":"(total_work_exp > vintage_in_current_biz)",
// "value_keys":[
// "total_work_exp",
// "vintage_in_current_biz"],
// "questions":[
// {
// "question_key":"previous_experience_details2",
// "question":"Previous Experience2",
// "type":"1",
// "api_properties":null,
// "answers":null,
// "onchange_properties":null,
// "is_repeatable":null,
// "field_type":"string",
// "validations":[{
// "isactive": "1",
// "message": "Name Required",
// "name": "required",
// "validator": "Validators.required",
// "value": null
// }]
// }]
// },
// {
// "insert_index":"vintage_in_current_biz",
// "expression":"(total_work_exp > vintage_in_current_biz)",
// "value_keys":[
// "total_work_exp",
// "vintage_in_current_biz"],
// "questions":[{
// "question_key":"vintage1",
// "question":"Vintage check",
// "type":"1",
// "api_properties":null,
// "answers":null,
// "onchange_properties":null,
// "is_repeatable":null,
// "field_type":"string",
// "validations":[]
// }]
// }
// ]
// }`
// onChangeProperties_value.push(JSON.parse(new_name))
onChangeProperties_value.forEach(onChangeProperty=>{
if(onChangeProperty.purpose == 'api'){
if(onChangeProperty.api == 'getListOfStatesAndCities'){
// console.log(event.value,onChangeProperty.params)
// onChangeProperty.params = JSON.stringify(onChangeProperty.params);
// let updatedParams =JSON.stringify(onChangeProperty.params);
// updatedParams = updatedParams.replace('value_of_answer',event.value);
// // updatedParams = JSON.parse(updatedParams)
// console.log(JSON.parse(updatedParams),updatedParams,JSON.parse(JSON.stringify(updatedParams)))
// debugger;
let params={records:{state_id:event.value}}
this.quesService.apiCall(onChangeProperty.api,params,onChangeProperty.api_method).subscribe(res=>{
if(res['dataStatus']){
this.local_city=res['records'].cities
this.local_pincode=res['records'].pincode
this.whole_json.forEach((val,index)=>{
if(val.api_properties == 'local_city'){
this.local_city=this.quesService.convertArrayNames(['city_id','city_name'],this.local_city)
val.answers = (this.local_city)
}
else if(val.api_properties == 'local_pincode'){
this.local_pincode=this.quesService.convertArrayNames(['pincode_id','pincode'],this.local_pincode)
val.answers = (this.local_pincode)
}
})
}
})
}
else{
this.quesService.apiCall(onChangeProperty.api,onChangeProperty.params,onChangeProperty.api_method).subscribe((result:any)=>{
if(result['dataStatus']){
if(result.hasOwnProperty('records')){
result=result['records']
}
// let ques_control= this.quesAnsForm.controls.questions['controls']
// if(options == 2){
// ques_control=group_ques.controls.questions['controls']
// }
if(onChangeProperty.hasOwnProperty('filter_properties') && onChangeProperty.filter_properties && result.length > 0) {
let filter_properties = onChangeProperty.filter_properties
result = result.filter(vv=>vv[filter_properties.key_name] == filter_properties.value)
}
this.whole_json.forEach((val,index)=>{
if(val.api_properties == onChangeProperty.local_variable){
let values1=this.quesService.convertArrayNames(onChangeProperty.fields,result)
val.answers = (values1)
}
})
}
})
}
}
if(onChangeProperty.purpose == 'validations'){
// if(options == 2){
this.setValidations_onChange(onChangeProperty,this.formGroupN,sec_control,sec_index)
// }
// else{
// this.setValidations_onChange(onChangeProperty,this.quesAnsForm,sec_control,sec_index)
// }
}
if(onChangeProperty.purpose == 'FORM_CTRL'){
// if(options == 2){
// debugger;
this.creteNewField(onChangeProperty,this.formGroupN,sec_control,sec_index)
// }
// else{
// this.creteNewField(onChangeProperty,this.quesAnsForm,sec_control,sec_index)
// }
}
if(onChangeProperty.purpose == 'answer_value' || onChangeProperty.purpose == 'question_label') {
this.setModifiedValuetoControl(onChangeProperty,this.formGroupN,sec_index)
}
// for calculation field from multiple arr values
if(onChangeProperty.purpose == 'answer_value_arr') {
let index = JSON.parse(JSON.stringify(this.json_index))
this.setModifiedValuetoControl_frommultiple(onChangeProperty,this.whole_form.get(this.group_key),index,sec_control)
}
})
}
}
setModifiedValuetoControl_frommultiple(curr_obj,formArray,curr_index ?,sec_control?) {
if(curr_obj && curr_obj.value_keys.length > 0 && curr_obj.arr_include.length > 0 ) {
let expression_value=curr_obj.expression
for(let index_str of curr_obj.arr_include) {
let value_index;
if(index_str == 'py') {
if(curr_index == 0) {
formArray.controls[curr_index].controls[curr_obj.insert_control].setValue(0)
// curr_obj.is_hidden = true;
this.whole_json.filter(vv=>{
if(vv.question_key == curr_obj.insert_control) {
vv.is_hidden = true
}})
}
if(formArray.value.length < 2) {
return;
}
value_index = curr_index-1
}
if(index_str == 'now'){
value_index = curr_index
}
for(let value of curr_obj.value_keys) {
let control_value = formArray.getRawValue()[value_index] ? formArray.getRawValue()[value_index][value] : ''
if(control_value) {
if(sec_control.type == '1' && sec_control.field_type == 'num' || sec_control.field_type == 'numtoword') {
let val = Number(control_value)
if(val == undefined || isNaN(val)) {
control_value = 0
}
}
expression_value = expression_value.split(value+'['+index_str+']').join(control_value)
}
else{
if(formArray.value.length > curr_index+1) {
this.setModifiedValuetoControl_frommultiple(curr_obj,formArray,curr_index+1,sec_control)
}
return
}
}
}
if(expression_value) {
let calc_exp=eval(expression_value)
if(calc_exp){
if(typeof(calc_exp) == 'number'){
calc_exp = calc_exp.toFixed(2)
}
if(curr_obj.insert_control) {
formArray.controls[curr_index].controls[curr_obj.insert_control].setValue(calc_exp)
if(formArray.value.length > curr_index+1) {
this.setModifiedValuetoControl_frommultiple(curr_obj,formArray,curr_index+1,sec_control)
}
}
}
}
}
}
// for setting the modified value to another or same control while field change
setModifiedValuetoControl(curr_obj,form_control_obj,curr_index) {
if(curr_obj && curr_obj.value_keys.length > 0){
let expression_value=curr_obj.expression
// curr_obj.value_keys.forEach(val=>{
for(let val of curr_obj.value_keys) {
let control_value
control_value =form_control_obj.getRawValue()[val]
if(control_value) {
expression_value = expression_value.split(val).join(control_value)
}
else{
return;
}
}
// })
let calc_exp=eval(expression_value)
if( (typeof(calc_exp) == 'string' || typeof(calc_exp) == 'number' ) ){
// if(typeof(calc_exp) == 'number'){
// calc_exp = calc_exp.toFixed(2)
// }
if(curr_obj.insert_control) {
// FOR SETTING THE ANSWER TO OTHER OR SAME FIELD
if(curr_obj.purpose == 'answer_value') {
form_control_obj.controls[curr_obj.insert_control].setValue(calc_exp)
}
// FOR SETTING THE Question Label TO OTHER OR SAME Question
if(curr_obj.purpose == 'question_label') {
let curr_question_obj
let curr_json = this.whole_json
if(curr_obj.hasOwnProperty('insert_group_key') && curr_obj.insert_group_key != null) {
curr_json = curr_json.filter(val=>val.group_key == curr_obj.insert_group_key)
curr_json = curr_json[0]
if(curr_json && curr_json.group_questions && curr_json.group_questions.length > 0) {
curr_json.group_questions.forEach(rr=>{
let temp_curr = rr.filter(val=>val.question_key == curr_obj.insert_control)
if(temp_curr && temp_curr.length > 0) {
temp_curr[0].question = calc_exp
}
})
curr_json = curr_json.question
}
}
if(curr_json) {
curr_question_obj = curr_json.filter(val=>val.question_key == curr_obj.insert_control)
if(curr_question_obj && curr_question_obj.length > 0) {
curr_question_obj[0].question = calc_exp
}
}
}
}
}
}
}
creteNewField(form_control_obj_raw,group_ques,sec_control,sec_index,purpose?){
if(form_control_obj_raw.form_controls.length > 0){
form_control_obj_raw.form_controls.forEach(form_control_obj=>{
if(form_control_obj.value_keys != null && form_control_obj.value_keys.length > 0 ){
let expression_value=form_control_obj.expression
form_control_obj.value_keys.forEach(res=>{
let control_value_obj
if(purpose != 'edit'){
control_value_obj =group_ques.value[res]
}
else{
control_value_obj = sec_index.questions.filter(val=>val.question_key == res)[0]
}
if(control_value_obj){
// if(control_value_obj.answer_value == ''){
// control_value_obj.answer_value =0
// }
expression_value=expression_value.split(res).join(control_value_obj)
}
})
let calc_exp=eval(expression_value)
if(calc_exp != false){
if(form_control_obj.questions.length > 0){
let question_index_after
this.whole_json.forEach((val,index,arr)=>{
if(val.question_key == form_control_obj.insert_index){
question_index_after= arr.indexOf(val)
}
})
this.createControl(form_control_obj,group_ques,question_index_after,1) //FOR ADD CONTOL
}
}
else{
this.createControl(form_control_obj,group_ques,'',2) //FOR REMOVE CONTROL
}
}
})
}
}
createControl(form_control_obj,group_ques,question_index_after,options){
let ques_control=this.whole_json
let inserted_control_obj=form_control_obj
// inserted_control_obj.questions.sort()
// inserted_control_obj.questions.reverse()
inserted_control_obj.questions.forEach((val,index)=>{
if(val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') {
if(options == 1) {
let check_dup=ques_control.filter(control_key=>control_key.group_key == val.group_key)
if(check_dup.length == 0){
this.formGroupN.addControl(val.group_key,this._fb.array([]))
// val.question.reverse()
let childControl: any = this.formGroupN.get(val.group_key) as FormArray
let control_names:any={}
inserted_control_obj.questions[index].group_questions = []
inserted_control_obj.questions[index].group_questions.push(val.question)
this.whole_json.splice(question_index_after+1,0,val);
val.question.forEach(group_val=>{
control_names[group_val.question_key] = ''
// console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val)
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
})
const question_temp:any = JSON.parse(JSON.stringify(val.question));
inserted_control_obj.questions[index].question = question_temp
childControl.push(this._fb.group(control_names))
val.group_questions[0].forEach((group_indi,arr_index)=>{
this.quesService.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
})
}
}
else{
// let childControl: any = this.formGroupN.get(val.group_key) as FormArray
val.question.forEach(group_val=>{
// control_names[group_val.question_key] = ''
// console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val)
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
})
}
}
else{
this.addOrRemoveControl(val,ques_control,question_index_after,options,val)
}
})
}
addOrRemoveControl(val,ques_control,question_index_after,options,paren_ques) {
console.log(val);
console.log(ques_control);
console.log(question_index_after);
console.log(paren_ques);
if(options == 1){
let check_dup=ques_control.filter(control_key=>control_key.question_key == val.question_key)
// let check_dup = []
if(check_dup.length == 0){
val.raw_validations=val.validations
// ques_control.insert(question_index_after+1,this.questionService.createValue(val))
if(paren_ques.hasOwnProperty('is_repeatable') && paren_ques.is_repeatable == '1') {
// this.formGroupN.addControl(val.question_key,new FormControl(''))
}
else{
this.whole_json.splice(question_index_after+1,0,val);
this.formGroupN.addControl(val.question_key,new FormControl(''))
this.quesService.addAdditionalControl(val, this.formGroupN, question_index_after+1,"")
}
}
}
else{
ques_control.forEach((control_key,index)=>{
if(paren_ques.hasOwnProperty('is_repeatable') && paren_ques.is_repeatable == '1') {
if(control_key.group_key == paren_ques.group_key){
this.whole_json.splice(index,1)
// this.formGroupN.controls[val.question_key].reset()
this.formGroupN.removeControl(paren_ques.group_key);
}
}
else{
if(control_key.question_key == val.question_key){
this.whole_json.splice(index,1)
this.formGroupN.controls[val.question_key].reset()
this.formGroupN.removeControl(val.question_key);
this.checkAndRemoveSubQuestion(control_key,ques_control)
// let getSubQuestion = this.whole_json.filter(vv=>vv.parent_question_key == control_key.question_key)
// console.log(getSubQuestion,control_key,this.whole_json)
}
}
})
}
}
checkAndRemoveSubQuestion(question_obj,ques_control) {
let getSubQuestion = this.whole_json.filter(vv=>vv.parent_question_key == question_obj.question_key)
if(getSubQuestion.length > 0) {
getSubQuestion.forEach(val=>{
this.addOrRemoveControl(val,ques_control,'',2,val)
})
}
}
setValidations_onChange(validation_obj_raw,group_ques,sec_control,sec_index){
if(validation_obj_raw.validations.length > 0){
validation_obj_raw.validations.forEach(validation_obj=>{
//FOR CHECKING THE EXPRESSION OR NORMAL VALIDATION
if(validation_obj.hasOwnProperty('value_keys')){
if( validation_obj.value_keys != null){
let expression_value=validation_obj.value
validation_obj.value_keys.forEach(res=>{
let validator_value_obj=group_ques.value[res]
// if(validator_value_obj){
expression_value=expression_value.split(res).join(validator_value_obj)
// }
})
// validation_obj.value=expression_value
validation_obj.validator=eval(expression_value)
if(validation_obj.validator == false){
validation_obj.isactive='0'
// // MAKING THE DECISION FOR SETTING THE VALIDATOR FOR CURRENT CONTROL OR OTHERS
this.proceedValidationSet(validation_obj,group_ques,sec_control,'')
}
else{
validation_obj.isactive='1'
let validator_single=this.quesService.setValueForValidator(validation_obj)
// // MAKING THE DECISION FOR SETTING THE VALIDATOR FOR CURRENT CONTROL OR OTHERS
this.proceedValidationSet(validation_obj,group_ques,sec_control,validator_single)
}
//END OF EXPRESSION CHECK
}
else{
// STARTING VALUE VALIDATION
let validator_value_obj
validator_value_obj=this.formGroupN.value[ validation_obj.value]
validation_obj.validator=validator_value_obj
// let validator_single=this.questionService.setValueForValidator(validation_obj)
// console.log(validator_single)
// MAKING THE DECISION FOR SETTING THE VALIDATOR FOR CURRENT CONTROL OR OTHERS
this.proceedValidationSet(validation_obj,group_ques,sec_control,'')
// END OF VALUE VALIDATION
}
//
// }
// else{
// }
}
})
}
}
proceedValidationSet(validation_obj,group_ques,sec_control,validator_single?){
let ques_control;
if(validation_obj.validation_to == null){
ques_control=this.whole_json[this.json_index]
// if(validation_obj.isactive == '1'){
// ques_control.controls.answer_value.setValidators(validator_single)
// ques_control.controls.answer_value.updateValueAndValidity()
// }
// else{
// ques_control.controls.answer_value.clearValidators()
// ques_control.controls.answer_value.updateValueAndValidity()
// }
// validation_obj.validator=validator_single
let new_validation_obj=this.updateValidationMsg(ques_control,validation_obj)
this.quesService.settingArrayofValidators({validations:new_validation_obj,question_key:sec_control.question_key},this.formGroupN,'')
}
else{
ques_control=this.whole_json[this.json_index]
let other_control = ques_control
if(ques_control.hasOwnProperty('is_repeatable') && ques_control.is_repeatable == '2') {
return;
}
// =ques_control.filter(val=>{
// if(val.question_key == validation_obj.validation_to){
// return val
// }
// })[0]
// let updateMsg=other_control.value.validations.filter(val=>val.name != validation_obj.name)
// updateMsg.push(validation_obj)
// other_control.controls.answer_value.setValidators(validator_single)
// if(validation_obj.isactive == '1'){
// other_control.controls.answer_value.setValidators(validator_single)
// other_control.controls.answer_value.updateValueAndValidity()
// }
// else{
// other_control.controls.answer_value.clearValidators()
// other_control.controls.answer_value.updateValueAndValidity()
// }
// other_control.controls.validations.setValue(updateMsg);
// validation_obj.validator=validator_single
let new_validations_obj=this.updateValidationMsg(other_control,validation_obj)
this.quesService.settingArrayofValidators({validations:new_validations_obj,question_key:validation_obj.validation_to},this.formGroupN,'')
}
}
newAnswerCreateDialog(choosed_answer_obj,curr_ques_obj) {
// console.log('aa');
// console.log(choosed_answer_obj);
// console.log(curr_ques_obj);
// console.log('abx');
// console.log(choosed_answer_obj.answer)
// if(choosed_answer_obj.answer!='')
// {
// console.log('changed');
// let company=this.quesService.companynamechanged(choosed_answer_obj,curr_ques_obj)
// }
if(choosed_answer_obj.is_others == '-1') {
this.formGroupN.get(curr_ques_obj.question_key).setValue('')
let dialog = this.matDialog.open(AnswerOptionCreateDialogComponent,{
data:{pd_all_details:this.quesService.pd_all_details},
disableClose: true,
width: '80vw',
maxHeight: '100vh',
panelClass:'min-padding'
})
dialog.afterClosed().subscribe(rr=>{
if(rr.update && rr.address_for_display && rr.address_for_display.length > 0) {
// curr_ques_obj.answers.splice(curr_ques_obj.answers.length -1,0,{answer:rr.address_for_display,answer_id:rr.address_for_display})
curr_ques_obj.answers = rr.address_for_display
let lastAddress = curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id && curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id != null && curr_ques_obj.answers[curr_ques_obj.answers.length-1].is_others != -1 ? curr_ques_obj.answers[curr_ques_obj.answers.length-1].answer_id : curr_ques_obj.answers[curr_ques_obj.answers.length-2].answer_id
this.formGroupN.get(curr_ques_obj.question_key).patchValue(lastAddress)
}
else if(rr.hasOwnProperty('update') && rr.update == false){
alert(rr.error_msg ? rr.error_msg : "Something went wrong while getting address")
}
})
}
}
updateValidationMsg(ques_control,validation_obj){
if(!ques_control) {
return;
}
let updateMsg=ques_control.validations.filter(val=>val.name != validation_obj.name)
updateMsg.push(validation_obj)
// ques_control.controls.validations.setValue(updateMsg);
ques_control.validations = updateMsg
return updateMsg;
}
updateAllComplete(a,b){
console.log(a)
console.log(b.checked)
if(b.checked){
console.log( this.whole_json)
this.formGroupN.get(a).disable()
this.parent_ques.disable =true
this.vr = true
}else{
console.log( this.whole_json)
this.formGroupN.get(a).enable()
this.parent_ques.disable = false
this.vr = false
console.log(this.parent_ques.disable)
}
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { QuesFormService } from './ques-form.service';
describe('QuesFormService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: QuesFormService = TestBed.get(QuesFormService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,38 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<ng-container *ngIf="waitLoading && existCompanyList.length > 0 ;">
<mat-card *ngFor="let companyList of existCompanyList">
<mat-card-header>
<mat-card-title class="p-text">{{companyList.company_name}}</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="80" fxFlex.md="40" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of companyList.form_status ;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectBusinessGroupForms(formButton, companyList,quesIndex)">
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;">
{{ formButton.form_name }}
</div>
</mat-card-header>
</mat-card>
</div>
</mat-card-content>
</mat-card>
</ng-container>
<mat-card *ngIf="waitLoading==false && existCompanyList.length == 0 ;">
<mat-card-content>
<p><strong>Business Related Information is Not Available.Please Check General Information</strong></p>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<notifier-container></notifier-container>

View File

@ -0,0 +1,34 @@
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
.p-text {
color:#e00201 !important;
font-weight: bold;
}
::ng-deep .mat-card-header-text{
margin:0px !important;
}
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
mat-card .child_mat_card > mat-card {
border-radius: 0px 0px 0px 15px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormGroupComponent } from './form-group.component';
describe('FormGroupComponent', () => {
let component: FormGroupComponent;
let fixture: ComponentFixture<FormGroupComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FormGroupComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FormGroupComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,150 @@
import { Component,OnInit,Inject,Input} from '@angular/core';
import { NotifierService } from 'angular-notifier';
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
/** Service */
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
import { FormComponent } from '../form/form.component';
@Component({
selector: 'app-form-group',
templateUrl: './form-group.component.html',
styleUrls: ['./form-group.component.scss']
})
export class FormGroupComponent implements OnInit {
customer_segment_abbr: any;
subproduct_abbr: any;
lender_applicant_id: any;
main_applicant: any;
pageTitle: string = "Business Related Information";
existCompanyList: any = [];
pdid: number;
form_id: number;
waitLoading:boolean;
lender_short_name :any;
product_abbr :any;
prod_catagory: any;
selectedFormsCategory: any;
// vendor_status_arr: any=[];
constructor(notifier: NotifierService,
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
console.log(this.pd_all_details)
this.pdid = this.pd_all_details.pdMasterList.pd_id;
console.log(this.pdid)
this.form_id = 13;
// this.waitLoading=false;
// this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
// this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
// this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
// this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
// this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name;
// console.log(this.lender_short_name);
// this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr;
// console.log(this.product_abbr);
// this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory;
}
ngOnInit() {
this.getCompanyListForBusiness();
}
getCompanyListForBusiness(): void{
console.log("data")
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
console.log(data)
if(data.dataStatus){
console.log(data)
//this.existCompanyList = data.records.filter(val =>val.is_active == 1);
this.existCompanyList = data.records;
console.log( this.existCompanyList)
// VENDOR FORM ANSWER FETCH STATUS START(SMART PD ONLY)
// if(this.existCompanyList.length > 0 && this.pd_all_details.pdmaster_details.fk_pd_type == '2') {
// if(this.existCompanyList[0].hasOwnProperty('vendor_form_status') && this.existCompanyList[0].vendor_form_status && this.existCompanyList[0].vendor_form_status.length > 0) {
// // temp_vendor_status = JSON.parse(temp_vendor_status)
// // if(temp_vendor_status && temp_vendor_status.length > 0 ) {
// this.vendor_status_arr = this.existCompanyList[0].vendor_form_status
// // }
// }
// }
// END OF VENDOR FORM ANSWER FETCH
this.waitLoading = true;
}
else {
this.waitLoading = false;
}
})
}
// direct form based questions
OnSelectBusinessGroupForms(details: any, company: any,id:any) {
console.log(details.form_id)
console.log(company)
// this.pd_all_details.company_id =company.company_order_id;
// this.pd_all_details.company_name =company.company_name;
// this.pd_all_details.business_entity_type=company.business_entity_type;
// this.pd_all_details.business_entity_type_other=company.business_entity_type_other;
// this.pd_all_details.business_years = company.business_years;
// this.pd_all_details.business_month = company.business_month;
let curr_vendor_ans_fetch_status = null
console.log(this.pd_all_details)
if(this.pd_all_details.pdMasterList.fk_pd_type == '2') {
if(company.hasOwnProperty('vendor_form_status') && company.vendor_form_status && company.vendor_form_status.length > 0) {
curr_vendor_ans_fetch_status =company.vendor_form_status.filter(val=>val.fk_form_id == String(details.form_id))
if(curr_vendor_ans_fetch_status.length > 0) {
curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status
}
else {
curr_vendor_ans_fetch_status = null
}
}
}
this.pd_all_details.pdMasterList.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status
// this.selectedFormsCategory = details;
// let curr_vendor_ans_fetch_status = null
// if(this.pdMasterList.fk_pd_type == '2') {
// if(this.vendor_status_arr && this.vendor_status_arr.length > 0 && this.selectedFormsCategory.form_id != 13) {
// console.log(this.vendor_status_arr,this.selectedFormsCategory)
// curr_vendor_ans_fetch_status =this.vendor_status_arr.filter(val=>val.fk_form_id == String(this.selectedFormsCategory.form_id))
// if(curr_vendor_ans_fetch_status.length > 0) {
// curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status
// }
// else {
// curr_vendor_ans_fetch_status = null
// }
// }
// }
// this.pdFullDetails.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status
console.log(this.pd_all_details.pdMasterList);
const dialogRef = this.dialog.open(FormComponent, {
data: {pd_FullDetails:this.pd_all_details.pd_FullDetails,pdMasterList:this.pd_all_details.pdMasterList,FormData:details,tmpid:id,Form_parent:this.pd_all_details.FormData},
position: { right: '0'},
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true,
closeOnNavigation:true,
panelClass:'no-padding'
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getCompanyListForBusiness();
});
}
}

View File

@ -0,0 +1,61 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="75" align="left" style="padding: 1% !important" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}">
<span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{questions_JSON.section_name}}
</div>
<div fxFlex="25" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
matTooltipPosition="right" mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
</h2>
<!-- <form [formGroup]="docsCollectedForm"> -->
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;" >
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0 && !is_loading">No Templates Found</h5>
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0 && is_loading">Loading...</h5>
<mat-card *ngIf="questions_JSON.questions.length > 0">
<!-- <mat-card-header>
<mat-card-title>
<h5>{{questions_JSON.section_name}}</h5>
</mat-card-title>
</mat-card-header> -->
<mat-card-content>
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="quesService.formanswers"></app-dynamic-form>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<!-- <mat-dialog-actions *ngIf="questions_JSON.questions.length > 0">
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="common_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end" >
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" (click)="saveForm()" [disabled]="disableAfterSubmit===true">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions> -->
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left" *ngIf="questions_JSON.questions.length > 0" >
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Other Remarks" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" (click)="saveForm()" [disabled]="disableAfterSubmit===true">
<mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
<!-- </form> -->
<notifier-container></notifier-container>
<!-- </form> -->

View File

@ -0,0 +1,34 @@
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
::ng-deep { .no-padding > mat-dialog-container {
// background: black;
padding: 0;
// overflow-y: scroll !important;
}
}
.mat-dialog-content{
margin:0px !important;
}
// mat-placeholder{
// margin-top: 20px;
// word-wrap: break-word;
// }
// input{
// height:40px;
// }
.mat-form-field-label {
white-space: normal;
}
textarea.mat-input-element {
padding: 0px 0;
margin: 5px 0;
}
.mat-input-placeholder {
white-space: normal;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormComponent } from './form.component';
describe('FormComponent', () => {
let component: FormComponent;
let fixture: ComponentFixture<FormComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FormComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,594 @@
import { Component, Inject, OnInit, ViewChild, Input } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material';
import { ActivatedRoute, Router } from '@angular/router';
import { NotifierService } from 'angular-notifier';
import { AwsService } from 'app/AwsService/aws.service';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { environment } from 'environments/environment';
import { DynamicFormComponent } from '../dynamic-form/dynamic-form/dynamic-form.component';
import { QuesFormService } from '../dynamic-form/ques-form/ques-form.service';
@Component({
selector: 'app-form',
templateUrl: './form.component.html',
styleUrls: ['./form.component.scss'],
})
export class FormComponent implements OnInit {
anslength:any;
form_id: number;
parent_pdid: any;
pdid: any;
notifier: NotifierService;
main_applicant: any;
lender_applicant_id: any;
subproduct_abbr: any;
customer_segment_abbr: any;
lenderShortName: any;
fk_pd_type: any;
image_doc_params: { pdid: any; form_id: any; company_id: string; };
questions_JSON: any = {questions:[],section_name:''};
commonFormGroup:FormGroup;
@Input() json_answers:any;
@ViewChild(DynamicFormComponent) formComponent:DynamicFormComponent
is_loading: boolean = false;
pd_all_details: any=[];
pdMasterList:any=[];
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private questionService:QuesFormService,
private dialogRef: MatDialogRef<FormComponent>,
private dialog: MatDialog, public quesService:QuesFormService,
@Inject(MAT_DIALOG_DATA) public pd_all_details_data: any,
private pdTriggerService:PdTrigerService,
private awsService:AwsService,private loaderService:LoaderService) {
console.log(this.pd_all_details_data)
this.pd_all_details = this.pd_all_details_data.pd_FullDetails
console.log(this.pd_all_details_data)
console.log(this.pd_all_details_data.pd_FullDetails)
// debugger;
this.form_id = 24;
this.pdMasterList= this.pd_all_details_data.pdMasterList
this.parent_pdid = this.pdMasterList.parent_pd_id;
this.pdid = this.pdMasterList.pd_id;
this.notifier = notifier;
// this.quesService.formanswers=null;
console.log(this.quesService.formanswers)
this.main_applicant = this.pdMasterList.main_applicant;
this.lender_applicant_id = this.pdMasterList.lender_applicant_id;
this.subproduct_abbr = this.pdMasterList.subproduct_abbr;
this.customer_segment_abbr = this.pdMasterList.customer_segment_abbr;
this.lenderShortName = this.pdMasterList.lender_short_name;
this.fk_pd_type = this.pdMasterList.fk_pd_type;
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
console.log(this.pd_all_details)
//console.log( this.quesService.pd_all_details)
this.quesService.pd_all_details = this.pd_all_details
console.log('image_doc_params',this.image_doc_params)
}
ngOnInit() {
this.getSectionData()
if(this.pd_all_details.form_id=='5' && this.pdMasterList.product_abbr=='LFMP')
{
let params = {"fk_pd_id":this.pdMasterList.pd_id,"fk_form_id":this.pd_all_details.form_id}
this.pdTriggerService.getPDSectionData(params,params,params).subscribe(result=>{
if(result['dataStatus']) {
let records = result['records']
let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) {
formValues = JSON.parse(records.json)
if(formValues.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(formValues.key_stakeholders[0].stakeholder_length=="undefined")
// {
// }
}
}
else
{
let params = {"pd_id":this.pdMasterList.pd_id,"random_string":this.pdMasterList.random_string,"form_id":this.pd_all_details.form_id}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) {
let records = result['records']
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(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
}
else
{
this.loadTemplate()
if(this.pd_all_details.is_answered == '1') {
this.getSectionData()
}
else{
this.getExcelData();
}
}
}
loadTemplate() {
this.is_loading = true
// let localId = this.getLocalFormId()
// console.log("d",this.pd_all_details.form_id,Number(this.pd_all_details.form_id))
// this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{
let params = this.pd_all_details_data.FormData.mapid;
console.log(params)
let map_id = this.pd_all_details_data.FormData.map_id
let form_id = this.pd_all_details_data.FormData.form_id
this.pd_all_details_data.Formname
// let params = {"fk_entity_id":this.pdMasterList.fk_lender_id,"fk_product_id":this.pdMasterList.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pdMasterList.pd_id}
this.pdTriggerService.loadCreditPDTemplate2(form_id,map_id, this.pd_all_details_data.Formname).subscribe(result=>{
console.log(result)
if(!environment.production){
result.dataStatus = true
}
console.log()
if(result.dataStatus) {
let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined
) {
// question_template = JSON.parse(question_template)
if (question_template.hasOwnProperty('template') && question_template.template) {
question_template =JSON.parse(question_template.template);
this.commonFormGroup = new FormGroup({})
console.log(question_template.json)
this.questions_JSON = JSON.parse(question_template.json);
//this.questions_JSON = question_template;
console.log( this.questions_JSON)
this.getSectionData()
this.questionService.notify(this.questions_JSON)
// setTimeout(() => {
// this.covidAnswers = null
// console.log("cleared")
// }, 2000)
}
}
}
// FOR LOCAL TEMPLATES ENV PURPOSE
else if(!environment.production){
console.log( this.pdMasterList.product_abbr)
let map_id = this.pd_all_details_data.FormData.map_id
let form_id = this.pd_all_details_data.FormData.form_id
this.pd_all_details_data.Formname
console.log( this.pd_all_details_data.Formname)
//let param = this.pdMasterList.product_abbr+'/'+Number(this.pd_all_details.form_id)
console.log(map_id)
this.pdTriggerService.loadTemplate(form_id,map_id, this.pd_all_details_data.Formname).subscribe(result=>{
console.log(result)
this.questionService.notify(result)
if(result.dataStatus) {
let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined
) {
// question_template = JSON.parse(question_template)
if (question_template.hasOwnProperty('template') && question_template.template) {
question_template =JSON.parse(question_template.template);
this.commonFormGroup = new FormGroup({})
// this.questions_JSON = question_template;
this.questions_JSON = JSON.parse(question_template.json);
console.log(this.questions_JSON);
// this.getSectionData()
this.questionService.notify(this.questions_JSON)
setTimeout(() => {
// this.covidAnswers = null
console.log("cleared")
}, 3)
}
}
}
})
}
this.is_loading = false
},err => {
this.is_loading = false
})
}
getSectionData() {
// let params = {"fk_pd_id":this.pdMasterList.pd_id,"fk_form_id":this.pd_all_details.form_id}
// let params = { "pd_id":this.pdMasterList.pd_id,"pd_form_id":this.pd_all_details_data.FormData.form_id}
// console.log(params)
console.log(this.pd_all_details_data)
let form_group = this.pd_all_details_data.FormData.is_group_form
//let params :any = {"pdid":this.pdMasterList.pd_id,"parent_pdid":this.pdMasterList.pd_id,formid:this.pd_all_details_data.FormData.form_id,"json":this.commonFormGroup.getRawValue(),fk_createdby:''}
this.pdTriggerService.getPDSectionData(this.pdMasterList.pd_id,this.pd_all_details_data.FormData.form_id,form_group).subscribe(result=>{
console.log(result)
if(result['dataStatus']) {
let records = result['records']
let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) {
//formValues = JSON.parse(records.json)
formValues = records.json
this.quesService.formanswers= formValues
this.loaderService.showMatSpinnerDialog("")
// setTimeout(()=>{
// this.quesService.formanswers = null
// },2000)
// this.commonFormGroup.patchValue(formValues)
}
}
if(this.pdMasterList.re_uploaded == '1' && this.pd_all_details.is_reupload_data_fetched != '1') {
// console.log("Reuploaded excel")
// let data = {"permanant_employees_person_met":"1","temporary_employees_person_met":"2","permanant_employees_cm":"3","temporary_employees_cm":"45","permanant_employees_salary":"55","temporary_employees_salary":"55","common_remarks":"dummy datas"}
// setTimeout(()=>{
// this.commonFormGroup.patchValue(data)
// },1000)
this.getExcelData(1)
}
})
}
getExcelData(re_uploaded?) {
let params = {"pd_id":this.pdMasterList.pd_id,"random_string":this.pdMasterList.random_string,"form_id":this.pd_all_details.form_id}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) {
let records = result['records']
let formValues:any ={};
if(records ) {
formValues = records
// records.forEach(val=>{
// if(val) {
// formValues[val.key_name] = val.value
// }
// })
// console.log(formValues)
// debugger;
if(re_uploaded && re_uploaded == '1') {
this.commonFormGroup.patchValue(formValues)
}
else {
this.loaderService.showMatSpinnerDialog("")
this.quesService.formanswers= formValues
// setTimeout(()=>{
// this.quesService.formanswers = null
// },2500)
}
// this.commonFormGroup.patchValue(formValues)
}
}
})
}
getLocalFormId() {
// console.log(this.pd_all_details)
switch(this.pd_all_details.form_id) {
case '5':
return 2
break
case '18':
return 1
break;
case '10':
return 3
break;
}
}
private markFormGroupTouched(formGroup: FormGroup) {
(<any>Object).values(formGroup.controls).forEach(control => {
control.markAsTouched();
if (control.controls) {
this.markFormGroupTouched(control);
}
});
}
public findInvalidControls() {
const invalid = [];
let msg=''
// let formArray:any = this.commonFormGroup ;
// console.log(formArray);
// for( const group in <any>(this.commonFormGroup.controls)) {
// if(group.invalid) {
// console.log(group,group.value.form_name,this.commonFormGroup.controls);
// debugger;
// msg= group.value.form_name+" are not complete"
// let index = this.stepperInfo.findIndex(vv=>vv.form_id == group.value.form_id);
// console.log("Index",index);
// if(index != -1) {
// msg = this.stepperInfo[index].form_name+" are not complete"
// this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index
// }
for (const name in <any>(this.commonFormGroup.controls)) {
// console.log(this.commonFormGroup.controls[name],name)
if (this.commonFormGroup.controls[name].invalid) {
invalid.push(name);
let invalidFields = [].slice.call(document.getElementsByClassName('ng-invalid'));
let firstInvalidField;
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
firstInvalidField=invalidFields[val]
break;
}
}
if(firstInvalidField != undefined){
// firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
this.formComponent.openMatExpansionPanel()
setTimeout(()=>{
firstInvalidField.scrollIntoView({block: "start", inline: "nearest"})
setTimeout(()=>{
firstInvalidField.focus()
},0)
// firstInvalidField.style.background = 'red'
firstInvalidField.classList.remove('field_highlight')
setTimeout(()=>{
firstInvalidField.classList.add('field_highlight')
},300)
},300)
// this.myStepper.selectedIndex = 0;
}
else {
// msg = this.stepperInfo[index].form_name+" images are not taken"
}
// console.log("kkdd",group['controls'][name],firstInvalidField)
// if(typeof(group['controls'][name].value) == 'string') {
// return name+' field is not '
// }
break
}
}
// }
// }
// let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
// const controls = this.getQuestionControl().at(1)['controls']
// for (const name in controls) {
// if (controls[name].invalid) {
// invalid.push(name);
// }
// }
return invalid;
}
saveForm() {
console.log(this.pd_all_details_data)
//console.log("values",this.commonFormGroup.getRawValue(),this.questions_JSON)
if(this.commonFormGroup.invalid) {
this.commonFormGroup.markAsDirty();
this.commonFormGroup.markAsTouched()
this.markFormGroupTouched(this.commonFormGroup)
let invalidfield = this.findInvalidControls()
console.log("Invalid field",invalidfield)
this.notifier.notify("info","Please fill all the required fields");
this.formComponent.openAllPanels()
return
}
let checkProperty=this.onSubmitProperty()
console.log("check rp",checkProperty)
if(checkProperty == false){
return;
}
this.loaderService.showMatSpinnerDialog('')
// "pdid":"2888","parent_pdid":"2888","formid":"5","fk_createdby":"165"
let params:any ;
console.log(this.pd_all_details_data)
if(this.pd_all_details_data.hasOwnProperty("Form_parent")){
let form_group = this.pd_all_details_data.Form_parent.is_group_form
let company_id = this.pd_all_details_data.Form_parent.is_business_form
if(form_group == 1){
params = {"pdid":this.pdMasterList.pd_id,"parent_pdid":this.pdMasterList.pd_id,formid:this.pd_all_details_data.FormData.form_id,"json":this.commonFormGroup.getRawValue(),fk_createdby:'',"company_id":company_id}
}
}else{
params = {"pdid":this.pdMasterList.pd_id,"parent_pdid":this.pdMasterList.pd_id,formid:this.pd_all_details_data.FormData.form_id,"json":this.commonFormGroup.getRawValue(),fk_createdby:''}
}
if(this.pdMasterList.re_uploaded == '1') {
params.is_reupload_data_fetched = '1'
}
console.log(params)
this.pdTriggerService.saveForm(params).subscribe(result=>{
if(result['dataStatus']) {
this.notifier.notify("success","Saved successfully..")
setTimeout(()=>{
this.dialogRef.close('refresh')
},1500)
}
else {
this.notifier.notify("warning","Something went wrong");
}
this.loaderService.closeMatSpinnerDialog()
},err=>{
this.loaderService.closeMatSpinnerDialog()
this.notifier.notify("warning","Network Error");
})
}
onSubmitProperty(){
let return_val=[]
let send_val:boolean=true
// this.local_ques_JSON.onsubmit=[
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];control.questions_group.forEach(ques_obj=>{ques_obj.questions.map(ques=>{if(ques.question_key == submitProperty.key_name){ques_key.push(ques)}})});if(ques_key.length >=3){return true}else{return false}return sum_val}())",
// "key_name": "approach_to_pd_location",
// "msg": "Minimum 3 image required in approach"
// },
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];if(control.question_key == submitProperty.key_name && control.answer_value == ''){return false}else{return true}return sum_val}())",
// "key_name": "selfie_with_person_met",
// "msg": "Selfie Person met pic is required"
// }
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];if(control.question_key == submitProperty.key_name){return control.answer_value.length >= 100}}())",
// "key_name": "brief_business_service",
// "msg": "Please enter more details"
// }
// ]
// console.log(this.local_ques_JSON);
if(this.questions_JSON.hasOwnProperty('onsubmit') && this.questions_JSON.onsubmit != null){
for(let i=0; i<this.questions_JSON.onsubmit.length ; i++){
// this.quesAnsForm.value.questions.forEach(parent_ques=>{
// let parent_ques
// for( parent_ques of this.commonFormGroup.getRawValue()){
// this.local_ques_JSON.onsubmit.forEach(submitProperty=>{
let submitProperty=this.questions_JSON.onsubmit[i]
if((submitProperty.hasOwnProperty('group_key') && submitProperty.group_key)){
return_val.length = 0
let val=this.calculation(this.commonFormGroup.getRawValue()[submitProperty.group_key],submitProperty)
if(val != true && val != 100){
this.notifier.notify("info",submitProperty.msg)
return_val.push(false) ;
break;
}
else {
return_val.push(true) ;
}
}
else{
send_val =true
}
// })
// })
// }
// console.log(return_val.filter(val=>val == false).length > 0)
if(return_val.filter(val=>val == false).length > 0){
break;
}
}
console.log(return_val)
if(return_val.length > 0){
if(return_val.filter(res=>res == false).length > 0){
send_val = false
}
else{
send_val =true
}
}
}
return send_val
}
calculation(control,submitProperty){
console.log("control",control)
let exp=`
(function () {let sum_val=null
let ques_key=[]
control.questions_group.forEach(ques_obj=>{
ques_obj.questions.map(ques=>{
// console.log(ques)
if(ques.question_key == 'share_holding'){
ques_key.push(ques)
}
})
})
if(ques_key.length > 0){
console.log(ques_key)
sum_val= ques_key.map(val=>val.answer_value).reduce((tot,val)=>{
console.log(">>>>",tot,val)
return parseInt(tot)+parseInt(val)
})
}
return sum_val == 100}());`
let exp1 = `(function (){let sum_val=null;let ques_key=[];
control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())`
let exp2 = `(function (){let sum_val=null;let ques_key=[];
control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())`
//for image total check
// let exp=`
// (function () {let sum_val=null
// let ques_key=[]
// control.questions_group.forEach(ques_obj=>{
// ques_obj.questions.map(ques=>{
// // console.log(ques)
// if(ques.question_key == 'name_board_seen'){
// ques_key.push(ques)
// }
// })
// })
// if(ques_key.length >= 3){
// sum_val=true
// }
// else{
// sum_val=false
// }
// return sum_val }());`
let val= eval(submitProperty.expression);
// let val= eval(exp1);
console.log(val)
return val
}
}

View File

@ -5,6 +5,9 @@
.example-section {
height: 120px;
}
form{
display: inline-table !important
}
.example-margin {
margin: 0 10px;
@ -41,7 +44,7 @@
}
mat-header-cell mat-cell {
display:flex;
// display:flex;
justify-content:flex-end;
}
mat-cell:nth-child(1),

View File

@ -27,7 +27,7 @@ export class ImagesAllComponent implements OnInit { imageData: any;
ngOnInit() {
console.log('abi');
console.log(this.data);
this.getPDImageDetails();
}
@ -42,6 +42,9 @@ export class ImagesAllComponent implements OnInit { imageData: any;
this.params = {"pd_id":"","random_string":this.pd_all_details.pdmaster_details.random_string}
}
console.log(this.pd_all_details)
let params = {"pd_id":"","random_string":this.pd_all_details.pdMasterList.random_string}
//let params = {"pd_id":"","random_string":'i2PnHMA7cdGx8zkz'}
// console.log(params);
this._pd.getPDImgDetails(this.params).subscribe(result=>{

View File

@ -0,0 +1,13 @@
import { StartPdRouting.ModuleModule } from './start-pd-routing.module.module';
describe('StartPdRouting.ModuleModule', () => {
let startPdRoutingModuleModule: StartPdRouting.ModuleModule;
beforeEach(() => {
startPdRoutingModuleModule = new StartPdRouting.ModuleModule();
});
it('should create an instance', () => {
expect(startPdRoutingModuleModule).toBeTruthy();
});
});

View File

@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { StartPdComponent } from './start-pd.component';
const routes: Routes = [
{
path:'',
component:StartPdComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class StartPdRoutingModule { }

View File

@ -16,7 +16,7 @@
</mat-card-header>
<mat-card-content style="max-height:100% !important;">
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton)">
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton,quesIndex)">
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;">

View File

@ -99,7 +99,9 @@ export class StartPdComponent implements OnInit, OnDestroy {
getCreditPDTemplate() {
// let params = { "fk_entity_id":this.pddetails.fk_lender_id,"fk_product_id":this.pddetails.fk_product_id,"pd_form_id":this.pddetails.pd_id }
let params = { "fk_entity_id":"","fk_product_id":"","pd_form_id":"24","fk_pd_id": this.startPD }
let tmp;
this._pd.loadCreditPDTemplate(params).subscribe(result=> {
//this._pd.loadCreditPDTemplate(params).subscribe(result=> {
let creditTemplate:any = null;
if(result['dataStatus']) {
if(result.hasOwnProperty('records') && result['records']) {
@ -608,3 +610,4 @@ export class StartPdComponent implements OnInit, OnDestroy {
}
}

View File

@ -0,0 +1,13 @@
import { StartPd.ModuleModule } from './start-pd.module.module';
describe('StartPd.ModuleModule', () => {
let startPdModuleModule: StartPd.ModuleModule;
beforeEach(() => {
startPdModuleModule = new StartPd.ModuleModule();
});
it('should create an instance', () => {
expect(startPdModuleModule).toBeTruthy();
});
});

View File

@ -0,0 +1,85 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { StartPdRoutingModule } from './start-pd-routing.module.module';
import { StartPdComponent } from './start-pd.component';
import { SharedModule } from 'app/shared/shared.module';
import { DemoMaterialModule } from 'app/shared/demo.module';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
import { FormComponent } from './forms-dynamic/form/form.component';
import { FormGroupComponent } from './forms-dynamic/form-group/form-group.component';
import { StartPd2Component } from './start-pd2/start-pd2.component';
import { DynamicFormComponent } from './forms/dynamic-form/dynamic-form/dynamic-form.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { DynamicQuestionTemplateComponent } from './forms/dynamic-form/dynamic-question-template/dynamic-question-template.component';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { MatIconModule } from '@angular/material';
// import { ImageCaptureComponent } from './forms/image-capture/image-capture.component';
// import { CaptureBtnComponent } from './forms/image-capture/capture-btn/capture-btn.component';
// import { Ng2ImgMaxModule } from 'ng2-img-max';
import { NgxViewerModule } from 'ngx-viewer';
import { AnswerOptionCreateDialogComponent } from './forms-dynamic/answer-option-create-dialog/answer-option-create-dialog.component';
import {MatTreeModule} from '@angular/material/tree';
// import { QuestionControlComponent } from './forms-dynamic/question-control/question-control.component';
const pdCustomNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 2000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
CommonModule,
StartPdRoutingModule,
SharedModule,
DemoMaterialModule,
ReactiveFormsModule,
FormsModule,
FlexLayoutModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
NgxMatSelectSearchModule,
MatIconModule,
MatTreeModule,
NgxViewerModule
],
declarations: [StartPdComponent, StartPd2Component,FormComponent,DynamicFormComponent,DynamicQuestionTemplateComponent, AnswerOptionCreateDialogComponent,FormGroupComponent],
entryComponents:[FormComponent,FormGroupComponent,AnswerOptionCreateDialogComponent]
})
export class StartPdModule { }

View File

@ -0,0 +1,50 @@
<mat-card class="parent_mat_card">
<mat-card-header>
<mat-card-title>
<div fxFlex="33" align="left">
<h4 class="mt-0">{{mainApplicantName}}</h4>
<small>{{pdMasterList.customer_segment_name}}</small>
</div>
<div fxFlex="66" align="end">
<h4 class="mt-0">{{pdMasterList.product_name}}<span *ngIf="pdMasterList.subproduct_name">/{{pdMasterList.subproduct_name}}</span>&nbsp;
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button>
</h4>
<small style="padding-right: 6.5% !important;">{{pdMasterList.lender_full_name}}<span *ngIf="pdMasterList.lender_applicant_id">/{{pdMasterList.lender_applicant_id}}</span></small>
</div>
</mat-card-title>
</mat-card-header>
<mat-card-content style="max-height:100% !important;">
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton,quesIndex)">
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;">
{{ formButton.form_name }}
</div>
<!--<div fxFlex="20" align="end">
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div> -->
</mat-card-header>
</mat-card>
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let photoButton of photographButtons;let quesIndex=index" [ngStyle]="{'background-color':photoButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(photoButton)">
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{actualQuestions+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;">
{{ photoButton.form_name }}
</div>
<!--<div fxFlex="20" align="end">
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div> -->
</mat-card-header>
</mat-card>
</div>
</mat-card-content>
<mat-card-actions align="end">
<button matTooltip="Complete Discussion" matTooltipPosition="above" [disabled]="actualQuestions==0 || actualQuestions!=answeredQuestions || currentPDStatus===false" mat-raised-button color="primary" (click)="pdStatusDialogue(pdStatusCheck.COMPLETED,2);"><span>{{currentPDStatus === true ? 'COMPLETE':'COMPLETED' }}</span></button>
</mat-card-actions>
</mat-card>
<notifier-container></notifier-container>

View File

@ -0,0 +1,84 @@
// .child_mat_card mat-card {
// margin: 2 0%;
// }
::ng-deep .mat-dialog-container{
overflow: hidden !important;
}
::ng-deep .mat-card-header-text{
margin:0px !important;
}
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-card.parent_mat_card > {
mat-card-header {
display: flex;
flex-direction: column;
}
mat-card-content {
min-height:auto;
max-height:52vh;
overflow:auto;
}
.user-thumb {
position: absolute;
bottom: -35%;
// img {
// border: 5px solid $white;
// border-radius: 100%;
// height: 75px;
// width: 75px;
// }
}
// @media only screen and (max-width:319px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:320px) and (max-width:767px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:768px) and (max-width:1023px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:1024px) and (max-width:1899px) {
// mat-card-content {
// max-height: 400px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:1900px) {
// mat-card-content {
// max-height: 500px;
// overflow: auto;
// }
// }
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
mat-card .child_mat_card > mat-card {
border-radius: 0px 0px 0px 15px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StartPd2Component } from './start-pd2.component';
describe('StartPd2Component', () => {
let component: StartPd2Component;
let fixture: ComponentFixture<StartPd2Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StartPd2Component ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StartPd2Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,290 @@
import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core';
import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms';
import {ActivatedRoute, Router} from '@angular/router';
import {MatDialog } from '@angular/material';
import {NotifierService} from 'angular-notifier';
import {ListPdComponent} from './../../list-pd.component';
import {PdTrigerService} from '../../../../pd-service/pd-triger.service';
import {GeneralInfoComponent} from './../forms/general-info/general-info.component';
import {PdStatusChangeDialogueComponent } from './../../pd-status-change-dialogue/pd-status-change-dialogue.component';
import { ImagesAllComponent } from './../forms/images-all/images-all.component';
import { FormComponent } from './../forms-dynamic/form/form.component';
import { FormGroupComponent } from './../forms-dynamic/form-group/form-group.component';
// import { ImageCaptureComponent } from './Form-Dynamic/image-capture/image-capture.component';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-start-pd2',
templateUrl: './start-pd2.component.html',
styleUrls: ['./start-pd2.component.scss']
})
export class StartPd2Component implements OnInit, OnDestroy {
public startPD: string;
public mainApplicantName: string;
public randomString: string;
//public remarks: string;
errorMessage: any;
selectedCategory: any = [];
categoryList: any = [];
pdMasterList: any = [];
pdFullDetails:any=[];
// category static form buttons
categoryFormButtons: any;
formsCategoryEnable: boolean = false;
selectedFormsCategory: any;
// create values for status check
pdStatusCheck: any = {
"DRAFT": 'DRAFT',
"TRIGGERED": 'TRIGGERED',
"ALLOCATED": 'ALLOCATED',
"SCHEDULED": 'SCHEDULED',
"INPROGRESS": 'INPROGRESS',
"COMPLETED": 'COMPLETED',
"QC_COMPLETED": 'QC_COMPLETED',
};
currentPDStatus: boolean;
actualQuestions: number;
answeredQuestions: number;
private notifier: NotifierService;
vendor_status_arr: any = [];
photographButtons: any[];
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,private loaderService:LoaderService) {
this.startPD = this.route.snapshot.params['pdid'];
this.randomString = this.route.snapshot.params['rdmstr'];
// console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']);
this.notifier = notifier;
this.currentPDStatus = false;
}
ngOnInit() {
this.listPDComponent.showListView(false);
const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) {
// Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
// Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
}
this.loadTemplates(this.startPD,1,this.randomString);
// this.getCreditPDTemplate();
}
// getCreditPDTemplate() {
// // let params = { "fk_entity_id":this.pddetails.fk_lender_id,"fk_product_id":this.pddetails.fk_product_id,"pd_form_id":this.pddetails.pd_id }
// let params = { "fk_entity_id":"","fk_product_id":"","pd_form_id":"24","fk_pd_id": this.startPD }
// this._pd.loadCreditPDTemplate(params).subscribe(result=> {
// let creditTemplate:any = null;
// if(result['dataStatus']) {
// if(result.hasOwnProperty('records') && result['records']) {
// creditTemplate = result['records'];
// }
// }
// localStorage.setItem("dynamicQuesTemplate",JSON.stringify(creditTemplate));
// })
// }
isMac(): boolean {
let bool = false;
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
bool = true;
}
return bool;
}
isOver(): boolean {
return window.matchMedia(`(max-width: 960px)`).matches;
}
// load templates details
loadTemplates(startID:string,type:number,randomString:string){
// console.log('start pd component inside - loadTemplates params are,',startID,type,randomString);
this._pd.loadPDTemplates(startID,randomString).subscribe(
data => {
console.log("after reponse = ", data);
console.log("after reponse = ", data.records.pdmaster_details);
if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details;
// this.categoryList=data.records.question_answers;
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
this.mainApplicantName = filterApplicantName.length > 0 ? filterApplicantName[0].applicant_name : '';
this.currentPDStatus = data.records.pdmaster_details.pd_status=='INPROGRESS' ? true : data.records.pdmaster_details.pd_status=='SCHEDULED' ? true :data.records.pdmaster_details.pd_status=='ALLOCATED' ? true : false;
//let categoryFormButtons1 = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true);
//this.categoryFormButtons =categoryFormButtons1.filter(item=>item.form_id!=26);
this.categoryFormButtons = data.records.template_forms
// this.photographButtons=categoryFormButtons1.filter(item=>item.form_id==26);
// console.log(this.photographButtons);
// this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true);
this.actualQuestions = this.categoryFormButtons.length;
let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true);
this.answeredQuestions = getAnsweredFormsCount.length;
console.log("ans",this.answeredQuestions,this.actualQuestions)
this.pdFullDetails = data.records;
// VENDOR FORM ANSWER FETCH STATUS START(SMART PD ONLY)
// if(this.pdMasterList.fk_pd_type == '2') {
// if(data.records.vendor_form_status && data.records.vendor_form_status.length > 0) {
// this.vendor_form_status_arr = JSON.stringify(data.records.vendor_form_status)
// localStorage.setItem("vendorFormStatus_arr",this.vendor_form_status_arr)
// }
// }
console.log(this.pdMasterList)
console.log(this.pdMasterList.fk_pd_type)
if(this.pdMasterList.fk_pd_type == '2') {
// let temp_vendor_status = localStorage.getItem("vendorFormStatus_arr")
if(data.records.hasOwnProperty('vendor_form_status') && data.records.vendor_form_status && data.records.vendor_form_status.length > 0) {
// temp_vendor_status = JSON.parse(temp_vendor_status)
// if(temp_vendor_status && temp_vendor_status.length > 0 ) {
this.vendor_status_arr = data.records.vendor_form_status
// }
}
}
// END OF VENDOR FORM ANSWER FETCH
if(type==1 && (data.records.pdmaster_details.pd_status=='SCHEDULED' || data.records.pdmaster_details.pd_status=='ALLOCATED')) {
this.pdStatusDialogue(this.pdStatusCheck.INPROGRESS,1)
}
}
else{
this.pdMasterList = "";
this.mainApplicantName = "";
this.categoryList = [];
this.currentPDStatus = false;
}
// this.getAnswers(serachQuestions);
});
}
// load pd status change dialogue
pdStatusDialogue(status: string, checkType: number): void {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString,pd_type:this.pdMasterList.fk_pd_type },
disableClose: true,
minWidth:'30%',
maxWidth:'40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
setTimeout(()=>{
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
let data = {
"pd_id": this.startPD,
"regenerate":0,
"random_string":this.randomString
};
},2000)
// this._pd.archivePDImages(data).subscribe(data => {
// })
let data1 = {
"pd_id": this.startPD,
"regenerate":0,
"random_string":this.randomString
};
this._pd.photoPDFDownload(data1).subscribe(data => {
})
}
else {
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
}
if(checkType == 2){
// this.loadTemplates(this.startPD,2,this.randomString);
}
});
}
// start
// direct form based questions
OnSelectDirectForms(details: any,id:any) {
console.log(details.form_name)
console.log( this.vendor_status_arr )
// this.formsCategoryEnable = true;
this.selectedFormsCategory = details;
let curr_vendor_ans_fetch_status = null
if(this.pdMasterList.fk_pd_type == '2') {
if(this.vendor_status_arr && this.vendor_status_arr.length > 0 && this.selectedFormsCategory.form_id != 13) {
console.log(this.vendor_status_arr,this.selectedFormsCategory)
curr_vendor_ans_fetch_status =this.vendor_status_arr.filter(val=>val.fk_form_id == String(this.selectedFormsCategory.form_id))
if(curr_vendor_ans_fetch_status.length > 0) {
curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status
}
else {
curr_vendor_ans_fetch_status = null
}
}
}
this.pdFullDetails.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status
// this.pdFullDetails.form_id= this.selectedFormsCategory.fk_form_id
// this.pdFullDetails.is_answered = this.selectedFormsCategory.is_answered
this.pdFullDetails.pdmaster_details = this.pdMasterList
console.log(this.pdFullDetails);
console.log(this.pdMasterList);
console.log(details);
console.log(this.startPD,2,this.randomString)
let componen_name:any = FormComponent
if(details.is_group_form == 1) {
componen_name = FormGroupComponent
}else if(details.form_name == 'Photograph'){
componen_name = ImagesAllComponent
}else if(details.form_name == 'General Information'){
componen_name = GeneralInfoComponent
}
const dialogRef = this.dialog.open(componen_name, {
data: {pd_FullDetails:this.pdFullDetails,pdMasterList:this.pdMasterList,FormData:details,Formname:details.form_name,pdmaster_details:this.pdMasterList},
position: { right: '0'},
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true,
closeOnNavigation:true,
panelClass:'no-padding'
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
// if(dataresult == 'refresh') {
this.loadTemplates(this.startPD,2,this.randomString);
// }
});
}
ngOnDestroy(): void {
this.listPDComponent.showListView(true);
}
// load pd view component
loadPdViewCompoent() {
this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}

View File

@ -50,6 +50,7 @@ import {SchedulePdComponent} from './list-pd/schedule-pd/schedule-pd.component';
import {EditPdApplicantComponent} from './list-pd/edit-pd-applicant/edit-pd-applicant.component';
import {EditPdMasterComponent} from './list-pd/edit-pd-master/edit-pd-master.component';
import {StartPdComponent} from './list-pd/start-pd/start-pd.component';
import {StartPd2Component} from './list-pd/start-pd/start-pd2/start-pd2.component';
import {InprogressPdComponent} from './list-pd/inprogress-pd/inprogress-pd.component';
import {AllPdComponent} from './list-pd/all-pd/all-pd.component';
import {ScheduledPdComponent} from './list-pd/scheduled-pd/scheduled-pd.component';
@ -133,14 +134,34 @@ import { ImageDocsComponent } from './list-pd/start-pd/forms/image-docs/image-do
import { environment } from 'environments/environment'
import { CustomTitleCaseDirective } from '../pd-directive/custom-title-case.directive';
import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component';
import { DynamicFormComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component';
import { DynamicQuestionTemplateComponent } from './list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component';
import { QuesFormService } from './list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service';
import { DynamicFormComponent } from './list-pd/start-pd/forms-dynamic/dynamic-form/dynamic-form/dynamic-form.component';
import { DynamicQuestionTemplateComponent } from './list-pd/start-pd/forms-dynamic/dynamic-form/dynamic-question-template/dynamic-question-template.component';
import { QuesFormService } from './list-pd/start-pd/forms-dynamic/dynamic-form/ques-form/ques-form.service';
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
import { MatVideoModule } from 'mat-video';
import { ImagesAllComponent } from './list-pd/start-pd/forms/images-all/images-all.component';
import { AnswerOptionCreateDialogComponent } from './list-pd/start-pd/forms-dynamic/answer-option-create-dialog/answer-option-create-dialog.component';
import { FormComponent } from './list-pd/start-pd/forms-dynamic/form/form.component';
import { FormGroupComponent } from './list-pd/start-pd/forms-dynamic/form-group/form-group.component';
// import { QuestionControlComponent } from './list-pd/start-pd/forms/question-control/question-control.component';
// import { ImageCaptureComponent } from './list-pd/start-pd/Form-Dynamic/image-capture/image-capture.component';
import {
MatBottomSheetModule,
MatDividerModule,
MatNativeDateModule,
MatRippleModule,
MatSliderModule,
MatSnackBarModule,
MatTreeModule,
} from '@angular/material';
/**
* Custom angular notifier options
*/
@ -186,8 +207,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
};
@NgModule({
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent, ImagesAllComponent],
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent, ImagesAllComponent,AnswerOptionCreateDialogComponent,FormComponent,FormGroupComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
@ -211,8 +232,22 @@ const pdCustomNotifierOptions: NotifierOptions = {
NgxSpinnerModule,
MatChipsModule,MatProgressSpinnerModule,
FormsModule,MatSlideToggleModule,
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
MatBottomSheetModule,
MatDividerModule,
MatNativeDateModule,
MatRippleModule,
MatSliderModule,
MatSnackBarModule,
MatTreeModule,
FileUploadModule,
TreeModule,
MatDatepickerModule,
@ -224,14 +259,14 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatVideoModule
],
exports: [DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,PurchaseCalculationComponent],
exports: [DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,PurchaseCalculationComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective,QuesFormService],
entryComponents: [DuplicatePdComponent,VendorPdAllocationComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,FuturePlansAndBusinessEnvironmentComponent,ImageCropComponent,QueriesDocsComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent,VideoPlayerComponent,ImageDocsComponent,ImagesAllComponent],
DynamicFormComponent,DynamicQuestionTemplateComponent,VideoPlayerComponent,ImageDocsComponent,ImagesAllComponent,FormComponent,FormGroupComponent],
})
export class ManagePdModule {
}

View File

@ -6,6 +6,7 @@ import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'
import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component';
import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component';
import { StartPdComponent } from './list-pd/start-pd/start-pd.component';
import { StartPd2Component } from './list-pd/start-pd/start-pd2/start-pd2.component';
import { PdReportComponent } from './list-pd/pd-report/pd-report.component';
/*
* manage pd router
@ -39,6 +40,10 @@ const routes: Routes = [
path: 'startpd/:pdid/:rdmstr',
component: StartPdComponent,
},
{
path: 'startpd2/:pdid/:rdmstr',
component: StartPd2Component,
},
{
path: 'pd_report/:pdid/:rdmstr',
component: PdReportComponent,

View File

@ -387,11 +387,14 @@ export class PdTrigerService {
httpParams = httpParams.append('random_string',randomString);
// console.log('loadFullTemplate api load httpParams are',httpParams);
const options = pdId ? { params: httpParams } : {};
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
console.log(options)
//return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
return this._http.get<any[]>(this.apiUrl + "loadFullTemplateV2", options)
.pipe(
catchError(this.handleError('operation', []))
)
}
// load PD question answers
@ -1006,7 +1009,7 @@ export class PdTrigerService {
loadCreditPDTemplate(params) {
return this._http.post(this.apiUrl+'loadCreditPDTemplate', params)
// dummy data
// // dummy data
// return this._http.get('../../../assets/sample_covid19_ques.json').map(result=>{
// console.log(result)
// let apivalue ={dataStatus:true,records:{template:JSON.stringify(result)}}
@ -1014,6 +1017,7 @@ export class PdTrigerService {
// return apivalue
// })
}
updateVendorFormStatus(params) {
console.log("update",params);
return this._http.post(this.apiUrl+'updateVendorFormStatus',params)
@ -1039,6 +1043,97 @@ export class PdTrigerService {
console.log(params);
return this._http.post(this.apiUrl+'updateMISReportRemarks',params);
}
///////////////////////////////////////////////////
savePDFormDetails(params) {
// {"fk_pd_id":"1","fk_form_id":"1"}
return this._http.post(this.apiUrl+'getSMCCreditPDSectionData',{records:params})
}
loadDataFromExcel(params) {
return this._http.post(this.apiUrl+'loadDataFromExcel',{records:params})
}
loadTemplate(form_id,mapid,Formname) {
console.log( Formname)
// return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/'+form_id+'.json').map(rr=>{
// return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/LFMP/16.json').map(rr=>{
if( Formname == 'Business Information'){
return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/LFMP/'+form_id+'.json').map(rr=>{
let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
// this.raw_credit_pd_template= returnValue.records.template
return returnValue
})
}else{
return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id="+form_id+"&map_id="+mapid+"").map(result=>{
console.log(result)
let apivalue ={dataStatus:true,status:200,records:{template:JSON.stringify(result)}}
console.log(apivalue)
return apivalue
})
// return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/DONE/'+form_id+'.json').map(rr=>{
// // return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json').map(rr=>{
// let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
// // this.raw_credit_pd_template= returnValue.records.template
// console.log("12345")
// return returnValue
// })
}
}
saveSMCCreditPDsection(params1):Observable<any> {
params1.createdby = this._aws.getlocale()
// "fk_pd_id":"1","fk_form_id":"1","json":"SOMEDATA","fk_createdby":"12"
// let params = {"records":{"smc_credit_pd":this.curr_credit_pd_data.smc_credit_pd,"lender_id":this.curr_credit_pd_data.lender_id,"product_id":this.curr_credit_pd_data.product_id,"fk_createdby":this._awsService.getlocale(),"geo_location":"","section_id":params1.section_id,"questions":params1.questions,"is_complete":"0"}}
return this._http.post(this.apiUrl+'saveSMCCreditPDsection',{records:params1})
}
// saveNewSMCTempAddresses(params) {
// params = {records:params}
// return this._http.post(this.apiUrl+'saveNewSMCTempAddresses',params)
// }
saveNewSMCTempAddresses(params) {
params = {records:params}
return this._http.post(this.apiUrl+'saveNewSMCTempAddresses',params)
}
getPDSectionData(pd_id,pd_form_id,form_group) {
if(form_group == 1){
return this._http.post(this.apiUrl+'getPDFormDetails',{ "pd_id":pd_id,"pd_form_id":pd_form_id,"company_id":1})
}else{
return this._http.post(this.apiUrl+'getPDFormDetails',{ "pd_id":pd_id,"pd_form_id":pd_form_id,parent_pdid:"2904"})
}
}
getSMCTempAddresses(params) {
return this._http.get(this.apiUrl+'getPDFormDetails',params)
}
loadCreditPDTemplate2(form_id,mapid,Formname):Observable<any> {
//return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id=5&map_id=7").map(result)
// return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id=5&map_id=7").map(result=>{
// console.log(result)
// let apivalue ={dataStatus:true,records:{template:JSON.stringify(result)}}
// console.log(apivalue)
// return apivalue
// })
// if( Formname == 'Business Information'){
// return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/LFMP/'+form_id+'.json').map(rr=>{
// let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
// // this.raw_credit_pd_template= returnValue.records.template
// return returnValue
// })
// }else{
return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id="+form_id+"&map_id="+mapid+"").map(result=>{
console.log(result)
let apivalue ={dataStatus:true,status:200,records:{template:JSON.stringify(result)}}
console.log(apivalue)
return apivalue
})
// }
}
generatesalereport(params :any): Observable<any> {
// let httpParams = new HttpParams().set('pdid', countpdid);
// httpParams = httpParams.append('random_string',randomString);

View File

@ -57,6 +57,8 @@ export class EntityListComponent implements OnInit {
// this.filterFormGroupCtrl = this._formBuilder.group({
// category: [null, '']
// });
let id = this.route.snapshot.params
console.log(id)
}
ngOnInit() {

View File

@ -51,6 +51,7 @@ const HORIZONTALMENUITEMS = [
{state:'setting/pdteamlist',name:'PD Team'},
// {state:'template/questions', name: 'Questions'},
{state:'template/templates', name: 'Templates'},
{state:'template2', name: 'Templates 2.0'},
]
},

View File

@ -83,6 +83,7 @@ const MENUITEMS : Menu[] = [
{state:'setting/pdteamlist',name:'PD Team'},
// {state:'template/questions', name: 'Questions'},
{state:'template/templates', name: 'Templates'},
{state:'template2/template2', name: 'Templates 2.0'},
]
},
{

View File

@ -83,6 +83,7 @@ export class EditLenderComponent implements OnInit {
if (data.records) {
this.noTemplateLendersFound = false;
this.templateLenderRecord = data.records;
console.log( this.templateLenderRecord)
this.setFormDatas(this.templateLenderRecord);
// this.templateListData = data.records;
// this.dataLength = data.records.length;

View File

@ -0,0 +1,67 @@
<div>
<mat-card>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
<div fxFlex="80%" style="padding-left: 250px;">
<mat-card-title><span style="font-size:24px"> Deselective Questions will be Disable</span></mat-card-title>
</div>
</div>
<mat-card-content>
<div class="tree" fxFlex="100" align="end" >
<mat-list-item class="mat-list-item" role="listitem" style="background-color:#e00201;height:48px !important;"><div class="mat-list-item-content" style="flex-direction: row; box-sizing: border-box; display: flex;"><div class="mat-list-item-ripple mat-ripple" mat-ripple="" ng-reflect-disabled="true" ng-reflect-trigger="[object HTMLElement]"></div><div class="mat-list-text"></div><div fxflex="row" ng-reflect-flex="row" style="flex: 1 1 100%; box-sizing: border-box; flex-direction: row; display: flex;"><div fxflex="100" ng-reflect-flex="100" style="flex: 1 1 100%; box-sizing: border-box; max-width: 100%; flex-direction: row; display: flex;">
<!-- <div align="center" fxflex="100" style="color: rgb(255, 255, 255); flex: 1 1 100%; box-sizing: border-box; max-width: 100%;" ng-reflect-flex="100" class="ng-star-inserted"><i class="fa-1x fa fa-check-circle"></i><small style="margin-left: 2%; font-size: inherit">Full PD </small></div> -->
</div></div></div></mat-list-item>
<!-- <button style="float: right;" mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button> -->
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
matTooltipPosition="right" mat-dialog-close>
<mat-icon>close</mat-icon>
</button> -->
<div align="right" style="padding-right: 80px;">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
matTooltipPosition="above" (click)="submit()" >
<mat-icon>save</mat-icon>
</button>
</div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding>
<button mat-icon-button disabled></button>
<mat-checkbox class="checklist-leaf-node"
[checked]="checklistSelection.isSelected(node) == false"
(change)="todoLeafItemSelectionToggle(node,checklistSelection.isSelected(node))"><span style="color: red;" [ngStyle] = "{'background-color':checklistSelection.isSelected(node) == true ? 'red' : ''}&&{'text-decoration':checklistSelection.isSelected(node) == true ? 'line-through' : ''}" > <span style='color:black'>{{node.item}}</span></span></mat-checkbox>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasNoContent" matTreeNodePadding>
<button mat-icon-button disabled></button>
<mat-form-field>
<input matInput #itemValue placeholder="New item...">
</mat-form-field>
<button mat-button (click)="saveNode(node, itemValue.value)">Save</button>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
<button mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.filename">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<mat-checkbox [checked]="descendantsAllSelected(node) == false"
[indeterminate]="descendantsPartiallySelected(node)"
(change)="todoItemSelectionToggle(node,descendantsAllSelected(node))"><span style="color: red;" [ngStyle] = "{'background-color':descendantsAllSelected(node) == true ? 'red' : ''}&&{'text-decoration':descendantsAllSelected(node) == true ? 'line-through' : ''}" > <span style='color:black'>{{node.item}}</span></span></mat-checkbox>
</mat-tree-node>
</mat-tree>
<!-- <button mat-button color="primary" (click)="submit()" >submit</button> -->
<!-- [ngStyle] = "{'background-color':row.item.is_calculated == '1' ? '#f5f5f5' : ''}" -->
</div>
</mat-card-content>
</mat-card>
</div>

View File

@ -0,0 +1,38 @@
.cdk-global-overlay-wrapper {
overflow: auto;
pointer-events: auto; // needed for chrome but prevents backdrop click close
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
::ng-deep { .no-padding > mat-dialog-container {
// background: black;
padding: 0;
// overflow-y: scroll !important;
}
}
.mat-dialog-content{
margin:0px !important;
}
// mat-placeholder{
// margin-top: 20px;
// word-wrap: break-word;
// }
// input{
// height:40px;
// }
.mat-form-field-label {
white-space: normal;
}
textarea.mat-input-element {
padding: 0px 0;
margin: 5px 0;
}
.mat-input-placeholder {
white-space: normal;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EditTemplateComponent } from './edit-template.component';
describe('EditTemplateComponent', () => {
let component: EditTemplateComponent;
let fixture: ComponentFixture<EditTemplateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EditTemplateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EditTemplateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,752 @@
import {SelectionModel} from '@angular/cdk/collections';
import {FlatTreeControl} from '@angular/cdk/tree';
import {Component, Injectable} from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {BehaviorSubject} from 'rxjs';
import { MasterService } from '../master.service';
import { NotifierService } from 'angular-notifier';
import { ActivatedRoute, Router, Params } from '@angular/router';
import { FocusTrap } from '@angular/cdk/a11y';
/**
* Node for to-do item
*/
export class TodoItemNode {
children: TodoItemNode[];
item: string;
}
/** Flat to-do item node with expandable and level information */
export class TodoItemFlatNode {
item: string;
level: number;
expandable: boolean;
}
/**
* The Json object for to-do list data.
*/
/**
* Checklist database, it can build a tree structured Json object.
* Each node in Json object represents a to-do item or a category.
* If a node is a category, it has children items and new items can be added under the category.
*/
@Injectable()
export class ChecklistDatabase {
dataChange = new BehaviorSubject<TodoItemNode[]>([]);
val: any;
g: any=[];
checked:any=true;
myModel = true;
get data(): TodoItemNode[] { return this.dataChange.value; }
constructor( private masterService: MasterService) {
let formid = localStorage.getItem('form_id');
let mapid = localStorage.getItem('map_id');
this.masterService.questionsjson(formid,mapid).subscribe(
data => {
console.log(data)
this.initialize(data);
});
var data;
this.masterService.list_3_observable$.subscribe(res=> {
console.log("nav list 3",res)
data =res
})
console.log()
// let question_json = JSON.parse(JSON.parse(data.json))
// console.log(question_json)
let question_json;
if(data != [] && data.json){
question_json = JSON.parse(data.json)
}else{
question_json = []
}
//question_json = JSON.parse(data.json)
console.log(question_json)
// let dd = JSON.parse(JSON.stringify(data))
// console.log(dd)
// var b=JSON.stringify(data);
// let str = b.replace(/\\/g, '');
}
initialize(tmp:any) {
// Build the tree nodes from Json object. The result is a list of `TodoItemNode` with nested
// file node as children.
console.log(this.val)
// let TREE_DATA;
// let child_l1 = []
// let group =[];
// console.log(group)
// if(this.val.questions[0].question instanceof Array){
// let tmp =[]
// this.val.questions[0].question.forEach(element => {
// console.log( element.question)
// let sub_question =[]
// if(element.onchange_properties instanceof Array){
// console.log(element.onchange_properties[0].form_controls[0].questions);
// element.question
// element.onchange_properties[0].form_controls[0].questions.forEach(child => {
// sub_question.push( child.question)
// });
// console
// // tmp.push({g1})
// let u = element.question
// tmp[u] = tmp[tmp.length]
// tmp[u] = sub_question // remove prior key
// delete tmp[tmp.length];
// //tmp["4"] = {[element.question]:g1}
// console.log(tmp)
// // tmp.push([element.question]:null)
// }else{
// tmp.push(element.question)
// console.log(tmp)
// }
// });
// this.val.questions.forEach(sub => {
// if( sub.question instanceof Array == false){
// child_l1.push(sub.question)
// }else{
// group.push(sub.group_title)
// }
// let u;
// // if(sub.group_title != undefined){
// // u = sub.group_title
// // console.log(u)
// // group[u] = group[group.length]
// // console.log(group[u])
// // group[u] = tmp // remove prior key
// // delete group[group.length];
// // }
// });
// console.log(group)
// TREE_DATA = {
// Available_Group_Questions: group,
// Available_Questions:child_l1,
// };
// }else{
// let tmp =[]
// this.val.questions.forEach(element => {
// console.log(element.question)
// let sub_question=[]
// if(element.onchange_properties instanceof Array && element.onchange_properties !=""){
// if(element.onchange_properties[0].form_controls instanceof Array){
// console.log(element.onchange_properties[0].form_controls[0].questions);
// element.question
// element.onchange_properties[0].form_controls[0].questions.forEach(child => {
// if(child.question instanceof Array){
// child.question.forEach(q1 => {
// sub_question.push( q1.question)
// });
// }else{
// sub_question.push( child.question)
// }
// console.log(child.question)
// });
// tmp.length
// // tmp.push({g1})
// let u = element.question
// tmp[u] = tmp[tmp.length]
// tmp[u] = sub_question // remove prior key
// delete tmp[tmp.length];
// //tmp["4"] = {[element.question]:g1}
// console.log(tmp)
// }
// // tmp.push([element.question]:null)
// }else{
// tmp.push(element.question)
// console.log(tmp)
// }
// // tmp.push(element.question)
// });
// TREE_DATA = {
// Available_Questions:tmp,
// };
// }
// console.log( this.val)
// // console.log( this.val.questions[0].group_questions)
// console.log( this.val.questions[0].question)
// console.log( this.val.questions[1].question)
// // const TREE_DATA = {
// // Groceries: {
// // 'Almond Meal flour': null,
// // 'Organic eggs': null,
// // 'Protein Powder': null,
// // Fruits: {
// // Apple: null,
// // Berries: ['Blueberry', 'Raspberry'],
// // Orange: null
// // }
// // },
// // Reminders: [
// // 'Cook dinner',
// // 'Read the Material Design spec',
// // 'Upgrade Application to Angular'
// // ]
// // };
this.val = tmp.available_question;
let TREE_DATA = {
Questions:this.val,
};
const data = this.buildFileTree( TREE_DATA , 0);
// Notify the change.
this.dataChange.next(data);
}
/**
* Build the file structure tree. The `value` is the Json object, or a sub-tree of a Json object.
* The return value is the list of `TodoItemNode`.
*/
buildFileTree(obj: {[key: string]: any}, level: number): TodoItemNode[] {
return Object.keys(obj).reduce<TodoItemNode[]>((accumulator, key) => {
const value = obj[key];
const node = new TodoItemNode();
node.item = key;
if (value != null) {
if (typeof value === 'object') {
node.children = this.buildFileTree(value, level + 1);
} else {
node.item = value;
}
}
return accumulator.concat(node);
}, []);
}
/** Add an item to to-do list */
insertItem(parent: TodoItemNode, name: string) {
if (parent.children) {
parent.children.push({item: name} as TodoItemNode);
this.dataChange.next(this.data);
}
}
updateItem(node: TodoItemNode, name: string) {
node.item = name;
this.dataChange.next(this.data);
}
}
/**
* @title Tree with checkboxes
*/
// @Component({
// selector: 'tree-checklist-example',
// templateUrl: 'tree-checklist-example.html',
// styleUrls: ['tree-checklist-example.css'],
// providers: [ChecklistDatabase]
// })
@Component({
selector: 'app-edit-template',
templateUrl: './edit-template.component.html',
styleUrls: ['./edit-template.component.scss'],
providers: [ChecklistDatabase]
})
export class EditTemplateComponent {
/** Map from flat node to nested node. This helps us finding the nested node to be modified */
flatNodeMap = new Map<TodoItemFlatNode, TodoItemNode>();
/** Map from nested node to flattened node. This helps us to keep the same object for selection */
nestedNodeMap = new Map<TodoItemNode, TodoItemFlatNode>();
/** A selected parent node to be inserted */
selectedParent: TodoItemFlatNode | null = null;
/** The new item's name */
newItemName = '';
treeControl: FlatTreeControl<TodoItemFlatNode>;
treeFlattener: MatTreeFlattener<TodoItemNode, TodoItemFlatNode>;
dataSource: MatTreeFlatDataSource<TodoItemNode, TodoItemFlatNode>;
/** The selection for checklist */
checklistSelection = new SelectionModel<TodoItemFlatNode>(true /* multiple */);
val: any;
result: any[];
errorMessage: string;
form_id: any;
constructor(private database: ChecklistDatabase, private masterService: MasterService, private notifier: NotifierService , private route: ActivatedRoute,
private router: Router) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel,
this.isExpandable, this.getChildren);
this.treeControl = new FlatTreeControl<TodoItemFlatNode>(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
database.dataChange.subscribe(data => {
this.dataSource.data = data;
});
this.masterService.list_3_observable$.subscribe(res=> {
console.log("nav list 3",res)
this.form_id = res.form_id;
this.val = JSON.parse(res.json)
this.val
})
}
getLevel = (node: TodoItemFlatNode) => node.level;
isExpandable = (node: TodoItemFlatNode) => node.expandable;
getChildren = (node: TodoItemNode): TodoItemNode[] => node.children;
hasChild = (_: number, _nodeData: TodoItemFlatNode) => _nodeData.expandable;
hasNoContent = (_: number, _nodeData: TodoItemFlatNode) => _nodeData.item === '';
/**
* Transformer to convert nested node to flat node. Record the nodes in maps for later use.
*/
transformer = (node: TodoItemNode, level: number) => {
const existingNode = this.nestedNodeMap.get(node);
const flatNode = existingNode && existingNode.item === node.item
? existingNode
: new TodoItemFlatNode();
flatNode.item = node.item;
flatNode.level = level;
flatNode.expandable = !!node.children;
this.flatNodeMap.set(flatNode, node);
this.nestedNodeMap.set(node, flatNode);
return flatNode;
}
/** Whether all the descendants of the node are selected. */
descendantsAllSelected(node: TodoItemFlatNode): boolean {
const descendants = this.treeControl.getDescendants(node);
const descAllSelected = descendants.every(child =>
this.checklistSelection.isSelected(child)
);
return descAllSelected;
}
/** Whether part of the descendants are selected */
descendantsPartiallySelected(node: TodoItemFlatNode): boolean {
const descendants = this.treeControl.getDescendants(node);
const result = descendants.some(child => this.checklistSelection.isSelected(child));
return result && !this.descendantsAllSelected(node);
}
/** Toggle the to-do item selection. Select/deselect all the descendants node */
todoItemSelectionToggle(node: TodoItemFlatNode,b): void {
///all select
console.log(node.item + b)
console.log(node)
console.log(this.val)
if(node.item == 'Available_Group_Questions'){
console.log("1")
if(b==false){
this.val.questions[0].disable = true
}else{
this.val.questions[0].disable = false
}
if(this.val.questions[0].question instanceof Array){
this.val.questions[0].question.forEach(element => {
if(b==false){
element.disable = true
}else{
element.disable = false
}
//element.onchange_properties[0].form_controls[0].questions
console.log(element)
});
}
}
else if(node.item == 'Available_Questions'){
console.log("2")
if(this.val.questions instanceof Array){
this.val.questions.forEach(element => {
if(b==false){
element.disable = true
}else{
element.disable = false
}
if(element.onchange_properties instanceof Array && element.onchange_properties !=null){
if(element.onchange_properties[0] && element.onchange_properties[0].form_controls){
console.log(element.onchange_properties[0].form_controls[0].questions);
element.onchange_properties[0].form_controls[0].questions.forEach(sub => {
console.log(sub.question)
if(b==false){
sub.disable = true
}else{
sub.disable = false
}
});
}
// alert("if disable this General & Address form will be affected")
}
console.log(element)
});
}
}else{
console.log("3")
this.val.questions.forEach(element => {
if(element.question == node.item ){
if(b==false){
element.disable = true
}else{
element.disable = false
}
console.log(element)
if(element.onchange_properties instanceof Array ){
if( element.onchange_properties[0].form_controls instanceof Array){
element.onchange_properties[0].form_controls[0].questions.forEach(e => {
console.log(e)
if(b==false){
e.disable = true
}else{
e.disable = false
}
});
}
}
}
});
}
console.log(this.val)
this.result =[]
this.result.push(this.val)
this.checklistSelection.toggle(node);
const descendants = this.treeControl.getDescendants(node);
this.checklistSelection.isSelected(node)
? this.checklistSelection.select(...descendants)
: this.checklistSelection.deselect(...descendants);
// Force update for the parent
descendants.every(child =>
this.checklistSelection.isSelected(child)
);
this.checkAllParentsSelection(node);
}
/** Toggle a leaf to-do item selection. Check all the parents to see if they changed */
todoLeafItemSelectionToggle(node: TodoItemFlatNode,b): void {
//single select
console.log(node.item + b)
console.log(node)
console.log(this.val)
if(this.val.questions[0].question instanceof Array && this.val.length ==0){
console.log('node')
this.val.questions[0].question.forEach(element => {
if(element.question == node.item){
if(b==false){
element.disable = true
}else{
element.disable = false
}
if(element.onchange_properties instanceof Array && b== false){
console.log(element.onchange_properties[0].form_controls[0].questions);
alert("if disable this General & Address form will be affected")
}
}
else{
if(this.val.questions[1].question == node.item){
if(b==false){
this.val.questions[1].disable = true
}else{
this.val.questions[1].disable = false
}
}
}
console.log(element)
});
}else if(!this.val.questions[1]){
console.log('node 2 ')
this.val.questions.forEach(element => {
if(element.question == node.item){
if(b==false){
element.disable = true
}else{
element.disable = false
}
if(element.onchange_properties instanceof Array && b== false){
console.log(element.onchange_properties[0].form_controls[0].questions);
alert("if disable this General & Address form will be affected")
}
}
console.log(element)
});
}
else{
console.log('node 3')
this.val.questions.forEach(element => {
console.log(element)
if(element.question == node.item || element.group_title == node.item ){
if(b==false){
element.disable = true
}else{
element.disable = false
}
console.log(element.onchange_properties)
}
if(element.onchange_properties instanceof Array && element.onchange_properties !=""){
console.log(element.onchange_properties)
if( element.onchange_properties[0].form_controls != undefined){
console.log(element.onchange_properties[0].form_controls[0].questions);
element.onchange_properties[0].form_controls[0].questions.forEach(sub => {
console.log(sub.question)
if(sub.question == node.item){
if(b==false){
sub.disable = true
}else{
sub.disable = false
}
}
if(sub.question instanceof Array){
sub.question.forEach(c => {
if(c.question == node.item){
if(b==false){
c.disable = true
}else{
c.disable = false
}
}
});
}
});
// alert("if disable this General & Address form will be affected")
}
}
console.log(element)
});
// if(this.val.questions[1].question == node.item){
// if(b==false){
// this.val.questions[1].disable = true
// }else{
// this.val.questions[1].disable = false
// }
// }
//console.log(element)
}
console.log(this.val)
this.result =[]
this.result.push(this.val)
this.checklistSelection.toggle(node);
this.checkAllParentsSelection(node);
// console.log(node);
}
/* Checks all the parents when a leaf node is selected/unselected */
checkAllParentsSelection(node: TodoItemFlatNode): void {
let parent: TodoItemFlatNode | null = this.getParentNode(node);
while (parent) {
this.checkRootNodeSelection(parent);
parent = this.getParentNode(parent);
}
console.log(node)
}
/** Check root node checked state and change it accordingly */
checkRootNodeSelection(node: TodoItemFlatNode): void {
const nodeSelected = this.checklistSelection.isSelected(node);
const descendants = this.treeControl.getDescendants(node);
const descAllSelected = descendants.every(child =>
this.checklistSelection.isSelected(child)
);
if (nodeSelected && !descAllSelected) {
this.checklistSelection.deselect(node);
} else if (!nodeSelected && descAllSelected) {
this.checklistSelection.select(node);
}
}
/* Get the parent node of a node */
getParentNode(node: TodoItemFlatNode): TodoItemFlatNode | null {
const currentLevel = this.getLevel(node);
if (currentLevel < 1) {
return null;
}
const startIndex = this.treeControl.dataNodes.indexOf(node) - 1;
for (let i = startIndex; i >= 0; i--) {
const currentNode = this.treeControl.dataNodes[i];
if (this.getLevel(currentNode) < currentLevel) {
return currentNode;
}
}
return null;
}
/** Select the category so we can insert the new item. */
addNewItem(node: TodoItemFlatNode) {
const parentNode = this.flatNodeMap.get(node);
this.database.insertItem(parentNode!, '');
this.treeControl.expand(node);
}
/** Save the node to database */
saveNode(node: TodoItemFlatNode, itemValue: string) {
const nestedNode = this.flatNodeMap.get(node);
this.database.updateItem(nestedNode!, itemValue);
console.log(this.dataSource)
}
loadPdViewCompoent(){
//this.router.routeReuseStrategy.shouldReuseRoute = () => false;
//this.router.onSameUrlNavigation = 'reload';
this.router.navigate(['template2/lenderlist']);
setTimeout(()=>{ //<<<---using ()=> syntax
window.location.reload()
}, 1);
//this.router.navigate([ 'template2/lenderlist'], { relativeTo: this.route });
}
submit(){
console.log(this.result)
console.log(this.val)
console.log(localStorage.getItem('map_id'));
let map_id = localStorage.getItem('map_id');
console.log( this.form_id )
// this.result.forEach(element => {
// const blob = new Blob([JSON.stringify(element)], {type : 'application/json'});
// saveAs(blob, 'sample');
// });
let formValues;
console.log("worked")
this.masterService.saveupdatejsondetails(map_id,this.form_id ,this.result[0]).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
}
else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
this.errorMessage = "Something Went Wrong Try Again.!";
}
}, error => {
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
}
}

View File

@ -0,0 +1,52 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
<span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{pageTitle}}</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button> -->
</div>
</h2>
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<ng-container *ngIf="waitLoading && existCompanyList.length > 0 ;">
<mat-card *ngFor="let companyList of existCompanyList">
<mat-card-header>
<mat-card-title class="p-text">{{companyList.company_name}}</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="80" fxFlex.md="40" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of CompanyList ;let quesIndex=index" [ngStyle]="{'background-color':formButton.is_form_disabled == 1 ? '#d5d5d5' : '#4caf50' ,'color':'#fff'}" >
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center" (click)="formButton.is_form_disabled == 1 ? null : OnSelectBusinessGroupForms(formButton, companyList,quesIndex)">{{quesIndex+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;" (click)="formButton.is_form_disabled == 1 ? null : OnSelectBusinessGroupForms(formButton, companyList,quesIndex)">
{{ formButton.form_name }}
</div>
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item [disabled]="formButton.is_form_disabled == 0" (click)="OnSelectform(formButton,quesIndex,0)">
<mat-icon>done</mat-icon>
<span>Enable</span>
</button>
<button mat-menu-item [disabled]="formButton.is_form_disabled == 1" (click)="OnSelectform(formButton,quesIndex,1)">
<mat-icon>clear</mat-icon>
<span>Disable</span>
</button>
</mat-menu>
</mat-card-header>
</mat-card>
</div>
</mat-card-content>
</mat-card>
</ng-container>
<mat-card *ngIf="waitLoading==false && existCompanyList.length == 0 ;">
<mat-card-content>
<p><strong>Business Related Information is Not Available.Please Check General Information</strong></p>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<notifier-container></notifier-container>

View File

@ -0,0 +1,34 @@
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
.p-text {
color:#e00201 !important;
font-weight: bold;
}
::ng-deep .mat-card-header-text{
margin:0px !important;
}
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
mat-card .child_mat_card > mat-card {
border-radius: 0px 0px 0px 15px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FormGroupComponent } from './form-group.component';
describe('FormGroupComponent', () => {
let component: FormGroupComponent;
let fixture: ComponentFixture<FormGroupComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FormGroupComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FormGroupComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,131 @@
import { Component,OnInit,Inject,Input} from '@angular/core';
import { NotifierService } from 'angular-notifier';
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
/** Service */
// import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import { MasterService } from '../master.service';
import {ActivatedRoute, Router} from "@angular/router";
import { EditTemplateComponent } from '../edit-template/edit-template.component';
@Component({
selector: 'app-form-group',
templateUrl: './form-group.component.html',
styleUrls: ['./form-group.component.scss']
})
export class FormGroupComponent implements OnInit {
customer_segment_abbr: any;
subproduct_abbr: any;
lender_applicant_id: any;
main_applicant: any;
pageTitle: string = "Business Related Information";
existCompanyList: any = [];
pdid: number;
form_id: number;
waitLoading:boolean;
lender_short_name :any;
product_abbr :any;
prod_catagory: any;
selectedFormsCategory: any;
pd_all_details: any;
CompanyList: any;
errorMessage: any;
// vendor_status_arr: any=[];
constructor( private notifier: NotifierService,
private route: ActivatedRoute,
private router: Router,
private masterService: MasterService,
) {
console.log(this.pd_all_details)
this.pdid = 1;
console.log(this.pdid)
this.form_id = 13;
// this.waitLoading=false;
// this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant;
// this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id;
// this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr;
// this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
// this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name;
// console.log(this.lender_short_name);
// this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr;
// console.log(this.product_abbr);
// this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory;
}
ngOnInit() {
this.getCompanyListForBusiness();
}
getCompanyListForBusiness(): void{
console.log("data")
let map_id = localStorage.getItem('map_id');
this.masterService.getCompaniesListsForBusiness(map_id).subscribe(data=>{
console.log(data)
if(data.dataStatus){
console.log(data)
//this.existCompanyList = data.records.filter(val =>val.is_active == 1);
this.existCompanyList = data.records;
this.CompanyList = data.records[0].forms;
console.log( this.existCompanyList)
// VENDOR FORM ANSWER FETCH STATUS START(SMART PD ONLY)
// if(this.existCompanyList.length > 0 && this.pd_all_details.pdmaster_details.fk_pd_type == '2') {
// if(this.existCompanyList[0].hasOwnProperty('vendor_form_status') && this.existCompanyList[0].vendor_form_status && this.existCompanyList[0].vendor_form_status.length > 0) {
// // temp_vendor_status = JSON.parse(temp_vendor_status)
// // if(temp_vendor_status && temp_vendor_status.length > 0 ) {
// this.vendor_status_arr = this.existCompanyList[0].vendor_form_status
// // }
// }
// }
// END OF VENDOR FORM ANSWER FETCH
this.waitLoading = true;
}
else {
this.waitLoading = false;
}
})
}
OnSelectform(details,index,disable_key){
console.log(details)
console.log(index)
console.log(disable_key)
let form_id = details.form_id;
let map_id = localStorage.getItem('map_id');
let disabled = disable_key
this.masterService.disableform(form_id,map_id,disabled).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
// this.loadTemplates();
this.getCompanyListForBusiness();
}
else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
this.errorMessage = "Something Went Wrong Try Again.!";
}
}, error => {
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
}
// direct form based questions
OnSelectBusinessGroupForms(details: any, company: any,id:any) {
console.log(details)
console.log(company)
this.masterService.list_3.next(details);
console.log(id)
//this.router.navigate(['Group-form'], { relativeTo: this.route });
this.router.navigate(['Edit-template'], { relativeTo: this.route });
}
}

View File

@ -0,0 +1,69 @@
<div [style.display]="listView ? 'block' : 'none'">
<mat-card>
<mat-card-content>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
<div fxFlex="80%">
<mat-card-title><span style="font-size:24px"> Lender Lists</span></mat-card-title>
</div>
</div>
<mat-card>
<!-- <div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none" style="padding-top:1%">
<div fxFlexOffset="90%" fxFlex="10%">
<button mat-fab class="mr-1 mb-1" color="primary"matTooltip="Add New Entity" matTooltipPosition="above" (click)="addNewEntity()"><mat-icon>add</mat-icon></button>
</div>
</div> -->
<mat-card-content>
<ng-container *ngIf="enityList.length > 0">
<mat-table [dataSource]="dataSource">
<ng-container matColumnDef="entity_name">
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
<span *ngIf="product.entity_name" mat-line>{{ product.entity_name }}</span>
<span mat-line>LENDER</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="name">
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
<div> {{ product.full_name }} ({{product.short_name}})</div>
<div> {{ product.branch_name }} </div>
<div> {{product.city_name}}<span *ngIf="product.state_name">,</span> {{product.state_name}} </div>
</mat-cell>
</ng-container>
<ng-container matColumnDef="contact">
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
<div> {{ product.phone_number }}</div>
<div> {{ product.official_email }}</div></mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product)"><mat-icon>edit</mat-icon></button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</ng-container>
<div *ngIf="!noQuesMasterRecrdFound">
<mat-paginator [length]="enityList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>
</mat-card-content>
<mat-card *ngIf="noQuesMasterRecrdFound">
<mat-card-content>
<div class="no-record-found">No Record Found ... </div>
</mat-card-content>
</mat-card>
</mat-card>
</mat-card-content>
</mat-card>
</div>
<div>
<router-outlet></router-outlet>
</div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LenderListComponent } from './lender-list.component';
describe('LenderListComponent', () => {
let component: LenderListComponent;
let fixture: ComponentFixture<LenderListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LenderListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LenderListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,222 @@
import { Component, ViewChild, OnInit } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
import { ActivatedRoute, Router, Params } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
// import { MastersService } from './../../service/masters/masters.service';
import { MastersService } from './../../settings/service/masters/masters.service';
/** Dialog Component */
// import { EntityAddComponent } from './../entity-add/entity.add.component';
import { EntityAddComponent } from './../../settings/entity/entity-add/entity.add.component';
// import { EditComponent } from './../entity-edit/entity.edit.component';
// import { EntityService } from './../../service/entity/entity.service';
import { EntityService } from './../../settings/service/entity/entity.service';
import { MasterService } from '../master.service';
// import { EntityEditComponent } from "./../entity-edit/entity.edit.component";
/*
* Questions master List component
* : kdk
*/
@Component({
selector: 'app-lender-list',
templateUrl: './lender-list.component.html',
styleUrls: ['./lender-list.component.scss']
})
export class LenderListComponent implements OnInit {
public listView: any = true;
public enityList: any[] = [];
public paginationList: any[] = [];
public categories: any = [];
public search_cid: any = null;
public noQuesMasterRecrdFound: boolean = false;
public filterFormGroupCtrl: FormGroup;
// @ViewChild(EntityEditComponent) child;
// pagination variable details
length = 50;
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
// data source variable details
questionListData = null;
public dataLength: number;
public dataSource = new MatTableDataSource();
displayedColumns = ['entity_name', 'name','contact', 'actions'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private dialog: MatDialog,
private masterService: MasterService,
private _formBuilder: FormBuilder,
private route: ActivatedRoute,
private router: Router,
private entityService: EntityService) {
// this.filterFormGroupCtrl = this._formBuilder.group({
// category: [null, '']
// });
//<<<---using ()=> syntax
}
ngOnInit() {
}
// get question master list details
getEntityListMasters() {
this.noQuesMasterRecrdFound = false;
// this.search_cid = this.filterFormGroupCtrl.controls.category.value;
console.log(this.search_cid + ", " + this.filterFormGroupCtrl);
this.masterService.getEntityListMasterDetails().subscribe(
data => {
console.log(data.records)
if (data) {
if (data.records) {
this.enityList = data.records;
// this.questionListData = data.records;
this.dataLength = data.records.length;
this.dataSource.data = this.enityList;
this.dataSource.paginator = this.paginator;
} else {
this.enityList = [];
this.dataLength = null;
this.noQuesMasterRecrdFound = true;
}
} else {
this.enityList = [];
this.dataLength = null;
this.noQuesMasterRecrdFound = true;
}
}
)
}
// get category master details
getCategorMaster() {
this.masterService.getAllMasterData('QUESTIONCATEGORY').subscribe(
data => {
this.categories = data.records.filter(category => category.isactive == 1);
},
error => {
// this.errorMessage = "No Category Record Found.";
}
)
}
ngAfterViewInit() {
this.getCategorMaster();
this.getEntityListMasters();
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.dataSource.filter = filterValue;
}
// add questions popup model call
addNewQuestion() {
this.router.navigate(['/setting/entity/add']);
// const dialogRef = this.dialog.open(EntityAddComponent, {
// data: {},
// disableClose: true
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// this.getQuestionsMasters();
// // this.getBranch();
// // this.isPopupOpened = false;
// });
}
public parentMessage: any = [];
editEntity(detail){
// this.parentMessage = detail;
this.router.navigate([ '../lenderlist/lps', detail.entity_id ], { relativeTo: this.route });
this.listView = false;
localStorage.setItem('listView', this.listView);
localStorage.setItem('entity_id', detail.entity_id);
console.log(detail)
}
// goToEdit(template_id : number){
// this.router.navigate([ '../list/edit', template_id ], { relativeTo: this.route });
// this.listView = false;
// }
showListView(status: boolean){
// alert(2);
this.listView = status;
}
changeListView(){
this.getEntityListMasters();
this.listView = true;
}
// edit questions master details popup model
// editQuestion(rowDetails: any) {
// const dialogRef = this.dialog.open(EditComponent, {
// data: rowDetails,
// disableClose: true
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// this.getQuestionsMasters();
// // this.getBranch();
// // this.isPopupOpened = false;
// });
// }
// padination page event call
pageChange(e) {
console.log(e);
}
addNewEntity(): void {
const dialogRef = this.dialog.open(EntityAddComponent, {
disableClose: true,
data: { }
});
dialogRef.afterClosed().subscribe(result => {
if(result != null) {
this.getEntityListMasters();
this.editEntity({'entity_id':result.record});
} else {
}
console.log('The dialog was closed');
// alert(result);
});
}
}
// {"dataStatus":true,"status":200,"records":
// [
// {"entity_id":"4","full_name":"chech","short_name":"check","fk_region":"2","region_name":"South India","fk_state":"2","state_name":"Tamil Nadu","fk_city":"2","city_name":"Chennai","fk_branch":"10","branch_name":"Ahmedabad","addressline1":"c","pincode":"c","official_email":"c@gmail.com","alt_email":"c@gmail.com","phone_number":"3423423444","mobile_no":"234234234","remarks":"234234","createdon":"2018-10-05 05:18:08","fk_createdby":"1","createdby":"sriram v","updatedon":null,"fk_updatedby":null,"updatedby":null,"isactive":"1","pan":"234234","gst_no":"2342","gst_state_code":"dfw","tat":"12","fk_entity_type_id":"2","entity_name":"LENDOR","0":[{"entity_child_id":"1","contact_person":"cc","contact_email":"cc@gmai.com","contact_mobile_no":"23412341234","isactive":"1","createdon":"2018-10-05 05:18:08","fk_createdby":"1","createdby":"sriram v","updatedon":null,"fk_updatedby":null,"updatedby":null}]},
// {"entity_id":"1","full_name":"ICICI","short_name":"ICICI","fk_region":"1","region_name":"North India","fk_state":"1","state_name":"Jammu and Kashmir","fk_city":"1","city_name":"Srinagar (summer), Jammu (winter)","fk_branch":"1","branch_name":"Main Branch","addressline1":"add1","pincode":"add2","official_email":null,"alt_email":null,"phone_number":null,"mobile_no":null,"remarks":null,"createdon":"2018-09-28 08:55:56","fk_createdby":"1","createdby":"sriram v","updatedon":"2018-10-03 10:11:28","fk_updatedby":null,"updatedby":null,"isactive":"1","pan":null,"gst_no":null,"gst_state_code":null,"tat":null,"fk_entity_type_id":"2","entity_name":"LENDOR","0":[{"entity_child_id":"2","contact_person":"ccee","contact_email":"ccee@gmai.com","contact_mobile_no":"234123412111","isactive":"1","createdon":"2018-10-05 05:18:08","fk_createdby":"1","createdby":"sriram v","updatedon":"2018-10-05 05:18:08","fk_updatedby":"1","updatedby":"sriram v"}]},
// {"entity_id":"8","full_name":"ICICIedited","short_name":"checkee","fk_region":"2","region_name":"South India","fk_state":"2","state_name":"Tamil Nadu","fk_city":"2","city_name":"Chennai","fk_branch":"10","branch_name":"Ahmedabad","addressline1":"cee","pincode":"cee","official_email":"cee@gmail.com","alt_email":"cee@gmail.com","phone_number":"3423423111","mobile_no":"234234111","remarks":"edietd","createdon":"2018-10-05 05:18:08","fk_createdby":"1","createdby":"sriram v","updatedon":"2018-10-05 05:18:08","fk_updatedby":"1","updatedby":"sriram v","isactive":"1","pan":"234111","gst_no":"2111","gst_state_code":"dfwee","tat":"12111","fk_entity_type_id":"2","entity_name":"LENDOR","0":[]}]}

View File

@ -0,0 +1,64 @@
<div>
<mat-card>
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
<div fxFlex="80%" style="padding-left: 250px;">
<mat-card-title><span style="font-size:24px"> Lender product and Customer Segment (Add / Edit)</span></mat-card-title>
</div>
</div>
<mat-card-content>
<form [formGroup]="_editTempLenderFrom" (submit)="onSubmit()">
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Add More Lender Details" matTooltipPosition="above" (click)="addLanguage(null, $event); false"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Clear Changes" matTooltipPosition="above" type="button" (click)="reset()"><mat-icon>settings_backup_restore</mat-icon></button>
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> -->
</div>
<div formArrayName="temp_lender" class="example-full-width">
<mat-card *ngFor="let answ of _editTempLenderFrom.controls.temp_lender['controls']; let i=index">
<div [formGroupName]="i">
<div class="p-11" fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
<!-- <div fxFlex="23%">
<mat-form-field >
<mat-select placeholder="Lender *" formControlName="fk_lender_id">
<mat-option *ngFor="let lend of m_lender" [value]="lend.entity_id">{{ lend.full_name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_lender_id.hasError('required')" class="mat-text-warn">Lender Type Required.!</mat-error>
</mat-form-field>
</div> -->
<div fxFlex="30%">
<mat-form-field >
<mat-select placeholder="Product *" formControlName="fk_product_id">
<mat-option *ngFor="let prcd of m_product" [value]="prcd.product_id">{{ prcd.name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_product_id.hasError('required')" class="mat-text-warn">Product Required.!</mat-error>
</mat-form-field>
</div>
<div fxFlex="30%">
<mat-form-field >
<mat-select placeholder="Customer Segment *" formControlName="fk_customer_segment">
<mat-option *ngFor="let cusSeg of m_customerSegment" [value]="cusSeg.customer_segment_id">{{ cusSeg.name }}</mat-option>
</mat-select>
<mat-error *ngIf="submitted && answ['controls'].fk_customer_segment.hasError('required')" class="mat-text-warn">Customer Segment Required.!</mat-error>
</mat-form-field>
</div>
<div fxFlex="23%">
<div *ngIf ="(templateLenderRecord[i] || templateLenderRecord[0] == false)"> <button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product,i)"><mat-icon>edit</mat-icon></button></div>
<div *ngIf ="( !templateLenderRecord[i] || (templateLenderRecord[i] == 'undefined'))"> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" (click)="save(answ,i)" ><mat-icon>save</mat-icon></button></div>
</div>
</div>
</div>
</mat-card>
</div>
</form>
</mat-card-content>
</mat-card>
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LenderProductSegMappingComponent } from './lender-product-seg-mapping.component';
describe('LenderProductSegMappingComponent', () => {
let component: LenderProductSegMappingComponent;
let fixture: ComponentFixture<LenderProductSegMappingComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LenderProductSegMappingComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LenderProductSegMappingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,314 @@
import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
import { FormGroup, FormControl, FormBuilder, Validators, FormArray } from '@angular/forms';
import { ActivatedRoute, Router, Params } from '@angular/router';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
import { NotifierService } from 'angular-notifier';
// import { TemplatesService } from './../../../../service/templates/templates.service';
// import { TemplatesService } from './../../template/service/templates/templates.service';
import { MasterService } from '../master.service';
// import { MastersService } from './../../../../service/masters/masters.service';
// import { MastersService } from './../../template/service/masters/masters.service';
@Component({
selector: 'app-lender-product-seg-mapping',
templateUrl: './lender-product-seg-mapping.component.html',
styleUrls: ['./lender-product-seg-mapping.component.scss']
})
export class LenderProductSegMappingComponent implements OnInit {
@Input() questionId: number;
public noTemplateLendersFound: boolean;
public templateLenderRecord: any =[];
public template: any =[];
public errorMessage;
public m_lender: any;
public m_product: any;
public m_customerSegment: any;
public _editTempLenderFrom: FormGroup;
public submitted = false;
/**
* Notifier service
*/
private notifier: NotifierService;
entity_id: string;
index: any;
value: any;
constructor(
notifier: NotifierService,
private masterService: MasterService, private route: ActivatedRoute,
private router: Router,
private _formBuilder: FormBuilder) {
this.notifier = notifier;
}
ngOnInit() {
this.getTemplateLenderDetails();
this.getLenderMasters();
this.getProductsMasters();
this.getCustomerSegmentMasters();
this.get_template_mapping_List();
this.template.push(true)
this._editTempLenderFrom = this._formBuilder.group({
temp_lender: this._formBuilder.array([
// this.initAnswers(),
])
})
}
setFormDatas(record) {
if (record.length > 0) {
for (let val of record) {
console.log(val)
this.value = val;
localStorage.setItem('map_id',val.map_id);
let vals = {
template_lender_map_id: val.map_id,
fk_template_id: val.fk_template_id,
fk_lender_id: val.fk_lender_id,
fk_product_id: val.product_id,
fk_customer_segment: val.customer_segment_id,
isactive: val.isactive,
};
this.addLanguage(vals, null);
}
}
}
getTemplateLenderDetails() {
this.entity_id = localStorage.getItem('entity_id')
this.masterService.get_template_mapping_List(this.entity_id).subscribe(
data => {
if (data) {
if (data.records) {
this.noTemplateLendersFound = false;
if(!data.records){
this.template =[]
this.templateLenderRecord.push(false)
}else{
this.templateLenderRecord =[]
this.templateLenderRecord = data.records;
this.setFormDatas(this.templateLenderRecord);
}
console.log(this.templateLenderRecord)
// this.templateListData = data.records;
// this.dataLength = data.records.length;
// this.dataSource.data = this.templateListData;
} else {
this.noTemplateLendersFound = true;
}
} else {
this.noTemplateLendersFound = true;
}
}
);
}
getLenderMasters() {
this.masterService.getLenderMasterListDetails().subscribe(
data => {
this.m_lender = data.records;
},
error => {
this.notifier.notify('warning', 'No Lender Master Records Found.!');
this.errorMessage = "No Lender Master Record Found.";
}
);
}
get_template_mapping_List() {
this.entity_id = localStorage.getItem('entity_id')
this.masterService.get_template_mapping_List( this.entity_id).subscribe(
data => {
console.log(data)
},
error => {
this.notifier.notify('warning', 'No Lender Master Records Found.!');
this.errorMessage = "No Lender Master Record Found.";
}
);
}
getProductsMasters() {
this.masterService.getProductsMasterListDetails().subscribe(
data => {
console.log(data)
this.m_product = data.records;
console.log(this.m_product)
},
error => {
this.notifier.notify('warning', 'No Products Master Records Found.!');
this.errorMessage = "No Products Master Record Found.";
}
);
}
getCustomerSegmentMasters() {
this.masterService.getCustomerSegmentsMasterListDetails().subscribe(
data => {
console.log(data)
this.m_customerSegment = data.records;
console.log( this.m_customerSegment)
console.log(this.templateLenderRecord)
},
error => {
this.notifier.notify('warning', 'No Customer Segment Master Records Found.!');
this.errorMessage = "No Customer Segment Master Record Found.";
}
);
}
editEntity(detail,index){
// this.parentMessage = detail;
var formValues = this._editTempLenderFrom.value;
console.log(formValues)
this.masterService.list_2.next(formValues.temp_lender[index]);
this.router.navigate([ 'selection-list'], { relativeTo: this.route });
//this.listView = false;
// localStorage.setItem('entity_id', detail.entity_id);
console.log(detail)
}
// convenience getter for easy access to form fields
get f() { return this._editTempLenderFrom.controls; }
// Dynamic Form field creation Functionality : START ===>
initAnswers(data) {
return this._formBuilder.group({
template_lender_map_id: [data.template_lender_map_id],
fk_template_id: [data.fk_template_id],
fk_lender_id: [data.fk_lender_id, Validators.compose([Validators.required])],
fk_product_id: [data.fk_product_id, Validators.compose([Validators.required])],
fk_customer_segment: [data.fk_customer_segment, Validators.compose([Validators.required])],
isactive: [data.isactive],
});
}
addLanguage(data, e) {
console.log(data)
if (data == null) {
let newDate = {
template_lender_map_id: null,
fk_template_id: this.questionId,
fk_lender_id: null,
fk_product_id: null,
fk_customer_segment: null,
isactive: 1,
}
const control = <FormArray>this._editTempLenderFrom.controls['temp_lender'];
control.push(this.initAnswers(newDate));
} else {
const control = <FormArray>this._editTempLenderFrom.controls['temp_lender'];
control.push(this.initAnswers(data));
}
}
removeLanguage(i: number) {
const control = <FormArray>this._editTempLenderFrom.controls['temp_lender'];
control.removeAt(i);
}
// END ===>
save(ans,index){
this.index = index;
const arr = <FormArray>this._editTempLenderFrom.controls.temp_lender;
console.log(this._editTempLenderFrom.controls.temp_lender)
console.log(arr)
console.log(ans)
}
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
var formValues = this._editTempLenderFrom.value;
console.log(this.templateLenderRecord)
console.log(formValues)
console.log(this._editTempLenderFrom)
console.log(this.index)
console.log(localStorage.getItem('entity_id'));
this.entity_id = localStorage.getItem('entity_id')
console.log(this.value )
this.value
let params = {"records":{"entity_id":this.entity_id,"product_id":formValues.temp_lender[this.index].fk_product_id,"customer_segment_id":formValues.temp_lender[this.index].fk_customer_segment}}
console.log(params)
//stop here if form is invalid
console.log(this._editTempLenderFrom.invalid)
// if (this._editTempLenderFrom.invalid) {
// console.log("1")
// this.notifier.notify('warning', 'Please Fill All Mandate Fields.!');
// this.errorMessage = "Please Fill All Mandate Fields.";
// return;
// } else {
// console.log("2")
// var formValues = this._editTempLenderFrom.value;
// console.log(formValues)
//To Remove The "Null" With Key also
// Object.keys(formValues).forEach((key) => (formValues[key] == null) && delete formValues[key]);
// // alert(JSON.stringify(formValues.temp_lender));
// console.log(formValues)
if (!this.checkDuplicateInObject(formValues.temp_lender)) {
console.log("worked")
this.masterService.savedetails(formValues).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
const arr = <FormArray>this._editTempLenderFrom.controls.temp_lender;
arr.controls.splice(0);
this.getTemplateLenderDetails();
}
else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
this.errorMessage = "Something Went Wrong Try Again.!";
}
}, error => {
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
} else {
this.notifier.notify('warning', 'duplication records occured.!');
}
// }
}
reset() {
const arr = <FormArray>this._editTempLenderFrom.controls.temp_lender;
arr.controls.splice(0);
this.getTemplateLenderDetails();
}
checkDuplicateInObject(inputArray) {
let seenDuplicate = false;
inputArray.map(function (item, index) {
let currentVal = inputArray[index];
for (let i = index + 1; i < inputArray.length; i++) {
if (currentVal.fk_lender_id === inputArray[i].fk_lender_id
&& currentVal.fk_product_id === inputArray[i].fk_product_id
&& currentVal.fk_customer_segment === inputArray[i].fk_customer_segment) {
console.log('duplication: ' + i);
seenDuplicate = true;
}
}
console.log(index);
});
return seenDuplicate;
}
ngOnDestroy(): void {
//Called once, before the instance is destroyed.
//Add 'implements OnDestroy' to the class.
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { MasterService } from './master.service';
describe('MasterService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: MasterService = TestBed.get(MasterService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,140 @@
import { Injectable } from '@angular/core';
// @Injectable({
// providedIn: 'root'
// })
// // export class MasterService {
// // constructor() { }
// // }
/** Common Import Section */
import { BehaviorSubject, Observable } from 'rxjs';//for Datatables
import { HttpClient } from '@angular/common/http';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs';
/** Imported Service Files Are., */
import { AwsService } from '../AwsService/aws.service';
/** Environment */
import { environment } from 'environments/environment';
/** Consant Value For Created Date And Updated Date */
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
/** Master Interface */
export interface Master {
master_id:number;
master_name:string;
constant_name:string;
}
@Injectable({
providedIn: 'root'
})
export class MasterService {
public list_2:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public list_2_observable$ = this.list_2.asObservable();
public list_3:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public list_3_observable$ = this.list_3.asObservable();
// private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
private apiUrll = 'http://localhost/sparqapi/api/';
private apiUrl = environment.apiEndpoint;
constructor(private _http: HttpClient,
private _aws:AwsService) { }
getAllMasterData(TableName:string): Observable<any> {
return this._http.post<any>(this.apiUrl+"getListOfMaster", { "master_name":TableName })
.pipe(
catchError(this.handleError('role', []))
)
}
getEntityListMasterDetails(): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.get<any[]>(this.apiUrl + "getListOfLenders");
}
getTemplateIDLenderDetails(temp_id: number): Observable<any>{
// Add safe, URL encoded search parameter if there is a search term
return this._http.post<any[]>(this.apiUrl + "getTemplateLenders", {'template_id': temp_id });
}
getProductsMasterListDetails(): Observable<any> {
// return this._http.get<any[]>(this.apiUrl + "getListOfProducts ");
return this._http.post<any[]>(this.apiUrl + "getListOfMaster", { "master_name":"PRODUCTS"});
}
get_template_mapping_List(entity_id): Observable<any> {
return this._http.get<any[]>(this.apiUrl + "getTemplateMappingDetailsV2?entity_id="+entity_id);
}
getCustomerSegmentsMasterListDetails(): Observable<any> {
// return this._http.get<any[]>(this.apiUrl + "getListOfCustomerSegments");
return this._http.post<any[]>(this.apiUrl + "getListOfMaster", { "master_name":"CUSTOMERSEGMENT"});
}
loadPDTemplates(map_id: any): Observable<any>{
console.log(map_id)
return this._http.get<any[]>(this.apiUrl + "getTemplateFormsV2?map_id="+map_id);
//return this._http.get<any[]>(this.apiUrl + "getTemplateFormsV2?map_id=1");
//return this._http.post<any[]>(this.apiUrl + "getTemplateFormsV2", {"records":{"entity_id":entity_id,"product_id":formValues[0].fk_product_id,"customer_segment_id":formValues[0].fk_customer_segment}} );
// return this._http.post<any[]>(this.apiUrl + "getTemplateFormsV2", {"records":{"entity_id":"42","product_id":"24","customer_segment_id":"5"}} );
}
saveupdatejsondetails(mapid: any,formid:any,json:any): Observable<any>{
return this._http.post<any[]>(this.apiUrl + "saveAndUpdateTemplateFormsV2", {"records" : {"map_id": mapid,"form_id": formid, "json":json }});
}
savedetails(formValues: any): Observable<any>{
return this._http.post<any[]>(this.apiUrl + "saveTemplateMappingDetailsV2", {"records":{"entity_id":"5","product_id":formValues.temp_lender[0].fk_product_id,"customer_segment_id":formValues.temp_lender[0].fk_customer_segment}} );
}
getLenderMasterListDetails(): Observable<any> {
return this._http.get<any[]>(this.apiUrl + "getListOfLenders");
}
getCompaniesListsForBusiness(map_id): Observable<any> {
return this._http.get<any[]>(this.apiUrl + "getBuinessGroupForms?map_id="+map_id);
}
disableform(form_id: any,map_id:any,disabled:any): Observable<any>{
return this._http.post<any[]>(this.apiUrl + "disableformV2", {"records" : {"form_id":form_id,"map_id":map_id,"is_form_disabled":disabled}});
}
questionsjson(form_id: any,map_id:any){
return this._http.get<any[]>(this.apiUrl + "questionsV2?form_id="+form_id+"&map_id="+map_id);
}
private extractData(res : Response) {
let Response = res['_body'];
Response = JSON.parse(Response);
return Response['dataStatus'] === true
? Response['records']
: [];
}
/**
* TO Handle The Error
*/
private handleError<T>(operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
return of(result as T);
};
}
}

View File

@ -0,0 +1,71 @@
<mat-card class="parent_mat_card">
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap style="padding-top:1%">
<div fxFlex="80%" style="padding-left: 250px;">
<mat-card-title><span style="font-size:24px"> Section List Edit Items (Enable / Disable)</span></mat-card-title>
</div>
</div>
<mat-card-content style="max-height:100% !important;">
<div fxLayout="row wrap" class="child_mat_card">
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.is_form_disabled == 1 ? '#d5d5d5' : '#4caf50' ,'color':'#fff'}" >
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center" (click)="formButton.is_form_disabled == 1 ? null : OnSelectDirectForms(formButton,quesIndex)" >{{quesIndex+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;" (click)="formButton.is_form_disabled == 1 ? null : OnSelectDirectForms(formButton,quesIndex)" >
{{ formButton.form_name }}
</div>
<!--<div fxFlex="20" align="end">
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div> -->
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item [disabled]="formButton.is_form_disabled == 0" (click)="OnSelectform(formButton,quesIndex,0)">
<mat-icon>done</mat-icon>
<span>Enable</span>
</button>
<button mat-menu-item [disabled]="formButton.is_form_disabled == 1" (click)="OnSelectform(formButton,quesIndex,1)">
<mat-icon>clear</mat-icon>
<span>Disable</span>
</button>
</mat-menu>
</mat-card-header>
</mat-card>
<div class="pad"> <mat-menu #menu="matMenu" class="remove-padding">
<button mat-menu-item>Enable</button>
<button mat-menu-item>Disable</button>
</mat-menu> </div>
<mat-card fxFlex.xs="80" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let photoButton of photographButtons;let quesIndex=index" [ngStyle]="{'background-color':photoButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(photoButton)">
<mat-card-header>
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{actualQuestions+1}}</span>
<div fxFlex="100" align="left" style="padding:15px !important;">
{{ photoButton.form_name }}
</div>
<!--<div fxFlex="20" align="end">
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div> -->
</mat-card-header>
</mat-card>
</div>
</mat-card-content>
<!-- <mat-card-actions align="end"> -->
<!-- <button matTooltip="Complete Discussion" matTooltipPosition="above" [disabled]="actualQuestions==0 || actualQuestions!=answeredQuestions || currentPDStatus===false" mat-raised-button color="primary" (click)="pdStatusDialogue(pdStatusCheck.COMPLETED,2);"><span>{{currentPDStatus === true ? 'COMPLETE':'COMPLETED' }}</span></button>
</mat-card-actions> -->
</mat-card>
<notifier-container></notifier-container>

View File

@ -0,0 +1,99 @@
// .child_mat_card mat-card {
// margin: 2 0%;
// }
::ng-deep .mat-dialog-container{
overflow: hidden !important;
}
::ng-deep .mat-card-header-text{
margin:0px !important;
}
.mat-purple{
background-color: gray !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-card.parent_mat_card > {
mat-card-header {
display: flex;
flex-direction: column;
}
mat-card-content {
min-height:auto;
max-height:52vh;
overflow:auto;
}
::ng-deep .mat-menu-content {
padding-top: 0px !important;
padding-bottom: 0px !important;
}
.mat-menu-item{
line-height:35px;
height:35px;
}
.user-thumb {
position: absolute;
bottom: -35%;
// img {
// border: 5px solid $white;
// border-radius: 100%;
// height: 75px;
// width: 75px;
// }
}
// @media only screen and (max-width:319px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:320px) and (max-width:767px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:768px) and (max-width:1023px) {
// mat-card-content {
// max-height: 350px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:1024px) and (max-width:1899px) {
// mat-card-content {
// max-height: 400px;
// overflow: auto;
// }
// }
// @media only screen and (min-width:1900px) {
// mat-card-content {
// max-height: 500px;
// overflow: auto;
// }
// }
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
mat-card .child_mat_card > mat-card {
border-radius: 0px 0px 0px 15px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
border: 1px solid lavender;
&:hover {
cursor: pointer;
// background-color: #e00201 !important;
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
}
.my-disable{
pointer-events:none;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SelectionListViewComponent } from './selection-list-view.component';
describe('SelectionListViewComponent', () => {
let component: SelectionListViewComponent;
let fixture: ComponentFixture<SelectionListViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SelectionListViewComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SelectionListViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,260 @@
import {Component, ViewChild, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core';
import {FormBuilder, FormGroup, Validators, FormControl, FormArray, AbstractControl} from '@angular/forms';
import {ActivatedRoute, Router} from '@angular/router';
import {MatDialog } from '@angular/material';
import {NotifierService} from 'angular-notifier';
import {ListPdComponent} from '../../personal-discussion/manage-pd/list-pd/list-pd.component';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { MasterService } from '../master.service';
import { EditTemplateComponent } from '../edit-template/edit-template.component';
import { LenderProductSegMappingComponent } from '../lender-product-seg-mapping/lender-product-seg-mapping.component';
@Component({
selector: 'app-selection-list-view',
templateUrl: './selection-list-view.component.html',
styleUrls: ['./selection-list-view.component.scss']
})
export class SelectionListViewComponent implements OnInit {
public startPD: string;
public mainApplicantName: string;
public randomString: string;
//public remarks: string;
errorMessage: any;
selectedCategory: any = [];
categoryList: any = [];
pdMasterList: any = [];
pdFullDetails:any=[];
// category static form buttons
categoryFormButtons: any;
formsCategoryEnable: boolean = false;
selectedFormsCategory: any;
// create values for status check
pdStatusCheck: any = {
"DRAFT": 'DRAFT',
"TRIGGERED": 'TRIGGERED',
"ALLOCATED": 'ALLOCATED',
"SCHEDULED": 'SCHEDULED',
"INPROGRESS": 'INPROGRESS',
"COMPLETED": 'COMPLETED',
"QC_COMPLETED": 'QC_COMPLETED',
};
currentPDStatus: boolean;
actualQuestions: number;
answeredQuestions: number;
private notifier: NotifierService;
vendor_status_arr: any = [];
photographButtons: any[];
formvalue: any;
entity_id: string;
map_id: any;
Record: any = [];
isDisabled:any =true;
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private masterService: MasterService,
private _pd: PdTrigerService,private loaderService:LoaderService) {
this.startPD = this.route.snapshot.params['pdid'];
this.randomString = this.route.snapshot.params['rdmstr'];
// console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']);
this.notifier = notifier;
this.currentPDStatus = false;
this.isDisabled = true;
}
ngOnInit() {
this.masterService.list_2_observable$.subscribe(res=> {
console.log("nav list 3",res)
this.formvalue = res
})
// this.listPDComponent.showListView(false);
// const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
// const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');
// if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) {
// // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
// // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
// }
this.loadTemplates();
//this.getCreditPDTemplate();
}
// getCreditPDTemplate() {
// // let params = { "fk_entity_id":this.pddetails.fk_lender_id,"fk_product_id":this.pddetails.fk_product_id,"pd_form_id":this.pddetails.pd_id }
// let params = { "fk_entity_id":"","fk_product_id":"","pd_form_id":"24","fk_pd_id": this.startPD }
// this._pd.loadCreditPDTemplate(params).subscribe(result=> {
// let creditTemplate:any = null;
// if(result['dataStatus']) {
// if(result.hasOwnProperty('records') && result['records']) {
// creditTemplate = result['records'];
// }
// }
// localStorage.setItem("dynamicQuesTemplate",JSON.stringify(creditTemplate));
// })
// }
isMac(): boolean {
let bool = false;
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
bool = true;
}
return bool;
}
isOver(): boolean {
return window.matchMedia(`(max-width: 960px)`).matches;
}
// load templates details
loadTemplates(){
this.formvalue
console.log(this.formvalue.template_lender_map_id)
this.entity_id = localStorage.getItem('entity_id')
console.log( this.entity_id)
let map_id = localStorage.getItem('map_id');
console.log(map_id)
// console.log('start pd component inside - loadTemplates params are,',startID,type,randomString);
this.masterService.loadPDTemplates(this.formvalue.template_lender_map_id).subscribe(
data => {
console.log("after reponse = ", data);
//console.log("after reponse = ", data.records.pdmaster_details);
if (data.status == 200) {
this.categoryFormButtons = data.records[0].forms
this.map_id = data.records[0].map_id
localStorage.setItem('map_id',this.map_id);
}
});
}
// load pd status change dialogue
pdStatusDialogue(status: string, checkType: number): void {
// const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
// data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString,pd_type:this.pdMasterList.fk_pd_type },
// disableClose: true,
// minWidth:'30%',
// maxWidth:'40%',
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// if(dataresult.update_status==true){
// setTimeout(()=>{
// checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
// let data = {
// "pd_id": this.startPD,
// "regenerate":0,
// "random_string":this.randomString
// };
// },2000)
// // this._pd.archivePDImages(data).subscribe(data => {
// // })
// let data1 = {
// "pd_id": this.startPD,
// "regenerate":0,
// "random_string":this.randomString
// };
// this._pd.photoPDFDownload(data1).subscribe(data => {
// })
// }
// else {
// checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
// }
// if(checkType == 2){
// // this.loadTemplates(this.startPD,2,this.randomString);
// }
// });
}
redirect(){
//this.router.routeReuseStrategy.shouldReuseRoute = () => false;
//this.router.onSameUrlNavigation = 'reload';
this.router.navigate(['template2/lenderlist']);
setTimeout(()=>{ //<<<---using ()=> syntax
window.location.reload()
}, 1);
//this.router.navigate([ 'template2/lenderlist'], { relativeTo: this.route });
}
// start
// direct form based questions
OnSelectDirectForms(details: any,id:any) {
console.log(details)
console.log(details.is_group_form)
localStorage.setItem('form_id',details.form_id);
if(details.is_group_form == 1){
this.masterService.list_3.next(details);
console.log(id)
this.router.navigate(['Group-form'], { relativeTo: this.route });
}else{
this.masterService.list_3.next(details);
console.log(id)
//this.router.navigate(['Group-form'], { relativeTo: this.route });
this.router.navigate(['Edit-template'], { relativeTo: this.route });
}
}
OnSelectform(details,index,disable_key){
console.log(details)
console.log(index)
let form_id = details.form_id;
let map_id = this.formvalue.template_lender_map_id;
let disabled = disable_key
this.masterService.disableform(form_id,map_id,disabled).subscribe(
dataresult => {
if (dataresult.status == 200) {
console.log(dataresult);
this.notifier.notify('success', 'Your Changes Updated.!');
this.loadTemplates();
}
else {
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
this.errorMessage = "Something Went Wrong Try Again.!";
}
}, error => {
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
});
}
ngOnDestroy(): void {
// this.listPDComponent.showListView(true);
}
// load pd view component
loadPdViewCompoent() {
this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}

View File

@ -0,0 +1,13 @@
import { Template2Module } from './template2.module';
describe('Template2Module', () => {
let template2Module: Template2Module;
beforeEach(() => {
template2Module = new Template2Module();
});
it('should create an instance', () => {
expect(template2Module).toBeTruthy();
});
});

View File

@ -0,0 +1,163 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { Template2Routes } from './template2.routing';
import { LenderListComponent } from './lender-list/lender-list.component';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
import { FlexLayoutModule } from '@angular/flex-layout';
import { EntityService } from './../settings/service/entity/entity.service';
import { MasterService } from './master.service';
import { CKEditorModule } from 'ng2-ckeditor';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import {FileUploadModule} from 'ng2-file-upload/ng2-file-upload';
import {TreeModule} from 'angular-tree-component';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {NgxSpinnerModule} from 'ngx-spinner'
import {
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,
MatListModule, MatMenuModule,
MatCheckboxModule,MatTabsModule,
MatExpansionModule,
MatChipsModule,
MatFormFieldModule
} from '@angular/material';
import {A11yModule} from '@angular/cdk/a11y';
import {PortalModule} from '@angular/cdk/portal';
import {CdkStepperModule} from '@angular/cdk/stepper';
import {CdkTableModule} from '@angular/cdk/table';
import {CdkTreeModule} from '@angular/cdk/tree';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { MatTooltipModule } from '@angular/material/tooltip';
import { LenderProductSegMappingComponent } from './lender-product-seg-mapping/lender-product-seg-mapping.component';
import { SelectionListViewComponent } from './selection-list-view/selection-list-view.component';
import { EditTemplateComponent } from './edit-template/edit-template.component';
import {
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonToggleModule,
MatDatepickerModule,
MatDividerModule,
MatGridListModule,
MatNativeDateModule,
MatProgressSpinnerModule,
MatRippleModule,
MatSidenavModule,
MatSliderModule,
MatSnackBarModule,
MatStepperModule,
MatTreeModule,
} from '@angular/material';
import { FormGroupComponent } from './form-group/form-group.component';
const customNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 5000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
A11yModule,
PortalModule,
CdkStepperModule,
CdkTableModule,
CommonModule,
CdkTreeModule,
PdfViewerModule,FileUploadModule,TreeModule,NgxDatatableModule,NgxSpinnerModule,
CKEditorModule,
NotifierModule.withConfig(customNotifierOptions),
FlexLayoutModule,
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
MatCheckboxModule,
MatTooltipModule,
MatTabsModule,
MatChipsModule,
MatExpansionModule,
MatSlideToggleModule,
FormsModule,
NgxMatSelectSearchModule,
ReactiveFormsModule,
MatFormFieldModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonToggleModule,
MatDatepickerModule,
MatDividerModule,
MatGridListModule,
MatNativeDateModule,
MatProgressSpinnerModule,
MatRippleModule,
MatSidenavModule,
MatSliderModule,
MatSnackBarModule,
MatStepperModule,
MatTreeModule,
RouterModule.forChild(Template2Routes),
],
declarations: [LenderListComponent, LenderProductSegMappingComponent, SelectionListViewComponent, EditTemplateComponent, FormGroupComponent],
entryComponents: [EditTemplateComponent],
exports: [
EditTemplateComponent
],
providers : [
MasterService,EditTemplateComponent
]
})
export class Template2Module { }

View File

@ -0,0 +1,93 @@
import { Routes } from '@angular/router';
import { EditTemplateComponent } from './edit-template/edit-template.component';
import { FormGroupComponent } from './form-group/form-group.component';
import { LenderListComponent } from './lender-list/lender-list.component';
import { LenderProductSegMappingComponent } from './lender-product-seg-mapping/lender-product-seg-mapping.component';
import { SelectionListViewComponent } from './selection-list-view/selection-list-view.component';
import { Template2Module } from './template2.module';
export const Template2Routes: Routes = [
{
path: '',
redirectTo: 'lenderlist',
pathMatch: 'full',
},{
path: '',
children: [
{
path: 'lenderlist',
component: LenderListComponent,
children: [
{
path: 'lps/:question-id',
component: LenderProductSegMappingComponent,
},
{
path: 'lps/:question-id/selection-list',
component: SelectionListViewComponent,
},
{
path: 'lps/:question-id/selection-list/Edit-template',
component: EditTemplateComponent,
},
{
path: 'lps/:question-id/selection-list/Group-form',
component: FormGroupComponent,
},
{
path: 'lps/:question-id/selection-list/Group-form/Edit-template',
component: EditTemplateComponent,
}
]
},
// {
// path: 'add',
// component: EntityAddComponent,
// },
// {
// path: 'edit',
// component: EntityEditComponent,
// }
]
}
// {
// path: '',
// pathMatch: 'full',
// redirectTo: 'lenderlist'
// },
// {
// path: 'lenderlist',
// component: LenderListComponent,
// children: [
// {
// path: 'lps/:question-id',
// component: LenderProductSegMappingComponent,
// },
// {
// path: 'lps/:question-id/selection-list',
// component: SelectionListViewComponent,
// },
// {
// path: 'lps/:question-id/selection-list/Edit-template',
// component: EditTemplateComponent,
// },
// {
// path: 'lps/:question-id/selection-list/Group-form',
// component: FormGroupComponent,
// },
// {
// path: 'lps/:question-id/selection-list/Group-form/Edit-template',
// component: EditTemplateComponent,
// }
// ]
// }
]

View File

@ -0,0 +1,315 @@
{
"section_id":"1",
"section_name":"Borrower & Guarantor Details",
"onsubmit":null,
"questions":[
{
"question":[{
"question":"Borrower Type",
"question_key":"borrower_type",
"type":"1",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"relationship",
"expression":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"value_keys":[
"borrower_type"
],
"questions":[
{
"question":"Numbers of years for which the business has been running",
"question_key":"numbers_of_years_business_running",
"type":"1",
"field_width":"45",
"field_type":"num",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"validations",
"validations":[{
"value_keys":["borrower_type"],
"value":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"validation_to":"borrower_age",
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required"
}]}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Name",
"question_key":"borrower_name",
"type":"1",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"questions_level_two":[
{
"question":"Mobile Number",
"question_key":"mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10}",
"message":"Mobile number should be 10 digit",
"value":null
}
]
}
],
"is_repeatable":"2",
"group_key":"mobile_numbers",
"group_title":"Mobile Number"
},
{
"question":"Entity Type",
"question_key":"entity_type",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"relationship",
"expression":"(String('entity_type').toLowerCase() == String('individual'))",
"value_keys":[
"entity_type"
],
"questions":[
{
"question":"Age",
"question_key":"borrower_age",
"type":"1",
"field_type":"num",
"field_width":"50",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]},
{
"insert_index":"relationship",
"expression":"(String('entity_type').toLowerCase() == String('individual'))",
"value_keys":[
"entity_type"
],
"questions":[
{
"question":"Met / Not Met",
"question_key":"borrower_met",
"type":"2",
"field_width":"20",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"question_label",
"expression":"(function () {let label= '';(String('entity_type').toLowerCase().includes('individual')) ? label= 'Number of years the borrower has been in this business.' : label = 'Number of years for which the business has been running';return label}())",
"value_keys":[
"entity_type"
],
"insert_control":"numbers_of_years_business_running"
},
{
"purpose":"validations",
"validations":[{
"value_keys":["borrower_type"],
"value":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"validation_to":"borrower_age",
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required"
}]}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Designation",
"question_key":"designation",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Relationship to",
"question_key":"relationship_to",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Relationship",
"question_key":"relationship",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_key":"borrower_details",
"group_title":"Borrower Details"},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,721 @@
{
"section_id": "10",
"section_name": "Financial Information",
"onsubmit": [
{
"expression": "(function (){let sum_val=null;let ques_key=[];if(!control || control == undefined || control == null){return true};control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())",
"group_key": "financial_info",
"key_name": "fy",
"msg": "Financial Year already entered earlier"
}
],
"questions": [
{
"question":"Is the Financial information available?",
"question_key":"financial_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"financial_info_available",
"expression":"(String('financial_info_available') && String('financial_info_available').toLowerCase() == String('yes'))",
"value_keys":[
"financial_info_available"
],
"questions":[
{
"question": "Net Profit / (Net Loss) (Rs)",
"question_key": "net_profit_rs",
"place_holder": "Enter the text",
"type": "1",
"field_width": "45",
"api_properties": null,
"answers": null,
"is_repeatable": null,
"field_type": "numtoword",
"validations": [
],
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "((Number(net_profit_rs)/Number(sales_amount))*100).toFixed(2)",
"value_keys": [
"sales_amount",
"net_profit_rs"
],
"insert_control": "net_profit_to_sales_percent"
}
]
},
{
"question": "Net Profit or (Net Loss) to Sales % ",
"question_key": "net_profit_to_sales_percent",
"place_holder": "Enter number",
"type": "1",
"field_width": "45",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(Number(sales_amount)*Number(net_profit_to_sales_percent))/100",
"value_keys": [
"sales_amount",
"net_profit_to_sales_percent"
],
"insert_control": "net_profit_rs"
}
],
"is_repeatable": null,
"field_type": "num",
"validations": [
{
"name": "max",
"validator": "100",
"isactive": "1",
"message": "Number must be less than 100",
"value": null
}
]
},
{
"question": "Sales / Revenue (Rs)",
"sub_title": "Particulars of Financials for Latest Year as per person met during PD visit",
"question_key": "sales_amount",
"place_holder": "Enter text",
"type": "1",
"field_width": "100",
"field_type": "numtoword",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(function (){let final_value; Number(net_profit_to_sales_percent) ? final_value = (Number(sales_amount)*Number(net_profit_to_sales_percent))/100 : '';return final_value}())",
"value_keys": [
"sales_amount",
"net_profit_to_sales_percent"
],
"insert_control": "net_profit_rs"
},
{
"purpose": "answer_value",
"expression": "(function (){let final_value; Number(net_profit_rs) ? final_value = (Number(net_profit_rs)/Number(sales_amount))*100 : '';return final_value.toFixed(2)}())",
"value_keys": [
"sales_amount",
"net_profit_rs"
],
"insert_control": "net_profit_to_sales_percent"
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Does the business have any working capital facility from any lender other than Moneywise?",
"question_key": "is_any_other_working_captial_facility",
"type": "2",
"field_width": "45",
"answers": [
{
"answer": "Yes",
"answer_id": "Yes"
},
{
"answer": "No",
"answer_id": "No"
}
],
"api_properties": null,
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "is_any_other_working_captial_facility",
"expression": "(String('is_any_other_working_captial_facility') === String('Yes'))",
"value_keys": [
"is_any_other_working_captial_facility"
],
"questions": [
{
"question": "Details of above facilities need to be entered",
"question_key": "facility_details_specify",
"type": "7",
"placeholder": "Enter the text",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "is_any_other_working_captial_facility",
"validations": [
]
},
{
"question": "Facility details i.e. Letter of Credit/ Bank guarantee, CC limit etc.",
"question_key": "facility_details_other_lender",
"type": "3",
"field_width": "45",
"answers": [
{
"answer": "Letter of Credit",
"answer_id": "Letter of Credit"
},
{
"answer": "Bank guarantee",
"answer_id": "Bank guarantee"
},
{
"answer": "CC limit",
"answer_id": "CC limit"
},
{
"answer": "Others",
"answer_id": "Others"
}
],
"api_properties": null,
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "facility_details_other_lender",
"expression": "(String('facility_details_other_lender').toLowerCase() == String('others'))",
"value_keys": [
"facility_details_other_lender"
],
"questions": [
{
"question": "Specify Facility details",
"question_key": "facility_details_other",
"type": "1",
"field_width": "45",
"field_type": "string",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "facility_details_other_lender",
"validations": []
}
]
}
]
}
],
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "is_any_other_working_captial_facility",
"validations": [
]
}
]
}
]
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Increase / Decrease in Turnover for Broken Period %",
"question_key": "broken_period_turnover_percent",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Turnover for Broken Period in PY (Rs)",
"question_key": "broken_period_turnover_py",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)",
"value_keys": [
"broken_period_turnover_py",
"broken_period_turnover_cy"
],
"insert_control": "broken_period_turnover_percent"
}
],
"is_repeatable": null,
"field_type": "numtoword",
"validations": [
]
},
{
"question": "Turnover for Broken Period in CY (Rs)",
"question_key": "broken_period_turnover_cy",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)",
"value_keys": [
"broken_period_turnover_py",
"broken_period_turnover_cy"
],
"insert_control": "broken_period_turnover_percent"
}
],
"is_repeatable": null,
"field_type": "numtoword",
"validations": [
]
},
{
"question": "No of Months",
"question_key": "broken_period_no_of_months",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Broken Period starting to (Date)",
"question_key": "broken_period_to_month",
"type": "1",
"place_holder": "DD-MM-YYYY (Eg 03-12-2020)",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())",
"value_keys": [
"broken_period_to_month",
"broken_period_from_month"
],
"insert_control": "broken_period_no_of_months"
}
],
"is_repeatable": null,
"field_type": "string",
"validations": [
]
},
{
"question": "Broken Period starting from (Date)",
"question_key": "broken_period_from_month",
"type": "1",
"field_width": "45",
"place_holder": "DD-MM-YYYY (Eg 05-02-2020)",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())",
"value_keys": [
"broken_period_to_month",
"broken_period_from_month"
],
"insert_control": "broken_period_no_of_months"
}
],
"is_repeatable": null,
"field_type": "string",
"validations": [
]
},
{
"question": "Inventory Days as per CM Discussion",
"question_key": "inventory_days_cm",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Creditor Days as per CM Discussion",
"question_key": "creditor_days_cm",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Debtor Days as per CM Discussion",
"question_key": "debtor_days_cm",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": [
{
"question": "Enter FY",
"question_key": "fy",
"type": "3",
"field_width": "45",
"answers": [],
"answer_value": "GET_FY_YEARS",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Sales / Revenue (Rs)",
"question_key": "sales_revenue",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)",
"value_keys": [
"sales_revenue",
"net_profit"
],
"insert_control": "net_profit_sales_percent"
},
{
"purpose": "answer_value_arr",
"arr_include": [
"py",
"now"
],
"expression": "((Number(sales_revenue[now])-Number(sales_revenue[py]))/Number(sales_revenue[py]))*100",
"value_keys": [
"sales_revenue"
],
"insert_control": "sales_py"
},
{
"purpose": "answer_value_arr",
"arr_include": [
"py",
"now"
],
"expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)",
"value_keys": [
"net_profit_sales_percent"
],
"insert_control": "netprofit_py_percent"
}
],
"is_repeatable": null,
"field_type": "numtoword",
"validations": [
]
},
{
"question": "Net Profit / (Net Loss) (Rs) ",
"question_key": "net_profit",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value",
"expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)",
"value_keys": [
"sales_revenue",
"net_profit"
],
"insert_control": "net_profit_sales_percent"
},
{
"purpose": "answer_value_arr",
"arr_include": [
"py",
"now"
],
"expression": "((Number(net_profit[now])-Number(net_profit[py]))/Number(net_profit[py]))*100",
"value_keys": [
"net_profit"
],
"insert_control": "netprofit_py"
},
{
"purpose": "answer_value_arr",
"arr_include": [
"py",
"now"
],
"expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)",
"value_keys": [
"net_profit_sales_percent"
],
"insert_control": "netprofit_py_percent"
}
],
"is_repeatable": null,
"field_type": "numtoword",
"validations": [
]
},
{
"question": "Net Profit or (Net Loss) to Sales % ",
"question_key": "net_profit_sales_percent",
"type": "1",
"is_disabled": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": [
{
"purpose": "answer_value_arr",
"arr_include": [
"py",
"now"
],
"expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)",
"value_keys": [
"net_profit_sales_percent"
],
"insert_control": "netprofit_py_percent"
}
],
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "% Variation in Sales over PY",
"question_key": "sales_py",
"type": "1",
"is_disabled": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "% Variation in Net Profit over PY",
"question_key": "netprofit_py",
"type": "1",
"is_disabled": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Variation in Net Profit % over PY",
"question_key": "netprofit_py_percent",
"type": "1",
"is_disabled": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Debtor Days as per CET",
"sub_title": "In Case of credit sales, what is the average no. of days taken to receive the money?",
"question_key": "debtor_days_cet",
"type": "1",
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Creditor Days as per CET",
"sub_title": "In Case of credit purchases, what is the average no. of days taken to pay the money?",
"question_key": "creditor_days_cet",
"type": "1",
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
},
{
"question": "Inventory Days as per CET",
"sub_title": "What is the average no. of days for which stock lies unsold during the year?",
"question_key": "inventory_days_cet",
"type": "1",
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
]
}
],
"is_repeatable": "1",
"group_key": "financial_info",
"group_title": "Financial Information"
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
},
{
"question": "Number of financial years for which we have financials",
"question_key": "no_of_financial_years",
"place_holder": "Enter the number",
"type": "1",
"field_width": "45",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
{
"name": "pattern",
"isactive": "1",
"validator": "[0-9]*",
"message": "Numeric only ",
"value": null
}
]
}
]
}]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
}],
"validations":[
]
},
{
"question_key": "common_remarks",
"question": "Remarks",
"place_holder": "Enter the text",
"type": "7",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}
]
}

View File

@ -0,0 +1,359 @@
{
"section_id":"11",
"section_name":"Supplier details",
"onsubmit":null,
"questions":[
{
"question":"Is the Supplier information available?",
"question_key":"supplier_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"supplier_info_available",
"expression":"(String('supplier_info_available') == String('No'))",
"value_keys":[
"supplier_info_available"
],
"questions":[
{ "question":"Reason",
"question_key":"supplier_not_available_reason",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
]
} ] } ] },
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"supplier_info_available",
"expression":"(String('supplier_info_available') == String('Yes'))",
"value_keys":[
"supplier_info_available"
],
"questions":[
{
"question":[{
"question":"Raw Material Name/ Trading Product Name/ Service Name",
"question_key":"provider_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Supplier Name",
"question_key":"supplier_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person name",
"question_key":"contact_person_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person Designation",
"question_key":"contact_person_designation",
"type":"8",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMPANYRELATIONSHIPS"
},
"fields":[
"company_relationship_id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person Mobile Number",
"question_key":"contact_person_mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10,12}",
"message":"Mobile number should be 10-12 digit",
"value":null
}
]
},
{
"question":"STD Code",
"sub_title":"Contact Person Landline number",
"question_key":"person_stdcode",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{3,5}",
"message":"Maximum 5 digit allowed",
"value":null
}
]
},
{
"question":"Contact Person Landline number",
"question_key":"person_landline",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{6,8}",
"message":"Maximum 8 digit allowed",
"value":null
}
]
},
{
"question":"Payment Terms",
"question_key":"payment_type",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PAYMENTMODE"
},
"fields":[
"id",
"name"
]
},
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"payment_type",
"expression":"(String('payment_type') == String('3'))",
"value_keys":[
"payment_type"
],
"questions":[
{
"question":"No. of credit period provided by supplier",
"question_key":"credit_period_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
]
},
{
"question":"What % of total purchases are done on credit?",
"question_key":"credit_total_purchase",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"max",
"isactive":"1",
"validator":"100",
"message":"Percentage should lower or equal to '100'",
"value":null
}
]
}
]}]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
]
},
{
"question":"Payment Mode",
"question_key":"payment_mode",
"type":"3",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":[
{
"answer_id":"Payment made in Cash",
"answer":"Payment made in Cash"
},
{
"answer_id":"Payment made through Banking channels",
"answer":"Payment made through Banking channels"
},
{
"answer_id":"Payment made through Cash and Banking channels",
"answer":"Payment made through Cash and Banking channels"
}
],
"validations":[
]
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Supplier Details",
"group_key":"supplier_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,359 @@
{
"section_id":"12",
"section_name":"Clients details",
"onsubmit":null,
"questions":[
{
"question":"Is the Client information available?",
"question_key":"client_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"client_info_available",
"expression":"(String('client_info_available') == String('No'))",
"value_keys":[
"client_info_available"
],
"questions":[
{ "question":"Reason",
"question_key":"client_not_available_reason",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
]
} ] } ] },
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"client_info_available",
"expression":"(String('client_info_available') == String('Yes'))",
"value_keys":[
"client_info_available"
],
"questions":[
{
"question":[{
"question":"Trading Product/Service/Manufacturing Product name",
"question_key":"provider_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Client Name",
"question_key":"client_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person name",
"question_key":"contact_person_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person Designation",
"question_key":"contact_person_designation",
"type":"8",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMPANYRELATIONSHIPS"
},
"fields":[
"company_relationship_id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
]
},
{
"question":"Contact Person Mobile Number",
"question_key":"contact_person_mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10,12}",
"message":"Mobile number should be 10-12 digit",
"value":null
}
]
},
{
"question":"STD Code",
"sub_title":"Contact Person Landline number",
"question_key":"person_stdcode",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{3,5}",
"message":"Maximum 5 digit allowed",
"value":null
}
]
},
{
"question":"Contact Person Landline number",
"question_key":"person_landline",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{6,8}",
"message":"Maximum 8 digit allowed",
"value":null
}
]
},
{
"question":"Payment Terms",
"question_key":"payment_type",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PAYMENTMODE"
},
"fields":[
"id",
"name"
]
},
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"payment_type",
"expression":"(String('payment_type') == String('3'))",
"value_keys":[
"payment_type"
],
"questions":[
{
"question":"No. of days of credit period provided by client",
"question_key":"credit_period_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
]
},
{
"question":"What % of total sales are done on credit?",
"question_key":"credit_total_purchase",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"max",
"isactive":"1",
"validator":"100",
"message":"Percentage should lower or equal to '100'",
"value":null
}
]
}
]}]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
]
},
{
"question":"Payment Mode",
"question_key":"payment_mode",
"type":"3",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":[
{
"answer_id":"Payment made in Cash",
"answer":"Payment made in Cash"
},
{
"answer_id":"Payment made through Banking channels",
"answer":"Payment made through Banking channels"
},
{
"answer_id":"Payment made through Cash and Banking channels",
"answer":"Payment made through Cash and Banking channels"
}
],
"validations":[
]
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Client Details",
"group_key":"client_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,330 @@
{
"section_id": "13",
"section_name": "Stock details",
"onsubmit": [],
"questions": [
{
"question": "Is stock applicable to the business (Yes / No)",
"question_key": "stock_info_available",
"type": "2",
"field_width": "45",
"api_properties": null,
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('No'))",
"value_keys": [
"stock_info_available"
],
"questions": [
{
"question": "Reason",
"question_key": "stock_not_available_reason",
"type": "7",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": null,
"validations": [
]
}
]
}
]
},
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('Yes'))",
"value_keys": [
"stock_info_available"
],
"questions":[
{
"question": "Is the stock of finished goods observed, sufficient considering the size of operations",
"question_key": "estimated_uom",
"type": "3",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": [
{
"answer": "Yes",
"answer_id": "yes"
},
{
"answer": "No",
"answer_id": "no"
},
{
"answer": "Stock not required to be maintained",
"answer_id": "not applicable"
}
],
"validations": [
]
}
]
},
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('Yes'))",
"value_keys": [
"stock_info_available"
],
"questions": [
{
"question": [
{
"question": "Type of Stock",
"question_key": "stock_type",
"type": "3",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": [
{
"answer": "RM",
"answer_id": "RM"
},
{
"answer": "FG",
"answer_id": "FG"
},
{
"answer": "SFG",
"answer_id": "SFG"
}
],
"validations": [
]
},
{
"question": "Name of trading goods/manufacturing goods (raw material/finished goods)/ Service Provided",
"question_key": "provider_name",
"place_holder": "Enter text",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"validations": [
]
},
{
"question": "Stock",
"question_key": "provider_observed",
"type": "3",
"api_properties": null,
"answers": [
{
"answer": "Add Stock Details",
"answer_id": "yes"
},
{
"answer": "No Stock Observed",
"answer_id": "no"
}
],
"is_repeatable": null,
"validations": [
],
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "provider_observed",
"expression": "(String('provider_observed') === String('yes'))",
"value_keys": [
"provider_observed"
],
"questions": [
{
"question": "Estimated Quantity",
"question_key": "estimated_quantity",
"type": "1",
"field_width": "100",
"field_type": "num",
"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_quantity') === String(''))",
"validation_to": "estimated_stock_value",
"value_keys": [
"estimated_quantity",
"estimated_stock_value"
]
}
]
}
],
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
]
},
{
"question": "UOM",
"question_key": "estimated_uom",
"type": "3",
"field_width": "100",
"api_properties": {
"api": "getListOfMaster",
"api_method": "POST",
"params": {
"master_name": "UOM"
},
"fields": [
"uom_id",
"name"
]
},
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
]
},
{
"question": "Estimated value of stock observed",
"question_key": "estimated_stock_value",
"type": "1",
"field_type": "numtoword",
"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_quantity",
"value_keys": [
"estimated_stock_value"
]
}
]
}
],
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": []
}
]
}
]
}
]
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}
],
"is_repeatable": "1",
"group_title": "Stock details",
"group_key": "stock_details"
}
]
}
]
}
],
"is_repeatable": null,
"answers": [
{
"answer": "Yes",
"answer_id": "Yes"
},
{
"answer": "No",
"answer_id": "No"
}
],
"validations": [
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,118 @@
{
"section_id":"14",
"section_name":"Future Plans & Business Environments",
"onsubmit":null,
"questions":[
{
"question":"USP of the business- How is applicant's business different from others in the same line of business",
"question_key":"usp_of_business",
"type":"1",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Future plans for business expansion",
"question_key":"future_business_expansion",
"type":"1",
"field_type":"string",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Key competitors",
"question_key":"key_competitors",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Sucession plan- who will look after the business after applicant retire/are unable to run business due to any reason",
"question_key":"sucession_plan",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Brief of other group concerns/Business run by the applicants",
"question_key":"other_group_business_applicants",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,197 @@
{
"section_id": "15",
"section_name": "Existing Loan Obligations",
"onsubmit": null,
"questions": [
{
"question": [
{
"question": "Loan type",
"question_key": "loan_type",
"type": "1",
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Loan amount",
"question_key": "loan_amount",
"type": "1",
"field_type": "numtoword",
"field_width": "100",
"onchange_properties": null,
"api_properties": null,
"answers": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Lender name",
"question_key": "lender_name",
"type": "1",
"field_width": "100",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Loan taken by",
"question_key": "loan_taken_by",
"type": "1",
"field_width": "100",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Installment Amount",
"question_key": "instalment_amount",
"type": "1",
"field_width": "100",
"field_type": "numtoword",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Installment frequency",
"question_key": "instalment_frequency",
"type": "3",
"field_width": "100",
"api_properties": null,
"answers": [
{
"answer_id": "Daily",
"answer": "Daily"
},
{
"answer_id": "Every 12 days",
"answer": "Every 12 days"
},
{
"answer_id": "Every 15 days",
"answer": "Every 15 days"
},
{
"answer_id": "Monthly",
"answer": "Monthly"
},
{
"answer_id": "Every 3 months",
"answer": "Every 3 months"
},
{
"answer_id": "Every 6 months",
"answer": "Every 6 months"
},
{
"answer_id": "Yearly",
"answer": "Yearly"
}
],
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Original tenure in months",
"question_key": "original_tenure_months",
"type": "1",
"field_width": "100",
"field_type": "num",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(current_tenure_months))",
"value_keys":[
"original_tenure_months", "current_tenure_months"
],
"insert_control":"elapsed_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Current balance tenure in months",
"question_key": "current_tenure_months",
"type": "1",
"field_type": "num",
"field_width": "100",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(current_tenure_months))",
"value_keys":[
"original_tenure_months", "current_tenure_months"
],
"insert_control":"elapsed_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Elapsed tenure in mths",
"question_key": "elapsed_tenure_months",
"type": "1",
"field_width": "45",
"field_type": "num",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(elapsed_tenure_months))",
"value_keys":[
"original_tenure_months", "elapsed_tenure_months"
],
"insert_control":"current_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
}
],
"is_repeatable": "1",
"group_title": "Existing Loan Obligations",
"group_key": "existing_loan_details"
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,228 @@
{
"section_id":"16",
"section_name":"Family Members Involved in Business",
"onsubmit":null,
"questions":[
{
"question":"Is any other family member involved in the business",
"question_key":"is_family_details_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_family_details_available",
"expression":"(String('is_family_details_available') == String('Yes'))",
"value_keys":[
"is_family_details_available"
],
"questions":[
{
"question":[
{
"question":"Name",
"question_key":"member_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Relationship",
"question_key":"relationship",
"place_holder":"Enter the text",
"type":"8",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"RELATIONSHIPS"
},
"fields":[
"relationship_id",
"name"
]
},
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[{
"insert_index":"relationship",
"expression":"(String('relationship').toLowerCase() == String('1'))",
"value_keys":[
"relationship"
],
"questions":[
{
"question": "Specify Facility details",
"question_key": "relationship_other",
"type": "1",
"field_width": "45",
"field_type": "string",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
}
]
}]
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Relation to Individual Stakeholders",
"question_key":"stakeholder_relation",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Relation to Company / Firm",
"question_key":"company_relation",
"place_holder":"Enter text",
"type":"8",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMPANYRELATIONSHIPS"
},
"fields":[
"company_relationship_id",
"name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Started Business (Yes / No)",
"question_key":"started_biz",
"place_holder":"Enter text",
"type":"2",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Family Members Involved in Business",
"group_key":"family_details"
}
]}]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,269 @@
{
"section_id":"17",
"section_name":"Neighbourhood Details",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Neighbour name",
"question_key":"neighbourhood_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Do you know about the applicant or their business?",
"question_key":"do_know",
"type":"3",
"api_properties":null,
"answers":[
{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
}
],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"As per you how long has this business been in operation",
"question_key":"know_business_operation",
"place_holder":"Enter the text",
"type":"2",
"api_properties":null,
"answers":[
{
"answer":"Know",
"answer_id":"yes"
},
{
"answer":"Do not know",
"answer_id":"no"
}
],
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties": [ {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"know_business_operation",
"expression":"(String('know_business_operation') === String('yes'))",
"value_keys":[
"know_business_operation"
],
"questions":[
{
"question":"Years",
"question_key":"how_long_do_know_in_year",
"type":"1",
"field_width":"100",
"field_type":"num",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_business_operation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ,
{
"question":"Months",
"question_key":"how_long_do_know_in_month",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_business_operation",
"answers":null,
"validations":[
]
}
] } ] }]
},
{
"question":"Who is the owner of organisation?",
"question_key":"know_organisation_owner",
"type":"2",
"api_properties":null,
"answers":[
{
"answer":"Know",
"answer_id":"yes"
},
{
"answer":"Do not know",
"answer_id":"no"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties": [ {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"know_organisation_owner",
"expression":"(String('know_organisation_owner') === String('yes'))",
"value_keys":[
"know_organisation_owner"
],
"questions":[
{
"question":"Who is the owner of the organisation",
"question_key":"organisation_owner",
"type":"4",
"field_width":"100",
"field_type":"num",
"api_properties": {
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_organisation_owner",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
] } ] }]
}
],
"is_repeatable":"1",
"group_title":"Neighbourhood Details",
"group_key":"neighbourhood_list"
},
{
"question":"Status of the neighbour check as per Credit Manager",
"question_key":"neighbourhood_status",
"type":"3",
"api_properties":null,
"answers":[
{
"answer":"Select",
"answer_id":""
},
{
"answer":"Positive",
"answer_id":"Positive"
},
{
"answer":"Negative",
"answer_id":"Negative"
},
{
"answer":"Could Not Verify",
"answer_id":"Could Not Verify"
}
],
"onchange_properties":[
{
"purpose":"validations",
"validations":[{
"value_keys":["neighbourhood_status"],
"value":"(String('neighbourhood_status').toLowerCase() != String('positive'))",
"validation_to":"neighbourhood_remarks",
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required"
}]}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Remarks",
"question_key":"neighbourhood_remarks",
"type":"7",
"placeholder":"Enter the remarks",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,53 @@
{
"section_id":"18",
"section_name":"Credit manager specific queries",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Question",
"question_key":"question",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
]
},
{
"question":"Answer",
"question_key":"answer",
"place_holder":"Enter the answer here",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
}
],
"is_repeatable":"1",
"group_title":"Query",
"group_key":"cm_queries"
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,218 @@
{
"section_id":"19",
"section_name":"Final remarks",
"onsubmit":null,
"questions":[
{
"question":"Customer Behaviour",
"question_key":"customer_behaviour",
"type":"3",
"field_width":"45",
"answers":null,
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"CUSTOMERBEHAVIOUR"
},
"fields":[
"customer_behaviour_id",
"description"
]
},
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"customer_behaviour",
"expression":"(String('customer_behaviour') == String('1'))",
"value_keys":[
"customer_behaviour"
],
"questions":[
{ "question":"Specify Customer behaviour",
"question_key":"customer_behaviour_other",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"customer_behaviour",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] }
]}] ,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is the location of the business suited to the nature of the business provided?",
"question_key":"business_location_suited",
"type":"3",
"field_width":"45",
"onchange_properties":null,
"api_properties":null,
"answers":[
{
"answer":"Well Suited",
"answer_id":"Well Suited"
},
{
"answer":"Fairly suited",
"answer_id":"Fairly suited"
},
{
"answer":"Not suited",
"answer_id":"Not suited"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Credit Manager recommendation (Positive/negative/ refer to credit)",
"question_key":"pd_officer_recommendation",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PDOFFICERRECOMMENDATIONS"
},
"fields":[
"pdofficer_recommendation_id",
"pdofficer_recommendation"
]
},
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"pd_officer_recommendation",
"expression":"(String('pd_officer_recommendation') == String('1'))",
"value_keys":[
"pd_officer_recommendation"
],
"questions":[
{ "question":"Specify Credit Manager Recommendation",
"question_key":"pd_officer_recommendation_other",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"pd_officer_recommendation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ,
{
"insert_index":"pd_officer_recommendation",
"expression":"(String('pd_officer_recommendation') != String('1')) && (String('pdofficer_recommendation') != String(''))",
"value_keys":[
"pd_officer_recommendation"
],
"questions":[
{
"question":[{
"question":"Reasons for marking PD status as Positive/negative/ refer to credit",
"question_key":"reason",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"pd_officer_recommendation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Remarks",
"group_title_shown":"0",
"group_key":"pd_officer_recommendation_remarks"
} ] }
] },
{
"purpose":"question_label",
"expression":"(function () {let label= 'Reasons for marking PD status as ';('pd_officer_recommendation' == '2') ? label+= 'Positive' : ('pd_officer_recommendation' == '3') ? label+= 'Negative' : ('pd_officer_recommendation' == '4') ? label+= 'Refer to Credit' : label+= 'Positive/negative/ refer to credit';return label}())",
"value_keys":[
"pd_officer_recommendation"
],
"insert_control":"reason",
"insert_group_key":"pd_officer_recommendation_remarks"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Common Remarks",
"question_key":"final_form_remarks",
"place_holder":"Enter the remarks here",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
}
]
}

View File

@ -0,0 +1,389 @@
{
"section_id":"2",
"section_name":"Address details",
"onsubmit":null,
"questions":[
{
"question":"Address at which PD was initiated",
"question_key":"initiated_address",
"type":"7",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is this the address where PD is done ?",
"question_key":"is_pd_done_on_initiated_address",
"type":"2",
"field_width":"45",
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_pd_done_on_initiated_address",
"expression":"(String('is_pd_done_on_initiated_address') == String('No'))",
"value_keys":[
"is_pd_done_on_initiated_address"
],
"questions":[
{
"question":"Choose the actual PD address",
"question_key":"alternative_address",
"place_holder":"",
"field_type":"string",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getSMCTempAddresses",
"api_method":"GET",
"params":{
"pdid":"VAR_PD_ID"
},
"fields":[
"display",
"display"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_pd_done_on_initiated_address",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}],
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Type of PD address",
"question_key":"address_type",
"type":"3",
"field_width":"90",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ADDRESSTYPE"
},
"fields":[
"address_type_id",
"address_type"
]
},
"answers":null,
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"address_type",
"expression":"(String('address_type') == String('1'))",
"value_keys":[
"address_type"
],
"questions":[
{
"question":"Specify the Address Type",
"question_key":"address_type_others",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"uom",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"PD locality",
"question_key":"pd_locality",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"LOCALITY"
},
"fields":[
"locality_id",
"locality_name"
]
},
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[{
"insert_index":"pd_locality",
"expression":"(String('pd_locality').toLowerCase() == String('1'))",
"value_keys":[
"pd_locality"
],
"questions":[
{
"question": "Specify Locality",
"question_key": "locality_other",
"type": "1",
"field_width": "45",
"field_type": "string",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
}
]
}]
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Approach to PD location*",
"question_key":"pd_location",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PDLOCATIONAPPROACH"
},
"fields":[
"pd_location_approach_id",
"description"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Comment on locality",
"question_key":"comment_locality",
"type":"3",
"field_width":"25",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMMENTSONLOCALITY"
},
"fields":[
"comments_on_locality_id",
"rating"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Estimated Area of the business",
"question_key":"business_estimated_area",
"type":"1",
"field_width":"30",
"field_type":"num",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"UOM",
"question_key":"uom",
"type":"8",
"field_width":"30",
"api_properties":null,
"answers":[
{
"answer":"Acres",
"answer_id":"Acres"
},
{
"answer":"Hectares",
"answer_id":"Hectares"
},
{
"answer":"Square Feet",
"answer_id":"Square Feet"
},
{
"answer":"Square Meters",
"answer_id":"Square Meters"
},
{
"answer":"Square Yards",
"answer_id":"Square Yards"
}
],
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"uom",
"expression":"(String('uom') == String('1'))",
"value_keys":[
"uom"
],
"questions":[
{
"question":"Specify the UOM",
"question_key":"uom_specify",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"uom",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,409 @@
{
"section_id":"2",
"section_name":"Loan details",
"onsubmit":null,
"questions":[
{
"question":"Loan amount applied for",
"question_key":"loan_amount",
"type":"1",
"field_type":"numtoword",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_fund_requirement",
"expression":" typeof(total_fund_requirement) == 'number' && (Number(total_fund_requirement) < Number(loan_amount))",
"value_keys":[
"total_fund_requirement","loan_amount"
],
"questions":[
{
"question":"Remarks on source of funds for balance amount required",
"question_key":"remarks_fund_source_balance",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
]
}
]
}]
}
],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Loan Tenure (in months)",
"question_key":"loan_tenure",
"type":"1",
"field_type":"num",
"field_width":"100",
"onchange_properties": null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Sub Product",
"question_key":"sub_product",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"SUBPRODUCTS"
},
"fields":[
"subproduct_id",
"name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"End use of loan",
"question_key":"end_use",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Total fund requirement",
"question_key":"total_fund_requirement",
"type":"1",
"field_width":"45",
"api_properties":null,
"field_type":"numtoword",
"answers":null,
"onchange_properties": [
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_fund_requirement",
"expression":" typeof(total_fund_requirement) == 'number' && (Number(total_fund_requirement) < Number(loan_amount))",
"value_keys":[
"total_fund_requirement","loan_amount"
],
"questions":[
{
"question":"Remarks on source of funds for balance amount required",
"question_key":"remarks_fund_source_balance",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
]
}
]
}]
}],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Is there a BT?",
"question_key":"is_transfer",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_transfer",
"expression":"(String('is_transfer') == String('Yes'))",
"value_keys":[
"is_transfer"
],
"questions":[
{
"question":"What is the amount of balance transfer",
"question_key":"balance_transfer_amount",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_transfer",
"answers":null,
"validations":[
]
},
{
"question":"Lender from where BT is done",
"question_key":"lender",
"type":"8",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BTLENDERLIST"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Top up amount",
"question_key":"topup_amount",
"type":"1",
"field_type":"numtoword",
"field_width":"45",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
}
]
}
]
}],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Type of property being Mortgaged",
"question_key":"property_type",
"type":"1",
"field_width":"45",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Name of Owner",
"question_key":"owner_name",
"type":"4",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Property Completion Stage",
"question_key":"construction_status",
"type":"1",
"field_width":"45",
"api_properties":null,
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[ {
"insert_index":"construction_status",
"expression":"(String('construction_status') != String(''))",
"value_keys":[
"construction_status"
],
"questions":[
{
"question":"Stage of Construction",
"question_key":"construction_stage",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"construction_status",
"answers":null,
"validations":[
]
}
]
}]
}
],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Estimated market value as per customer",
"question_key":"emv_per_customer",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Market Value Considered for LTV Calculation (Rs)",
"question_key":"ltv_market_value_calculation",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Address of the proposed property",
"question_key":"address",
"place_holder":"",
"field_type":"string",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getSMCTempAddresses",
"api_method":"GET",
"params":{
"pdid":"VAR_PD_ID"
},
"fields":[
"display",
"display"
]
},
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Property Usage",
"question_key":"property_usage",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Structure Type",
"question_key":"structure_type",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,267 @@
{
"section_id": "4",
"section_name": "General Business Information",
"onsubmit": null,
"questions": [
{
"question": [
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"default_index_if_len_one":true,
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
},
{
"question": "Type of Business Entity",
"question_key": "business_entity_type",
"type": "1",
"field_width": "45",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Type of Business activities",
"question_key": "select_business_activity_type",
"type": "1",
"field_width": "45",
"onchange_properties": null,
"api_properties": null,
"answers": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Area of Sale",
"question_key": "area_of_sale",
"type": "3",
"field_width": "45",
"api_properties": null,
"answers": [
{
"answer": "Within India",
"answer_id": "Within India"
},
{
"answer": "Export",
"answer_id": "Export"
},
{
"answer": "Both (within India and Export)",
"answer_id": "Both (within India and Export)"
}
],
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Is the business seasonal (Yes / No)",
"question_key": "seasonality",
"type": "2",
"field_width": "45",
"api_properties": null,
"answers": [
{
"answer": "Yes",
"answer_id": "Yes"
},
{
"answer": "No",
"answer_id": "No"
}
],
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "seasonality",
"expression": "(String('seasonality') == String('Yes'))",
"value_keys": [
"seasonality"
],
"questions": [
{
"question_key": "low_sale_month_reason",
"question": "Reason for Months in which sales/services is low?",
"place_holder": "Enter the text",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"is_subfield": "1",
"field_width": "45",
"parent_question_key": "seasonality",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
]
},
{
"question_key": "low_sale_month",
"question": "Months in which sales/services is low?",
"place_holder": "",
"type": "4",
"api_properties": null,
"answers": [
{
"answer_id": "January",
"answer": "January"
},
{
"answer_id": "February",
"answer": "February"
},
{
"answer_id": "March",
"answer": "March"
},
{
"answer_id": "April",
"answer": "April"
},
{
"answer_id": "May",
"answer": "May"
},
{
"answer_id": "June",
"answer": "June"
},
{
"answer_id": "July",
"answer": "July"
},
{
"answer_id": "August",
"answer": "August"
},
{
"answer_id": "September",
"answer": "September"
},
{
"answer_id": "October",
"answer": "October"
},
{
"answer_id": "November",
"answer": "November"
},
{
"answer_id": "December",
"answer": "December"
}
],
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"field_width": "45",
"is_subfield": "1",
"parent_question_key": "seasonality",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
]
}
]
}
]
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
}
],
"is_repeatable": "1",
"group_title": "Details of General Business Information",
"group_key": "business_entity"
},
{
"question_key": "common_remarks",
"question": "Remarks",
"place_holder": "Enter the text",
"type": "7",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}
]
}

View File

@ -0,0 +1,273 @@
{
"section_id":"5",
"section_name":"Key Stakeholders in Business",
"onsubmit":[
],
"questions":[
{
"question":[
{
"question":"Name of the Entity",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Entity Name Required",
"value":null
}
]
},
{
"question":"length",
"question_key":"stakeholder_length",
"type":"hidden",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string"
},
{
"question":"Name of key Stakeholder",
"question_key":"stakeholder_name0",
"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":"Share Holding (%)",
"question_key":"share_holding0",
"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":"Vintage in Current Business (in years)",
"question_key":"vintage_in_current_biz0",
"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_biz0",
"expression":"(total_work_exp0 > vintage_in_current_biz0)",
"value_keys":[
"total_work_exp0",
"vintage_in_current_biz0"
],
"questions":[
{
"question_key":"previous_experience_details0",
"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_biz0",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
{
"question":"Total Work Experience (in years)",
"question_key":"total_work_exp0",
"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_biz0",
"expression":"(total_work_exp0 > vintage_in_current_biz0)",
"value_keys":[
"total_work_exp0",
"vintage_in_current_biz0"
],
"questions":[
{
"question":"Previous Experience Details",
"question_key":"previous_experience_details0",
"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_exp0",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
{
"question":"Started Business (Yes / No)",
"question_key":"started_biz0",
"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
}
]
}
],
"is_repeatable":"1",
"group_title":"Details of Key Stakeholders in the Business",
"group_key":"key_stakeholders",
"form_name":"Key Stakeholders in Business"
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,139 @@
{
"section_id":"6",
"section_name":"Key Products and Business Contribution",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Key Product Name",
"question_key":"product_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Contribution to Business of the Product (%)",
"question_key":"contribution_business_product",
"place_holder":"Enter number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"max",
"validator":"100",
"isactive":"1",
"message":"Number must be less than 100",
"value":null
}
]
},
{
"question":"Remarks if any",
"question_key":"remarks",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
],
"onchange_properties":null
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Key Products and Business Contribution",
"group_key":"key_products_contribution"
},
{
"question":"Business Process Brief",
"question_key":"business_process",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties":null
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,131 @@
{
"section_id":"7",
"section_name":"Employee Strength",
"onsubmit":[],
"questions":[
{
"question":"Permanent Employees",
"sub_title":"No of Employees (As per person met)",
"question_key":"permanant_employees_person_met",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_person_met",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
]
},
{
"question":"Permanent Employees",
"sub_title":"No of Employees (Sighted by Credit Manager)",
"question_key":"permanant_employees_cm",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_cm",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
]
},
{
"question":"Permanent Employees",
"sub_title":"Approximate Salary Paid (Rs Per Month)",
"question_key":"permanant_employees_salary",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_salary",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_width":"45",
"validations":[
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,816 @@
{
"section_id":"8",
"section_name":"Business Assets",
"onsubmit":null,
"questions":[
{
"question":"Address",
"question_key":"initiated_address",
"type":"7",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":" Is this the business address?",
"question_key":"is_business_address",
"type":"2",
"field_width":"100",
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_business_address",
"expression":"(String('is_business_address') == String('Yes'))",
"value_keys":[
"is_business_address"
],
"questions":[
{
"question":"No of Months",
"question_key":"business_months",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":null,
"validations":[
]
},
{
"question":"No of Years",
"sub_title":"How Long has business been operated from visited premises? (Eg. If operating for 5 years and 4 months enter 5 in Years field and 4 in months field)",
"question_key":"business_years",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":null,
"validations":[
]
},
{
"question":"Was any business activities seen during visit?",
"question_key":"business_is_pd_visited",
"place_holder":"",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_is_pd_visited",
"expression":"(String('business_is_pd_visited') != String('')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_is_pd_visited",
"is_business_address"
],
"questions":[
{
"question":"Remarks",
"question_key":"business_pd_visited_remark",
"place_holder":"",
"field_type":"string",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_is_pd_visited",
"answers":null,
"validations":[
]
}
]
}
]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},
{
"question":"Ownership type",
"question_key":"business_ownership_type",
"place_holder":"",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Owned')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_ownership_type",
"is_business_address"
],
"questions":[
{
"question":"Approximate Market value",
"question_key":"business_approximate_market_value",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Owned by",
"question_key":"business_name_of_the_owner",
"type":"4",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Age of asset in years",
"question_key":"business_vintage",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"answer_value",
"expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_vintage)}())",
"value_keys":[
"business_vintage"
],
"insert_control":"business_purchase_year"
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Purchase year",
"question_key":"business_purchase_year",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"answer_value",
"expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_purchase_year)}())",
"value_keys":[
"business_purchase_year"
],
"insert_control":"business_vintage"
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
}
,
{
"question":"Is there a Loan Existing against this asset",
"question_key":"business_emi",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":[
{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}
],
"validations":[
]
}
]
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Rented')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_ownership_type",
"is_business_address"
],
"questions":[
{
"question":"Monthly Rent Amount",
"question_key":"business_monthly_rented_amt",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
}
]
}
]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[
{
"answer":"Owned",
"answer_id":"Owned"
},
{
"answer":"Rented",
"answer_id":"Rented"
}
],
"validations":[
]
}
]
}
]
}
],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Is there any other business asset available?",
"question_key":"asset_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"asset_info_available",
"expression":"(String('asset_info_available') == String('Yes'))",
"value_keys":[
"asset_info_available"
],
"questions":[
{
"question":[{
"question":"Asset Type",
"question_key":"business_assets_mode",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ASSETTYPE"
},
"fields":[
"id",
"name"
],
"filter_properties":{
"key_name":"flag",
"value":"1"
}
},
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_assets_mode",
"expression":"(String('business_assets_mode') == String('2'))",
"value_keys":[
"business_assets_mode"
],
"questions":[
{
"question":"Property Type",
"question_key":"property_type",
"place_holder":"",
"field_type":"string",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ADDRESSTYPE"
},
"fields":[
"address_type_id",
"address_type"
]
},
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[{
"insert_index":"property_type",
"expression":"String('property_type') && (String('property_type') != String('')) && (String('business_assets_mode') == String('2'))",
"value_keys":[
"property_type",
"business_assets_mode"
],
"questions":[
{
"question":"Address of the property",
"question_key":"property_address",
"place_holder":"",
"field_type":"string",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getSMCTempAddresses",
"api_method":"GET",
"params":{
"pdid":"VAR_PD_ID"
},
"fields":[
"display",
"display"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"property_type",
"answers":null,
"validations":[
]
}
]
},
{
"insert_index":"property_type",
"expression":"(String('property_type') == String('1')) && (String('business_assets_mode') == String('2'))",
"value_keys":[
"property_type",
"business_assets_mode"
],
"questions":[
{
"question":"Specify the Property",
"question_key":"property_type_others",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"property_type",
"answers":null,
"validations":[
]
}
]
}]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_assets_mode",
"answers":null,
"validations":[
]
}
]
},
{
"insert_index":"business_assets_mode",
"expression":"(String('business_assets_mode') == String('3'))",
"value_keys":[
"business_assets_mode"
],
"questions":[
{
"question":"Type of Vehicle",
"question_key":"vehicle_type",
"place_holder":"",
"field_type":"string",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"VEHICLETYPE"
},
"fields":[
"vehicle_type_id",
"vehicle_type_name"
]
},
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"vehicle_type",
"expression":"(String('vehicle_type') == String('1')) && (String('business_assets_mode') == String('3'))",
"value_keys":[
"vehicle_type",
"business_assets_mode"
],
"questions":[
{
"question":"Specify the Vehicle",
"question_key":"vehicle_type_others",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"vehicle_type",
"answers":null,
"validations":[
]
}
]
}]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_assets_mode",
"answers":null,
"validations":[
]
}
]
}
]
}
],
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Description",
"question_key":"other_asset_description",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Ownership type",
"question_key":"business_ownership_type",
"place_holder":"",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Owned'))",
"value_keys":[
"business_ownership_type"
],
"questions":[
{
"question":"Approximate Market value",
"question_key":"business_approximate_market_value",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Asset owned by",
"question_key":"business_name_of_the_owner",
"type":"4",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Age of asset in years",
"question_key":"business_vintage",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"answer_value",
"expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_vintage)}())",
"value_keys":[
"business_vintage"
],
"insert_control":"business_purchase_year"
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
},
{
"question":"Purchase year",
"question_key":"business_purchase_year",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"answer_value",
"expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_purchase_year)}())",
"value_keys":[
"business_purchase_year"
],
"insert_control":"business_vintage"
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
}
,
{
"question":"Is there a Loan Existing against this asset",
"question_key":"business_emi",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":[
{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}
],
"validations":[
]
}
]
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Rented'))",
"value_keys":[
"business_ownership_type"
],
"questions":[
{
"question":"Monthly Rent Amount",
"question_key":"business_monthly_rented_amt",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
]
}
]
}
]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[
{
"answer":"Owned",
"answer_id":"Owned"
},
{
"answer":"Rented",
"answer_id":"Rented"
}
],
"validations":[
]
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}],
"is_repeatable":"1",
"group_title":"Business Asset Details",
"group_key":"business_assets_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,117 @@
{
"section_id": "9",
"section_name": "Business and Personal Banking Details",
"onsubmit": [],
"questions": [
{
"question": [
{
"question": "Account holder name",
"question_key": "applicant_name",
"type": "1",
"api_properties": {
"purpose": "answer_options_local",
"master_name": "pd_applicants",
"fields": [
"pd_co_applicant_id",
"applicant_name"
]
},
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"validations": [
]
},
{
"question": "Bank Name",
"question_key": "bank_name",
"type": "1",
"field_width": "45",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Account type",
"question_key": "account_type",
"type": "3",
"field_width": "45",
"api_properties": null,
"answers": [
{
"answer": "Savings",
"answer_id": "Savings"
},
{
"answer": "OD",
"answer_id": "OD"
},
{
"answer": "Current",
"answer_id": "Current"
},
{
"answer": "CC",
"answer_id": "CC"
}
],
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "account_type",
"expression": "(String('account_type').toLowerCase() != String('savings') && String('account_type').toLowerCase() != String('current'))",
"value_keys": [
"account_type"
],
"questions": [
{
"question": "OD/CC Limit",
"question_key": "cc_limit",
"type": "1",
"field_width": "45",
"field_type": "num",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
}
]
}
]
}
],
"is_repeatable": null,
"validations": [
]
}
],
"is_repeatable": "1",
"group_title": "Banking Details",
"group_key": "banking_details"
},
{
"question_key": "common_remarks",
"question": "Remarks",
"place_holder": "Enter the text",
"type": "7",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}
]
}

View File

@ -0,0 +1,315 @@
{
"section_id":"1",
"section_name":"Borrower & Guarantor Details",
"onsubmit":null,
"questions":[
{
"question":[{
"question":"Borrower Type",
"question_key":"borrower_type",
"type":"1",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"relationship",
"expression":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"value_keys":[
"borrower_type"
],
"questions":[
{
"question":"Numbers of years for which the business has been running",
"question_key":"numbers_of_years_business_running",
"type":"1",
"field_width":"45",
"field_type":"num",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"validations",
"validations":[{
"value_keys":["borrower_type"],
"value":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"validation_to":"borrower_age",
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required"
}]}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Name",
"question_key":"borrower_name",
"type":"1",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"questions_level_two":[
{
"question":"Mobile Number",
"question_key":"mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10}",
"message":"Mobile number should be 10 digit",
"value":null
}
]
}
],
"is_repeatable":"2",
"group_key":"mobile_numbers",
"group_title":"Mobile Number"
},
{
"question":"Entity Type",
"question_key":"entity_type",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"relationship",
"expression":"(String('entity_type').toLowerCase() == String('individual'))",
"value_keys":[
"entity_type"
],
"questions":[
{
"question":"Age",
"question_key":"borrower_age",
"type":"1",
"field_type":"num",
"field_width":"50",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]},
{
"insert_index":"relationship",
"expression":"(String('entity_type').toLowerCase() == String('individual'))",
"value_keys":[
"entity_type"
],
"questions":[
{
"question":"Met / Not Met",
"question_key":"borrower_met",
"type":"2",
"field_width":"20",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":null,
"is_subfield":"1",
"parent_question_key":"entity_type",
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"question_label",
"expression":"(function () {let label= '';(String('entity_type').toLowerCase().includes('individual')) ? label= 'Number of years the borrower has been in this business.' : label = 'Number of years for which the business has been running';return label}())",
"value_keys":[
"entity_type"
],
"insert_control":"numbers_of_years_business_running"
},
{
"purpose":"validations",
"validations":[{
"value_keys":["borrower_type"],
"value":"(String('borrower_type').toLowerCase() != String('guarantor'))",
"validation_to":"borrower_age",
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required"
}]}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Designation",
"question_key":"designation",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Relationship to",
"question_key":"relationship_to",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Relationship",
"question_key":"relationship",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_key":"borrower_details",
"group_title":"Borrower Details"},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,197 @@
{
"section_id": "10",
"section_name": "Neighbourhood / Reference Check",
"onsubmit": [
],
"questions": [
{
"question":[
{
"question_key": "Neighbour_Name",
"question": "Neighbour Name",
"place_holder": "Enter the text",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}, {
"question_key": "Do_you_known_about_the_applicants_or_their_business",
"question": "Do you known about the applicants or their business?",
"place_holder": "Enter the text",
"type": "3",
"api_properties": null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Do_you_known_about_the_applicants_or_their_business",
"expression":"(String('Do_you_known_about_the_applicants_or_their_business') == String('Yes'))",
"value_keys":[
"Do_you_known_about_the_applicants_or_their_business"
],
"questions":[
{
"question_key": "As_per_you_how_long_has_this_business_been_in_operation",
"question": "As per you how long has this business been in operation?",
"place_holder": "Enter the text",
"type": "5",
"api_properties": null,
"answers":[
{
"answer_id":"Do_not_know",
"answer":"Do not know"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"As_per_you_how_long_has_this_business_been_in_operation",
"expression":"(String('As_per_you_how_long_has_this_business_been_in_operation') != String('Do_not_know'))",
"value_keys":[
"As_per_you_how_long_has_this_business_been_in_operation"
],
"questions":[
{ "question":"Year",
"question_key":"Year",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"As_per_you_how_long_has_this_business_been_in_operation",
"answers":null,
"validations":[
]
},
{ "question":"Month",
"question_key":"YeMonthar",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"As_per_you_how_long_has_this_business_been_in_operation",
"answers":null,
"validations":[
]
} ] } ] }],
"is_repeatable": null,
"field_type": "string",
"field_width": "100",
"validations": []
},
{
"question_key": "Who_is_the_owner_of_the_organisation",
"question": "Who is the owner of the organisation?",
"place_holder": "Enter the text",
"type": "5",
"api_properties": null,
"answers":[
{
"answer_id":"Do_not_know",
"answer":"Do not know"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Who_is_the_owner_of_the_organisation",
"expression":"(String('Who_is_the_owner_of_the_organisation') != String('Do_not_know'))",
"value_keys":[
"Who_is_the_owner_of_the_organisation"
],
"questions":[
{ "question_key": "Who_is_the_owner_of_the_organisations",
"question": "Who is the owner of the organisation?",
"type":"3",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Who_is_the_owner_of_the_organisation",
"answers":null,
"validations":[
]
}
] } ] }],
"is_repeatable": null,
"field_type": "string",
"field_width": "100",
"validations": []
}
]
} ] }],
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}
],
"is_repeatable":"1",
"hidden_button":true,
"group_title":"Neighbourhood",
"group_key":"Neighbourhood"
},
{
"question_key": "Status of the check as per PD officer?",
"question": "Status of the check as per PD officer?",
"place_holder": "Enter the text",
"type": "3",
"api_properties": null,
"answers":[
{
"answer_id":"Positive",
"answer":"Positive"
},
{
"answer_id":"Negative",
"answer":"Negative"
}, {
"answer_id":"Could_not_verify",
"answer":"Could not verify"
}
],
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}
]
}

View File

@ -0,0 +1,267 @@
{
"section_id":"11",
"section_name":"Credit Manager Queries",
"onsubmit":null,
"questions":[
{
"question":"Is your business adversely impacted by coronavirus outbreak ?",
"question_key":"Is_your_business_adversely_impacted_by_coronavirus_outbreak",
"type":"2",
"sub_title":"Covid 19 Questions",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_your_business_adversely_impacted_by_coronavirus_outbreak",
"expression":"(String('Is_your_business_adversely_impacted_by_coronavirus_outbreak') == String('No'))",
"value_keys":[
"Is_your_business_adversely_impacted_by_coronavirus_outbreak"
],
"questions":[
{ "question":"Enter Your Remarks",
"question_key":"Enter_Your_Remarks",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Is_your_business_adversely_impacted_by_coronavirus_outbreak",
"answers":null,
"validations":[
]
} ] } ] },
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_your_business_adversely_impacted_by_coronavirus_outbreak",
"expression":"(String('Is_your_business_adversely_impacted_by_coronavirus_outbreak') == String('Yes'))",
"value_keys":[
"Is_your_business_adversely_impacted_by_coronavirus_outbreak"
],
"questions":[
{ "question":"Enter Your Remarks",
"question_key":"enter_Your_Remarks",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Is_your_business_adversely_impacted_by_coronavirus_outbreak",
"answers":null,
"validations":[
]
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},{
"question":"Did you avail the loan moratorium facility on your existing loans which is extended by your bank or financial institution?",
"question_key":"your_bank_or_financial_institution",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},{
"question":"Are you planning to avail/ or already availed any loan or any other term facility for your business or personal use?",
"question_key":"your_business_or_personal_use",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"your_business_or_personal_use",
"expression":"(String('your_business_or_personal_use') == String('Yes'))",
"value_keys":[
"your_business_or_personal_use"
],
"questions":[
{ "question":"How much is your sales/revenue from April till date?",
"question_key":"sales/revenue_April_till_date",
"type":"1",
"field_width":"100",
"field_type":"numtoword",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"your_business_or_personal_use",
"answers":null,
"validations":[
]
}, {
"question":"Please specify amount,lender etc",
"question_key":"Please_specify_amount_lender_etc",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"your_business_or_personal_use",
"answers":null,
"validations":[
]
}
]
}
]
}, {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"your_business_or_personal_use",
"expression":"(String('your_business_or_personal_use') == String('No'))",
"value_keys":[
"your_business_or_personal_use"
],
"questions":[
{ "question":"How much is your sales/revenue from April till date?",
"question_key":"How_much_is_your_sales/revenue_from_April_till_date",
"type":"1",
"field_width":"100",
"field_type":"numtoword",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"your_business_or_personal_use",
"answers":null,
"validations":[
]
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
},{
"question":"Is turnover mentioned above (sales/revenue from April till date) validated?",
"question_key":"sales/revenue_from_April_till_date_validated",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"sales/revenue_from_April_till_date_validated",
"expression":"(String('sales/revenue_from_April_till_date_validated') == String('Yes'))",
"value_keys":[
"sales/revenue_from_April_till_date_validated"
],
"questions":[
{ "question":"Choose any ",
"question_key":"Choose any",
"type":"3",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"your_business_or_personal_use",
"answers":[
{
"answer_id":"Bills",
"answer":"Bills"
},
{
"answer_id":"Gst_returns",
"answer":"Gst returns"
},
{
"answer_id":"records_shown",
"answer":"records shown"
}
],
"validations":[
]
}
]
}
]
} ],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
]
}
]
}

View File

@ -0,0 +1,297 @@
{
"section_id":"12",
"section_name":"Final Remarks Details",
"onsubmit":null,
"questions":[
{
"question":"Customer Behaviour",
"question_key":"Customer_Behaviour",
"place_holder":"Enter the text",
"type":"3",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"CUSTOMERBEHAVIOUR"
},
"fields":[
"customer_behaviour_id",
"description"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
},
{
"question":"Is the location of the business / profession suited to the nature of business / service provided?",
"question_key":"location_of_the_business",
"place_holder":"Enter the text",
"type":"3",
"api_properties":null,
"answers":[{
"answer":"Well Suited",
"answer_id":"Well Suited"
},
{
"answer":"Fairly Suited",
"answer_id":"Fairly Suited"
},{
"answer":"Not Suited",
"answer_id":"Not Suited"
}],
"onchange_properties":null,
"is_repeatable":null,
"sub_title":"Location",
"field_type":"string",
"field_width":"100",
"validations":[
]
},
{
"question":"Personal feedback or market intelligence on the case (if any)",
"question_key":"Personal_feedback_or_market_intelligence_on_the_case",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"100",
"validations":[
]
},
{
"question_key":"PD_Officers_Recommendation",
"question":"PD Officers Recommendation",
"place_holder":"Enter the text",
"type":"3",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PDOFFICERRECOMMENDATIONS"
},
"fields":[
"pdofficer_recommendation_id",
"pdofficer_recommendation"
]
},
"answers":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"PD_Officers_Recommendation",
"expression":"(String('PD_Officers_Recommendation') == String('2'))",
"value_keys":[
"PD_Officers_Recommendation"
],
"questions":[
{
"question":[
{
"question":"Reasons for marking PD status as Positive",
"question_key":"Reasons_for_marking_PD_status_as_Positive",
"type":"1",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
}
],
"is_repeatable":"1",
"group_key":"Reasons_for_marking_PD_status_as_Positive",
"group_title":"Reasons for marking PD status as Positive"
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"PD_Officers_Recommendation",
"expression":"(String('PD_Officers_Recommendation') == String('3'))",
"value_keys":[
"PD_Officers_Recommendation"
],
"questions":[
{
"question":[
{
"question":"Reasons for marking PD status as Negative",
"question_key":"Reasons_for_marking_PD_status_as_Negative",
"type":"1",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
}
],
"is_repeatable":"1",
"group_key":"Reasons_for_marking_PD_status_as_Negative",
"group_title":"Reasons for marking PD status as Negative"
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"PD_Officers_Recommendation",
"expression":"(String('PD_Officers_Recommendation') == String('1'))",
"value_keys":[
"PD_Officers_Recommendation"
],
"questions":[
{
"question":"Specify PD Officers Recommendation",
"question_key":"Specify_PD_Officers_Recommendation",
"type":"1",
"field_width":"45",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
}
]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"PD_Officers_Recommendation",
"expression":"(String('PD_Officers_Recommendation') == String('4'))",
"value_keys":[
"PD_Officers_Recommendation"
],
"questions":[
{
"question":[
{
"question":"Reasons for marking PD status as Refer to Credit",
"question_key":"Reasons_for_marking_PD_status_as_Refer_to_Credit",
"type":"1",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
}
],
"is_repeatable":"1",
"group_key":"Reasons_for_marking_PD_status_as_Refer_to_Credit",
"group_title":"Reasons for marking PD status as Refer to Credit"
}]
}]
}],
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}, {
"question_key":"Any_additional_visit_(Godown/multiple_rental_properties)",
"question":"Any additional visit (Godown /multiple rental properties)",
"place_holder":"Enter the text",
"type":"12",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"100",
"validations":[
]
}, {
"question":"Mode of Transport Used to Visit the PD address",
"question_key":"Mode_of_Transport_Used_to_Visit_the_PD_address",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Two_Wheeler",
"answer":"Two Wheeler"
},{
"answer_id":"Four_Wheeler",
"answer":" Four Wheeler"
},{
"answer_id":"Public_Transport",
"answer":"Public Transport"
},
{
"answer_id":"Others",
"answer":"Others"
}
],
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Mode_of_Transport_Used_to_Visit_the_PD_address",
"expression":"(String('Mode_of_Transport_Used_to_Visit_the_PD_address') == String('Others'))",
"value_keys":[
"Mode_of_Transport_Used_to_Visit_the_PD_address"
],
"questions":[
{
"question":"Specify the Mode of Transport Used to Visit the PD address",
"question_key":"Specify_the_Mode_of_Transport_Used_to_Visit_the_PD_address",
"type":"1",
"field_width":"45",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
}
]
}]
}],
"is_repeatable":null,
"validations":[
]
}
]
}

View File

@ -0,0 +1,330 @@
{
"section_id": "13",
"section_name": "Stock details",
"onsubmit": [],
"questions": [
{
"question": "Is stock applicable to the business (Yes / No)",
"question_key": "stock_info_available",
"type": "2",
"field_width": "45",
"api_properties": null,
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('No'))",
"value_keys": [
"stock_info_available"
],
"questions": [
{
"question": "Reason",
"question_key": "stock_not_available_reason",
"type": "7",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": null,
"validations": [
]
}
]
}
]
},
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('Yes'))",
"value_keys": [
"stock_info_available"
],
"questions":[
{
"question": "Is the stock of finished goods observed, sufficient considering the size of operations",
"question_key": "estimated_uom",
"type": "3",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": [
{
"answer": "Yes",
"answer_id": "yes"
},
{
"answer": "No",
"answer_id": "no"
},
{
"answer": "Stock not required to be maintained",
"answer_id": "not applicable"
}
],
"validations": [
]
}
]
},
{
"insert_index": "stock_info_available",
"expression": "(String('stock_info_available') == String('Yes'))",
"value_keys": [
"stock_info_available"
],
"questions": [
{
"question": [
{
"question": "Type of Stock",
"question_key": "stock_type",
"type": "3",
"field_width": "100",
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "stock_info_available",
"answers": [
{
"answer": "RM",
"answer_id": "RM"
},
{
"answer": "FG",
"answer_id": "FG"
},
{
"answer": "SFG",
"answer_id": "SFG"
}
],
"validations": [
]
},
{
"question": "Name of trading goods/manufacturing goods (raw material/finished goods)/ Service Provided",
"question_key": "provider_name",
"place_holder": "Enter text",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"validations": [
]
},
{
"question": "Stock",
"question_key": "provider_observed",
"type": "3",
"api_properties": null,
"answers": [
{
"answer": "Add Stock Details",
"answer_id": "yes"
},
{
"answer": "No Stock Observed",
"answer_id": "no"
}
],
"is_repeatable": null,
"validations": [
],
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "provider_observed",
"expression": "(String('provider_observed') === String('yes'))",
"value_keys": [
"provider_observed"
],
"questions": [
{
"question": "Estimated Quantity",
"question_key": "estimated_quantity",
"type": "1",
"field_width": "100",
"field_type": "num",
"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_quantity') === String(''))",
"validation_to": "estimated_stock_value",
"value_keys": [
"estimated_quantity",
"estimated_stock_value"
]
}
]
}
],
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
]
},
{
"question": "UOM",
"question_key": "estimated_uom",
"type": "3",
"field_width": "100",
"api_properties": {
"api": "getListOfMaster",
"api_method": "POST",
"params": {
"master_name": "UOM"
},
"fields": [
"uom_id",
"name"
]
},
"onchange_properties": null,
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
]
},
{
"question": "Estimated value of stock observed",
"question_key": "estimated_stock_value",
"type": "1",
"field_type": "numtoword",
"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_quantity",
"value_keys": [
"estimated_stock_value"
]
}
]
}
],
"is_repeatable": null,
"is_subfield": "1",
"parent_question_key": "provider_observed",
"answers": null,
"validations": []
}
]
}
]
}
]
},
{
"question":"Name of the Company",
"question_key":"company_name",
"place_holder":"Enter text",
"type":"3",
"api_properties":{
"api":"getCompanyListForSMCList",
"api_method":"POST",
"params":{"records":{
"pd_id":"VAR_PD_ID",
"random_string":"VAR_RANDOM_STRING"
}},
"fields":[
"company_id",
"borrower_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Company Name Required",
"value":null
}
]
}
],
"is_repeatable": "1",
"group_title": "Stock details",
"group_key": "stock_details"
}
]
}
]
}
],
"is_repeatable": null,
"answers": [
{
"answer": "Yes",
"answer_id": "Yes"
},
{
"answer": "No",
"answer_id": "No"
}
],
"validations": [
]
},
{
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

View File

@ -0,0 +1,478 @@
{
"section_id":"5",
"section_name":"Address details",
"onsubmit":null,
"questions":[
{
"question":"Address at which PD was initiated",
"question_key":"initiated_address",
"type":"7",
"disable":false,
"field_width":"100",
"title":"Address Details",
"answers":true,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question": "State",
"question_key": "state",
"type": "3",
"answers": null,
"field_width":"25",
"api_properties": {
"api": "getListOfMaster",
"api_method": "POST",
"params": {
"master_name": "STATE"
},
"fields": [
"state_id",
"name"
]
},
"onchange_properties": [
{
"purpose": "api",
"api": "getListOfStatesAndCities",
"api_method": "POST",
"params": "{records:{state_id:'value_of_answer'}}",
"fields": [
"state_id",
"name"
],
"local_variable": "local_city"
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "State Required",
"value": null
}
]
},
{
"question": "City",
"question_key": "city",
"type": "3",
"answers": null,
"field_width":"25",
"api_properties": "local_city",
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "CIty Required",
"value": null
}
]
},
{
"question": "Pincode",
"question_key": "pincode",
"type": "3",
"answers": null,
"field_width":"25",
"api_properties": "local_pincode",
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "pincode",
"expression": "(pincode == 1)",
"value_keys": [
"pincode"
],
"questions": [
{
"question_key": "pincode_others",
"question": "Specify the Pincode",
"place_holder": "Enter the Pincode",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Pincode is Required",
"value": null
},
{
"name": "pattern",
"isactive": "1",
"validator": "[0-9]{6}",
"message": "Pincode should be 6 digit",
"value": null
}
]
}
]
}
]
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Pincode Required",
"value": null
}
]
},
{
"question":"Is this the address where PD is done ?",
"question_key":"is_pd_done_on_initiated_address",
"type":"2",
"disable":false,
"field_width":"100",
"onchange_properties": [{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_pd_done_on_initiated_address",
"expression":"(String('is_pd_done_on_initiated_address') == String('No'))",
"value_keys":[
"is_pd_done_on_initiated_address"
],
"questions":[
{
"question":"Reason for change in PD visit address",
"question_key":"end_use",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Pincode",
"question_key":"Pincode_list",
"type":"3",
"disable":false,
"field_width":"25",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMMENTSONLOCALITY"
},
"fields":[
"comments_on_locality_id",
"rating"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}, {
"question":"City",
"question_key":"City_list",
"type":"3",
"disable":false,
"field_width":"25",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMMENTSONLOCALITY"
},
"fields":[
"comments_on_locality_id",
"rating"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"State",
"question_key":"State_list",
"type":"3",
"disable":false,
"field_width":"25",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"STATE"
},
"fields":[
"state_id",
"name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}, {
"question":"Enter actual PD address",
"question_key":"actual_pd_address",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
}
]
}
]
}],
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Address Type",
"question_key":"Address_Type",
"type":"3",
"disable":false,
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ADDRESSTYPE"
},
"fields":[
"address_type_id",
"address_type"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Locality",
"question_key":"Locality",
"type":"3",
"disable":false,
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"LOCALITY"
},
"fields":[
"locality_id",
"locality_name"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Approach to PD location*",
"question_key":"Approach_to_PD_location",
"type":"3",
"disable":false,
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PDLOCATIONAPPROACH"
},
"fields":[
"pd_location_approach_id",
"description"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Comment on Locality",
"question_key":"Comment_on_Locality",
"type":"3",
"disable":false,
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMMENTSONLOCALITY"
},
"fields":[
"comments_on_locality_id",
"rating"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}, {
"question":"Unit of Measurement",
"question_key":"Unit_of_Measurement",
"type":"3",
"disable":false,
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"UOM"
},
"fields":[
"uom_id",
"name"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},{
"question":"Estimate area of the Residence",
"question_key":"Estimate_area_of_the_Residence",
"type":"1",
"disable":false,
"field_width":"45",
"api_properties": null,
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,410 @@
{
"section_id":"3",
"section_name":"Loan details",
"onsubmit":null,
"questions":[
{
"question":"Loan amount applied for ?",
"question_key":"loan_amount",
"type":"1",
"field_type":"numtoword",
"field_width":"65",
"answers":null,
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_fund_requirement",
"expression":" typeof(total_fund_requirement) == 'number' && (Number(total_fund_requirement) < Number(loan_amount))",
"value_keys":[
"total_fund_requirement","loan_amount"
],
"questions":[
{
"question":"Remarks on source of funds for balance amount required",
"question_key":"remarks_fund_source_balance",
"place_holder":"",
"field_type":"string",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
]
}
]
}]
}
],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Loan Tenure applied for ?",
"question_key":"loan_tenure",
"type":"1",
"field_type":"num",
"field_width":"25",
"onchange_properties": null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Sub Product",
"question_key":"sub_product",
"type":"3",
"field_width":"65",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"SUBPRODUCTS"
},
"fields":[
"subproduct_id",
"name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"What is the end use",
"question_key":"end_use",
"type":"3",
"field_width":"65",
"api_properties":{
"api":"getEndUseOfLoan",
"api_method":"POST",
"params":{
"master_name":null
},
"fields":["enduse_of_loan_id","enduse_of_loan"]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Is there a balance transfer?",
"question_key":"balance_transfer",
"type":"3",
"field_width":"65",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BTLENDERLIST"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers": null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"EMI Amount comfortable paying",
"question_key":"emi_amount",
"type":"1",
"field_type":"numtoword",
"field_width":"65",
"answers":null,
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_fund_requirement",
"expression":" typeof(total_fund_requirement) == 'number' && (Number(total_fund_requirement) < Number(loan_amount))",
"value_keys":[
"total_fund_requirement","loan_amount"
],
"questions":[
]
}]
}
],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Type of Property",
"question_key":"is_transfer",
"type":"3",
"sub_title":"Details of Property being Mortgaged",
"field_width":"55",
"api_properties":null,
"answers":[
{
"answer_id":"Chawl",
"answer":"Chawl"
},{
"answer_id":"Flat",
"answer":"Flat"
},{
"answer_id":"Floor",
"answer":"Floor"
},
{
"answer_id":"Independent House",
"answer":"Independent House"
}, {
"answer_id":"Row House",
"answer":"Row House"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Specify Type of Property*",
"question_key":"Specify_Type",
"type":"1",
"field_width":"55",
"api_properties":null,
"answers":[
{
"answer_id":"other",
"answer":"other"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Name of Owner",
"question_key":"owner_name",
"type":"4",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
]
},
{
"question":"Status of Construction",
"question_key":"is_transfer",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"STATUSOFCONSTRUCTION"
},
"fields":[
"id",
"name"
]
},
"answers": null,
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Estimated market value as per customer",
"question_key":"emv_per_customer",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question":"Address of Property*",
"question_key":"Address_of_Property",
"place_holder":"",
"field_type":"text",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
]
},
{
"question": "State",
"question_key": "state",
"type": "3",
"answers": null,
"field_width":"45",
"api_properties": {
"api": "getListOfMaster",
"api_method": "POST",
"params": {
"master_name": "STATE"
},
"fields": [
"state_id",
"name"
]
},
"onchange_properties": [
{
"purpose": "api",
"api": "getListOfStatesAndCities",
"api_method": "POST",
"params": "{records:{state_id:'value_of_answer'}}",
"fields": [
"state_id",
"name"
],
"local_variable": "local_city"
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "State Required",
"value": null
}
]
},
{
"question": "City",
"question_key": "city",
"type": "3",
"answers": null,
"field_width":"45",
"api_properties": "local_city",
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "CIty Required",
"value": null
}
]
},
{
"question": "Pincode",
"question_key": "pincode",
"type": "3",
"answers": null,
"field_width":"45",
"api_properties": "local_pincode",
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "pincode",
"expression": "(pincode == 1)",
"value_keys": [
"pincode"
],
"questions": [
{
"question_key": "pincode_others",
"question": "Specify the Pincode",
"place_holder": "Enter the Pincode",
"type": "1",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "num",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Pincode is Required",
"value": null
},
{
"name": "pattern",
"isactive": "1",
"validator": "[0-9]{6}",
"message": "Pincode should be 6 digit",
"value": null
}
]
}
]
}
]
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Pincode Required",
"value": null
}
]
}
]
}

View File

@ -0,0 +1,764 @@
{
"section_id": "4",
"section_name": "Employement Information",
"onsubmit": null,
"questions": [
{
"question": "Name of Employer*",
"question_key": "Name_of_Employer",
"type": "3",
"disable":false,
"field_width": "35",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Company profile in brief",
"question_key": "Company_profile_in_brief",
"type": "7",
"disable":false,
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Since how long working with this employer?",
"question_key": "Since_how_long_working_with_this_employer?",
"field_type":"null",
"sub_title":"Since how long working with this employer?",
"disable":false,
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": []
},
{
"question": "Year*",
"question_key": "Year",
"type": "1",
"field_type":"num",
"disable":false,
"field_width": "25",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Month",
"question_key": "Month",
"type": "1",
"disable":false,
"field_type":"num",
"field_width": "25",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question": "Total Work Experience",
"question_key": "Total_Work_Experience",
"type": "1",
"disable":false,
"field_width": "25",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
"question":"Was the employee met?",
"question_key":"Was_the_employee_met",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Was_the_employee_met",
"expression":"(String('Was_the_employee_met') == String('Yes'))",
"value_keys":[
"Was_the_employee_met"
],
"questions":[
{
"question":"Name of the Person met",
"question_key":"Name_of_the_Person_met",
"place_holder":"",
"field_type":"text",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Was_the_employee_met",
"answers":null,
"validations":[
]
},{
"question":"Designation of Person met",
"question_key":"Designation_of_Person_met",
"place_holder":"",
"field_type":"text",
"type":"3",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Was_the_employee_met",
"answers":null,
"validations":[
]
},{
"question":"Photograph of 'Photo ID card of the Employee/Manager'",
"question_key":"Photograph",
"place_holder":"",
"field_type":"text",
"type":"3",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Was_the_employee_met",
"answers":null,
"validations":[
]
},{
"question":"Employer's/Manager's Company ID card / Visiting card provided?",
"question_key":"Visiting_card_provided",
"place_holder":"",
"field_type":"text",
"type":"3",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Was_the_employee_met",
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Salary Amount confirmed?",
"question_key":"Salary_Amount_confirmed",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Salary_Amount_confirmed",
"expression":"(String('Salary_Amount_confirmed') == String('No'))",
"value_keys":[
"Salary_Amount_confirmed"
],
"questions":[
{
"question":"why salary amount was not confirmed",
"question_key":"why_salary_amount_was_not_confirmed",
"place_holder":"why salary amount was not confirmed",
"field_type":"text",
"type":"7",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Salary_Amount_confirmed",
"answers":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Attendance register seen?",
"question_key":"Attendance_register_seen",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"yes"
},
{
"answer_id":"No",
"answer":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Salary register seen?",
"question_key":"Salary_register_seen",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"yes"
},
{
"answer_id":"No",
"answer":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Cash Voucher",
"question_key":"Cash_Voucher",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"yes"
},
{
"answer_id":"No",
"answer":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Salary Certificate",
"question_key":"Salary_Certificate",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"yes"
},
{
"answer_id":"No",
"answer":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Salary Slip",
"question_key":"Salary_Slip",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"yes"
},
{
"answer_id":"No",
"answer":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Others please specify",
"question_key":"Others_please_specify",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Others_please_specify",
"expression":"(String('Others_please_specify') == String('Yes'))",
"value_keys":[
"Others_please_specify"
],
"questions":[
{
"question":"Specify the Document",
"question_key":"Specify_the_Document",
"type":"1",
"field_width":"45",
"api_properties":null,
"parent_question_key":"Others_please_specify",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Others_please_specify",
"expression":"(String('Others_please_specify') == String('No'))",
"value_keys":[
"Others_please_specify"
],
"questions":[
{
"question":"Why Documents are not available?",
"question_key":"Why_Documents_are_not_available",
"place_holder":"",
"field_type":"text",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"Others_please_specify",
"answers":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Mode of getting salary",
"question_key":"Mode_of_getting_salary",
"type":"3",
"field_width":"65",
"api_properties":null,
"answers":[
{
"answer":"Bank Transfer",
"answer_id":"Bank_Transfer"
},
{
"answer":"Paid in Cash",
"answer_id":"Paid_in_Cash"
},
{
"answer":"Both Bank Transfer & Cash",
"answer_id":"Both_Bank_Transfer_and _Cash"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}, {
"question": "Salary Details",
"question_key": "Salary_Details",
"field_type":"null",
"sub_title":"Salary Details",
"disable":false,
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": []
},
{
"question": "Date of Salary",
"question_key": "Date_of_Salary",
"field_type":"null",
"sub_title":"Date of Salary",
"disable":false,
"field_width": "100",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": []
},
{
"question":"From",
"question_key":"from",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer":"Bank Transfer",
"answer_id":"Bank_Transfer"
},
{
"answer":"Paid in Cash",
"answer_id":"Paid_in_Cash"
},
{
"answer":"Both Bank Transfer & Cash",
"answer_id":"Both_Bank_Transfer_and _Cash"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"To",
"question_key":"to",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer":"Bank Transfer",
"answer_id":"Bank_Transfer"
},
{
"answer":"Paid in Cash",
"answer_id":"Paid_in_Cash"
},
{
"answer":"Both Bank Transfer & Cash",
"answer_id":"Both_Bank_Transfer_and _Cash"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}, {
"question":"Has salary been paid regularly in last 3 months",
"question_key":"Has_salary_been_paid_regularly_in_last_3_months",
"type":"3",
"field_width":"65",
"api_properties":null,
"answers":[
{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Gross Monthly Salary",
"question_key":"Gross_Monthly_Salary",
"type":"1",
"field_type":"numtoword",
"field_width":"65",
"api_properties":null,
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Net Monthly Salary",
"question_key":"Net_Monthly_Salary",
"type":"1",
"field_width":"65",
"field_type":"numtoword",
"api_properties":null,
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
},
{
"question":"Bounce or incentive*",
"question_key":"Bounce_or_incentive",
"type":"1",
"field_type":"numtoword",
"field_width":"65",
"api_properties":null,
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}, {
"question": "Bonus Frequency",
"question_key": "Bonus_Frequency",
"type": "3",
"field_width": "45",
"api_properties": null,
"answers": [
{
"answer": "Daily",
"answer_id": "Daily"
},
{
"answer": "Every 12 days",
"answer_id": "Every_12_days"
},
{
"answer": " Every 15 days",
"answer_id": " Every_15_days"
},
{
"answer": " Every 3 months",
"answer_id": " Every_3_months"
},
{
"answer": " Every 6 month",
"answer_id": " Every_6_month"
},
{
"answer": " Monthly",
"answer_id": "Monthly"
},
{
"answer": " Yearly",
"answer_id": "Yearly"
}
],
"onchange_properties": [
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Type of Bonus",
"question_key": "Type_of_Bonus",
"type": "3",
"field_width": "45",
"api_properties": null,
"answers": [
{
"answer": "Fixed",
"answer_id": "Fixed"
},
{
"answer": "Variable depending on performance",
"answer_id": "Variable_depending_on_performance"
},
{
"answer": " Others",
"answer_id": "Others"
}
],
"onchange_properties": [
],
"is_repeatable": null,
"validations": [
]
},{
"question":"ID card issued by the Company seen?*",
"question_key":"ID_card_issued_by_the_Company_seen",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"ID_card_issued_by_the_Company_seen",
"expression":"(String('ID_card_issued_by_the_Company_seen') == String('No'))",
"value_keys":[
"ID_card_issued_by_the_Company_seen"
],
"questions":[
{
"question_key": "common_remarks",
"question": "Remarks",
"place_holder": "Enter the text",
"type": "7",
"disable":false,
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations": []
}]
}]
}],
"is_repeatable":null,
"validations":[
]
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,683 @@
{
"section_id":"6",
"section_name":"Banking Details",
"onsubmit":[
],
"questions":[ {
"question":"Is the Personal Banking Information Available",
"question_key":"Is_the_Personal_Banking_Information_Available",
"type":"3",
"sub_title":"Personal Banking Details",
"field_width":"65",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_the_Personal_Banking_Information_Available",
"expression":"(String('Is_the_Personal_Banking_Information_Available') == String('Yes'))",
"value_keys":[
"Is_the_Personal_Banking_Information_Available"
],
"questions":[
{
"question":[
{
"question_key":"Account_Holder_Name",
"question":"Account Holder's Name",
"place_holder":"Enter the text",
"type":"3",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"30",
"validations":[
]
},{
"question_key":"Banking_name",
"question":"Banking Name",
"place_holder":"Enter the text",
"type":"8",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BTLENDERLIST"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Banking_name",
"expression":"(String('Banking_name') == String('1'))",
"value_keys":[
"Banking_name"
],
"questions":[
{
"question":"Salary Credited in this account",
"question_key":"Salary_Credited_in_this_account",
"type":"1",
"field_width":"30",
"api_properties":null,
"parent_question_key":"Banking_name",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}, {
"answer_id":"NA",
"answer":"NA"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"field_type":"string",
"field_width":"30",
"validations":[
]
}, {
"question":"Account Type",
"question_key":"Is_the_Personal_Banking_Information_Available",
"place_holder":"Enter text",
"type":"3",
"field_width":"30",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ACCOUNTTYPE"
},
"fields":[
"id",
"name"
]
},
"answers": null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_the_Personal_Banking_Information_Available",
"expression":"(String('Is_the_Personal_Banking_Information_Available') == String('4'))",
"value_keys":[
"Is_the_Personal_Banking_Information_Available"
],
"questions":[
{
"question":"Limit in case of OD / CC account",
"question_key":"Limit_in_case_of_OD_CC_account",
"type":"1",
"field_type":"numtoword",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}, {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_the_Personal_Banking_Information_Available",
"expression":"(String('Is_the_Personal_Banking_Information_Available') == String('3'))",
"value_keys":[
"Is_the_Personal_Banking_Information_Available"
],
"questions":[
{
"question":"Limit in case of OD / CC account",
"question_key":"limit_in_case_of_OD_CC_account",
"type":"1",
"field_width":"45",
"field_type":"numtoword",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Personal Banking Information Required",
"value":null
}
]
}, {
"question_key":null,
"question":null,
"place_holder":"Enter the text",
"type":null,
"api_properties":null,
"sub_title":"Number of Years / Months since account was started",
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"100",
"validations":[
]
}, {
"question_key":"year",
"question":"Year",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"25",
"validations":[
]
}, {
"question_key":"month",
"question":"Month",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"25",
"validations":[
]
},
{
"question":"Is this same AC used for?",
"question_key":"Is_this_same_AC_used_for",
"place_holder":"Enter the text",
"type":"3",
"api_properties":null,
"answers":[
{
"answer_id":"Personal",
"answer":"Personal"
},
{
"answer_id":"Business",
"answer":"Business"
},
{
"answer_id":"Both",
"answer":"Both"
}
],
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"25",
"validations":[
]
}
],
"is_repeatable":"1",
"group_title":"Personal Banking Details",
"group_key":"Personal_Banking_Details",
"form_name":"Personal Banking Details"
}
]
}]
}],
"is_repeatable":null,
"validations":[
]
}, {
"question":"Is the Business Information Available",
"question_key":"Is_the_Business_Information_Available",
"type":"3",
"sub_title":"Business Details",
"field_width":"65",
"api_properties":null,
"answers":[
{
"answer_id":"Yes",
"answer":"Yes"
},
{
"answer_id":"No",
"answer":"No"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Is_the_Business_Information_Available",
"expression":"(String('Is_the_Business_Information_Available') == String('Yes'))",
"value_keys":[
"Is_the_Business_Information_Available"
],
"questions":[
{
"question":[
{
"question_key":"Account_Holder_name",
"question":"Account Holder's Name",
"place_holder":"Enter the text",
"type":"3",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"30",
"validations":[
]
},{
"question_key":"banking_name",
"question":"Banking Name",
"place_holder":"Enter the text",
"type":"8",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BTLENDERLIST"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"banking_name",
"expression":"(String('banking_name') == String('1'))",
"value_keys":[
"banking_name"
],
"questions":[
{
"question":"Salary Credited in this account",
"question_key":"salary_Credited_in_this_account",
"type":"1",
"field_width":"30",
"api_properties":null,
"parent_question_key":"banking_name",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}, {
"answer_id":"NA",
"answer":"NA"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"field_type":"string",
"field_width":"30",
"validations":[
]
}, {
"question":"Account Type",
"question_key":"Account_Type",
"place_holder":"Enter text",
"type":"3",
"field_width":"30",
"api_properties":null,
"answers":[
{
"answer_id":"CC",
"answer":"CC"
},
{
"answer_id":"Current",
"answer":"Current"
},
{
"answer_id":"OD",
"answer":"OD"
},
{
"answer_id":"Savings",
"answer":"Savings"
}
],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Account_Type",
"expression":"(String('Account_Type') == String('4'))",
"value_keys":[
"Account_Type"
],
"questions":[
{
"question":"Limit in case of OD / CC account",
"question_key":"Limit_in_case_of_OD_CC_account",
"type": "1",
"field_width": "45",
"field_type":"numtoword",
"api_properties": null,
"parent_question_key":"loan_type",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}, {
"question":"Is the main business account",
"question_key":"Is_the_main_business_account",
"type":"3",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}, {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Account_Type",
"expression":"(String('Account_Type') == String('3'))",
"value_keys":[
"Account_Type"
],
"questions":[
{
"question":"Limit in case of OD / CC account",
"question_key":"limit_in_case_of_OD_CC_account",
"type":"1",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}, {
"question":"Is the main business account",
"question_key":"is_the_main_business_account",
"type":"3",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}, {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Account_Type",
"expression":"(String('Account_Type') == String('2'))",
"value_keys":[
"Account_Type"
],
"questions":[
{
"question":"Is the main business account",
"question_key":"is_the_main_Business_account",
"type":"3",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Account_Type",
"expression":"(String('Account_Type') == String('1'))",
"value_keys":[
"Account_Type"
],
"questions":[
{
"question":"Is the main business account",
"question_key":"is_the_main_Business_Account",
"type":"3",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
{
"answer_id":"YES",
"answer":"YES"
},
{
"answer_id":"NO",
"answer":"NO"
}
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Business Details Required",
"value":null
}
]
}, {
"question_key":null,
"question":null,
"place_holder":"Enter the text",
"type":null,
"api_properties":null,
"sub_title":"Number of Years / Months since account was started",
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"100",
"validations":[
]
}, {
"question_key":"year",
"question":"Year",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"25",
"validations":[
]
}, {
"question_key":"month",
"question":"Month",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"25",
"validations":[
]
}
],
"is_repeatable":"1",
"group_title":"Business Details",
"group_key":"Business_Details",
"form_name":"Business Details"
}
]
}]
}],
"is_repeatable":null,
"validations":[
]
}
]
}

View File

@ -0,0 +1,472 @@
{
"section_id": "7",
"section_name": "Existing Loan Obligations",
"onsubmit": null,
"questions": [
{
"question":"Do you have any exiting loan",
"question_key":"Do_you_have_any_exiting_loan",
"type":"3",
"field_width":"45",
"answers":[{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
}],
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"Do_you_have_any_exiting_loan",
"expression":"(String('Do_you_have_any_exiting_loan') == String('yes'))",
"value_keys":[
"Do_you_have_any_exiting_loan"
],
"questions":[
{
"question": [
{
"question": "Loan type",
"question_key": "loan_type",
"type": "3",
"field_width": "45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"EXISTINGLOANTYPES"
},
"fields":[
"existing_loan_type_id",
"loan_type_name"
]
},
"answers": null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"loan_type",
"expression":"(String('loan_type') == String('1'))",
"value_keys":[
"loan_type"
],
"questions":[
{
"question":"Specify Loan Type",
"question_key":"Specify_Loan_Type",
"type":"1",
"field_width":"45",
"api_properties":null,
"parent_question_key":"loan_type",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Loan amount",
"question_key": "loan_amount",
"type": "1",
"field_type": "numtoword",
"field_width": "65",
"onchange_properties": null,
"api_properties": null,
"answers": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Lender name",
"question_key": "lender_name",
"type": "4",
"field_width": "45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"BTLENDERLIST"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Loan taken by",
"question_key": "loan_taken_by",
"type": "1",
"field_width": "45",
"api_properties": null,
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"validations": [
]
},
{
"question": "Instalment frequency",
"question_key": "instalment_frequency",
"type": "3",
"field_width": "45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"FREQUENCY"
},
"fields":[
"frequency_id",
"name"
]
},
"answers": null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('5'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Daily Instalment Amount",
"question_key":"Daily_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('8'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Instalment Amount",
"question_key":"Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('4'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Fortnightly Instalment Amount",
"question_key":"Fortnightly_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('6'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Quartly Instalment Amount",
"question_key":"Quartly_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('3'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Halfyearly Instalment Amount",
"question_key":"Halfyearly_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('7'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Monthly Instalment Amount",
"question_key":"Monthly_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
},{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"instalment_frequency",
"expression":"(String('instalment_frequency') == String('2'))",
"value_keys":[
"instalment_frequency"
],
"questions":[
{
"question":"Annual Instalment Amount",
"question_key":"Annual_Instalment_Amount",
"type":"1",
"field_width":"45",
"field_type": "numtoword",
"api_properties":null,
"parent_question_key":"instalment_frequency",
"answers":[
],
"onchange_properties": [],
"is_repeatable":null,
"validations":[
]
}]
}]
}],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Original tenure in months",
"question_key": "original_tenure_months",
"type": "1",
"field_width": "65",
"field_type": "num",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(current_tenure_months))",
"value_keys":[
"original_tenure_months", "current_tenure_months"
],
"insert_control":"elapsed_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Current balance tenure in months",
"question_key": "current_tenure_months",
"type": "1",
"field_type": "num",
"field_width": "65",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(current_tenure_months))",
"value_keys":[
"original_tenure_months", "current_tenure_months"
],
"insert_control":"elapsed_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
},
{
"question": "Elapsed tenure in mths",
"question_key": "elapsed_tenure_months",
"type": "1",
"field_width": "65",
"field_type": "num",
"api_properties": null,
"answers": null,
"onchange_properties": [
{
"purpose":"answer_value",
"expression":"(Number(original_tenure_months)-Number(elapsed_tenure_months))",
"value_keys":[
"original_tenure_months", "elapsed_tenure_months"
],
"insert_control":"current_tenure_months"
}
],
"is_repeatable": null,
"validations": [
]
}
],
"is_repeatable": "1",
"group_title": "Loan Details",
"group_key": "Loan_Details"
} ]
}]
}],
"is_repeatable":null,
"validations":[
]
}, {
"question_key":"common_remarks",
"question":"Remarks",
"place_holder":"Enter the text",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_width":"45",
"validations":[
]
}
]
}

Some files were not shown because too many files have changed in this diff Show More