pd additional requirement changes

This commit is contained in:
gandhimathi 2018-12-05 18:52:24 +05:30
parent c62d273c7a
commit 9c4d281a16
19 changed files with 1021 additions and 646 deletions

View File

@ -1,23 +1,26 @@
<mat-card>
<mat-card-content>
<form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value,PDTriggerStatus)">
<form [formGroup]="_PDtriggerForm">
<mat-card-content>
<div style="width: 100%;text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdListCompoent(cancelStatus)"><mat-icon>close</mat-icon></button>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="p-2">
<h5>PD Details</h5>
<div fxLayout="column" fxLayoutAlign="start stretch">
<!-- <mat-form-field style="width: 100%">
<input matInput placeholder="First Name" type="text" name="name" required>
</mat-form-field> -->
<mat-form-field style="width: 100%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)">
<mat-card>
<mat-card-header>
<mat-card-title>
PD Details
</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 32%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
@ -26,41 +29,41 @@
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error>
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Billing Address" formControlName="lender_billing">
<mat-option *ngFor="let billL of billingList" [value]="billL.entity_billing_id" >
{{billL.billing_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.lender_billing.hasError('required')">Billing Address Required</mat-error> -->
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" required>
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Person" formControlName="lender_contact_person" type="text" required>
<mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Contact Person Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Number" formControlName="lender_contact_mobile" type="text" required>
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('required')">Contact Number Required</mat-error>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" required>
<!-- <mat-error *ngIf="pdMain.lender_contact_mobile.hasError('required')">Lender Contact Number Required</mat-error> -->
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 32%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
{{PL.product_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 32%">
<mat-select placeholder="Sub Product Name" formControlName="fk_subproduct_id">
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
{{SPL.subproduct_name}}
</mat-option>
@ -68,231 +71,188 @@
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 32%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.customer_segment}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 32%">
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
{{PDL.type_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 24%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)">
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 96%">
<textarea matInput placeholder="Address at which PD is to be done" formControlName="addressline1" oninput="this.value = this.value.toUpperCase()"></textarea>
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<!-- <mat-form-field style="width: 28%">
<textarea matInput placeholder="Address 2" formControlName="addressline2" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 28%">
<textarea matInput placeholder="Address 3" formControlName="addressline3" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field>
<mat-form-field style="width: 100%;">
</mat-form-field>-->
<mat-form-field style="width: 32%">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-form-field style="width: 32%">
<mat-select placeholder="City" formControlName="fk_city">
` <mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
{{CL.city_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-form-field style="width: 24%">
<input matInput placeholder="Pincode" formControlName="pincode" (keypress)="keyPress($event)">
<!-- <mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode Required.</mat-error> -->
<mat-error *ngIf="pdMain.pincode.hasError('maxlength') || pdMain.pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field>
<mat-form-field style="width: 100%;">
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
<!-- <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" >
<h4 mat-dialog-title style="width: 14%;margin-top: 0%;">Allocation</h4>
<div style="width: 20%;"> <mat-slide-toggle formControlName="allocation_type"
class="example-margin" id="type"
[(ngModel)]="allocationTypeCheck" (change)="changeAllocationType(allocationTypeCheck)"
checked="allocationTypeModel==1 ? false:allocationTypeModel==2 ? false:allocationTypeModel==3 ? true"> {{allocationLabel}}
</mat-slide-toggle> </div>
<div style="width: 20%;">
<mat-slide-toggle *ngIf="allocationTypeModel==1 || allocationTypeModel==2" formControlName="sub_allocation_type"
class="example-margin" id="subType"
[(ngModel)]="subAllocationTypeCheck" (change)="changeSubAllocationType(subAllocationTypeCheck)"
checked="allocationTypeModel==1 ? false:allocationTypeModel==2 ? true"> {{subAllocationLabel}}
</mat-slide-toggle>
</div>
</div> -->
</div>
</mat-card-content>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="p-2">
<h5>Main Applicant</h5>
<mat-form-field style="width: 100%">
<input matInput placeholder="Name" formControlName="applicant_name">
<mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error>
<mat-card>
<mat-card-header>
<mat-card-title>Applicant Details</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 46%">
<input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name">
<!-- <mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 46%">
<input matInput placeholder="Company / Firm Name" formControlName="company_name" type="text">
</mat-form-field>
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none">
<mat-form-field style="width: 50%">
<input matInput placeholder="Mobile" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-form-field style="width: 46%">
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 50%">
<input matInput placeholder="LandLine" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.landline.hasError('maxlength') || pdMain.landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
<mat-form-field style="width: 46%">
<input matInput placeholder="LandLine Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.landline.hasError('maxlength') || pdMain.landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
</mat-form-field>
</div>
<!-- Phone field to be split into 2 parts. Mobile Number mandatory and optional land line number with std code. -->
<mat-form-field style="width: 100%">
<input matInput placeholder="Email" formControlName="email" type="email">
<!-- <mat-error *ngIf="pdMain.email.hasError('required')">Email Required.</mat-error> -->
</mat-form-field>
</mat-card-content>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap" formArrayName="items" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
<mat-card>
<mat-card-header>
<mat-card-title>Additional Requirements</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="addtional_requirements" *ngFor="let requirements of pdRequirements.controls; let i = index;">
<mat-card>
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 90%;">
<input matInput placeholder="Requirement" formControlName="add_requirement">
</mat-form-field>
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<button mat-raised-button mat-icon-button color="primary" matTooltip="Delete" matTooltipPosition="above" (click)="removeRequirements(i)" type="button"><mat-icon>delete</mat-icon></button>
</mat-card-content>
<mat-card class="p-2">
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5>
</mat-card>
</mat-card-content>
<mat-card-actions align="left">
<button type="button" mat-raised-button mat-icon-button (click)="addRequiremnts()"
matTooltip="Add More Additional Requirements" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
<div [formGroupName]="i">
<mat-form-field style="width: 100%">
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none">
<mat-form-field style="width: 50%">
<input matInput placeholder="Mobile" formControlName="coapplicant_mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 50%">
<input matInput placeholder="LandLine" formControlName="coapplicant_landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field>
</div>
<mat-card formArrayName="documents">
<mat-card-header>
<mat-card-title>
Document
</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-list *ngFor="let docList of documents.controls; let d = index;" [formGroupName]="d">
<!-- <h3 mat-subheader>Upload Documents</h3> -->
<mat-list-item>
<mat-form-field style="width: 70%">
<input matInput placeholder="Document Name" formControlName="doc_name" type="text">
</mat-form-field>
<mat-form-field style="width: 100%">
<div style="width:50%">
<input type="file" title="Browse Document" (change)="fileSelectionEvent($event,d)" formControlName="documentFile">
<mat-select placeholder="Relationship" formControlName="relationship">
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
{{rel.name}}
</mat-option>
</mat-select>
</mat-form-field>
<span (click)="removeItem(d)">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" type="button"><mat-icon>delete</mat-icon></button>
</span>
</div>
</mat-list-item>
</mat-list>
</mat-card-content>
<div style="width:20%">
<span (click)="removeCoApplicant(i)">
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
</div>
</div>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<mat-card-actions align="left">
<button mat-raised-button mat-icon-button matTooltip="Add Document" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" (click)="addMoreDocs()" type="button"><mat-icon>attach_file</mat-icon></button>
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="p-2">
<h5>Co-Applicant</h5>
<!-- <button _ngcontent-c29="" class="mr-1 mb-2 mat-fab1 mat-accent" mat-fab="" (click)="addCoApplicant(createWithLongContent)"><span class="mat-button-wrapper"><mat-icon _ngcontent-c29="" class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div><div class="mat-button-focus-overlay"></div></button> -->
<!--<button mat-fab class="mr-1 mb-1" color="primary" (click)="addCoApplicant()"><mat-icon>add</mat-icon></button>-->
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add Co-Applicant" matTooltipPosition="above" style="opacity: 0.8;border:2px;border-radius: 50%;" (click)="addCoApplicant()"><mat-icon>group_add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
<!-- <button mat-raised-button mat-button-sm color="primary" (click)="addCoApplicant()" type="button">Add More Co-Applicant</button> -->
</mat-card-actions>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="p-2" formArrayName="documents">
<h5>Document</h5>
<mat-list>
<mat-list-item>
<!-- <button mat-raised-button mat-button-sm color="primary" type="button">Add Document</button> -->
<button mat-fab matTooltip="Add Document" matTooltipPosition="above" class="mr-1 mb-1" color="primary" (click)="addMoreDocs()" class="mat-button-wrapper"><mat-icon>attach_file</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
</mat-list-item><br>
</mat-list>
<mat-list *ngFor="let docList of documents.controls; let d = index;" [formGroupName]="d">
<!-- <h3 mat-subheader>Upload Documents</h3> -->
<mat-list-item>
<mat-form-field style="width: 50%">
<input matInput placeholder="Document Name" formControlName="doc_name" type="text">
</mat-form-field>
<div style="width:50%">
<input type="file" title="Browse Document" (change)="fileSelectionEvent($event,d)" formControlName="documentFile">
<span (click)="removeItem(d)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span>
</div>
</mat-list-item>
</mat-list>
</mat-card>
</div>
</div>
</mat-card-content>
<!-- <mat-card-actions style="text-align: right">
<button mat-button color="accent" type="button" (click)="loadPdListCompoent()">Cancel</button>
<mat-card-actions>
<div fxFlex="70" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<!-- <mat-label>Remarks</mat-label> -->
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</div>
<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="PD Draft" matTooltipPosition="above" type="button"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Process" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.value,PDTriggerStatus)"><mat-icon>save</mat-icon></button>
</div>
<button mat-button color="primary" type="submit" [disabled]="!PDtriggerForm.valid">Submit</button>
</mat-card-actions> -->
<mat-card-actions style="text-align: right">
<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" matTooltip="Click To Draft" matTooltipPosition="above" type="button" (click)="addCoApplicant()"><mat-icon>drafts</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="submitPdDetails(_PDtriggerForm.value,draftStatus)" matTooltip="PD Draft" matTooltipPosition="above" type="button"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="PD Process" matTooltipPosition="above" [disabled]="!enablePDButton || !_PDtriggerForm.valid "><mat-icon>save</mat-icon></button>
</mat-card-actions>
</form>
</mat-card-content>

View File

@ -0,0 +1,3 @@
mat-form-field {
margin: 0 2%;
}

View File

@ -21,6 +21,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
private notifier: NotifierService;
public _PDtriggerForm: FormGroup;
items: FormArray;
addtional_requirements: FormArray;
productList:any;
subProductList:any;
lenderList:any;
@ -34,11 +35,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
// Dynamic co applicant
createWithLongContent = false;
dynamicCoApplicant = [];
//allocationTypeModel: number;
//allocationTypeCheck: boolean;
//subAllocationTypeCheck: boolean;
//allocationLabel: string;
//subAllocationLabel: string;
constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute,
private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) {
this.notifier = notifier;
@ -59,7 +55,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.getPDTypeList();
this.getRelationMaster();
this.loadFormData();
this.OnChanges();
}
@ -70,40 +65,29 @@ export class AddPdComponent implements OnInit, OnDestroy {
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [null, Validators.compose([Validators.required])],
lender_contact_mobile: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.required,Validators.pattern('^[0-9]*$')])],
lender_billing: [null],
//lender_billing: [null],
fk_product_id: [null],
fk_subproduct_id: [null],
fk_pd_type: [null],
fk_customer_segment: [null],
loan_amount: [null,Validators.compose([Validators.pattern('^[0-9]*$')])],
applicant_name: [null],
mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10),Validators.required])],
landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
email: [null],
mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
landline : [null,Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null],
  addressline1: [null],
addressline2: [null],
addressline3: [null],
fk_city: [null],
fk_state: [null],
  pincode : [null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])],
remarks:[null],
  // allocation_type: [null],
  // sub_allocation_type: [null],
items: this._fb.array([]),
documents: this._fb.array([])
//items: this._fb.array([]),
documents: this._fb.array([]),
addtional_requirements: this._fb.array([this.createRequiremnt()])
});
}
// enable pd trigger submit function
OnChanges(): void{
this._PDtriggerForm.valueChanges.subscribe(val => {
if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.applicant_name && val.mobile_no && val.addressline1 && val.fk_city && val.fk_state && val.pincode){
this.enablePDButton=true;
}
else{
this.enablePDButton=false;
}
});
}
getLenderList(){
this._pd.getLenderDetails().subscribe(
data => {
@ -143,34 +127,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
if (data.status == 200) {
this.pdTypeList=data.records.pd_type;
//start hide pd allocation type functinality
// if(data.records.pd_allocation_type){
// let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1);
// if(getDefaultAllocation[0].pd_allocation_type_id==1){
// this.allocationTypeModel=1;
// this.allocationTypeCheck=false;
// this.subAllocationTypeCheck=false;
// this.allocationLabel="Auto";
// this.subAllocationLabel="Load Balance";
// }
// else if(this.allocationTypeModel[0].pd_allocation_type_id==2){
// this.allocationTypeModel=2;
// this.allocationTypeCheck=false;
// this.subAllocationTypeCheck=true;
// this.allocationLabel="Auto";
// this.subAllocationLabel="Nearest";
// }
// else if(this.allocationTypeModel[0].pd_allocation_type_id==3){
// this.allocationTypeModel=3;
// this.allocationTypeCheck=true;
// this.allocationLabel="Manual";
// }
// }
// end
}
}, error => this.errorMessage = <any> error);
}
@ -187,11 +143,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.cityList=this.cityList[0].cities;
}
// lendor billing address
getBillingDetails(lendorID:string){
this.billingList= this.lenderList.filter(item => item.entity_id == lendorID);
this.billingList=this.billingList[0].billing_address;
}
// get relation master details
getRelationMaster(){
let relation ="RELATIONSHIPS";
@ -246,7 +197,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
};
get pdMain() {
return this._PDtriggerForm.controls; }
get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; }
// get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; }
removeCoApplicant(i: number) {
const control = <FormArray>this._PDtriggerForm.controls['items'];
@ -259,6 +210,24 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lengthCheckToaddMore=this.lengthCheckToaddMore-1;
}
get pdRequirements() { return this._PDtriggerForm.get('addtional_requirements') as FormArray; }
createRequiremnt(): FormGroup {
return this._fb.group({
add_req_id:[null],
add_requirement: [null, Validators.compose([Validators.required])],
isactive: [1],
});
};
addRequiremnts() {
this.addtional_requirements = this._PDtriggerForm.get('addtional_requirements') as FormArray;
this.addtional_requirements.push(this.createRequiremnt());
}
removeRequirements(index: number) {
const requirement_control = <FormArray>this._PDtriggerForm.controls['addtional_requirements'];
requirement_control.removeAt(index);
}
public fileSelectionEvent(fileInput: any,oldIndex:number) {
@ -286,116 +255,182 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lengthCheckToaddMore=1;
}
}
submitPdDetails(formValue: any, status:string) {
if(this._PDtriggerForm.valid){
// let my_array = this.PDtriggerForm.value;
// Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
let pd_details:any={
"fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id,
"fk_entity_billing_id":formValue.lender_billing,
"pd_contact_person":formValue.lender_contact_person,
"pd_contact_mobileno":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id,
"fk_subproduct_id":formValue.fk_subproduct_id,
"fk_pd_type":formValue.fk_pd_type,
"fk_customer_segment":formValue.fk_customer_segment,
"loan_amount":formValue.loan_amount,
"addressline1":formValue.addressline1,
"addressline2":formValue.addressline2,
"addressline3":formValue.addressline3,
"fk_city":formValue.fk_city,
"fk_state":formValue.fk_state,
"pincode":formValue.pincode ,
"remarks":formValue.remarks,
"pd_status": status,
//"fk_pd_allocation_type":this.allocationTypeModel ,
"fk_createdby" : this._aws.getlocale(),
// "createdon": new Date().toJSON().slice(0,19).replace('T',' ')
};
let pd_applicant_details : any=[{
"applicant_name":formValue.applicant_name,
"email":formValue.email,
"mobile_no":formValue.mobile_no,
"landline":formValue.landline,
"applicant_type":1,
"relation":"",
}];
formValue.items.forEach((itemElement, itemIndex) => {
let obj1 = {
"applicant_name":itemElement.coapplicantName,
"relation":itemElement.relationship,
"email":"",
"mobile_no":itemElement.coapplicant_mobile_no,
"landline":itemElement.coapplicant_landline,
"applicant_type":0,
}
pd_applicant_details.push(obj1)
});
// docs details
let pd_form: FormData = new FormData();
for(let j=0;j<this.totalfiles.length; j++)
{
pd_form.append('pddocuments[]',<File>this.totalfiles[j])
}
//reverseFileNames=this.totalFileName.reverse();
let AllFilesObj= []
formValue.documents.forEach((element, index) => {
// let eachObj=
// {
// 'doc_name' : element.doc_name,
// 'file_name' : this.totalFileName[index]
// }
AllFilesObj.push(element.doc_name);
});
pd_form.append("pd_details",JSON.stringify(pd_details))
pd_form.append("pd_applicant_details",JSON.stringify(pd_applicant_details))
pd_form.append("pd_document_titles",JSON.stringify(AllFilesObj))
this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Saved.');
this.loadPdListCompoent(true);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
// save pd in draft
saveDraftPD(formValue: any, status:string){
this.submitPdDetails(formValue, status);
}
// start hide allocation type functionality
//trigger pd
triggerPD(formValue: any, status:string){
this._PDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
// changeAllocationType(status: boolean) {
// if(status){
// this.allocationTypeModel=3;
// this.allocationLabel="Manual";
// }
// else{
// this.allocationTypeModel=1;
// this.allocationLabel="Auto";
// this.subAllocationLabel="Load Balance";
// }
// }
// changeSubAllocationType(status: boolean){
// if(status){
// this.allocationTypeModel=2;
// this.allocationLabel="Auto";
// this.subAllocationLabel="Nearest";
// }
// else{
// this.allocationTypeModel=1;
// this.allocationLabel="Auto";
// this.subAllocationLabel="Load Balance";
// }
// }
// end
this._PDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_customer_segment'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required]);
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
this._PDtriggerForm.controls['applicant_name'].setValidators([Validators.required]);
this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity();
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();
this._PDtriggerForm.controls['fk_city'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_city'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_state'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_state'].updateValueAndValidity();
this._PDtriggerForm.controls['pincode'].setValidators([Validators.required]);
this._PDtriggerForm.controls['pincode'].updateValueAndValidity();
setTimeout(() => {
this.clearCustomValidatorFields();
}, 10000);
this.submitPdDetails(formValue, status);
}
// this is for clear custom validator required fields
clearCustomValidatorFields(){
this._PDtriggerForm.controls['fk_lender_id'].clearValidators();
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_product_id'].clearValidators();
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_subproduct_id'].clearValidators();
this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_pd_type'].clearValidators();
this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_customer_segment'].clearValidators();
this._PDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
this._PDtriggerForm.controls['loan_amount'].clearValidators();
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
this._PDtriggerForm.controls['applicant_name'].clearValidators();
this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity();
this._PDtriggerForm.controls['mobile_no'].clearValidators();
this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity();
this._PDtriggerForm.controls['addressline1'].clearValidators();
this._PDtriggerForm.controls['addressline1'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_city'].clearValidators();
this._PDtriggerForm.controls['fk_city'].updateValueAndValidity();
this._PDtriggerForm.controls['fk_state'].clearValidators();
this._PDtriggerForm.controls['fk_state'].updateValueAndValidity();
this._PDtriggerForm.controls['pincode'].clearValidators();
this._PDtriggerForm.controls['pincode'].updateValueAndValidity();
this.validateAllFormFields(this._PDtriggerForm);
}
// common function for both draft and process pd
submitPdDetails(formValue: any, status:string) {
if(this._PDtriggerForm.invalid) {
this.validateAllFormFields(this._PDtriggerForm)
return;
}
else {
let pd_details:any={
"fk_lender_id":formValue.fk_lender_id,
"lender_applicant_id":formValue.lender_applicant_id,
"pd_contact_person":formValue.lender_contact_person,
"pd_contact_mobileno":formValue.lender_contact_mobile,
"fk_product_id":formValue.fk_product_id,
"fk_subproduct_id":formValue.fk_subproduct_id,
"fk_pd_type":formValue.fk_pd_type,
"fk_customer_segment":formValue.fk_customer_segment,
"loan_amount":formValue.loan_amount,
"addressline1":formValue.addressline1,
"fk_city":formValue.fk_city,
"fk_state":formValue.fk_state,
"pincode":formValue.pincode ,
"remarks":formValue.remarks,
"pd_status": status,
"fk_createdby" : this._aws.getlocale(),
};
var pd_applicant_details: any=[];
if(formValue.applicant_name){
pd_applicant_details.push({
"applicant_name":formValue.applicant_name,
"company_name":formValue.company_name,
"mobile_no":formValue.mobile_no,
"landline":formValue.landline,
"applicant_type":1,
"relation":"",
});
}
// formValue.items.forEach((itemElement, itemIndex) => {
// let obj1 = {
// "applicant_name":itemElement.coapplicantName,
// "relation":itemElement.relationship,
// "email":"",
// "mobile_no":itemElement.coapplicant_mobile_no,
// "landline":itemElement.coapplicant_landline,
// "applicant_type":0,
// }
// pd_applicant_details.push(obj1)
// });
// docs details
let pd_form: FormData = new FormData();
for(let j=0;j<this.totalfiles.length; j++)
{
pd_form.append('pddocuments[]',<File>this.totalfiles[j])
}
//reverseFileNames=this.totalFileName.reverse();
let AllFilesObj= []
formValue.documents.forEach((element, index) => {
AllFilesObj.push(element.doc_name);
});
pd_form.append("pd_details",JSON.stringify(pd_details))
if(pd_applicant_details.length>0){
pd_form.append("pd_applicant_details",JSON.stringify(pd_applicant_details))
}
pd_form.append("pd_document_titles",JSON.stringify(AllFilesObj))
if(formValue.addtional_requirements.length > 0){
pd_form.append("addtional_requirements",JSON.stringify(formValue.addtional_requirements))
}
this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'PD Saved.');
this.loadPdListCompoent(true);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}
loadPdListCompoent(from:boolean) {
if(from){
this.router.navigate([ '../../' ], { relativeTo: this.route });
@ -423,4 +458,19 @@ export class AddPdComponent implements OnInit, OnDestroy {
event.preventDefault();
}
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -1,90 +1,89 @@
<div style="max-height: 480px; width: 550px;">
<div style="text-align: right">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
(click)="closeEditComponent()"><mat-icon>close</mat-icon></button>
</div>
<form [formGroup]="_EditApplicantForm">
<form [formGroup]="_EditApplicantForm" (submit)="updatePdApplicant(_EditApplicantForm.value)">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-card class="p-2">
<h5>Main Applicant</h5>
<mat-form-field style="width: 100%">
<input matInput placeholder="Name" formControlName="applicant_name" required>
<mat-error *ngIf="pdMainApplicant.applicant_name.hasError('required')">Name is required.</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Email" formControlName="email" type="email" required>
<mat-error *ngIf="pdMainApplicant.email.hasError('required')">Email is required.</mat-error>
</mat-form-field>
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none">
<mat-form-field style="width: 50%">
<input matInput placeholder="Mobile" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('required')">Mobile number is required.</mat-error>
<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: 50%">
<input matInput placeholder="LandLine" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left">
{{pageTitle}}
</div>
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
</mat-card>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap" formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-dialog-content>
<mat-card class="p-2">
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5>
<div [formGroupName]="i">
<mat-form-field style="width: 100%">
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required>
<mat-error *ngIf="coDetails['controls'].coapplicantName.hasError('required')">Name is Required.</mat-error>
<mat-card>
<mat-card-header>
<mat-card-title>Main Applicant</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 40%">
<input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name" required>
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Company / Firm Name" formControlName="company_name" type="text">
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none">
<mat-form-field style="width: 50%">
<input matInput placeholder="Mobile" formControlName="coapplicant_mobile_no" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('pattern') || coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 50%" >
<input matInput placeholder="LandLine" formControlName="coapplicant_landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf=" coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field>
</div>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<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: 40%">
<input matInput placeholder="LandLine Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMainApplicant.landline.hasError('maxlength') || pdMainApplicant.landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field>
<mat-select placeholder="Relationship With Main Applicant" formControlName="relationship">
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
{{rel.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
<div style="text-align: right">
<button mat-raised-button mat-icon-button class="mr-1 mb-1" matTooltip="Add More Co-Applicant" matTooltipPosition="above" color="primary" type="button" (click)="addCoApplicant(emptyData)"><mat-icon>add</mat-icon></button>
<mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
<!-- <mat-card-header>
<mat-card-title>Co Applicant</mat-card-title>
</mat-card-header> -->
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 40%">
<input matInput placeholder="Name of Individual Applicant" formControlName="coapplicantName" type="text" required>
<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>
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Company / Firm Name" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('pattern') || coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 40%" >
<input matInput placeholder="LandLine Number" formControlName="coapplicant_landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf=" coDetails['controls'].coapplicant_landline.hasError('maxlength') || coDetails['controls'].coapplicant_landline.hasError('minlength')">Enter Valid Phone Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 82%">
<mat-select placeholder="Relationship With Main Applicant" formControlName="relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
{{rel.name}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1" matTooltip="Add More Co-Applicant" matTooltipPosition="above" color="primary" type="button" (click)="addCoApplicant(emptyData)"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="updatePdApplicant(_EditApplicantForm.value)"><mat-icon>save</mat-icon></button>
</mat-dialog-actions>
</form>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above"><mat-icon>save</mat-icon></button>
</div>
</form>
</div>
<!-- <notifier-container></notifier-container> -->

View File

@ -0,0 +1,6 @@
mat-form-field {
margin: 0 2%;
}
.paragraph_change {
color: #e00201 !important;
}

View File

@ -11,7 +11,7 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service';
encapsulation: ViewEncapsulation.None,
})
export class EditPdApplicantComponent implements OnInit {
public pageTitle: string = "Edit Applicant";
public pageTitle: string = "Applicant Details";
errorMessage: any;
public _EditApplicantForm:FormGroup;
public notifier: NotifierService;
@ -43,8 +43,8 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
landline: [null, Validators.compose([Validators.required,Validators.minLength(12),Validators.maxLength(13)])],
email: [null, Validators.compose([Validators.required, CustomValidators.email])],
landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null],
applicant_type: [1],
coApplicantItems: this._fb.array([]),
});
@ -55,9 +55,9 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
landline: [this.mainApplicantData[0].landline, Validators.compose([Validators.required,Validators.minLength(12),Validators.maxLength(13)])],
email: [this.mainApplicantData[0].email, Validators.compose([Validators.required, CustomValidators.email])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
landline: [this.mainApplicantData[0].landline, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [this.mainApplicantData[0].company_name],
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
coApplicantItems: this._fb.array([]),
});
@ -76,9 +76,10 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [listData.pd_co_applicant_id],
coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])],
coapplicant_mobile_no: [listData.mobile_no,Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
coapplicant_landline: [listData.landline,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
coapplicant_landline: [listData.landline,Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
relationship: [listData.relation],
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
company_name: [listData.company_name],
});
}
else{
@ -87,9 +88,10 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [null],
coapplicantName: [null, Validators.compose([Validators.required])],
coapplicant_mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
coapplicant_landline: [null, Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
coapplicant_landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
relationship: [null],
applicant_type: [0],
company_name: [null],
});
}
@ -105,12 +107,16 @@ export class EditPdApplicantComponent implements OnInit {
get pdMainApplicant() { return this._EditApplicantForm.controls; }
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
updatePdApplicant(formValue: any) {
if(this._EditApplicantForm.valid){
if(this._EditApplicantForm.invalid) {
this.validateAllFormFields(this._EditApplicantForm)
return;
}
else {
let pd_applicant_details : any=[{
"fk_pd_id": this.data.pdID,
"pd_co_applicant_id": formValue.fk_applicant_primary_id,
"applicant_name":formValue.applicant_name,
"email":formValue.email,
"company_name":formValue.company_name,
"mobile_no":formValue.mobile_no,
"landline":formValue.landline,
"applicant_type":formValue.applicant_type,
@ -123,10 +129,10 @@ export class EditPdApplicantComponent implements OnInit {
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
"applicant_name":itemElement.coapplicantName,
"relation":itemElement.relationship,
"email":"",
"mobile_no":itemElement.coapplicant_mobile_no,
"landline":itemElement.coapplicant_landline,
"applicant_type":itemElement.applicant_type,
"company_name":itemElement.company_name,
"isactive":1
}
pd_applicant_details.push(obj1)
@ -179,4 +185,19 @@ export class EditPdApplicantComponent implements OnInit {
event.preventDefault();
}
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -1,147 +1,151 @@
<div style="max-height: 480px; width: 550px;">
<div style="text-align: right">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
(click)="closeEditMasterComponent()"><mat-icon>close</mat-icon></button>
</div>
<mat-card>
<form [formGroup]="_EditPDtriggerForm" (submit)="submitPdDetails(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)">
<mat-card-content>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)">
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
<form [formGroup]="_EditPDtriggerForm" novalidate>
</mat-form-field>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left">
{{pageTitle}}
</div>
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
<mat-form-field style="width: 100%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Billing Address" formControlName="fk_entity_billing_id">
<mat-option *ngFor="let billL of billingList" [value]="billL.entity_billing_id" >
{{billL.billing_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Person" formControlName="pd_contact_person" type="text" required>
<mat-error *ngIf="pdMain.pd_contact_person.hasError('required')">Contact Person Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Number" formControlName="pd_contact_mobileno" type="text" required>
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('required')">Contact Number Required</mat-error>
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</div>
</h2>
<mat-dialog-content>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
{{PL.product_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field>
<mat-card>
<!-- <mat-card-header>
<mat-card-title>PD Details</mat-card-title>
</mat-card-header> -->
<mat-card-content>
<mat-form-field style="width: 32%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
<mat-form-field style="width: 100%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
{{SPL.subproduct_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.customer_segment}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
{{PDL.type_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<textarea matInput placeholder="Address at which PD is to be done" formControlName="addressline1" oninput="this.value = this.value.toUpperCase()"></textarea>
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%">
<textarea matInput placeholder="Address 2" formControlName="addressline2" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field>
<mat-form-field style="width: 100%">
<textarea matInput placeholder="Address 3" formControlName="addressline3" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-select placeholder="City" formControlName="fk_city">
` <mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
{{CL.city_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput placeholder="Pincode" formControlName="pincode" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.pincode.hasError('pattern') || pdMain.pincode.hasError('maxlength') || pdMain.pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field>
<mat-form-field style="width: 100%;">
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</div>
</div>
</div>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
</mat-form-field>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person" type="text" required>
</mat-form-field>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Contact Number" formControlName="pd_contact_mobileno" type="text" required>
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-card-content>
<mat-card-actions style="text-align: right">
<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 *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="submitPdDetails(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" [disabled]="applicantLength<=0 || !_EditPDtriggerForm.valid || !enablePDButton" type="submit"><mat-icon>save</mat-icon></button>
</mat-card-actions>
</form>
</mat-card>
</div>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
{{PL.product_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option>
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
{{SPL.subproduct_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-option>Select</mat-option>
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
{{CSL.customer_segment}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
<mat-option>Select</mat-option>
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
{{PDL.type_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 24%">
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>
<mat-form-field style="width: 96%">
<textarea matInput placeholder="Address at which PD is to be done" formControlName="addressline1" oninput="this.value = this.value.toUpperCase()"></textarea>
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%;">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%;">
<mat-select placeholder="City" formControlName="fk_city">
<mat-option>Select</mat-option>
<mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
{{CL.city_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 24%;">
<input matInput placeholder="Pincode" formControlName="pincode" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.pincode.hasError('pattern') || pdMain.pincode.hasError('maxlength') || pdMain.pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="70" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="30" align="end">
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(this._EditPDtriggerForm.value,pdStatusCheck.DRAFT)" type="button" matTooltip="Save As Draft" matTooltipPosition="above"><mat-icon>insert_drive_file</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="PD Process" matTooltipPosition="above" type="button" (click)="triggerPD(_EditPDtriggerForm.value, pdStatusCheck.TRIGGERED)"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -0,0 +1,6 @@
mat-form-field {
margin: 0 2%;
}
.paragraph_change {
color: #e00201 !important;
}

View File

@ -11,7 +11,7 @@ import { PdTrigerService } from '../../../pd-service/pd-triger.service';
encapsulation: ViewEncapsulation.None
})
export class EditPdMasterComponent implements OnInit {
public pageTitle: string = "Edit PD Master";
public pageTitle: string = "PD Details";
errorMessage: any;
productList:any;
subProductList:any;
@ -55,7 +55,6 @@ export class EditPdMasterComponent implements OnInit {
this.getPDTypeList();
this.loadFormData();
this.applicantLength=this.data.applicantLength;
this.OnChanges();
}
@ -65,10 +64,6 @@ export class EditPdMasterComponent implements OnInit {
data => {
if (data.status == 200) {
this.lenderList=data.records
if(this.data.records.fk_lender_id){
this.getBillingDetails(this.data.records.fk_lender_id);
}
}
}, error => this.errorMessage = <any> error);
}
@ -121,39 +116,19 @@ export class EditPdMasterComponent implements OnInit {
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
pd_contact_person: [this.data.records.pd_contact_person, Validators.compose([Validators.required])],
pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
fk_entity_billing_id: [this.data.records.fk_entity_billing_id],
fk_product_id: [this.data.records.fk_product_id],
fk_subproduct_id: [this.data.records.fk_subproduct_id],
fk_pd_type: [this.data.records.fk_pd_type],
fk_customer_segment: [this.data.records.fk_customer_segment],
loan_amount: [this.data.records.loan_amount,Validators.compose([Validators.pattern('^[0-9]*$')])],
  addressline1: [this.data.records.addressline1],
addressline2: [this.data.records.addressline2],
addressline3: [this.data.records.addressline3],
fk_city: [this.data.records.fk_city],
fk_state: [this.data.records.fk_state],
  pincode : [this.data.records.pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],
remarks: [this.data.records.remarks],
});
if(this.data.records.fk_lender_id && this.data.records.fk_product_id && this.data.records.fk_subproduct_id && this.data.records.fk_pd_type && this.data.records.fk_customer_segment && this.data.records.loan_amount && this.data.records.addressline1 && this.data.records.fk_city && this.data.records.fk_state && this.data.records.pincode){
this.enablePDButton=true;
}
else{
this.enablePDButton=false;
}
}
// enable pd trigger submit function
OnChanges(): void{
this._EditPDtriggerForm.valueChanges.subscribe(val => {
if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.addressline1 && val.fk_city && val.fk_state && val.pincode){
this.enablePDButton=true;
}
else{
this.enablePDButton=false;
}
});
}
get pdMain() { return this._EditPDtriggerForm.controls; }
//get sub product list based on prokduct id
@ -168,14 +143,95 @@ export class EditPdMasterComponent implements OnInit {
this.cityList= this.stateList.filter(item => item.state_id == stateID);
this.cityList=this.cityList[0].cities;
}
// lendor billing address
getBillingDetails(lendorID:string){
this.billingList= this.lenderList.filter(item => item.entity_id == lendorID);
this.billingList=this.billingList[0].billing_address;
}
// save pd in draft
saveDraftPD(formValue: any, status:string){
this.clearCustomValidatorFields();
this.submitPdDetails(formValue, status);
}
//trigger pd
triggerPD(formValue: any, status:string){
this._EditPDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_customer_segment'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
this._EditPDtriggerForm.controls['loan_amount'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity();
this._EditPDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['addressline1'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_city'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_city'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_state'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['fk_state'].updateValueAndValidity();
this._EditPDtriggerForm.controls['pincode'].setValidators([Validators.required]);
this._EditPDtriggerForm.controls['pincode'].updateValueAndValidity();
if(this.applicantLength==0){
this.notifier.notify('error', 'Please add applicants.!');
}
this.submitPdDetails(formValue, status);
setTimeout(() => {
this.clearCustomValidatorFields();
}, 10000);
}
// this is for clear custom validator required fields
clearCustomValidatorFields(){
this._EditPDtriggerForm.controls['fk_lender_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_product_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_subproduct_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_pd_type'].clearValidators();
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_customer_segment'].clearValidators();
this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
this._EditPDtriggerForm.controls['loan_amount'].clearValidators();
this._EditPDtriggerForm.controls['loan_amount'].updateValueAndValidity();
this._EditPDtriggerForm.controls['addressline1'].clearValidators();
this._EditPDtriggerForm.controls['addressline1'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_city'].clearValidators();
this._EditPDtriggerForm.controls['fk_city'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_state'].clearValidators();
this._EditPDtriggerForm.controls['fk_state'].updateValueAndValidity();
this._EditPDtriggerForm.controls['pincode'].clearValidators();
this._EditPDtriggerForm.controls['pincode'].updateValueAndValidity();
this.validateAllFormFields(this._EditPDtriggerForm);
}
submitPdDetails(formValue: any, status:string) {
let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus;
if(this._EditPDtriggerForm.valid){
if(this._EditPDtriggerForm.invalid) {
this.validateAllFormFields(this._EditPDtriggerForm)
return;
}
else{
let my_array = this._EditPDtriggerForm.value;
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
this._pd.editPdMasterDetails(my_array, updateStatus).subscribe(result => {
@ -209,5 +265,20 @@ export class EditPdMasterComponent implements OnInit {
}
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -1,4 +1,3 @@
<mat-card>
<mat-card-content [style.display]="viewPdList ? 'block' : 'none'">
<div fxLayout="row">

View File

@ -0,0 +1,38 @@
<form [formGroup]="_EditPDRequirementForm" novalidate>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left">
{{pageTitle}}
</div>
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content>
<mat-card formArrayName="addtional_requirements" *ngFor="let requirements of pdRequirements.controls; let i = index;">
<mat-card-content [formGroupName]="i">
<mat-form-field style="width: 90%;">
<input matInput placeholder="Requirement" formControlName="add_requirement">
</mat-form-field>
<!-- <button mat-raised-button mat-icon-button color="primary" matTooltip="Delete" matTooltipPosition="above" (click)="removeRequirements(i)" type="button"><mat-icon>delete</mat-icon></button> -->
</mat-card-content>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button type="button" mat-raised-button mat-icon-button (click)="addRequiremnts(const_requirement)" matTooltip="Add More Additional Requirements" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button"> <mat-icon>add</mat-icon> </button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="updateAdditionalRequirement(_EditPDRequirementForm.value)"><mat-icon>save</mat-icon></button>
</mat-dialog-actions>
</form>
<!-- <notifier-container></notifier-container> -->

View File

@ -0,0 +1,6 @@
mat-form-field {
margin: 0 2%;
}
.paragraph_change {
color: #e00201 !important;
}

View File

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

View File

@ -0,0 +1,111 @@
import { Component, OnInit,ViewEncapsulation, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { CustomValidators } from 'ng2-validation';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
@Component({
selector: 'app-pd-requirement',
templateUrl: './pd-requirement.component.html',
styleUrls: ['./pd-requirement.component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class PdRequirementComponent implements OnInit {
public pageTitle: string = "Additional Requirements Details";
public _EditPDRequirementForm:FormGroup;
public notifier: NotifierService;
addtional_requirements: FormArray;
public const_requirement : any = {
"add_req_id": '',
"add_requirement":'',
"earning_ans": '',
"isactive": 1,
};
constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<PdRequirementComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.notifier=notifier
}
ngOnInit() {
this.loadForm();
}
loadForm() {
this._EditPDRequirementForm = this._fb.group({
pdid: [this.data.pdID],
addtional_requirements: this._fb.array([])
});
// bind dynamic co applicant data
if(this.data.records.length > 0){
this.data.records.forEach((itemElement, itemIndex) => {
this.addRequiremnts(itemElement)
});
}
else {
this.addRequiremnts(this.const_requirement)
}
}
get pdRequirements() { return this._EditPDRequirementForm.get('addtional_requirements') as FormArray; }
createRequiremnt(receive:any): FormGroup {
return this._fb.group({
add_req_id:[receive.add_req_id],
add_requirement: [receive.add_requirement, Validators.compose([Validators.required])],
isactive: [receive.isactive],
});
};
addRequiremnts(getData:any) {
if(this._EditPDRequirementForm.valid){
this.addtional_requirements = this._EditPDRequirementForm.get('addtional_requirements') as FormArray;
this.addtional_requirements.push(this.createRequiremnt(getData));
}
else {
this.validateAllFormFields(this._EditPDRequirementForm);
}
}
// removeRequirements(index: number) {
// const requirement_control = <FormArray>this._EditPDRequirementForm.controls['additional_requirements'];
// requirement_control.removeAt(index);
// }
updateAdditionalRequirement(formValue: any) {
if(this._EditPDRequirementForm.invalid) {
this.validateAllFormFields(this._EditPDRequirementForm)
return;
}
else {
let records:any=formValue;
this._pd.saveAdditionalRequirements(records).subscribe(result => {
if (result.status == 200) {
this.notifier.notify('success', 'Additional Requirements Updated.');
this.dialogRef.close();
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({ onlySelf: true });
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
} else if (control instanceof FormArray) {
this.validateAllFormFields(control);
}
});
}
}

View File

@ -11,7 +11,7 @@
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" >
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
@ -40,25 +40,28 @@
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd master -->
<mat-card *ngFor="let master of pdMasterData" class="minheight">
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<!-- <button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
<button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
-->
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
</div>
<mat-card-header>
<!-- <img mat-card-avatar src="assets/images/avatar.jpg">
<mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}}
</mat-card-title>-->
<mat-card-subtitle *ngIf="master.city_name" class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> &nbsp;<span>{{master.city_name}} / {{master.state_name}}-{{master.pincode}}</span></mat-card-subtitle>
<mat-card-title *ngIf="master.state_name" class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> &nbsp;<span>{{master.city_name}} / {{master.state_name}}-{{master.pincode}}</span></mat-card-title>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<!-- <button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
<button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
-->
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
</div>
</mat-card-header>
<mat-card-content>
<p *ngIf="master.pd_contact_person || master.pd_contact_mobileno "><span *ngIf="master.pd_contact_person"> <i class="fa-1x fa fa-user-o"></i> {{master.pd_contact_person}}</span>&nbsp;&nbsp; <span *ngIf="master.pd_contact_mobileno"> <i class="fa-1x fa fa-phone"></i> {{master.pd_contact_mobileno}}</span><span style="font-size:13px;"> (Lender Contact Details) </span> </p>
<p *ngIf="master.product_name">{{master.product_name}}<span *ngIf="master.subproduct_name"> / </span> {{master.subproduct_name}}</p>
<p *ngIf="master.product_name">{{master.product_name}}<span *ngIf="master.subproduct_name"> / {{master.subproduct_name}} </span></p>
<p *ngIf="master.pd_type_name"><span>{{master.pd_type_name}}</span> <span *ngIf="master.loan_amount" class="hover-icon"> / <i class="fa-1x fa fa-rupee">&nbsp;</i>{{master.loan_amount}}</span></p>
<p><span>{{master.addressline1}}<span *ngIf="master.addressline2"> , </span>{{master.addressline2}} <span *ngIf="master.addressline3"> , </span>{{master.addressline3}}</span></p>
<p><span>{{master.addressline1}}</span></p>
<p *ngIf="master.remarks"><span style="font-size:13px;"> Remarks : </span> <span style="color:red">{{master.remarks}}</span></p>
</mat-card-content>
</mat-card>
@ -80,7 +83,7 @@
<mat-list-item style="height:68px !important;">
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-user-o"></i>
&nbsp;{{applicant.applicant_name}} </span> &nbsp;&nbsp;&nbsp;<span *ngIf="applicant.mobile_no!=null" class="mb-2 text-center hover-icon">
&nbsp;{{applicant.applicant_name}} </span> &nbsp;&nbsp;&nbsp;<span *ngIf="applicant.mobile_no!=''" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
&nbsp;{{applicant.mobile_no}} </span> <br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span>
<ng-template #codetails><span>{{applicant.relation_name}}</span></ng-template>
@ -91,6 +94,30 @@
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="100" fxFlex.xl="100">
<!-- applicant card -->
<mat-card class="minheight">
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button>
</div>
<mat-card-header>
<mat-card-title>Additional Requirements</mat-card-title>
</mat-card-header>
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">
<mat-list *ngFor="let requirement of pdAdditionalReqData">
<mat-list-item>
<p>{{requirement.add_requirement}}</p>
</mat-list-item>
</mat-list>
</mat-card-content>
<ng-template #noRequirement><mat-card-content><p>No Additional Requirements</p></mat-card-content></ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
<!-- pd documents card -->

View File

@ -1,5 +1,7 @@
.cardEdit {
display: inline;float:right;padding-top:3%;
display: inline;
float:right;
padding-top:3%;
}
.minheight {
min-height: 100%;

View File

@ -1,4 +1,4 @@
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDestroy } from '@angular/core';
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDestroy, Pipe, PipeTransform } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
@ -11,7 +11,9 @@ import { ListPdComponent } from '../list-pd.component';
import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.component';
import { PdRequirementComponent } from '../pd-requirement/pd-requirement.component';
import {DatePipe } from '@angular/common';
@Component({
selector: 'app-view-pd',
templateUrl: './view-pd.component.html',
@ -19,7 +21,7 @@ import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.componen
encapsulation: ViewEncapsulation.None
})
export class ViewPdComponent implements OnInit, OnDestroy {
public selectedMoment = new Date();
pipe = new DatePipe('en-US');
private notifier:NotifierService;
errorMessage: any;
pdMasterData: any=[];
@ -27,11 +29,12 @@ export class ViewPdComponent implements OnInit, OnDestroy {
pdDocumentsData: any=[];
masterPdLogsData: any=[];
applicantPDLogsData: any=[];
pdAdditionalReqData: any=[];
viewID:string;
viewParams:any;
destroyType:number=1;
currentPDStatus:string;
enableStartPD: boolean;
// create values for status check
pdStatusCheck :any={
"DRAFT" :'DRAFT',
@ -48,14 +51,24 @@ export class ViewPdComponent implements OnInit, OnDestroy {
public _EditPDtriggerForm:FormGroup;
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) {
this.notifier=notifier
this.notifier=notifier;
this.enableStartPD=false;
}
ngOnInit() {
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => {
this.viewID = params['pdid'];
});
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
let scheduledDateTime: string="2018-12-03 08:20";
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
if(diffInHours>=-4){
this.enableStartPD=true;
}
else {
this.enableStartPD=false;
}
this.viewPdDetails(this.viewID);
}
@ -69,6 +82,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.masterPdLogsData=data.records.pd_logs.master;
//this.applicantPDLogsData= data.records.pd_logs.master;
this.currentPDStatus = data.records.pd_master_details[0].pd_status;
this.pdAdditionalReqData = data.records.pd_additional_requirements;
}
}, error => this.errorMessage = <any> error);
}
@ -86,6 +100,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
data: record,
position: { right: '0'},
width: '80%',
disableClose: true
});
dialogPDMaster.afterClosed()
@ -101,6 +117,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
data: setPdDetails,
position: { right: '0'},
width: '60%',
disableClose: true
});
dialogApplicant.afterClosed()
@ -109,6 +127,24 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.viewPdDetails(this.viewID)
});
}
// edit pd addtional requirements
editAdditionalRequirement(requirementData:any){
let setPdDetails = {
"pdID":this.viewID,
"records":requirementData
}
const dialogRequirement = this.dialog.open(PdRequirementComponent, {
data: setPdDetails,
position: { right: '0'},
width: '60%',
disableClose: true
});
dialogRequirement.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
});
}
// pd allocation to
pdAllocationTo(pdData:any) {
if(pdData.fk_pd_type == 1){

View File

@ -67,6 +67,7 @@ import { PdReportComponent } from './list-pd/pd-report/pd-report.component';
import {RentalInfoComponent} from "./list-pd/start-pd/forms/rental-info/rental-info.component";
import { AllocationViewMoreComponent } from './list-pd/allocation-view-more/allocation-view-more.component';
import { PdRequirementComponent } from './list-pd/pd-requirement/pd-requirement.component';
/**
@ -141,7 +142,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@ -173,9 +174,9 @@ const pdCustomNotifierOptions: NotifierOptions = {
OwlNativeDateTimeModule,
],
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent],
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent],
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent]
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PdRequirementComponent]
})
export class ManagePdModule {
}

View File

@ -367,6 +367,16 @@ convertNumberToWords(amount) {
return words_string;
}
// save additional requirements
saveAdditionalRequirements(saveData: any): Observable<any> {
saveData.createdby = this._aws.getlocale();
return this._http.post<any>(this.apiUrl+"savePDAdditionalRequiremets",{"records":saveData})
.pipe(
catchError(this.handleError('operation', []))
)
}
// private handleError<T>(operation = 'operation', result?: T) {
// return (error: any): Observable<T> => {
// return of(result as T);