Merge branch 'smc_credit_pd_new' of https://bitbucket.org/venbaittech/sparq-lender into smc_credit_pd_new

This commit is contained in:
gayathri1990 2021-03-15 14:56:12 +05:30
commit adeb5b3693
56 changed files with 2369 additions and 1765 deletions

View File

@ -45,7 +45,9 @@
"node_modules/hammerjs/hammer.min.js",
"node_modules/sortablejs/Sortable.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"src/assets/cropper/cropper.js"
"src/assets/cropper/cropper.js",
"node_modules/blueimp-canvas-to-blob/js/canvas-to-blob.min.js"
]
},
"configurations": {

View File

@ -2223,6 +2223,11 @@
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz",
"integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg=="
},
"blueimp-canvas-to-blob": {
"version": "3.28.0",
"resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.28.0.tgz",
"integrity": "sha512-5q+YHzgGsuHQ01iouGgJaPJXod2AzTxJXmVv90PpGrRxU7G7IqgPqWXz+PBmt3520jKKi6irWbNV87DicEa7wg=="
},
"bn.js": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz",
@ -2439,7 +2444,7 @@
},
"buffer": {
"version": "4.9.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
"resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
"integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
"requires": {
"base64-js": "^1.0.2",
@ -2570,7 +2575,7 @@
},
"calendar-utils": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/calendar-utils/-/calendar-utils-0.1.2.tgz",
"resolved": "http://registry.npmjs.org/calendar-utils/-/calendar-utils-0.1.2.tgz",
"integrity": "sha512-9j4Zd1itopNYTSWzFU4MqD2IDHMqznfxsGr8UWGh7hWv+lKzjRJz0LS29iAg5rHtP6+6x3ikQnhoMGqFUzoD2Q=="
},
"caller-callsite": {
@ -7303,7 +7308,7 @@
},
"lodash": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true
},
@ -7478,7 +7483,7 @@
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
@ -7620,7 +7625,7 @@
},
"log4js": {
"version": "0.6.38",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz",
"resolved": "http://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz",
"integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=",
"dev": true,
"requires": {
@ -7941,7 +7946,7 @@
},
"meow": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"requires": {
"camelcase-keys": "^2.0.0",
@ -8456,7 +8461,7 @@
"dependencies": {
"semver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
},
"tar": {
@ -8897,7 +8902,7 @@
"dependencies": {
"minimist": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
"dev": true
},
@ -12786,7 +12791,7 @@
},
"sax": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz",
"resolved": "http://registry.npmjs.org/sax/-/sax-0.6.1.tgz",
"integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=",
"dev": true
},

View File

@ -43,6 +43,7 @@
"angular-sortablejs": "^2.7.0",
"angular-split": "^3.0.2",
"angular-tree-component": "6.1.0",
"blueimp-canvas-to-blob": "^3.28.0",
"chart.js": "2.6.0",
"core-js": "^2.6.5",
"d3": "^4.9.1",

View File

@ -218,7 +218,7 @@ private handleError<T> (operation = 'operation', error?: T) {
}
else if(error.status == 0){
console.log("NO Internet")
this.router.navigate(['/error/404']);
// this.router.navigate(['/error/404']);
}
else{
// alert("Please Check your Internet connection");

View File

@ -188,6 +188,12 @@
<mat-card-header>
<mat-card-title>Address Details</mat-card-title>
</mat-card-header>
<mat-form-field style="width:95%" *ngIf="lenderShortName == 'MWISE' && excel_file_id != null">
<mat-select [formControl] = "choosed_address" placeholder="Choose the Address" (selectionChange) = "onChangeSelectedAddress($event.value)" required>
<mat-option class="large-select-option" *ngFor="let val of addressList" [value]="val.id"><span > {{ val.display }}</span> </mat-option>
</mat-select>
<mat-error *ngIf="choosed_address.hasError('required')">Required.</mat-error>
</mat-form-field>
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index;">
<mat-card-content [formGroupName]="i" fxLayout="row wrap" fxLayout.xs="column">
<mat-form-field fxFlex="100%">
@ -250,7 +256,7 @@
</mat-card-content>
</div>
<mat-card-actions align="end">
<mat-card-actions align="end" *ngIf="lenderShortName != 'MWISE'">
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses()"
matTooltip="Add More Additional Addresses" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
@ -258,7 +264,7 @@
</button>
</mat-card-actions>
</mat-card>
<div #applicant_details></div>
<mat-card >
<mat-card-header>
<mat-card-title>Applicant Details</mat-card-title>
@ -450,8 +456,8 @@
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.value,draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.value,PDTriggerStatus)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.getRawValue(),draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.getRawValue(),PDTriggerStatus)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
</div>
</mat-card-actions>

View File

