merge :ps

This commit is contained in:
venbatechnologies@gmail.com 2018-12-06 11:36:45 +05:30
commit e549ffe422
20 changed files with 1194 additions and 744 deletions

View File

@ -1,23 +1,26 @@
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value,PDTriggerStatus)"> <form [formGroup]="_PDtriggerForm">
<mat-card-content> <mat-card-content>
<div style="width: 100%;text-align:right;"> <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" <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> (click)="loadPdListCompoent(cancelStatus)"><mat-icon>close</mat-icon></button>
</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>PD Details</h5>
<div fxLayout="column" fxLayoutAlign="start stretch"> <mat-card>
<!-- <mat-form-field style="width: 100%"> <mat-card-header>
<input matInput placeholder="First Name" type="text" name="name" required> <mat-card-title>
</mat-form-field> --> PD Details
<mat-form-field style="width: 100%"> </mat-card-title>
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)"> </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" > <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
{{LL.full_name}} {{LL.full_name}}
</mat-option> </mat-option>
@ -26,17 +29,14 @@
</mat-form-field> </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> <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>
<mat-form-field style="width: 100%">
<mat-select placeholder="Billing Address" formControlName="lender_billing"> <mat-form-field style="width: 32%">
<mat-option *ngFor="let billL of billingList" [value]="billL.entity_billing_id" > <input matInput placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" required>
{{billL.billing_name}} <!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.lender_billing.hasError('required')">Billing Address Required</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Contact Person" formControlName="lender_contact_person" type="text" required> <input matInput placeholder="Contact Person" formControlName="lender_contact_person" type="text" required>
@ -48,19 +48,26 @@
<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-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>
<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-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}} {{PL.product_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field> </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-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}} {{SPL.subproduct_name}}
</mat-option> </mat-option>
@ -68,231 +75,188 @@
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field> </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-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}} {{CSL.customer_segment}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
</mat-form-field> </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-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}} {{PDL.type_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field> </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)"> <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('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error> <mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field> </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> <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-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
</mat-form-field> </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> <textarea matInput placeholder="Address 2" formControlName="addressline2" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field> </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> <textarea matInput placeholder="Address 3" formControlName="addressline3" oninput="this.value = this.value.toUpperCase()"></textarea>
</mat-form-field> </mat-form-field>-->
<mat-form-field style="width: 100%;"> <mat-form-field style="width: 32%">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)"> <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"> <mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%;"> <mat-form-field style="width: 32%">
<mat-select placeholder="City" formControlName="fk_city"> <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}} {{CL.city_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> --> <!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%;"> <mat-form-field style="width: 24%">
<input matInput placeholder="Pincode" formControlName="pincode" (keypress)="keyPress($event)"> <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('required')">Pincode Required.</mat-error> -->
<mat-error *ngIf="pdMain.pincode.hasError('maxlength') || pdMain.pincode.hasError('minlength')">Enter Valid Pincode. </mat-error> <mat-error *ngIf="pdMain.pincode.hasError('maxlength') || pdMain.pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field> </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> </mat-card>
</div>
</div> <mat-card>
<div fxLayout="row" fxLayoutWrap="wrap"> <mat-card-header>
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100"> <mat-card-title>Applicant Details</mat-card-title>
<mat-card class="p-2"> </mat-card-header>
<h5>Main Applicant</h5> <mat-card-content>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 46%">
<input matInput placeholder="Name" formControlName="applicant_name"> <input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name">
<mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error> <!-- <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> </mat-form-field>
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none"> <mat-form-field style="width: 46%">
<mat-form-field style="width: 50%"> <input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" (keypress)="keyPress($event)">
<input matInput placeholder="Mobile" formControlName="mobile_no" type="text" (keypress)="keyPress($event)" required>
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <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>
<mat-form-field style="width: 50%"> <mat-form-field style="width: 46%">
<input matInput placeholder="LandLine" formControlName="landline" type="text" (keypress)="keyPress($event)"> <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 Phone Number. </mat-error> <mat-error *ngIf="pdMain.landline.hasError('maxlength') || pdMain.landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
</mat-form-field> </mat-form-field>
</div>
<!-- Phone field to be split into 2 parts. Mobile Number mandatory and optional land line number with std code. --> <!-- Phone field to be split into 2 parts. Mobile Number mandatory and optional land line number with std code. -->
</mat-card-content>
<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> </mat-card>
</div> <mat-card>
</div> <mat-card-header>
<div fxLayout="row" fxLayoutWrap="wrap" formArrayName="items" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;"> <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"> </mat-card>
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5> </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-card formArrayName="documents">
<mat-form-field style="width: 100%"> <mat-card-header>
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required> <mat-card-title>
</mat-form-field> Document
</mat-card-title>
<div fxLayout="row" fxLayoutGap="5%" fxLayoutAlign="start none"> </mat-card-header>
<mat-form-field style="width: 50%"> <mat-card-content>
<input matInput placeholder="Mobile" formControlName="coapplicant_mobile_no" type="text" (keypress)="keyPress($event)" required> <mat-list *ngFor="let docList of documents.controls; let d = index;" [formGroupName]="d">
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <!-- <h3 mat-subheader>Upload Documents</h3> -->
</mat-form-field> <mat-list-item>
<mat-form-field style="width: 70%">
<mat-form-field style="width: 50%"> <input matInput placeholder="Document Name" formControlName="doc_name" type="text">
<input matInput placeholder="LandLine" formControlName="coapplicant_landline" type="text" (keypress)="keyPress($event)"> </mat-form-field>
<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 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"> <span (click)="removeItem(d)">
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" > <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>
{{rel.name}} </span>
</mat-option> </div>
</mat-select> </mat-list-item>
</mat-form-field> </mat-list>
</mat-card-content>
<div style="width:20%"> <mat-card-actions align="left">
<span (click)="removeCoApplicant(i)"> <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>
<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">
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100"> </mat-card-actions>
<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>
</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> </mat-card>
</div>
</div>
</mat-card-content> </mat-card-content>
<!-- <mat-card-actions style="text-align: right"> <mat-card-actions>
<button mat-button color="accent" type="button" (click)="loadPdListCompoent()">Cancel</button> <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> </mat-card-actions>
</form> </form>
</mat-card-content> </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; private notifier: NotifierService;
public _PDtriggerForm: FormGroup; public _PDtriggerForm: FormGroup;
items: FormArray; items: FormArray;
addtional_requirements: FormArray;
productList:any; productList:any;
subProductList:any; subProductList:any;
lenderList:any; lenderList:any;
@ -34,11 +35,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
// Dynamic co applicant // Dynamic co applicant
createWithLongContent = false; createWithLongContent = false;
dynamicCoApplicant = []; dynamicCoApplicant = [];
//allocationTypeModel: number;
//allocationTypeCheck: boolean;
//subAllocationTypeCheck: boolean;
//allocationLabel: string;
//subAllocationLabel: string;
constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute, constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute,
private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) { private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) {
this.notifier = notifier; this.notifier = notifier;
@ -59,7 +55,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.getPDTypeList(); this.getPDTypeList();
this.getRelationMaster(); this.getRelationMaster();
this.loadFormData(); this.loadFormData();
this.OnChanges();
} }
@ -70,7 +65,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
lender_applicant_id: [null, Validators.compose([Validators.required])], lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_contact_person: [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_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_product_id: [null],
fk_subproduct_id: [null], fk_subproduct_id: [null],
fk_pd_type: [null], fk_pd_type: [null],
@ -78,32 +73,24 @@ export class AddPdComponent implements OnInit, OnDestroy {
loan_amount: [null,Validators.compose([Validators.pattern('^[0-9]*$')])], loan_amount: [null,Validators.compose([Validators.pattern('^[0-9]*$')])],
applicant_name: [null], applicant_name: [null],
mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])], // landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
email: [null], // email: [null],
landline : [null,Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null],
  addressline1: [null],   addressline1: [null],
