Fairoj : Duplicate functionality check for trigger cases

This commit is contained in:
venbatechnologies@gmail.com 2019-11-04 19:49:08 +05:30
parent 6a0afa55fa
commit c22fa3fca3
7 changed files with 76 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.sineedge.pdglender" version="0.0.8" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.sineedge.pdglender" version="0.0.9" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>PD Genie</name>
<description>info@pdgenie.com</description>
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>

View File

@ -28,7 +28,7 @@
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Application ID" type="text" name="lenAppID" formControlName="lenAppID"required>
<input matInput placeholder="Loan Application ID" type="text" name="lenAppID" formControlName="lenAppID" (change)="checkExistPd($event.target.value,1)" required>
<mat-error *ngIf="pdforms.controls['lenAppID'].hasError('required')">Application ID Required</mat-error>
</mat-form-field>
</div>
@ -246,7 +246,7 @@
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Name of Individual Applicant" type="text" name="lenName" formControlName="mainappname" required>
<input matInput placeholder="Name of Individual Applicant" type="text" name="lenName" formControlName="mainappname" (change)="checkExistPd($event.target.value,2)" required>
<mat-error *ngIf="pdforms.controls['mainappname'].hasError('required')">Individual Name is Required</mat-error>
</mat-form-field>
</div>
@ -257,7 +257,7 @@
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Mobile Number" type="tel" minlength="10" maxlength="10" name="mainappphone" formControlName="mainappphone" required>
<input matInput placeholder="Mobile Number" type="tel" minlength="10" maxlength="10" name="mainappphone" formControlName="mainappphone" (change)="checkExistPd($event.target.value,2)" required>
<mat-error *ngIf="pdforms.controls['mainappname'].hasError('required')">Mobile Number is Required</mat-error>
</mat-form-field>

View File

@ -825,5 +825,54 @@ if( this.pdforms.value.pd_branch_id !=null){
console.log(this.customer_seg_abbr)
}
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.pdforms.value.mainappname,mobile_no:this.pdforms.value.mainappphone}
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.pdforms.value.mainappphone != null && this.pdforms.value.mainappphone != '' && this.pdforms.value.mainappname != null && this.pdforms.value.mainappname != '' && option == 2) || option == 1){
this.pddetails.checkExistPDDetails(param,this.users.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.toast.setAlert("Warning",swal_text+exist_pd_sno)
// this._PDtriggerForm.controls['lender_applicant_id'].setValue('');
}
}
})
}
}
}

View File

@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Toast, ToastController } from 'ionic-angular';
import { Toast, ToastController, AlertController } from 'ionic-angular';
/*
Generated class for the ToastProvider provider.
@ -11,7 +11,7 @@ import { Toast, ToastController } from 'ionic-angular';
@Injectable()
export class ToastProvider {
constructor(public http: HttpClient,public toast:ToastController) {
constructor(public http: HttpClient,public toast:ToastController,private alertCtrl:AlertController) {
console.log('Hello ToastProvider Provider');
}
lenderappmessage(mess){
@ -24,4 +24,14 @@ export class ToastProvider {
valalert.present();
}
setAlert(title,subTitle){
const alert = this.alertCtrl.create({
title:title,
subTitle: subTitle,
buttons: ['OK']
});
alert.present();
}
}

View File

@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
import {ConstantsProvider} from '../constants/constants';
import { Observable } from 'rxjs';
import { AwsServiceProvider } from '../aws-service/aws-service';
import { catchError } from 'rxjs/operators';
/*
Generated class for the PdtriggerProvider provider.
@ -143,5 +144,13 @@ getLenderContactPersons(datas){
pdId.fk_createdby = this.aws.getlocale();
return this.http.post<any>(this.apiurl + "generatePDReportPDF", { "records": pdId });
}
checkExistPDDetails(datas,entity_id){
return this.http.post(this.apiurl+'checkExistPDDetails',{records:datas,client:entity_id})
.pipe(catchError(err=>this.handleError("checkExistPDDetails",err)))
}
handleError(arg0: string, arg1: undefined[]): any {
console.log("error",arg1)
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long