@ -38,3 +38,23 @@ mat-radio-button,mat-checkbox{
::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb {
background-color:rgb(212, 15, 15);
}
// .large-select {
// ::ng-deep .mat-select-panel .mat-optgroup-label, .mat-select-panel .mat-option {
// height: unset;
// }
// ::ng-deep .mat-option-text {
// white-space: normal;
// }
// }
.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

@ -1,4 +1,4 @@
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild } from '@angular/core';
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild, ElementRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { CustomValidators } from 'ng2-validation';
@ -73,6 +73,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
billingtolist: any;
removedControl: any = [];
excel_file_id: any = null;
choosed_address:FormControl = new FormControl('')
addressList:any = []
@ViewChild('applicant_details') applicant_details_element :ElementRef
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) {
@ -614,9 +618,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity();
this._PDtriggerForm.controls['applicant_title_name'].setValidators([Validators.required]);
this._PDtriggerForm.controls['applicant_title_name'].updateValueAndValidity();
// console.log("seleccccc", this.lenderShortName)
if(this.lenderShortName != 'MWISE') {
this._PDtriggerForm.controls['mobile_no'].setValidators([Validators.required]);
this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity();
}
// this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
// this._PDtriggerForm.controls['addressline1'].updateValueAndValidity();
@ -718,7 +724,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
// return;
// }
if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
if (formValue.mobile_no != null && formValue.mobile_no.length != 10 && this.lenderShortName != 'MWISE'){
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
@ -838,6 +844,18 @@ export class AddPdComponent implements OnInit, OnDestroy {
pd_applicant_details.push(obj1)
});
// FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE
if(this.lenderShortName == 'MWISE') {
let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null)
console.log(mobile_number_check)
if(mobile_number_check == 0 || mobile_number_check == -1) {
this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'})
this.disableAfterSubmit = false;
this.notifier.notify("info", "Please provide atleast 1 Mobile Number")
return;
}
}
if (formValue.addresses.length > 0) {
formValue.addresses.forEach((addressElement, itemIndex) => {
let addressobj = {
@ -1144,6 +1162,7 @@ searchFun(control:any,i:number,option){
maxWidth:'75vw'
})
dialogRef.afterClosed().subscribe(result=>{
if(result) {
this.excel_file_id = result.excel_file_id
console.log(result,JSON.stringify(result));
// let formValues = {}
@ -1167,13 +1186,35 @@ searchFun(control:any,i:number,option){
this.addCoApplicant()
}
}
if(key_name == 'address_details') {
this.addressList = records['address_details']
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
control_address.get('addressline1').disable()
control_address.get('fk_state').disable()
control_address.get('fk_city').disable()
control_address.get('pincode').disable()
this.choosed_address.setValidators(Validators.required)
}
// formValues[val.key_name] = val.value
}
})
this._PDtriggerForm.patchValue(records)
}
}
})
}
onChangeSelectedAddress(value) {
console.log(value)
if(value) {
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
console.log(control_address);
control_address.get('addressline1').setValue(value.addressline)
control_address.get('fk_state').setValue(value.state)
this.getCityList(value.state,0);
control_address.get('fk_city').setValue(value.city)
control_address.get('pincode').setValue(value.pincode)
}
}
changePDTypeSlideValue(event) {
if(event.checked) {
this._PDtriggerForm.controls['fk_pd_type'].setValue('3')

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { MatDialogRef, MatSnackBar } from '@angular/material';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MatSnackBar, MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@ -13,7 +13,7 @@ export class ExcelUploadDialogComponent implements OnInit {
sheetBufferRender: File;
constructor(private snackBar:MatSnackBar,private loaderService:LoaderService,private _pdService:PdTrigerService,
private dialogRef:MatDialogRef<ExcelUploadDialogComponent>) { }
private dialogRef:MatDialogRef<ExcelUploadDialogComponent>, @Inject(MAT_DIALOG_DATA)public data:any) { }
ngOnInit() {
}
@ -68,7 +68,8 @@ export class ExcelUploadDialogComponent implements OnInit {
return;
}
this.loaderService.showMatSpinnerDialog("Upload is in progress.. Please wait..")
this._pdService.uploadSMCDataFile(this.sheetBufferRender).subscribe(res=>{
let pd_id = this.data && this.data.hasOwnProperty('pd_id') ? this.data.pd_id : null
this._pdService.uploadSMCDataFile(this.sheetBufferRender,pd_id).subscribe(res=>{
if(res['dataStatus']) {
this.dialogRef.close(res)
}

View File

@ -74,7 +74,7 @@
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)=" details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<!--Start Mobile View Code-->
<!-- <div (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" class="webhide"> -->
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
@ -165,7 +165,8 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<!-- *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' || LenderRoleID == '27' || LenderRoleID == '25' -->
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">

View File

@ -7,6 +7,7 @@ import { NotifierService } from 'angular-notifier';
import { AwsService } from 'app/AwsService/aws.service';
import { UserService } from 'app/settings/service/user.service';
import { ReplaySubject } from 'rxjs';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-all-pd',
@ -54,8 +55,12 @@ export class AllPdComponent implements OnInit, OnChanges {
common: any;
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
user_id: any;
startIndex: number;
endIndex: any;
filtered_raw_data: any[];
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService) {
private _aws:AwsService,private loaderService:LoaderService) {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
this.notifier = notifier;
this.searchForm = this._fb.group(
@ -99,9 +104,11 @@ export class AllPdComponent implements OnInit, OnChanges {
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
//this.getcommonDropDown();
@ -122,7 +129,10 @@ console.log(this.displayedColumns)
filterData(text) {
if(!text) {
setTimeout(()=>{
this.filtered_raw_data = []
this.pagedList .next(this.PdListData.slice(0, 10));
},0)
this.length = this.PdListData.length;
return
}
@ -134,7 +144,12 @@ console.log(this.displayedColumns)
}
return false
})
this.pagedList.next(temp)
setTimeout(()=>{
console.log(temp)
this.filtered_raw_data = temp
this.length = this.filtered_raw_data.length
this.pagedList.next(temp.slice(0, 10))
},0)
// this.pa
// this.length = this.pagedList.length
// console.log(this.PdListData,this.pagedList,text)
@ -144,14 +159,24 @@ console.log(this.displayedColumns)
// load inprogress pd list
public LenderRoleID : string = localStorage.getItem('LenderRoleID');
loadPDDetails() {
this.LenderRoleID = localStorage.getItem('LenderRoleID');
if(this.PdListData.length == 0) {
this.loaderService.showMatSpinnerDialog("Loading...")
}
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._pd.getPdDetails(this.LenderRoleID)
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.PdListData = data.records;
// this.PdListData = <GetOrInitializeYourListHere>;
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.PdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.PdListData.slice(0, 10));
}
this.length = this.PdListData.length;
this.PdListData.forEach(value=>{
let original=value.pd_sno
@ -176,6 +201,7 @@ console.log(this.displayedColumns)
}
// , error => {this.errorMessage = <any> error});
,error => {
this.loaderService.closeMatSpinnerDialog();
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
@ -183,12 +209,13 @@ console.log(this.displayedColumns)
}
OnPageChange(event: PageEvent){
let startIndex = event.pageIndex * event.pageSize;
let endIndex = startIndex + event.pageSize;
if(endIndex > this.length){
endIndex = this.length;
this.startIndex = event.pageIndex * event.pageSize;
this.endIndex = this.startIndex + event.pageSize;
if(this.endIndex > this.length){
this.endIndex = this.length;
}
this.pagedList.next(this.PdListData.slice(startIndex, endIndex));
let raw_data = this.filtered_raw_data && this.filtered_raw_data.length > 0 ? this.filtered_raw_data : this.PdListData
this.pagedList.next(raw_data.slice(this.startIndex, this.endIndex));
}
pageChange(e) {

View File

@ -74,7 +74,7 @@
<br/>
<div class="example-container">
<!--Start Mobile View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
@ -116,7 +116,7 @@
<!--End Mobile View Code-->
<!--Start Web View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="12" fxFlex.lg="12" fxFlex.xl="12" class="cell" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<span *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')" mat-line class="cell">{{details.pd_type_name}}</span>
@ -157,7 +157,7 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
@ -223,7 +223,7 @@
</mat-card-content>
<div [hidden]="recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="completedPdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
<mat-paginator #paginator class="mat-elevation-z1" [length]="length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent=OnPageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>

View File

@ -6,6 +6,8 @@ import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { UserService } from 'app/settings/service/user.service';
import { AwsService } from 'app/AwsService/aws.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { ReplaySubject } from 'rxjs';
@Component({
selector: 'app-completed-pd',
@ -51,10 +53,13 @@ export class CompletedPdComponent implements OnInit, OnChanges {
user_role_name: string;
limitMsg: boolean = false;
common: any;
pagedList: any=[];
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
user_id: any;
startIndex: any;
endIndex: any;
filtered_raw_data: any[];
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService) {
private _aws:AwsService, private loaderService:LoaderService) {
this.notifier = notifier;
this.searchForm = this._fb.group(
@ -111,21 +116,31 @@ export class CompletedPdComponent implements OnInit, OnChanges {
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
// filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab4.filter = filteredText;
// this.dataSourceTab4.filter = filteredText;
this.filterData(filteredText)
}
// load inprogress pd list
public LenderRoleID : any = localStorage.getItem('LenderRoleID');
loadPDDetails() {
if(this.completedPdListData.length == 0) {
this.loaderService.showMatSpinnerDialog("Loading...")
}
this._pd.getTabStatusPdDetails(this.tabStatus,this.LenderRoleID)
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.completedPdListData = data.records;
// this.dataLengthTab4 = data.records.length;
// this.dataSourceTab4.data = this.completedPdListData;
this.pagedList = this.completedPdListData.slice(0, 10);
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.completedPdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.completedPdListData.slice(0, 10));
}
this.length = this.completedPdListData.length;
this.completedPdListData.forEach(value=>{
let original=value.pd_sno
@ -144,6 +159,7 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID');
}
// , error => this.errorMessage = <any> error);
,error => {
this.loaderService.closeMatSpinnerDialog();
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
@ -151,12 +167,13 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID');
}
OnPageChange(event: PageEvent){
let startIndex = event.pageIndex * event.pageSize;
let endIndex = startIndex + event.pageSize;
if(endIndex > this.length){
endIndex = this.length;
this.startIndex = event.pageIndex * event.pageSize;
this.endIndex = this.startIndex + event.pageSize;
if(this.endIndex > this.length){
this.endIndex = this.length;
}
this.pagedList = this.completedPdListData.slice(startIndex, endIndex);
let raw_data = this.filtered_raw_data && this.filtered_raw_data.length > 0 ? this.filtered_raw_data : this.completedPdListData
this.pagedList.next(raw_data.slice(this.startIndex, this.endIndex));
}
pageChange(e) {
@ -265,7 +282,7 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID');
this.completedPdListData=res['records'];
// this.dataSourceTab4.data = res['records'];
// this.dataSourceTab4.paginator = this.paginator;
this.pagedList = this.completedPdListData.slice(0, 10);
this.pagedList .next(this.completedPdListData.slice(0, 10));
this.length = this.completedPdListData.length;
this.completedPdListData.forEach(value=>{
let original=value.pd_sno
@ -279,7 +296,7 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID');
// this.dataSourceTab4.paginator['pageIndex'] = 0;
// this.dataSourceTab4.data = [];
// this.completedPdListData = [];
this.pagedList = [];
this.pagedList.next([]);
this.recordStatus=true
this.limitMsg = false
}
@ -288,6 +305,34 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID');
this.notifier.notify('warning', 'Something Went Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
filterData(text) {
if(!text) {
setTimeout(()=>{
this.filtered_raw_data = []
this.pagedList .next(this.completedPdListData.slice(0, 10));
},0)
this.length = this.completedPdListData.length;
return
}
let temp = this.completedPdListData.filter(v=>{
if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1
|| v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1
||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) {
return true;
}
return false
})
setTimeout(()=>{
console.log(temp)
this.filtered_raw_data = temp
this.length = this.filtered_raw_data.length
this.pagedList.next(temp.slice(0, 10))
},0)
// this.pa
// this.length = this.pagedList.length
// console.log(this.PdListData,this.pagedList,text)
}
onReset(){
this.searchForm.reset();

View File

@ -37,7 +37,7 @@
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers required>
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers>
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('maxlength') || pdMainApplicant.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 15%">
@ -115,6 +115,6 @@
</form>
<!-- <notifier-container></notifier-container> -->
<notifier-container></notifier-container>

View File

@ -143,6 +143,9 @@ export class EditPdApplicantComponent implements OnInit {
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
this.coApplicantItems.push(this.createItem(listData));
}
else if(!listData){
this.notifier.notify("info","Please Fill all the fields")
}
}
@ -155,11 +158,11 @@ export class EditPdApplicantComponent implements OnInit {
return;
}
else {
if((formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){
if(this.data.lender_short_name != 'MWISE' && (formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else if(formValue.mobile_no.length != 10){
else if(this.data.lender_short_name != 'MWISE' && formValue.mobile_no.length != 10){
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
@ -252,6 +255,16 @@ export class EditPdApplicantComponent implements OnInit {
}
pd_applicant_details.push(obj1)
});
// FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE
if(this.data.lender_short_name == 'MWISE') {
let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null)
console.log(mobile_number_check)
if(mobile_number_check == 0 || mobile_number_check == -1) {
// this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'})
this.notifier.notify("info", "Please provide atleast 1 Mobile Number")
return;
}
}
this.disableAfterSubmit = true;
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
if (result.status == 200) {

View File

@ -73,7 +73,7 @@
<br/>
<div class="example-container">
<!--Start Mobile View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList" (click)="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED' ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
<p class="lettericon">{{details.pd_sno_split.lender_name}}<br/>
<span style="font-size: 90%">{{details.pd_sno_split.serial_no}}</span></p>
@ -115,7 +115,7 @@
<!--End Mobile View Code-->
<!--Start Web View Code-->
<div fxLayout="row wrap" *ngFor="let details of pagedList">
<div fxLayout="row wrap" *ngFor="let details of pagedList | async">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="12" fxFlex.lg="12" fxFlex.xl="12" class="cell" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<span *ngIf="(details.lender_short_name == 'MWISE' && details.fk_pd_type == '3') || (details.lender_short_name != 'MWISE')" mat-line class="cell">{{details.pd_type_name}}</span>
@ -156,7 +156,7 @@
</span><br/>
<span class="fontsize" style="font-weight: bold;font-size: 1.1rem;" [ngStyle] = "{'color' : details.fk_pd_allocated_to == user_id ? 'black' : 'gray'}" *ngIf="details.fk_pd_allocated_to != null" matTooltip="Allocated to" matTooltipPosition="above">{{details.fk_pd_allocated_to == user_id ? 'Self' : details.pd_allocated_to }}</span>
</div>
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.fk_pd_allocated_to == null || details.fk_pd_allocated_to == user_id || details.pd_status == 'BOUNCED'">
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="16.66" fxFlex.lg="16.66" fxFlex.xl="16.66" class="cell center" style="justify-content:flex-end" *ngIf="details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id">
<a [style.visibility]="details.pd_status=='INITIATED' && details.encrypted_url!=null && details.encrypted_url!='' ? 'visible' : 'hidden'" [attr.href]="details.encrypted_url" target="_blank">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary"
matTooltip="Officer Tracking" matTooltipPosition="above">
@ -220,7 +220,7 @@
</mat-card-content>
<div [hidden]="recordStatus">
<mat-paginator #paginator class="mat-elevation-z1" [length]="progressPdListData.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
<mat-paginator #paginator class="mat-elevation-z1" [length]="length" [pageIndex]="pageIndex" [pageSize]="pageSize"
[pageSizeOptions]="[5, 10, 25,50, 100]" (page)="pageEvent=OnPageChange($event)" showFirstLastButtons>
</mat-paginator>
</div>

View File

@ -6,6 +6,8 @@ import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { UserService } from 'app/settings/service/user.service';
import { AwsService } from 'app/AwsService/aws.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { ReplaySubject } from 'rxjs';
@Component({
selector: 'app-inprogress-pd',
@ -49,10 +51,13 @@ export class InprogressPdComponent implements OnInit, OnChanges {
user_role_name: string;
limitMsg: boolean = false;
common: any;
pagedList: any=[];
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
user_id: any;
startIndex: any;
endIndex: any;
filtered_raw_data:any = [];
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService,
private _aws:AwsService) {
private _aws:AwsService, private loaderService:LoaderService) {
this.notifier = notifier;
this.searchForm = this._fb.group(
@ -108,20 +113,29 @@ export class InprogressPdComponent implements OnInit, OnChanges {
// filteredText = filteredText ? filteredText.trim() : filteredText;
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab2.filter = filteredText;
this.filterData(filteredText)
}
// load inprogress pd list
public LenderRoleID : string = localStorage.getItem('LenderRoleID');
loadPDDetails() {
if(this.progressPdListData.length == 0) {
this.loaderService.showMatSpinnerDialog("Loading...")
}
this._pd.getTabStatusPdDetails(this.tabStatus,this.LenderRoleID)
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.progressPdListData = data.records;
// this.dataLengthTab2 = data.records.length;
// this.dataSourceTab2.data = this.progressPdListData;
this.pagedList = this.progressPdListData.slice(0, 10);
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.progressPdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.progressPdListData.slice(0, 10));
}
this.length = this.progressPdListData.length;
this.progressPdListData.forEach(value=>{
let original=value.pd_sno
@ -137,6 +151,7 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID');
this.limitMsg = false
}
},error => {
this.loaderService.closeMatSpinnerDialog();
this.errorMessage.push(error);
this.notifier.notify('warning', 'Something Went Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
@ -144,12 +159,13 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID');
}
OnPageChange(event: PageEvent){
let startIndex = event.pageIndex * event.pageSize;
let endIndex = startIndex + event.pageSize;
if(endIndex > this.length){
endIndex = this.length;
this.startIndex = event.pageIndex * event.pageSize;
this.endIndex = this.startIndex + event.pageSize;
if(this.endIndex > this.length){
this.endIndex = this.length;
}
this.pagedList = this.progressPdListData.slice(startIndex, endIndex);
let raw_data = this.filtered_raw_data && this.filtered_raw_data.length > 0 ? this.filtered_raw_data : this.progressPdListData
this.pagedList.next(raw_data.slice(this.startIndex, this.endIndex));
}
pageChange(e) {
@ -255,7 +271,7 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID');
this.progressPdListData = res['records'];
// this.dataSourceTab2.data = res['records'];
// this.dataSourceTab2.paginator = this.paginator;
this.pagedList = this.progressPdListData.slice(0, 10);
this.pagedList.next(this.progressPdListData.slice(0, 10));
this.length = this.progressPdListData.length;
this.progressPdListData.forEach(value=>{
let original=value.pd_sno
@ -269,7 +285,7 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID');
// this.dataSourceTab2.paginator['pageIndex'] = 0;
// this.dataSourceTab2.data = [];
this.progressPdListData = [];
this.pagedList = [];
this.pagedList.next([]);
this.recordStatus=true
this.limitMsg = false
}
@ -279,6 +295,34 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID');
alert(error.html_format);
});
}
filterData(text) {
if(!text) {
setTimeout(()=>{
this.filtered_raw_data = []
this.pagedList .next(this.progressPdListData.slice(0, 10));
},0)
this.length = this.progressPdListData.length;
return
}
let temp = this.progressPdListData.filter(v=>{
if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1
|| v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1
||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) {
return true;
}
return false
})
setTimeout(()=>{
console.log(temp)
this.filtered_raw_data = temp
this.length = this.filtered_raw_data.length
this.pagedList.next(temp.slice(0, 10))
},0)
// this.pa
// this.length = this.pagedList.length
// console.log(this.PdListData,this.pagedList,text)
}
onReset(){
this.searchForm.reset();

View File

@ -3,10 +3,11 @@
<div fxLayout="row">
<div fxFlex="50" class="pb-0 text-sm-left">
<mat-form-field dividerColor="primary" style="width: 50%;">
<input matInput [(ngModel)]="filterValue" placeholder="Search">
<input matInput autocomplete="off" [(ngModel)]="filterValue" placeholder="Search">
<span matSuffix class="close_btn_filter" *ngIf="filterValue" (click)="filterValue = ''"><mat-icon>close</mat-icon></span>
</mat-form-field>
</div>
<div fxFlex="50" class="pb-0 text-sm-right" *ngIf="user_role_name != 'sales' && LenderRoleID != '26'">
<div fxFlex="50" class="pb-0 text-sm-right" *ngIf="user_role_name != 'sales' && LenderRoleID != '26' && LenderRoleID != '27'">
<!-- <button mat-fab (click)="viewMapPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Map view" matTooltipPosition="above"><mat-icon>map</mat-icon></button> -->
<button mat-fab (click)="addPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Add PD" matTooltipPosition="above" *ngIf="roleAccessDetails.trigger"><mat-icon>add</mat-icon></button>
</div>

View File

@ -26,3 +26,10 @@
background-color: #fff !important;
float: right;
}
.close_btn_filter{
color: gainsboro
}
.close_btn_filter:hover{
color: black;
cursor: pointer;
}

View File

@ -59,12 +59,13 @@ export class ListPdComponent implements OnInit, OnDestroy {
this.user_role_name=role_name
})
if(localStorage.getItem('LocalSetEntity')) {
console.log("Sudden")
this.getUserFromLocal()
}
else{
// for Listening the local storage LocalSetEntity
this.userService.messageSubject.subscribe(rr=>{
console.log(rr)
console.log("late",rr)
this.getUserFromLocal()
// let entity_id = localStorage.getItem('LocalSetEntity')
// if(entity_id) {
@ -119,7 +120,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
}
pdListLoad(status: boolean){
this.viewPdList = status;
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==3 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
}
viewPDDetails(event){
@ -134,6 +135,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
//get tab changes
onTabClick(event: MatTabChangeEvent) {
this.getTabIndex=event.index;
this.filterValue = ''
// this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.scheduledTabC.loadPDDetails() : this.getTabIndex==2 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==3 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();
this.getTabIndex==0 ? this.allTabC.loadPDDetails() : this.getTabIndex==1 ? this.inprogressTabC.loadPDDetails() : this.getTabIndex==2 ? this.completedTabC.loadPDDetails() : this.qcCompletedTabC.loadPDDetails();

View File

@ -0,0 +1,64 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 10px !important;">
{{pageTitle}}
</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" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content class="mat-typography">
<!-- <form [formGroup]="_pdAllocationForm" (submit)="onSubmit()"> -->
<mat-list role="list" *ngIf="pdOfficerList.length > 0">
<mat-list-item role="listitem" *ngFor="let officer of pdOfficerList; let i = index">
<div fxFlex="100">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<mat-radio-button color="primary" [value]="officer" (change)="selectedItem = $event.value">
{{officer.first_name}} {{officer.last_name}}
</mat-radio-button>
</div>
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<span>{{officer.mobile_no}}</span>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="40" fxFlex.xl="40">
<span class="view_more" (click)="viewMoreDetails(officer)" matTooltip="View More" matTooltipPosition="right">PD in hand - {{officer.count}}</span>
</div> -->
</div>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="pdOfficerList.length == 0">
<mat-list-item>
<p>No <span *ngIf="data.lender_role_id == '25'">Regional </span>Credit Managers available.</p>
</mat-list-item>
</mat-list>
<!-- </form> -->
</mat-dialog-content>
<mat-dialog-actions >
<div fxFlex="50" align="left">
<p *ngIf="selectedItem"> <span *ngIf="data.lender_role_id == '25'">Regional </span>Credit Manager: {{selectedItem.first_name}}</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)="updatePdOfficer(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
<notifier-container></notifier-container>

View File

@ -0,0 +1,23 @@
.example-full-width{
width: 100%;
}
.view_more {
cursor: pointer;
color: #e00201 !important;
// text-decoration-line: underline;
// text-decoration-style: dotted;
// font-weight: bold;
}
.text_change {
color: #e00201 !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
// padding: 10px !important;
}

View File

@ -0,0 +1,126 @@
import { Component, OnInit, Inject, ViewEncapsulation } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
// import { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component';
// import { VendorPdAllocationComponent } from '../vendor-pd-allocation/VendorPdAllocationComponent';
@Component({
selector: 'app-pd-allocation',
templateUrl: './pd-allocation.component.html',
styleUrls: ['./pd-allocation.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class PdAllocationComponent implements OnInit {
public pageTitle: string = "Allocation To Credit Manager";
public _pdAllocationForm: FormGroup;
public pdOfficerList: any = [];
errorMessage: any;
notifier : NotifierService;
selectedItem:any;
isDisabled: boolean;
constructor( notifier: NotifierService,
private _fb: FormBuilder,
private dialogRef: MatDialogRef<PdAllocationComponent>,
private _pd: PdTrigerService, private dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public data: any) {
console.log(data)
this.notifier=notifier;
if(this.data.lender_role_id == '25') {
this.pageTitle = "Allocation To Regional Credit Manager"
}
}
ngOnInit() {
this.isDisabled=true;
console.log(this.data)
this.getPDOfficerList(this.data.pd_id);
// this._pdAllocationForm = this._fb.group({
// pd_primary_id: [null],
// allocation_id: [null],
// });
}
// convenience getter for easy access to form fields
// get readForm() { return this._pdAllocationForm.controls; }
// pd officer list
getPDOfficerList(pdID:string){
let user_type
if(this.data.lender_role_id == '25') {
user_type = "RCM"
}
else if(this.data.lender_role_id == '27') {
user_type = "CM"
}
this._pd.getCMUsers(this.data.state_id,user_type).subscribe(
data => {
if (data.status == 200) {
this.pdOfficerList= data.records
}
}, error => this.errorMessage = <any> error);
}
/** To update pd officer*/
updatePdOfficer(allocateDetails:any) {
if(!allocateDetails){
this.notifier.notify('warning', 'Please Choose PD Officer.!');
}
else {
let updateData = {
"pd_id":this.data.pd_id,
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
"fk_pd_allocated_to":allocateDetails.userid,
}
this._pd.updatePdOfficer(updateData).subscribe(
result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Allocated.!');
this.dialogRef.close(true);
}
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.!";
// this.dialogRef.close();
});
}
}
/** For Popup Close Button */
closeAllocationComponent(): void {
this.dialogRef.close();
}
// pd officer view more
// viewMoreDetails(details:any){
// if(Number(details.count) > 0) {
// const dialogSchedule = this.dialog.open(AllocationViewMoreComponent, {
// data: details,
// disableClose: true,
// position: { right: '0'},
// width:'100%',
// // hasBackdrop:false
// });
// // dialogSchedule.afterClosed()
// // .subscribe(dataresult => {
// // });
// }
// else {
// this.notifier.notify('warning', 'No PD In Hand');
// }
// }
// pd Vendor officer
viewVendorOfficer(){
this.dialogRef.close('openvendorallocation');
}
}

View File

@ -25,8 +25,8 @@ export class PdStatusChangeDialogueComponent implements OnInit {
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<PdStatusChangeDialogueComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
{
this.notifier = notifier;
this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Allocate to Self' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion';
this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='ALLOCATED' ? 'Do you want to allocate the PD to yourself ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion';
this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : this.data.pd_status == 'CM_ALLOCATED' ? 'Self Allocate' : 'Change Discussion';
this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : this.data.pd_status == 'CM_ALLOCATED' ? 'Do you want to Allocate the PD to yourself' : 'Change Discussion';
this.enableAddonPD = false;
this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true;
this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false;
@ -74,7 +74,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
this.pd.editPdMasterDetails(update_status, status).subscribe(result => {
if (result.status == 200) {
this.dialogRef.close({update_status:true});
this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Discussions Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully');
this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully');
}
else {
this.dialogRef.close({update_status:false});

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,76 @@
.example-full-width{
width: 100%;
}
::ng-deep { .min-padding > mat-dialog-container {
// background: black;
padding: 3%;
// overflow-y: scroll !important;
}
}
.view_more {
cursor: pointer;
color: #e00201 !important;
// text-decoration-line: underline;
// text-decoration-style: dotted;
// font-weight: bold;
}
.text_change {
color: #e00201 !important;
}
.cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
// padding: 10px !important;
}
.mat-form-field {
width: 100%;
}
.mat-error {
color: #e00201;
float: right;
}
@-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;
}

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

@ -42,8 +42,81 @@
[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%;">

View File

@ -16,6 +16,7 @@ export class DynamicFormComponent implements OnInit {
@Input() questions_JSON:any;
@Input() json_answers:any;
step: number=0;
step_child:number = 0
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
@ViewChild('accordion') Accordion: MatAccordion
constructor(private _fb:FormBuilder,private questionService:QuesFormService) { }
@ -38,9 +39,11 @@ export class DynamicFormComponent implements OnInit {
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) {
console.log(this.json_answers[parent_ques.group_key]);
// 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)=>{
console.log(parent_ques,g_i)
console.log(parent_ques,g_i,group_ques)
// debugger;
if(g_i != 0){
// let parent_control=this.form_group_name
@ -49,6 +52,28 @@ export class DynamicFormComponent implements OnInit {
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') {
console.log("Entered",group_ques[vv]);
if(group_ques[vv] && group_ques[vv].length > 0) {
//
group_ques[vv].forEach((child_val,child_index)=>{
if(child_index != 0) {
console.log(parent_ques,this.form_group_name.get(parent_ques.group_key)['controls'][g_i],parent_ques,vv,g_i)
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]
console.log(find_json,child_index,g_i)
this.addSecondLevelChild(g_i,find_json,this.form_group_name.get(parent_ques.group_key)['controls'][g_i])
}
}
})
}
}
})
})
}
}
@ -93,13 +118,61 @@ export class DynamicFormComponent implements OnInit {
let control_names:any= {}
let control = this.form_group_name.get(json_obj.group_key) as FormArray
json_obj.question.map(val=>{
control_names[val.question_key] = ''
// 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]:''})
})
console.log(control,json_obj.group_key,control_names);
}
else {
control_names[val.question_key] = ''
}
})
console.log(control,json_obj.group_key,control_names,json_obj.question);
// 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
console.log(this.form_group_name.value);
// debugger;
}
// ADDING A CHILD REPEATABLE OBJ IN A EXISTING FORM ARRYA
addSecondLevelChild(index,json_obj,parent_group) {
console.log(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] = ''
})
console.log(control,json_obj.group_key,control_names,json_obj.question);
// debugger;
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)
@ -107,9 +180,20 @@ export class DynamicFormComponent implements OnInit {
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
console.log(this.form_group_name.value);
parent_group.updateValueAndValidity();
this.step_child = control.length-1
console.log(this.form_group_name.value,this.questions_JSON);
// debugger;
}
// REMOVE OF CHILD REPEATABLE OBJ
removeSecondLevelChild(index,json_obj,parent_group) {
console.log(json_obj)
// 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
console.log(json_obj)
}
removeData(index,json_obj) {

View File

@ -20,6 +20,7 @@
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>
@ -69,7 +70,8 @@
<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">{{val.answer}}</mat-option>
[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())">
@ -175,7 +177,8 @@
<mat-option
*ngFor="let val of ngxFilteredValue | async"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
[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())">

View File

@ -79,3 +79,12 @@ mat-form-field {
::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

@ -3,6 +3,8 @@ 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';
@Component({
selector: 'app-dynamic-question-template',
@ -25,7 +27,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
autoCompleteAns:Observable<string[]>
public commonFilterCtrl:FormControl = new FormControl();
public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(private quesService:QuesFormService,private _fb:FormBuilder) { }
constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog) { }
ngOnInit() {
this.parent_ques = this.currFormArrayObj
@ -60,16 +62,25 @@ export class DynamicQuestionTemplateComponent implements OnInit {
this.generateGroupControls.emit()
}
this.json_answers.forEach((value,index)=>{
let keys= Object.keys(value)
keys.forEach(vv=>{
console.log("ype of ",value[vv],typeof(value[vv]),this.whole_json)
// debugger;
if(typeof(value[vv])== 'string') {
// console.log("ype of ",typeof(value[vv]))
// console.log("ansssssssssssssssssssssssssssss",this.json_answers[vv],vv,this.whole_json.filter(vl=>vl.question_key == vv))
if(this.whole_form.get(this.group_key)) {
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,'')
}
console.log("Repeatable ques",value,this.parent_ques.question_key)
}
})
})
// debugger;
@ -399,8 +410,8 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// })
console.log(expression_value)
let calc_exp=eval(expression_value)
console.log(calc_exp)
if(calc_exp){
console.log(calc_exp, (typeof(calc_exp) == 'string' || typeof(calc_exp) == 'number' ))
if( (typeof(calc_exp) == 'string' || typeof(calc_exp) == 'number' ) ){
// if(typeof(calc_exp) == 'number'){
// calc_exp = calc_exp.toFixed(2)
// }
@ -490,7 +501,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
let inserted_control_obj=form_control_obj
// inserted_control_obj.questions.sort()
// inserted_control_obj.questions.reverse()
console.log("check ddddddddddd",inserted_control_obj.questions.reverse(),inserted_control_obj.questions)
console.log("check ddddddddddd",inserted_control_obj.questions)
inserted_control_obj.questions.forEach((val,index)=>{
if(val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') {
if(options == 1) {
@ -506,7 +517,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
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)
// 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));
@ -522,7 +533,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// 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)
// 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)
})
}
@ -678,6 +689,9 @@ export class DynamicQuestionTemplateComponent implements OnInit {
ques_control=this.whole_json[this.json_index]
console.log(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
@ -703,6 +717,32 @@ export class DynamicQuestionTemplateComponent implements OnInit {
this.quesService.settingArrayofValidators({validations:new_validations_obj,question_key:validation_obj.validation_to},this.formGroupN,'')
}
}
newAnswerCreateDialog(choosed_answer_obj,curr_ques_obj) {
console.log(curr_ques_obj,choosed_answer_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) {
console.log(curr_ques_obj.answers,curr_ques_obj.answers.length -2,rr.address_for_display)
// 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
console.log(curr_ques_obj.answers,curr_ques_obj.answers[curr_ques_obj.answers.length-2].answer_id)
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){
console.log("updae msg",ques_control,validation_obj);
if(!ques_control) {

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { FormGroup, FormArray, FormBuilder, FormControl, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpParams } from '@angular/common/http';
import { environment } from 'environments/environment';
import { DatePipe } from '@angular/common';
@ -42,32 +42,15 @@ export class QuesFormService {
ques_data[index].group_questions = []
ques_data[index].group_questions.push(val.question)
val.group_questions[0].forEach((group_indi, arr_index) => {
// if(group_indi.api_properties != null && typeof(group_indi.api_properties) == 'object'){
console.log("api pro", val.api_properties)
// let param
// val.api_properties.forEach(val=>param=val)
// console.log(param)
// CREATING A FORMARRAY AND CONTROL FOR CHILD REPEATABLE
if(group_indi.is_repeatable == '2') {
this.addLevelTwoControls(group_indi,childControl,val.group_questions[0],val.question,arr_index)
}
else {
group_indi.raw_validations = group_indi.validations
// sub_childControl.push(this.createValue(group_indi))
// childControl.addControl(group_indi.question_key,new FormControl(''))
control_names[group_indi.question_key] = ''
// childControl.push(this._fb.group({
// [group_indi.question_key] :['']
// }))
// setTimeout(()=>{
// this.addAdditionalControl(group_indi, childControl.at(arr_index), arr_index)
// },2000)
// if(group_indi.type == '5'){
// sub_childControl.controls[arr_index].removeControl('answer_value');
// console.log("loop",arr_index,sub_childControl);
// sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
// }
// if(group_indi.type == '1'){
// sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
// }
// if(val.type == '8'){
// sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type))
// }
if (group_indi.api_properties != null) {
if(group_indi.api_properties.hasOwnProperty('purpose') && group_indi.api_properties.purpose == 'answer_options_local') {
@ -91,6 +74,7 @@ export class QuesFormService {
const question_temp:any = JSON.parse(JSON.stringify(val.question));
ques_data[index].question = question_temp
}
// else{
// setTimeout(()=>{
// sub_childControl.push(this.createValue(group_indi))
@ -98,15 +82,34 @@ export class QuesFormService {
// }
// sub_childControl.push(this.createValue(group_indi))
})
console.log(control_names);
console.log(control_names, childControl.at(0));
// debugger
// val.questions[0]=val.question;
if(childControl.value.length == 0) {
childControl.push(this._fb.group(control_names))
}
else{
// MERGINE THE 0 INDEX ARRAY WITH CHILD REPEATABLE
// control_names[childControl.at(0)] =''
let previous_added_controls = childControl.at(0).controls
control_names = Object.assign(previous_added_controls,control_names)
console.log(control_names);
// debugger;
childControl.setControl(0,this._fb.group(control_names))
}
console.log(formgroup.value);
// debugger;
val.group_questions[0].forEach((group_indi,arr_index)=>{
console.log("sd",childControl,group_indi)
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)=> {
this.addAdditionalControl(child_val, childControl.at(0).get(group_indi.group_key).controls[0], child_index)
})
}
else{
this.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
}
})
// }
@ -175,7 +178,8 @@ export class QuesFormService {
// else{
// control.push(this.createValue(val))
// }
console.log(formgroup)
console.log(formgroup,ques_data)
// debugger;
}
}, err => console.log(err))
@ -183,6 +187,60 @@ export class QuesFormService {
}
// END OF FORM CREATION
// FUNCTIONAL TO HANDLE THE CREATION OF CHILD REPEABLE 2
addLevelTwoControls(curr_obj:any,child_control,group_ques,valQues,group_index) {
console.log(child_control)
// CURR VALUE(MULTI ARRAY)
const question_temp:any = JSON.parse(JSON.stringify(curr_obj.questions_level_two));
group_ques[group_index].questions_level_two = []
group_ques[group_index].questions_level_two.push(question_temp)
group_ques[group_index].question = question_temp
// RAW VALUES(SINGLE ARRAY)
valQues[group_index].question = question_temp
valQues[group_index].questions_level_two = []
valQues[group_index].questions_level_two.push(question_temp)
console.log(group_ques[group_index],question_temp);
// debugger;
let group_key:any = {}
group_key[curr_obj.group_key] = this._fb.array([])
child_control.push(this._fb.group(group_key))
console.log(child_control)
console.log(child_control.at(0),child_control.controls[0].controls[curr_obj.group_key])
// debugger;
let levelTwoChildCtrl: any = child_control.at(0).get(curr_obj.group_key) as FormArray
let control_names:any={}
curr_obj.questions_level_two[0].forEach((val,arr_index)=>{
console.log("Level 2",val)
val.raw_validations = val.validations
control_names[val.question_key] = ''
if (val.api_properties != null) {
if(val.api_properties.hasOwnProperty('purpose') && val.api_properties.purpose == 'answer_options_local') {
if(val.api_properties.master_name == 'pd_applicants') {
val.answers = (this.convertArrayNames( val.api_properties.fields,this.pd_all_details.pdapplicants_detials))
// val.question[arr_index].answers = val.answers
}
}
else{
this.apiPropertiesCall(val).then(res => {
if (res != false) {
val.answers = []
// group_indi.answers=this.convertArrayNames(val.api_properties.fields,res)
val.answers = (this.convertArrayNames(val.api_properties.fields, res))
// val.question[arr_index].answers = val.answers
}
})
}
}
})
console.log(group_ques[group_index])
levelTwoChildCtrl.push(this._fb.group(control_names))
// console.log(formgroup.value);
}
// FOR CREATING THE FORM CONTROL FOR SPECIFIC FORM ARRAY
createValue(data){
@ -227,6 +285,7 @@ export class QuesFormService {
if(res['dataStatus']){
if(res.hasOwnProperty('records')){
res=res['records']
// res.push({display:"Add New", id:"00",is_others:"-1"})
}
if(val.api_properties.hasOwnProperty('filter_properties') && val.api_properties.filter_properties && res.length > 0) {
let filter_properties = val.api_properties.filter_properties
@ -251,7 +310,19 @@ export class QuesFormService {
return this.http.post(apiUrl+api_name,params)
}
else{
return this.http.get(apiUrl+api_name)
let httpParams = new HttpParams()
if(params) {
let keysList = Object.keys(params)
if(keysList.length > 0) {
keysList.forEach(val=>{
if(params[val] == 'VAR_PD_ID') {
params[val] = this.pd_all_details.pdmaster_details.pd_id
}
httpParams = httpParams.set(val,params[val])
})
}
}
return this.http.get(apiUrl+api_name,{params:httpParams})
}
}
@ -265,7 +336,7 @@ export class QuesFormService {
return {
"answer_id" : obj[fieldName[0]],
"answer":obj[fieldName[1]],
"is_others":obj.is_others ? obj.is_others : '0'
}
});
return modified_json

View File

@ -42,6 +42,7 @@ export class FormComponent implements OnInit {
private pdTriggerService:PdTrigerService,
private awsService:AwsService,private loaderService:LoaderService) {
// console.log(this.pd_all_details)
// debugger;
this.form_id = 24;
this.pd_all_details.pdmaster_details=this.pd_all_details.pdmaster_details[0]
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
@ -135,10 +136,17 @@ export class FormComponent implements OnInit {
// this.commonFormGroup.patchValue(formValues)
}
}
if(this.pd_all_details.pdmaster_details.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() {
getExcelData(re_uploaded?) {
let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id}
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
if(result['dataStatus']) {
@ -153,10 +161,15 @@ export class FormComponent implements OnInit {
// })
console.log(formValues)
// debugger;
if(re_uploaded && re_uploaded == '1') {
this.commonFormGroup.patchValue(formValues)
}
else {
this.form_answers= formValues
setTimeout(()=>{
this.form_answers = null
},2500)
}
// this.commonFormGroup.patchValue(formValues)
}
}
@ -278,7 +291,10 @@ export class FormComponent implements OnInit {
return;
}
this.loaderService.showMatSpinnerDialog('')
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''}
let params :any = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''}
if(this.pd_all_details.pdmaster_details.re_uploaded == '1') {
params.is_reupload_data_fetched = '1'
}
this.pdTriggerService.saveSMCCreditPDsection(params).subscribe(result=>{
if(result['dataStatus']) {
this.notifier.notify("success","Saved successfully..")

View File

@ -1,5 +1,6 @@
import { Component, OnInit, Output, EventEmitter, Input, ElementRef, ViewChild } from '@angular/core';
import { CameraService } from 'app/personal-discussion/pd-service/camera.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { Ng2ImgMaxService } from 'ng2-img-max';
@Component({
@ -11,7 +12,7 @@ export class CaptureBtnComponent implements OnInit {
@ViewChild('input_file') fileBtn :ElementRef
@Input() addMoreBtn;
@Output() imageDataEmitter = new EventEmitter
constructor(private ng2ImgMax:Ng2ImgMaxService,private cameraService:CameraService) { }
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) { }
ngOnInit(): void {
console.log(this.addMoreBtn)
@ -20,12 +21,16 @@ export class CaptureBtnComponent implements OnInit {
// event.stopPropagation()
console.log(event);
let imageData= event.target.files[0]
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
this.loaderService.showMatSpinnerDialog("Optimizing image..")
this.ng2ImgMax.resizeImage(imageData, 450, 650,true).subscribe(
result => {
this.loaderService.closeMatSpinnerDialog();
this.imageDataEmitter.emit(result)
},
error => {
this.loaderService.closeMatSpinnerDialog();
console.log('😢 Oh no!', error);
alert(JSON.stringify(error))
}
);

View File

@ -97,7 +97,7 @@ export class ImageCaptureComponent implements OnInit {
// this.router.navigateByUrl('error');
// }
addImage(event,index){
this.loaderService.showMatSpinnerDialog('');
this.loaderService.showMatSpinnerDialog('Processing watermark..');
console.log(event,index);
var reader = new FileReader();
// let imagePath = event;

View File

@ -22,7 +22,7 @@
<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 }}
{{ formButton.form_name }} <span *ngIf="formButton.complete_check_enabled == '1'" class="required_star_class">*</span>
</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>

View File

@ -81,4 +81,9 @@ mat-card .child_mat_card > mat-card {
}
}
.required_star_class
{
color: red;
font-size: 1em;
}

View File

@ -116,9 +116,10 @@ export class StartPdComponent implements OnInit, OnDestroy {
// this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true);
this.categoryFormButtons = data.records.template_details
// this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true);
this.actualQuestions = this.categoryFormButtons.length;
let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.is_answered==='1');
this.actualQuestions = this.categoryFormButtons.filter(item => item.complete_check_enabled == '1').length;
let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.is_answered==='1' && item.complete_check_enabled == '1');
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') {
@ -157,6 +158,8 @@ export class StartPdComponent implements OnInit, OnDestroy {
// load pd status change dialogue
pdStatusDialogue(status: string, checkType: number): void {
// checkType==2 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
// return;
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,
@ -166,13 +169,15 @@ export class StartPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
setTimeout(()=>{
checkType==2 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
},2000)
}
else {
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
checkType==1 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
}
if(checkType == 2){
this.loadTemplates(this.startPD,2,this.randomString);
// this.loadTemplates(this.startPD,2,this.randomString);
}
});
}
@ -196,6 +201,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
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.is_reupload_data_fetched = this.selectedFormsCategory.is_reupload_data_fetched
console.log(this.pdFullDetails);
let componen_name:any = FormComponent
if(this.pdFullDetails.form_id == '20') {

View File

@ -17,6 +17,7 @@ import { ImageCaptureComponent } from './forms/image-capture/image-capture.compo
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/answer-option-create-dialog/answer-option-create-dialog.component';
const pdCustomNotifierOptions: NotifierOptions = {
position: {
@ -74,7 +75,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
Ng2ImgMaxModule,
NgxViewerModule
],
declarations: [StartPdComponent, FormComponent,DynamicFormComponent,DynamicQuestionTemplateComponent, ImageCaptureComponent,CaptureBtnComponent],
entryComponents:[FormComponent,ImageCaptureComponent]
declarations: [StartPdComponent, FormComponent,DynamicFormComponent,DynamicQuestionTemplateComponent, ImageCaptureComponent,CaptureBtnComponent, AnswerOptionCreateDialogComponent],
entryComponents:[FormComponent,ImageCaptureComponent,AnswerOptionCreateDialogComponent]
})
export class StartPdModule { }

View File

@ -21,12 +21,16 @@
<mat-icon>videocam</mat-icon>&nbsp;
<strong>Call</strong>
</button>
<button mat-stroked-button class="mr-1 mb-1" color="primary" (click)="openExcelUpload()" *ngIf="master.lender_short_name == 'MWISE' &&(LenderRoleID == '25' || LenderRoleID == '26' || LenderRoleID == '27') && currentPDStatus!=pdStatusCheck.INPROGRESS && currentPDStatus!=pdStatusCheck.COMPLETED" >
<mat-icon>upload_file</mat-icon>&nbsp;
<strong>Upload Excel</strong>
</button>
<button mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong>
</button>
<button *ngIf="roleAccessDetails.trigger && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)" matTooltipPosition="above" matTooltip="Edit PD Master"><mat-icon>edit</mat-icon></button>
<button *ngIf="roleAccessDetails.trigger && (LenderRoleID == '25' && (currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED)) || (currentPDStatus==pdStatusCheck.DRAFT)" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)" matTooltipPosition="above" matTooltip="Edit PD Master"><mat-icon>edit</mat-icon></button>
<button *ngIf="roleAccessDetails.trigger && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master)"><mat-icon>flash_on</mat-icon></button>
<button *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && roleAccessDetails.reports && master.pd_type_name && (currentPDStatus==pdStatusCheck.QC_COMPLETED || currentPDStatus==pdStatusCheck.COMPLETED)" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="smcCreditPDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button *ngIf="(master.lender_short_name != 'MWISE' && currentPDStatus==pdStatusCheck.QC_COMPLETED ) || (master.lender_short_name == 'MWISE' && LenderRoleID != '25' && currentPDStatus==pdStatusCheck.COMPLETED) && roleAccessDetails.reports && master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="smcCreditPDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<span><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button></span>
</div>
</div>
@ -192,9 +196,12 @@
</div>
<div fxFlex="60" align="right">
<!-- <span><button *ngIf="roleAccessDetails.trigger && addresses.assigned_pd==null || addresses.assigned_pd==''" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" [matTooltip]="master.fk_primary_address_id ? 'Initiate PD for this address' : 'Initiate Address for PD Process'" matTooltipPosition="above" (click)="initiateAddtionalPD(master,addresses,master.fk_primary_address_id ? true : false)"><mat-icon>where_to_vote</mat-icon></button></span> -->
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Reject" matTooltipPosition="above" (click)="rejectPD()"><mat-icon>settings_backup_restore</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && currentPDStatus!=pdStatusCheck.TRIGGERED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
<!-- {{userId == master.fk_pd_allocated_to}} -->
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && userId == master.fk_pd_allocated_to"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Reject" matTooltipPosition="above" (click)="rejectPD()"><mat-icon>settings_backup_restore</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && (LenderRoleID == '27' || LenderRoleID == '25' && currentPDStatus == pdStatusCheck.BOUNCED)"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && userId == master.fk_pd_allocated_to)|| (currentPDStatus == pdStatusCheck.BOUNCED && userId == master.fk_pd_allocated_to)) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_state)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && (LenderRoleID == '26')"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && master.pd_allocated_to_role_id == '27')) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_city)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED || currentPDStatus == pdStatusCheck.INPROGRESS)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Send back to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && (LenderRoleID == '27' || currentPDStatus!=pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
</div>
</div>
</div>
@ -234,7 +241,7 @@
</div>
<div fxFlex="60" align="right">
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Reject" matTooltipPosition="above" (click)="rejectPD()"><mat-icon>settings_backup_restore</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && LenderRoleID != '26'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.BOUNCED || currentPDStatus == pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation()"><mat-icon>verified_user</mat-icon></button></span>
<!-- <span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10 "><button *ngIf="roleAccessDetails.schedule && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.COMPLETED && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.ADD_ON_PENDING && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span> -->
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && currentPDStatus!=pdStatusCheck.TRIGGERED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
</div>
@ -317,7 +324,7 @@
<div fxFlex="70" align="left" style="padding: 10px !important;">
<mat-card-title>Applicants</mat-card-title>
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;" *ngIf="roleAccessDetails.trigger && currentPDStatus==pdStatusCheck.DRAFT ">
<div fxFlex="30" align="end" style="padding: 10px !important;" *ngIf="roleAccessDetails.trigger && (LenderRoleID == '25' && (currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED)) || (currentPDStatus==pdStatusCheck.DRAFT)">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdApplicant(pdApplicantData,CustomerSegmentAbbr)"><mat-icon>edit</mat-icon></button>
</div>
</mat-card-header>

View File

@ -5,9 +5,8 @@ import { MatDialog } from '@angular/material';
import { DatePipe } from '@angular/common';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
// import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component';
import { TelePdAllocationComponent } from './../tele-pd-allocation/tele-pd-allocation.component';
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
import { ListPdComponent } from '../list-pd.component';
// import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
@ -20,6 +19,7 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi
import Swal from 'sweetalert2';
import { VideoPlayerComponent } from 'app/video-player/video-player.component';
import { AwsService } from 'app/AwsService/aws.service';
import { ExcelUploadDialogComponent } from '../add-pd/excel-upload-dialog/excel-upload-dialog.component';
@Component({
selector: 'app-view-pd',
@ -123,6 +123,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// }
]
};
userId: any;
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
@ -133,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.userId = this._aws.getlocale()
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
@ -284,6 +286,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
"pdID": this.viewID,
"records": applicantData,
"SegmentAbbr":CSAbbr,
lender_short_name:this.pdMasterData[0].lender_short_name
}
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
data: setPdDetails,
@ -433,10 +436,31 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
});
}
downloadPDReport() {
let data = {
"pd_id": this.viewID,
"random_string":this.pdMasterData[0].random_string
};
this._pd.generatePDReportPDF(data).subscribe(data => {
if (data.dataStatus) {
window.open(data.records);
this.notifier.notify('success', 'Done Successfully..!');
} else {
this.notifier.notify('warning', data.msg ? data.msg :'Something Went Wrong Try Again.!');
}
}, err => {
this.notifier.notify('error', err.msg ? err.msg :'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
// alert(err.html_format);
});
}
smcCreditPDReport(pd_id) {
// this.destroyType = 3;
// this.router.navigate(['../../../pd_report', pd_id,this.masterRandomString], { relativeTo: this.route });
if(this.pdMasterData[0].lender_short_name != 'MWISE') {
this.downloadPDReport()
return
}
let params = { "pd_id":pd_id,"fk_createdby":"","regenerate":"0"}
this._pd.smcCreditPDReport(params).subscribe(result=>{
if(result.dataStatus) {
@ -504,9 +528,24 @@ else {
}
/** To update pd officer*/
selfAllocation() {
selfAllocation(state_id) {
if(this.LenderRoleID == '27' || this.LenderRoleID == '25') {
const dialogRef1 = this.dialog.open(PdAllocationComponent, {
data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly',state_id:state_id, lender_role_id:this.LenderRoleID },
disableClose: true,
minWidth: '30%',
})
dialogRef1.afterClosed().subscribe(rr=>{
if(rr) {
this.viewPdDetails(this.viewID)
}
// this.notifier.notify("success","Allocated Successfully")
})
}
else{
// return;
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
data: { pdid:this.viewID, pd_status: "CM_ALLOCATED",random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
disableClose: true,
minWidth: '30%',
// maxWidth: '40%',
@ -541,9 +580,23 @@ else {
});
}
});
}
}
openExcelUpload() {
const dialogRef = this.dialog.open(ExcelUploadDialogComponent,{
data:{pd_id:this.viewID},
minWidth:'50vw',
maxWidth:'75vw'
})
dialogRef.afterClosed().subscribe(rr=>{
if(rr.dataStatus) {
this.notifier.notify("success","Uploaded Successuflly")
}
})
}
rejectPD() {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid: this.viewID, pd_status: this.pdStatusCheck.BOUNCED,random_string:this.pdMasterData[0].random_string },
@ -559,6 +612,32 @@ else {
}
});
}
allocateToCpa() {
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' },
disableClose: true,
minWidth: '30%',
// maxWidth: '40%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
// return;
let lenderMasterArray = { "pd_id": this.viewID,random_string:this.masterRandomString }
this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'Updated successfully.');
this.viewPdDetails(this.viewID);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
});
}
// updateViewComponent(editBack:string) {

View File

@ -127,6 +127,7 @@ import { ExcelUploadDialogComponent } from './list-pd/add-pd/excel-upload-dialog
import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component';
import { VideoPlayerComponent } from 'app/video-player/video-player.component';
import { MatVideoModule } from 'mat-video';
import { PdAllocationComponent } from './list-pd/pd-allocation/pd-allocation.component';
/**
* Custom angular notifier options
@ -174,7 +175,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
@NgModule({
declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent,
SpeedDialFabComponent,VideoPlayerComponent],
SpeedDialFabComponent,VideoPlayerComponent,PdAllocationComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
@ -216,7 +217,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective],
entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent],
entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent,VideoPlayerComponent,
PdAllocationComponent],
})
export class ManagePdModule {
}

View File

@ -175,9 +175,9 @@ export class PdTrigerService {
const Lender:any = entity_id ?
{ params: new HttpParams().set('lenderid', entity_id) } :
{ };
if(LenderRoleID == '25') {
Lender.params = Lender.params.set('createdby',userid)
}
// if(LenderRoleID == '25') {
Lender.params = Lender && Lender.params ? Lender.params.set('createdby',userid) : {}
// }
return this._http.get<any>(this.apiUrl + "listLessPDDetails/get",Lender)
.pipe(
catchError(this.handleError('operation', []))
@ -198,9 +198,9 @@ export class PdTrigerService {
// { params: new HttpParams().set('createdby', userid) };
let paramHttp:any= entity_id && status ?
{params : new HttpParams().set('lenderid', entity_id).set('status',status)} : {};
if(LenderRoleID == '25') {
// if(LenderRoleID == '25') {
paramHttp.params = paramHttp.params.set('createdby',userid)
}
// }
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp)
.pipe(
catchError(this.handleError('operation', []))
@ -656,9 +656,9 @@ export class PdTrigerService {
overAllSearchFormDetails(searchItem) {
let LenderRoleID : any = localStorage.getItem('LenderRoleID');
let userid=this._aws.getlocale()
if(LenderRoleID == '25') {
// if(LenderRoleID == '25') {
searchItem.createdby = userid
}
// }
let records = { 'records': searchItem };
return this._http.post(this.apiUrl + 'filterPDList', records).pipe(
catchError(this.handleError('operation', []))
@ -813,8 +813,12 @@ checkExistPDDetails(datas,entity_id){
return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id})
.pipe(catchError(this.handleError("checkExistPDDetails",[])))
}
uploadSMCDataFile(file) {
let records = {"rand_key":"qwerty1234"}
uploadSMCDataFile(file,pd_id ?) {
// let records = {"rand_key":"qwerty1234"}
let records :any= {}
if(pd_id) {
records.fk_pd_id = pd_id
}
let formData= new FormData()
formData.append("pd_excel_data",file)
formData.append("records",JSON.stringify(records))
@ -882,6 +886,17 @@ loadTemplate(form_id) {
return this._http.post(this.apiUrl+'updateTwlioVideoStatus',params)
.pipe(catchError(this.handleError("updateTwlioVideoStatus",[])))
}
getCMUsers(state_id,user_type):Observable<any> {
let param = new HttpParams().set('state_id',state_id).set('usertype',user_type)
return this._http.get(this.apiUrl+"getCMUsers",{params:param})
}
saveNewSMCTempAddresses(params) {
params = {records:params}
return this._http.post(this.apiUrl+'saveNewSMCTempAddresses',params)
}
getSMCTempAddresses(pd_id) {
let params = new HttpParams().set("pdid",pd_id)
return this._http.get(this.apiUrl+'getSMCTempAddresses',{params})
}
}

View File

@ -20,6 +20,7 @@ export class LoaderService {
this.loaderSubject.next(<LoaderState>{ show: false });
}
showMatSpinnerDialog(message ?:String) {
this.closeMatSpinnerDialog();
this.spinnerdialogRef = this.dialog.open(ProgressSpineerDialogComponent, {
data:message,
panelClass: 'transparent',

View File

@ -90,6 +90,33 @@
}
]
},
{
"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",

File diff suppressed because it is too large Load Diff

View File

@ -31,13 +31,7 @@
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ] },
{
@ -63,13 +57,7 @@
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -84,13 +72,7 @@
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -105,13 +87,7 @@
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -244,13 +220,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -266,13 +236,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"max",
"isactive":"1",
@ -289,13 +253,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -323,13 +281,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
@ -352,13 +304,7 @@
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{

View File

@ -31,13 +31,7 @@
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ] },
{
@ -63,13 +57,7 @@
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -84,13 +72,7 @@
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -105,13 +87,7 @@
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -244,13 +220,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -266,13 +236,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"max",
"isactive":"1",
@ -289,13 +253,7 @@
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -323,13 +281,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
@ -352,13 +304,7 @@
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{

View File

@ -32,13 +32,7 @@
"parent_question_key": "stock_info_available",
"answers": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field required",
"value": null
}
]
}
]
@ -80,13 +74,7 @@
}
],
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field required",
"value": null
}
]
}
]
@ -125,13 +113,7 @@
}
],
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field required",
"value": null
}
]
},
{
@ -145,13 +127,7 @@
"is_repeatable": null,
"field_type": "string",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
]
},
{
@ -171,13 +147,7 @@
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
],
"onchange_properties": [
{
@ -222,13 +192,7 @@
"parent_question_key": "provider_observed",
"answers": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Either Estimated Stock value or Estimated Quantity is required",
"value": null
}
]
},
{
@ -314,13 +278,7 @@
}
],
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field required",
"value": null
}
]
},
{

View File

@ -38,13 +38,23 @@
],
"questions":[
{
"question":"Enter actual PD address",
"question":"Choose the actual PD address",
"question_key":"alternative_address",
"place_holder":"",
"field_type":"string",
"type":"7",
"type":"3",
"field_width":"100",
"api_properties":null,
"api_properties":{
"api":"getSMCTempAddresses",
"api_method":"GET",
"params":{
"pdid":"VAR_PD_ID"
},
"fields":[
"display",
"display"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
@ -90,7 +100,7 @@
"question":"Type of PD address",
"question_key":"address_type",
"type":"3",
"field_width":"45",
"field_width":"90",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",

View File

@ -36,13 +36,7 @@
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -51,13 +45,7 @@
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -71,13 +59,7 @@
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -100,13 +82,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -119,13 +95,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -161,13 +131,7 @@
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -175,13 +139,7 @@
}],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -224,13 +182,7 @@
"parent_question_key":"is_transfer",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -253,13 +205,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -273,13 +219,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
@ -288,13 +228,7 @@
}],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -307,13 +241,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -331,13 +259,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -371,13 +293,7 @@
"parent_question_key":"construction_status",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -386,13 +302,7 @@
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -407,13 +317,7 @@
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -428,112 +332,31 @@
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Address of the proposed property",
"question_key":"address",
"place_holder":"Enter door no,street",
"type":"7",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"place_holder":"",
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Address Required",
"value":null
}
]
},
{
"question":"State",
"question_key":"state",
"type":"8",
"field_width":"45",
"answers":null,
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"api":"getSMCTempAddresses",
"api_method":"GET",
"params":{
"master_name":"STATE"
"pdid":"VAR_PD_ID"
},
"fields":[
"state_id",
"name"
"display",
"display"
]
},
"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":"8",
"field_width":"45",
"answers":null,
"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":"8",
"field_width":"45",
"answers":null,
"api_properties":"local_pincode",
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Pincode Required",
"value":null
}
]
},
{
@ -548,13 +371,7 @@
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -569,13 +386,7 @@
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{

View File

@ -96,6 +96,29 @@
"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?",
@ -167,30 +190,8 @@
"value":null
}
]
},
{
"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
}
]
}
]
}
]

View File

@ -13,13 +13,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -47,6 +41,22 @@
"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)",
@ -62,29 +72,7 @@
"parent_question_key":"is_business_address",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"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":[
]
},
{
@ -120,13 +108,7 @@
"parent_question_key":"business_is_pd_visited",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -144,13 +126,7 @@
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -186,13 +162,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -212,13 +182,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -293,13 +257,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -331,13 +289,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -359,13 +311,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -375,13 +321,7 @@
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -466,22 +406,25 @@
"question_key":"property_address",
"place_holder":"",
"field_type":"string",
"type":"7",
"field_width":"45",
"api_properties":null,
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -508,13 +451,7 @@
"parent_question_key":"property_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -526,13 +463,7 @@
"parent_question_key":"business_assets_mode",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -588,13 +519,7 @@
"parent_question_key":"vehicle_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -606,13 +531,7 @@
"parent_question_key":"business_assets_mode",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -623,13 +542,7 @@
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -676,13 +589,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -702,13 +609,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
@ -785,13 +686,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -822,13 +717,7 @@
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -850,13 +739,7 @@
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}],
"is_repeatable":"1",
@ -878,13 +761,7 @@
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{

View File

@ -22,13 +22,6 @@
"is_repeatable": null,
"field_type": "string",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
]
},
{
@ -41,13 +34,6 @@
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Field Required",
"value": null
}
]
},
{
@ -77,7 +63,8 @@
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls":[{
"form_controls": [
{
"insert_index": "account_type",
"expression": "(String('account_type').toLowerCase() != String('savings') && String('account_type').toLowerCase() != String('current'))",
"value_keys": [
@ -95,31 +82,19 @@
"onchange_properties": null,
"is_repeatable": 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
}
]
}
],
"is_repeatable": "1",
"group_title": "Banking Details",
@ -136,8 +111,7 @@
"is_repeatable": null,
"field_type": "string",
"field_width": "45",
"validations":[
]
"validations": []
}
]
}

View File

@ -36,13 +36,7 @@
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -51,13 +45,7 @@
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -71,13 +59,7 @@
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -90,13 +72,7 @@
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
@ -132,13 +108,7 @@
"parent_question_key":"total_fund_requirement",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
@ -146,13 +116,7 @@
}],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{