addressline2: [null],
addressline3: [null],
fk_city: [null], fk_city: [null],
fk_state: [null], fk_state: [null],
  pincode : [null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])],   pincode : [null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])],
remarks:[null], remarks:[null],
  // allocation_type: [null],   // allocation_type: [null],
  // sub_allocation_type: [null],   // sub_allocation_type: [null],
items: this._fb.array([]), //items: this._fb.array([]),
documents: 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(){ getLenderList(){
this._pd.getLenderDetails().subscribe( this._pd.getLenderDetails().subscribe(
data => { data => {
@ -143,34 +130,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
if (data.status == 200) { if (data.status == 200) {
this.pdTypeList=data.records.pd_type; 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); }, error => this.errorMessage = <any> error);
} }
@ -187,11 +146,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.cityList=this.cityList[0].cities; 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 // get relation master details
getRelationMaster(){ getRelationMaster(){
let relation ="RELATIONSHIPS"; let relation ="RELATIONSHIPS";
@ -246,7 +200,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
}; };
get pdMain() { get pdMain() {
return this._PDtriggerForm.controls; } 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) { removeCoApplicant(i: number) {
const control = <FormArray>this._PDtriggerForm.controls['items']; const control = <FormArray>this._PDtriggerForm.controls['items'];
@ -259,6 +213,24 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lengthCheckToaddMore=this.lengthCheckToaddMore-1; 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) { public fileSelectionEvent(fileInput: any,oldIndex:number) {
@ -286,116 +258,182 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.lengthCheckToaddMore=1; 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 // save pd in draft
let pd_form: FormData = new FormData(); saveDraftPD(formValue: any, status:string){
this.submitPdDetails(formValue, status);
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.!');
});
}
} }
// 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) { this._PDtriggerForm.controls['fk_product_id'].setValidators([Validators.required]);
// if(status){ this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
// this.allocationTypeModel=3;
// this.allocationLabel="Manual"; this._PDtriggerForm.controls['fk_subproduct_id'].setValidators([Validators.required]);
// } this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
// else{
// this.allocationTypeModel=1; this._PDtriggerForm.controls['fk_pd_type'].setValidators([Validators.required]);
// this.allocationLabel="Auto"; this._PDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
// this.subAllocationLabel="Load Balance";
// } this._PDtriggerForm.controls['fk_customer_segment'].setValidators([Validators.required]);
// } this._PDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
// changeSubAllocationType(status: boolean){
// if(status){ this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required]);
// this.allocationTypeModel=2; this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
// this.allocationLabel="Auto";
// this.subAllocationLabel="Nearest"; this._PDtriggerForm.controls['applicant_name'].setValidators([Validators.required]);
// } this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity();
// else{
// this.allocationTypeModel=1; this._PDtriggerForm.controls['mobile_no'].setValidators([Validators.required]);
// this.allocationLabel="Auto"; this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity();
// this.subAllocationLabel="Load Balance";
// } this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
// } this._PDtriggerForm.controls['addressline1'].updateValueAndValidity();
// end
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) { loadPdListCompoent(from:boolean) {
if(from){ if(from){
this.router.navigate([ '../../' ], { relativeTo: this.route }); this.router.navigate([ '../../' ], { relativeTo: this.route });
@ -423,4 +461,19 @@ export class AddPdComponent implements OnInit, OnDestroy {
event.preventDefault(); 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,90 @@
<div style="max-height: 480px; width: 550px;"> <form [formGroup]="_EditApplicantForm">
<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" (submit)="updatePdApplicant(_EditApplicantForm.value)"> <h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left">
{{pageTitle}}
<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)">
<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>
</div> </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> <mat-dialog-content>
</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-card class="p-2"> <mat-card>
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5> <mat-card-header>
<mat-card-title>Main Applicant</mat-card-title>
<div [formGroupName]="i"> </mat-card-header>
<mat-form-field style="width: 100%"> <mat-card-content>
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required> <mat-form-field style="width: 40%">
<mat-error *ngIf="coDetails['controls'].coapplicantName.hasError('required')">Name is Required.</mat-error> <input matInput placeholder="Name of Individual Applicant" formControlName="applicant_name" required>
</mat-form-field> </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>
<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 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-card-content>
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
{{rel.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-card> </mat-card>
</div> <mat-card formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
</div> <!-- <mat-card-header>
<div style="text-align: right"> <mat-card-title>Co Applicant</mat-card-title>
<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-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" </mat-form-field>
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button> <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> --> <!-- <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, encapsulation: ViewEncapsulation.None,
}) })
export class EditPdApplicantComponent implements OnInit { export class EditPdApplicantComponent implements OnInit {
public pageTitle: string = "Edit Applicant"; public pageTitle: string = "Applicant Details";
errorMessage: any; errorMessage: any;
public _EditApplicantForm:FormGroup; public _EditApplicantForm:FormGroup;
public notifier: NotifierService; public notifier: NotifierService;
@ -43,8 +43,8 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [null], fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])], applicant_name: [null, Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])], 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)])], landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
email: [null, Validators.compose([Validators.required, CustomValidators.email])], company_name: [null],
applicant_type: [1], applicant_type: [1],
coApplicantItems: this._fb.array([]), coApplicantItems: this._fb.array([]),
}); });
@ -55,9 +55,9 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({ this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], 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)])], 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.required,Validators.minLength(12),Validators.maxLength(13)])], landline: [this.mainApplicantData[0].landline, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
email: [this.mainApplicantData[0].email, Validators.compose([Validators.required, CustomValidators.email])], company_name: [this.mainApplicantData[0].company_name],
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])], applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
coApplicantItems: this._fb.array([]), coApplicantItems: this._fb.array([]),
}); });
@ -76,9 +76,10 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [listData.pd_co_applicant_id], fk_applicant_primary_id: [listData.pd_co_applicant_id],
coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])], 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_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], relationship: [listData.relation],
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])], applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
company_name: [listData.company_name],
}); });
} }
else{ else{
@ -87,9 +88,10 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [null], fk_applicant_primary_id: [null],
coapplicantName: [null, Validators.compose([Validators.required])], coapplicantName: [null, Validators.compose([Validators.required])],
coapplicant_mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])], 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], relationship: [null],
applicant_type: [0], applicant_type: [0],
company_name: [null],
}); });
} }
@ -105,12 +107,16 @@ export class EditPdApplicantComponent implements OnInit {
get pdMainApplicant() { return this._EditApplicantForm.controls; } get pdMainApplicant() { return this._EditApplicantForm.controls; }
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; } get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
updatePdApplicant(formValue: any) { updatePdApplicant(formValue: any) {
if(this._EditApplicantForm.valid){ if(this._EditApplicantForm.invalid) {
this.validateAllFormFields(this._EditApplicantForm)
return;
}
else {
let pd_applicant_details : any=[{ let pd_applicant_details : any=[{
"fk_pd_id": this.data.pdID, "fk_pd_id": this.data.pdID,
"pd_co_applicant_id": formValue.fk_applicant_primary_id, "pd_co_applicant_id": formValue.fk_applicant_primary_id,
"applicant_name":formValue.applicant_name, "applicant_name":formValue.applicant_name,
"email":formValue.email, "company_name":formValue.company_name,
"mobile_no":formValue.mobile_no, "mobile_no":formValue.mobile_no,
"landline":formValue.landline, "landline":formValue.landline,
"applicant_type":formValue.applicant_type, "applicant_type":formValue.applicant_type,
@ -123,10 +129,10 @@ export class EditPdApplicantComponent implements OnInit {
"pd_co_applicant_id": itemElement.fk_applicant_primary_id, "pd_co_applicant_id": itemElement.fk_applicant_primary_id,
"applicant_name":itemElement.coapplicantName, "applicant_name":itemElement.coapplicantName,
"relation":itemElement.relationship, "relation":itemElement.relationship,
"email":"",
"mobile_no":itemElement.coapplicant_mobile_no, "mobile_no":itemElement.coapplicant_mobile_no,
"landline":itemElement.coapplicant_landline, "landline":itemElement.coapplicant_landline,
"applicant_type":itemElement.applicant_type, "applicant_type":itemElement.applicant_type,
"company_name":itemElement.company_name,
"isactive":1 "isactive":1
} }
pd_applicant_details.push(obj1) pd_applicant_details.push(obj1)
@ -179,4 +185,19 @@ export class EditPdApplicantComponent implements OnInit {
event.preventDefault(); 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;"> <form [formGroup]="_EditPDtriggerForm" novalidate>
<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> -->
</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%"> </div>
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required> </h2>
<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>
<mat-dialog-content>
</mat-form-field> <mat-card>
<mat-form-field style="width: 100%"> <!-- <mat-card-header>
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)"> <mat-card-title>PD Details</mat-card-title>
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" > </mat-card-header> -->
{{PL.product_name}} <mat-card-content>
</mat-option> <mat-form-field style="width: 32%">
</mat-select> <mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> --> <mat-option>
</mat-form-field> 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> </mat-form-field>
</div> <mat-form-field style="width: 32%">
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
</div> </mat-form-field>
</div> <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-form-field>
<mat-card-actions style="text-align: right"> <mat-form-field style="width: 32%">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" <mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button> <mat-option>
<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> Select
<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-option>
</mat-card-actions> <mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
</form> {{PL.product_name}}
</mat-card> </mat-option>
</div> </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 encapsulation: ViewEncapsulation.None
}) })
export class EditPdMasterComponent implements OnInit { export class EditPdMasterComponent implements OnInit {
public pageTitle: string = "Edit PD Master"; public pageTitle: string = "PD Details";
errorMessage: any; errorMessage: any;
productList:any; productList:any;
subProductList:any; subProductList:any;
@ -55,7 +55,6 @@ export class EditPdMasterComponent implements OnInit {
this.getPDTypeList(); this.getPDTypeList();
this.loadFormData(); this.loadFormData();
this.applicantLength=this.data.applicantLength; this.applicantLength=this.data.applicantLength;
this.OnChanges();
} }
@ -65,10 +64,6 @@ export class EditPdMasterComponent implements OnInit {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.lenderList=data.records this.lenderList=data.records
if(this.data.records.fk_lender_id){
this.getBillingDetails(this.data.records.fk_lender_id);
}
} }
}, error => this.errorMessage = <any> error); }, 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])], 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_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]*$')])], 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_product_id: [this.data.records.fk_product_id],
fk_subproduct_id: [this.data.records.fk_subproduct_id], fk_subproduct_id: [this.data.records.fk_subproduct_id],
fk_pd_type: [this.data.records.fk_pd_type], fk_pd_type: [this.data.records.fk_pd_type],
fk_customer_segment: [this.data.records.fk_customer_segment], fk_customer_segment: [this.data.records.fk_customer_segment],
loan_amount: [this.data.records.loan_amount,Validators.compose([Validators.pattern('^[0-9]*$')])], loan_amount: [this.data.records.loan_amount,Validators.compose([Validators.pattern('^[0-9]*$')])],
  addressline1: [this.data.records.addressline1],   addressline1: [this.data.records.addressline1],
