Fairoj : Duplicate Functionality for applicant name, mob no., app id implemented

This commit is contained in:
venbatechnologies@gmail.com 2019-11-04 15:59:43 +05:30
parent c59dc64bb6
commit 2d9ce4948e
4 changed files with 86 additions and 3 deletions

View File

@ -41,7 +41,7 @@
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" required>
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" (change)="checkExistPd($event.target.value,1)" required>
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
</mat-form-field>
<!-- <div *ngIf="sales_and_credit_enable"> -->
@ -226,7 +226,7 @@
<mat-form-field style="width: 38%">
<input matInput autocomplete="off" placeholder="Name of Individual Applicant" formControlName="applicant_name"
[value]="pdMain.applicant_name.value | titlecase">
[value]="pdMain.applicant_name.value | titlecase" (change)="checkExistPd($event.target.value,2)">
<!-- <mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is Required.</mat-error> -->
</mat-form-field>
@ -235,7 +235,7 @@
</mat-form-field>
<mat-form-field style="width: 38%">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" ForMobileNumbers maxlength="10" minlength="10">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" ForMobileNumbers maxlength="10" minlength="10" (change)="checkExistPd($event.target.value,2)">
<mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile No is Required . </mat-error>
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>

View File

@ -915,4 +915,52 @@ cusSegChange(cus_id){
this.cus_abbr_value = this.customerSegmentList.filter(val=>val.customer_segment_id == cus_id).map(cus_abbr=>cus_abbr.abbr)[0]
}
checkExistPd(value,option){
// console.log(value);
let param
let name
let swal_text
switch(option){
case 1:
param={lender_applicant_id:value}
name= "Loan Application Id"
swal_text="The Entered "+name+" ("+value+") is already exists on the Case No. "
break;
case 2:
param={applicant_name:this.pdMain.applicant_name.value,mobile_no:this.pdMain.mobile_no.value}
name= "Applicant Name"
swal_text="The Entered applicant name and mobile number is already exists on the following Case Nos. "
break;
// case 3:
// param={mobile_no:value}
// name= "Mobile Number"
// break;
}
// if(option == 2 || ){
if((this.pdMain.mobile_no.value != null && this.pdMain.mobile_no.value != '' && this.pdMain.applicant_name.value != null && this.pdMain.applicant_name.value != '' && option == 2) || option == 1){
this._pd.checkExistPDDetails(param,this.userDetails.fk_entity_id).subscribe(result=>{
if(result['dataStatus']){
if(result['records'].length > 0){
let exist_pd_sno:string=''
result['records'].forEach(val=>{
if(exist_pd_sno == ''){
exist_pd_sno=val.pd_sno
}
else{
exist_pd_sno=exist_pd_sno+','+val.pd_sno}
})
Swal({
title:"Warning!",
type:'warning',
text:swal_text+exist_pd_sno
})
// this._PDtriggerForm.controls['lender_applicant_id'].setValue('');
}
}
})
}
}
}

View File

@ -79,6 +79,7 @@
<div>
<mat-card-title style="color:#e00201;">Lender Contact Details</mat-card-title>
<div *ngIf="master.pd_contact_person != '' && master.pd_contact_person != null">
<mat-list>
<mat-list-item align="left" *ngIf="master.pd_contact_person" style="height:48px !important;">
<i class="fa-1x fa fa-user"></i><small style="margin-left: 2%; font-size: inherit">{{master.pd_contact_person}}</small>
@ -87,6 +88,35 @@
<i class="fa-1x fa fa-phone"></i><small style="margin-left: 2%; font-size: inherit">{{master.pd_contact_mobileno}}</small>
</mat-list-item>
</mat-list>
</div>
<div *ngIf="master.lender_credit_person_name != '' && master.lender_credit_person_name != null">
<!-- <mat-list-item> -->
<mat-card-subtitle>Credit Person</mat-card-subtitle>
<!-- </mat-list-item> -->
<div fxLayout="row" fxFlex="100">
<!-- <div > -->
<div fxFlex="50" align="left">
<i class="fa-1x fa fa-user"></i><small style="margin-left: 1%; font-size: inherit">{{master.lender_credit_person_name}}</small>
</div>
<div fxFlex="50" align="right">
<i class="fa-1x fa fa-phone"></i><small style="margin-left: 1%; font-size: inherit">{{master.lender_credit_person_contact_mobileno}}</small>
</div>
<!-- </div> -->
</div>
</div><br/>
<div *ngIf="master.lender_sales_person_name != '' && master.lender_sales_person_name != null">
<mat-card-subtitle>Sales Person</mat-card-subtitle><br/>
<div fxFlex="row">
<div fxFlex="100">
<div fxFlex="50" align="left">
<i class="fa-1x fa fa-user"></i><small style="margin-left: 2%; font-size: inherit">{{master.lender_sales_person_name}}</small>
</div>
<div fxFlex="50" align="right">
<i class="fa-1x fa fa-phone"></i><small style="margin-left: 2%; font-size: inherit">{{master.lender_sales_contact_mobileno}}</small>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>

View File

@ -771,5 +771,10 @@ generatePDReportPDF(pdId: any): Observable<any> {
archivePDImages(Dtl : any): Observable<any> {
return this._http.post<any>(this.apiUrl + "archivePDImages", { "records": Dtl });
}
checkExistPDDetails(datas,entity_id){
return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id})
.pipe(catchError(this.handleError("checkExistPDDetails",[])))
}
}