changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-14 16:11:09 +05:30
parent 721e337ec8
commit 135182ea57
4 changed files with 396 additions and 298 deletions

View File

@ -6,6 +6,8 @@ import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { ListPdComponent } from '../list-pd.component';
import { AwsService } from '../../../../AwsService/aws.service';
/**sweet alert */
import Swal from 'sweetalert2';
@Component({
selector: 'app-add-pd',
templateUrl: './add-pd.component.html',
@ -486,11 +488,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
}
loadPdListCompoent(from:boolean) {
//alert(from);
if(from){
// alert('if'+from);
this.router.navigate([ '../../' ], { relativeTo: this.route });
this.ListPdComponent.pdListLoad(true);
}
else{
// alert(from);
this.router.navigate([ '../../' ], { relativeTo: this.route });
this.ListPdComponent.showListView(true);
}

View File

@ -17,7 +17,7 @@
<mat-card-title>PD Details</mat-card-title>
</mat-card-header> -->
<mat-card-content>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
<mat-option>
Select
@ -30,14 +30,14 @@
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<input matInput placeholder="Loan Applicant ID" formControlName="lender_applicant_id" type="text" required>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person" type="text" required>
</mat-form-field>
<mat-form-field style="width: 25%">
<input matInput placeholder="Lender Contact Number" formControlName="pd_contact_mobileno" type="text" (keypress)="keyPress($event)">
<mat-form-field style="width: 29%">
<input matInput placeholder="Lender Mobile Number" formControlName="pd_contact_mobileno" type="text" (keypress)="keyPress($event)">
<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-form-field>
<mat-form-field style="width: 10%">
@ -49,7 +49,7 @@
<input matInput placeholder="LandLine Number" formControlName="lender_landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
<mat-option>
Select
@ -61,7 +61,7 @@
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
<mat-option>Select</mat-option>
@ -74,7 +74,7 @@
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-form-field style="width: 29%">
<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" >
@ -83,7 +83,7 @@
</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-form-field style="width: 29%">
<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" >
@ -94,7 +94,7 @@
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 24%">
<mat-form-field style="width: 62%">
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="pdMain.loan_amount.value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
@ -106,7 +106,7 @@
<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-form-field style="width: 29%;">
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
<mat-option>Select</mat-option>
@ -118,7 +118,7 @@
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 32%;">
<mat-form-field style="width: 29%;">
<mat-select placeholder="City" formControlName="fk_city">
<mat-option>Select</mat-option>
<mat-option *ngFor="let CL of cityList" [value]="CL.city_id">

View File

@ -20,7 +20,7 @@
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="text-align:left">{{master.pd_status | titlecase}}</span>
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
</button>&nbsp;&nbsp;
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT && mandatoryFieldsValidations.length==0" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master.pd_id)"><mat-icon>flash_on</mat-icon></button>
<button *ngIf="currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="directTriggerPD(mandatoryFieldsValidations,master)"><mat-icon>flash_on</mat-icon></button>
<br>
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
<small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small>
@ -145,11 +145,19 @@
<mat-tab-group class="mt-2">
<mat-tab>
<ng-template mat-tab-label>Applicants</ng-template>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<!-- <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)="editPdApplicant(pdApplicantData)"><mat-icon>edit</mat-icon></button>
</div>
<mat-card-header>
<mat-card-title style="color:red !important;">Applicants</mat-card-title>
</mat-card-header> -->
<mat-card-header>
<div fxFlex="70" align="left" style="padding: 10px !important; color:red !important;">
<mat-card-title>Applicants</mat-card-title>
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;" *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)="editPdApplicant(pdApplicantData)"><mat-icon>edit</mat-icon></button>
</div>
</mat-card-header>
<mat-card-content *ngIf="pdApplicantData.length>0; else noApplicant">
@ -181,11 +189,19 @@
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Additional Requirements</ng-template>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<!-- <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 style="color:red !important;">Additional Requirements</mat-card-title>
</mat-card-header> -->
<mat-card-header>
<div fxFlex="70" align="left" style="padding: 10px !important; color:red !important;">
<mat-card-title>Additional Requirements</mat-card-title>
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;" *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 style="color:red !important;">Additional Requirements</mat-card-title>
</mat-card-header>
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">
<mat-list *ngFor="let requirement of pdAdditionalReqData">
@ -271,5 +287,3 @@
</mat-card>
</mat-card-content>
</mat-card>

View File

@ -30,6 +30,59 @@ export class ViewPdComponent implements OnInit, OnDestroy {
masterPdLogsData: any=[];
applicantPDLogsData: any=[];
pdAdditionalReqData: any=[];
FilteredFieldNames : any=[];
localcount :any;
localstring : any;
localMandatoryFields: any=
[ {'backEnd_FieldName':"fk_lender_id",'frontEnd_FieldName':"Lender Name"},
{'backEnd_FieldName':"lender_applicant_id",'frontEnd_FieldName':"Loan Applicant ID"},
{'backEnd_FieldName':"fk_product_id",'frontEnd_FieldName':"Product Name"},
{'backEnd_FieldName':"fk_subproduct_id",'frontEnd_FieldName':"Sub Product Name"},
{'backEnd_FieldName':"fk_pd_type",'frontEnd_FieldName':"PD Type"},
{'backEnd_FieldName':"fk_customer_segment",'frontEnd_FieldName':"Customer Segment"},
{'backEnd_FieldName':"loan_amount",'frontEnd_FieldName':"Loan Amount"},
{'backEnd_FieldName':"addressline1",'frontEnd_FieldName':"Address at which PD is to be done"},
{'backEnd_FieldName':"fk_city",'frontEnd_FieldName':"City"},
{'backEnd_FieldName':"fk_state",'frontEnd_FieldName':"State"},
{'backEnd_FieldName':"pincode",'frontEnd_FieldName':"Pincode"},
{'backEnd_FieldName':"pd_contact_person",'frontEnd_FieldName':"Lender Contact Person"},
{'backEnd_FieldName':"pd_contact_mobileno",'frontEnd_FieldName':"Lender's Mobile Number"},
{'backEnd_FieldName':"pd_branch_id",'frontEnd_FieldName':"Branch"},
{'backEnd_FieldName':"pd_contact_landline",'frontEnd_FieldName':"Lender's Landline Number"}];
// localMandatoryFields: any=
// ['fk_lender_id',
// 'lender_applicant_id',
// 'fk_product_id',
// 'fk_subproduct_id',
// 'fk_pd_type',
// 'fk_customer_segment',
// 'loan_amount',
// 'addressline1',
// 'fk_city',
// 'fk_state',
// 'pincode',
// 'pd_contact_person',
// 'pd_contact_mobileno',
// 'pd_branch_id',
// 'pd_contact_landline'];
// localMandatoryFields2: any=
// [ "Lender Name",
// "Loan Applicant ID",
// "Product Name",
// "Sub Product Name",
// "PD Type",
// "Customer Segment",
// "Loan Amount",
// "Address at which PD is to be done",
// "City",
// "State",
// "Pincode",
// "Lender Contact Person",
// "Lender's Mobile Number",
// "Branch",
// "Lender's Landline Number"];
viewID:string;
viewParams:any;
destroyType:number=1;
@ -119,9 +172,18 @@ export class ViewPdComponent implements OnInit, OnDestroy {
width: '80%',
disableClose: true
});
dialogPDMaster.afterClosed()
dialogPDMaster.afterOpen()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
if(this.localcount == 1){
let ffd : any = [];
this.FilteredFieldNames.forEach(field => {
ffd.push(field.frontEnd_FieldName);
});
this.notifier.notify('info', 'Please Fill ' + ffd.join(',') + ' are Fields.!');
}
});
dialogPDMaster.afterClosed().subscribe(dataresult => {
this.viewPdDetails(this.viewID)
});
}
@ -233,9 +295,26 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// direct trigger the pd
directTriggerPD(data: any,pdid:string){
directTriggerPD(data: any,masterdetail : any){
/** */
let pdid = masterdetail.pd_id;
let getValues = data.filter(val =>val).map(Val => Val);
this.FilteredFieldNames = getValues.map(x => {
let findIndex = this.localMandatoryFields.map(val => val.backEnd_FieldName).indexOf(x);
return this.localMandatoryFields[findIndex];
});
if(data.length>0){
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
// FilteredFieldNames.forEach(field => {
// });
this.localcount = 1;
this.editPdMaster(masterdetail);
// alert(this.localMandatoryFields);
}
else {
let lenderMasterArray = {