addressline2: [this.data.records.addressline2],
addressline3: [this.data.records.addressline3],
fk_city: [this.data.records.fk_city], fk_city: [this.data.records.fk_city],
fk_state: [this.data.records.fk_state], fk_state: [this.data.records.fk_state],
  pincode : [this.data.records.pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],   pincode : [this.data.records.pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],
remarks: [this.data.records.remarks], 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 pdMain() { return this._EditPDtriggerForm.controls; }
//get sub product list based on prokduct id //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.stateList.filter(item => item.state_id == stateID);
this.cityList=this.cityList[0].cities; this.cityList=this.cityList[0].cities;
} }
// lendor billing address
getBillingDetails(lendorID:string){ // save pd in draft
this.billingList= this.lenderList.filter(item => item.entity_id == lendorID); saveDraftPD(formValue: any, status:string){
this.billingList=this.billingList[0].billing_address; 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) { submitPdDetails(formValue: any, status:string) {
let updateStatus = this.currentPDStatus == this.pdStatusCheck.DRAFT ? status : this.currentPDStatus == this.pdStatusCheck.TRIGGERED ? status : this.currentPDStatus; 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; let my_array = this._EditPDtriggerForm.value;
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
this._pd.editPdMasterDetails(my_array, updateStatus).subscribe(result => { 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>
<mat-card-content [style.display]="viewPdList ? 'block' : 'none'"> <mat-card-content [style.display]="viewPdList ? 'block' : 'none'">
<div fxLayout="row"> <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;" > <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="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.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> <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"> <div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd master --> <!--pd master -->
<mat-card *ngFor="let master of pdMasterData" class="minheight"> <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> <mat-card-header>
<!-- <img mat-card-avatar src="assets/images/avatar.jpg"> <!-- <img mat-card-avatar src="assets/images/avatar.jpg">
<mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}} <mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}}
</mat-card-title>--> </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-header>
<mat-card-content> <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.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 *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> <p *ngIf="master.remarks"><span style="font-size:13px;"> Remarks : </span> <span style="color:red">{{master.remarks}}</span></p>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
@ -80,7 +83,7 @@
<mat-list-item style="height:68px !important;"> <mat-list-item style="height:68px !important;">
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon"> <p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-user-o"></i> <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> <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> &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> <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> <ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
</mat-card> </mat-card>
</div> </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"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
<!-- pd documents card --> <!-- pd documents card -->

View File

@ -1,5 +1,7 @@
.cardEdit { .cardEdit {
display: inline;float:right;padding-top:3%; display: inline;
float:right;
padding-top:3%;
} }
.minheight { .minheight {
min-height: 100%; 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 { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
@ -11,7 +11,9 @@ import { ListPdComponent } from '../list-pd.component';
import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component'; import { SchedulePdComponent } from '../schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component'; import { EditPdApplicantComponent } from '../edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.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({ @Component({
selector: 'app-view-pd', selector: 'app-view-pd',
templateUrl: './view-pd.component.html', templateUrl: './view-pd.component.html',
@ -19,7 +21,7 @@ import { EditPdMasterComponent } from '../edit-pd-master/edit-pd-master.componen
encapsulation: ViewEncapsulation.None encapsulation: ViewEncapsulation.None
}) })
export class ViewPdComponent implements OnInit, OnDestroy { export class ViewPdComponent implements OnInit, OnDestroy {
public selectedMoment = new Date(); pipe = new DatePipe('en-US');
private notifier:NotifierService; private notifier:NotifierService;
errorMessage: any; errorMessage: any;
pdMasterData: any=[]; pdMasterData: any=[];
@ -27,11 +29,12 @@ export class ViewPdComponent implements OnInit, OnDestroy {
pdDocumentsData: any=[]; pdDocumentsData: any=[];
masterPdLogsData: any=[]; masterPdLogsData: any=[];
applicantPDLogsData: any=[]; applicantPDLogsData: any=[];
pdAdditionalReqData: any=[];
viewID:string; viewID:string;
viewParams:any; viewParams:any;
destroyType:number=1; destroyType:number=1;
currentPDStatus:string; currentPDStatus:string;
enableStartPD: boolean;
// create values for status check // create values for status check
pdStatusCheck :any={ pdStatusCheck :any={
"DRAFT" :'DRAFT', "DRAFT" :'DRAFT',
@ -48,14 +51,24 @@ export class ViewPdComponent implements OnInit, OnDestroy {
public _EditPDtriggerForm:FormGroup; public _EditPDtriggerForm:FormGroup;
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) { private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) {
this.notifier=notifier this.notifier=notifier;
this.enableStartPD=false;
} }
ngOnInit() { ngOnInit() {
this.ListPdComponent.showListView(false);
this.route.params.subscribe(params => { this.route.params.subscribe(params => {
this.viewID = params['pdid']; 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); this.viewPdDetails(this.viewID);
} }
@ -69,6 +82,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.masterPdLogsData=data.records.pd_logs.master; this.masterPdLogsData=data.records.pd_logs.master;
//this.applicantPDLogsData= data.records.pd_logs.master; //this.applicantPDLogsData= data.records.pd_logs.master;
this.currentPDStatus = data.records.pd_master_details[0].pd_status; this.currentPDStatus = data.records.pd_master_details[0].pd_status;
this.pdAdditionalReqData = data.records.pd_additional_requirements;
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
} }
@ -86,6 +100,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
} }
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, { const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
data: record, data: record,
position: { right: '0'},
width: '80%',
disableClose: true disableClose: true
}); });
dialogPDMaster.afterClosed() dialogPDMaster.afterClosed()
@ -101,6 +117,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
} }
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, { const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
data: setPdDetails, data: setPdDetails,
position: { right: '0'},
width: '60%',
disableClose: true disableClose: true
}); });
dialogApplicant.afterClosed() dialogApplicant.afterClosed()
@ -109,13 +127,31 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.viewPdDetails(this.viewID) 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 // pd allocation to
pdAllocationTo(pdData:any) { pdAllocationTo(pdData:any) {
if(pdData.fk_pd_type == 1){ if(pdData.fk_pd_type == 1){
const dialogRef = this.dialog.open(PdAllocationComponent, { const dialogRef = this.dialog.open(PdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true disableClose: true
}); });
dialogRef.afterClosed() dialogRef.afterClosed()
@ -127,8 +163,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
else if(pdData.fk_pd_type == 2){ else if(pdData.fk_pd_type == 2){
const dialogRef = this.dialog.open(SmartPdAllocationComponent, { const dialogRef = this.dialog.open(SmartPdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true disableClose: true
}); });
dialogRef.afterClosed() dialogRef.afterClosed()
@ -141,8 +177,8 @@ export class ViewPdComponent implements OnInit, OnDestroy {
else if(pdData.fk_pd_type == 3){ else if(pdData.fk_pd_type == 3){
const dialogRef = this.dialog.open(TelePdAllocationComponent, { const dialogRef = this.dialog.open(TelePdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true, disableClose: true,
}); });
dialogRef.afterClosed() dialogRef.afterClosed()

View File

@ -70,6 +70,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 {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 { AllocationViewMoreComponent } from './list-pd/allocation-view-more/allocation-view-more.component';
import { PdRequirementComponent } from './list-pd/pd-requirement/pd-requirement.component';
/** /**
@ -117,108 +118,175 @@ const pdCustomNotifierOptions: NotifierOptions = {
}; };
@NgModule({ @NgModule({
imports: [ // <<<<<<< HEAD
CommonModule, // imports: [
ManagePdRoutingModule, // CommonModule,
NotifierModule.withConfig(pdCustomNotifierOptions), // ManagePdRoutingModule,
MatCardModule, // NotifierModule.withConfig(pdCustomNotifierOptions),
MatIconModule, // MatCardModule,
MatInputModule, // MatIconModule,
MatRadioModule, // MatInputModule,
MatTableModule, // MatRadioModule,
MatPaginatorModule, // MatTableModule,
MatButtonModule, // MatPaginatorModule,
MatProgressBarModule, // MatButtonModule,
MatToolbarModule, // MatProgressBarModule,
FlexLayoutModule, // MatToolbarModule,
NgxDatatableModule, // FlexLayoutModule,
FormsModule,MatSlideToggleModule, // NgxDatatableModule,
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule, // FormsModule,MatSlideToggleModule,
ReactiveFormsModule, // MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
FileUploadModule, // ReactiveFormsModule,
TreeModule, // FileUploadModule,
MatDatepickerModule, // TreeModule,
MatDialogModule,MatSortModule, // MatDatepickerModule,
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, // MatDialogModule,MatSortModule,
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule, // NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
OwlNativeDateTimeModule, // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
], // OwlNativeDateTimeModule,
declarations: [RentalInfoComponent, // ],
TelePdAllocationComponent, // declarations: [RentalInfoComponent,
FinancialInfoComponent, // TelePdAllocationComponent,
BusinessInfoComponent, // FinancialInfoComponent,
EmploymentInfoComponent, // BusinessInfoComponent,
StockComponent, // EmploymentInfoComponent,
BankingDetailsComponent, // StockComponent,
ListPdComponent, // BankingDetailsComponent,
FamilyDetailsComponent, // ListPdComponent,
AddressComponent, // FamilyDetailsComponent,
ManagePdComponent, // AddressComponent,
MapPdViewComponent, // ManagePdComponent,
AddPdComponent, // MapPdViewComponent,
ViewPdComponent, // AddPdComponent,
PdAllocationComponent, // ViewPdComponent,
SmartPdAllocationComponent, // PdAllocationComponent,
SchedulePdComponent, // SmartPdAllocationComponent,
EditPdApplicantComponent, // SchedulePdComponent,
EditPdMasterComponent, // EditPdApplicantComponent,
StartPdComponent, // EditPdMasterComponent,
InprogressPdComponent, // StartPdComponent,
AllPdComponent, // InprogressPdComponent,
ScheduledPdComponent, // AllPdComponent,
CompletedPdComponent, // ScheduledPdComponent,
QcCompletedPdComponent, // CompletedPdComponent,
ClientInfoComponent, // QcCompletedPdComponent,
CurrentLoanComponent, // ClientInfoComponent,
AssetsInfoComponent, // CurrentLoanComponent,
LoanDetailsComponent, // AssetsInfoComponent,
OtherIncomeComponent, // LoanDetailsComponent,
SupplierInfoComponent, // OtherIncomeComponent,
PersonalInfoComponent, // SupplierInfoComponent,
LenderRepresentativeComponent, // PersonalInfoComponent,
PdReportComponent, // LenderRepresentativeComponent,
AssessedIncomeComponent, // PdReportComponent,
AllocationViewMoreComponent], // AssessedIncomeComponent,
// AllocationViewMoreComponent],
exports: [PdAllocationComponent, // exports: [PdAllocationComponent,
SmartPdAllocationComponent, // SmartPdAllocationComponent,
TelePdAllocationComponent, // TelePdAllocationComponent,
SchedulePdComponent, // SchedulePdComponent,
EditPdApplicantComponent, // EditPdApplicantComponent,
EditPdMasterComponent, // EditPdMasterComponent,
StartPdComponent, // StartPdComponent,
CompletedPdComponent, // CompletedPdComponent,
QcCompletedPdComponent, // QcCompletedPdComponent,
AllocationViewMoreComponent], // AllocationViewMoreComponent],
providers: [PdTrigerService, // providers: [PdTrigerService,
GetGeometricLocationService], // GetGeometricLocationService],
entryComponents: [PdAllocationComponent, // entryComponents: [PdAllocationComponent,
SmartPdAllocationComponent, // SmartPdAllocationComponent,
SchedulePdComponent, // SchedulePdComponent,
EditPdApplicantComponent, // EditPdApplicantComponent,
EditPdMasterComponent, // EditPdMasterComponent,
TelePdAllocationComponent, // TelePdAllocationComponent,
AllocationViewMoreComponent, // AllocationViewMoreComponent,
// PersonalInfoComponent,
// ClientInfoComponent,
// SupplierInfoComponent,
// CurrentLoanComponent,
// LoanDetailsComponent,
// OtherIncomeComponent,
// AssetsInfoComponent,
// AddressComponent,
// FamilyDetailsComponent,
// BankingDetailsComponent,
// StockComponent,
// EmploymentInfoComponent,
// BusinessInfoComponent,
// FinancialInfoComponent,
// LenderRepresentativeComponent,
// RentalInfoComponent,
// AssessedIncomeComponent],
// =======
// imports: [
// CommonModule,
// ManagePdRoutingModule,
// NotifierModule.withConfig(pdCustomNotifierOptions),
// MatCardModule,
// MatIconModule,
// MatInputModule,
// MatRadioModule,
// MatTableModule,
// MatPaginatorModule,
// MatButtonModule,
// MatProgressBarModule,
// MatAutocompleteModule,
// MatToolbarModule,
// FlexLayoutModule,
// NgxDatatableModule,
// FormsModule,
// MatSlideToggleModule,
// MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule,
// ReactiveFormsModule,
// FileUploadModule,
// TreeModule,
// MatDialogModule, MatSortModule,
// NgxMatSelectSearchModule, MatTooltipModule, MatExpansionModule,
// 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, PdRequirementComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
// entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
MatCardModule,
MatIconModule,
MatInputModule,
MatRadioModule,
MatTableModule,
MatPaginatorModule,
MatButtonModule,
MatProgressBarModule,
MatToolbarModule,
FlexLayoutModule,
NgxDatatableModule,
FormsModule,MatSlideToggleModule,
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
FileUploadModule,
TreeModule,
MatDatepickerModule,
MatDialogModule,MatSortModule,
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule,
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, PdRequirementComponent],
providers: [PdTrigerService, GetGeometricLocationService],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, PdRequirementComponent],
PersonalInfoComponent,
ClientInfoComponent,
SupplierInfoComponent,
CurrentLoanComponent,
LoanDetailsComponent,
OtherIncomeComponent,
AssetsInfoComponent,
AddressComponent,
FamilyDetailsComponent,
BankingDetailsComponent,
StockComponent,
EmploymentInfoComponent,
BusinessInfoComponent,
FinancialInfoComponent,
LenderRepresentativeComponent,
RentalInfoComponent,
AssessedIncomeComponent],
}) })
export class ManagePdModule { export class ManagePdModule {
} }

View File

@ -367,6 +367,16 @@ convertNumberToWords(amount) {
return words_string; 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) { // private handleError<T>(operation = 'operation', result?: T) {
// return (error: any): Observable<T> => { // return (error: any): Observable<T> => {
// return of(result as T); // return of(result as T);

View File

@ -112,8 +112,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
if(pdData.fk_pd_type == 1){ if(pdData.fk_pd_type == 1){
const dialogRef = this.dialog.open(PdAllocationComponent, { const dialogRef = this.dialog.open(PdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true disableClose: true
}); });
dialogRef.afterClosed() dialogRef.afterClosed()
@ -125,8 +125,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
else if(pdData.fk_pd_type == 2){ else if(pdData.fk_pd_type == 2){
const dialogRef = this.dialog.open(SmartPdAllocationComponent, { const dialogRef = this.dialog.open(SmartPdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true disableClose: true
}); });
dialogRef.afterClosed() dialogRef.afterClosed()
@ -139,8 +139,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
else if(pdData.fk_pd_type == 3){ else if(pdData.fk_pd_type == 3){
const dialogRef = this.dialog.open(TelePdAllocationComponent, { const dialogRef = this.dialog.open(TelePdAllocationComponent, {
data: pdData, data: pdData,
width: '60%', position: { right: '0'},
maxHeight: '60%', width: '80%',
disableClose: true, disableClose: true,
}); });
dialogRef.afterClosed() dialogRef.afterClosed()