Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
8d9396042b
@ -38,7 +38,7 @@
|
||||
<input matInput autocomplete="off" placeholder=" Loan Application ID" formControlName="lender_applicant_id" type="text" required>
|
||||
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<div *ngIf="sales_and_credit_enable">
|
||||
<!-- <div *ngIf="sales_and_credit_enable"> -->
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-select placeholder="Lender Sales Person" formControlName="lender_sales_person">
|
||||
<mat-option>Select</mat-option>
|
||||
@ -51,13 +51,13 @@
|
||||
<mat-option *ngFor="let person of sales_and_credit_person.credit_person" [value]="person.userid">{{person.user_name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-form-field style="width: 28%" *ngIf="sales_and_credit_enable">
|
||||
<input matInput autocomplete="off" placeholder="Financial Institution" formControlName="imgc_fin_institute">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</mat-form-field><br/>
|
||||
<!-- </div> -->
|
||||
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput autocomplete="off" placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" required>
|
||||
<input matInput autocomplete="off" placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" >
|
||||
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
|
||||
@ -88,7 +88,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
lender_sales_person:[null],
|
||||
lender_credit_person:[null],
|
||||
imgc_fin_institute:[null],
|
||||
lender_contact_person: [null, Validators.compose([Validators.required])],
|
||||
lender_contact_person: [null],
|
||||
lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])],
|
||||
lender_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
|
||||
lender_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
|
||||
@ -452,6 +452,15 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this._PDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
|
||||
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
|
||||
|
||||
if(this.sales_and_credit_enable){
|
||||
// this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required]))
|
||||
// this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity();
|
||||
// this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required]))
|
||||
// this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity();
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].setValidators(Validators.compose([Validators.required]))
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if(formValue.fk_product_id != '4'){
|
||||
@ -508,6 +517,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this._PDtriggerForm.controls['fk_product_id'].clearValidators();
|
||||
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
|
||||
|
||||
this._PDtriggerForm.controls['lender_credit_person'].clearValidators();
|
||||
this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity();
|
||||
|
||||
this._PDtriggerForm.controls['lender_sales_person'].clearValidators();
|
||||
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity();
|
||||
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators();
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity();
|
||||
// if(this._PDtriggerForm.controls.fk_product_id.value != '4'){
|
||||
// this._PDtriggerForm.controls['fk_subproduct_id'].clearValidators();
|
||||
// this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
|
||||
@ -557,20 +574,21 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
if((this._PDtriggerForm.value.lender_contact_person == '' || this._PDtriggerForm.value.lender_contact_person == null) && (this._PDtriggerForm.value.lender_credit_person== '' || this._PDtriggerForm.value.lender_credit_person == null)){
|
||||
this.notifier.notify("warning","Either Lender contact person or Lender credit person Need..!");
|
||||
}
|
||||
else {
|
||||
|
||||
if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null)) {
|
||||
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
|
||||
return;
|
||||
}
|
||||
// if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null) && !this.sales_and_credit_enable) {
|
||||
// this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
|
||||
// return;
|
||||
// }
|
||||
|
||||
else if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
|
||||
if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
|
||||
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
|
||||
return;
|
||||
}
|
||||
else {
|
||||
console.log(this._PDtriggerForm.value)
|
||||
return
|
||||
this.disableAfterSubmit = true;
|
||||
|
||||
let lender_landline_no;
|
||||
@ -787,20 +805,36 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
getContactPerson(){
|
||||
|
||||
|
||||
if(this._PDtriggerForm.value.fk_lender_id !=null && this._PDtriggerForm.value.pd_branch_id !=null ){
|
||||
if(this._PDtriggerForm.value.fk_lender_id !=null ){
|
||||
let lender_filter= this.checkLender(this._PDtriggerForm.value.fk_lender_id)
|
||||
if(lender_filter != ''){
|
||||
|
||||
if(lender_filter=="IMGC"){
|
||||
this.sales_and_credit_enable=true;
|
||||
this._PDtriggerForm.controls['lender_contact_person'].setValue(null)
|
||||
this._PDtriggerForm.controls['lender_contact_person'].clearValidators()
|
||||
this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity()
|
||||
|
||||
this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required]))
|
||||
this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required]))
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].setValidators(Validators.compose([Validators.required]))
|
||||
}
|
||||
else{
|
||||
this.sales_and_credit_enable=false;
|
||||
// this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
|
||||
this._PDtriggerForm.controls['lender_sales_person'].clearValidators()
|
||||
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity()
|
||||
|
||||
// this._PDtriggerForm.controls['lender_credit_person'].setValue(null)
|
||||
// this._PDtriggerForm.controls['lender_credit_person'].clearValidators()
|
||||
// this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity()
|
||||
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].setValue(null)
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators()
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
|
||||
|
||||
// this._PDtriggerForm.controls['lender_contact_person'].setValidators(Validators.compose([Validators.required]))
|
||||
// this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity();
|
||||
|
||||
}
|
||||
|
||||
|
||||
if( this._PDtriggerForm.value.pd_branch_id !=null){
|
||||
let param={fk_lender_id:this._PDtriggerForm.value.fk_lender_id,pd_branch_id:this._PDtriggerForm.value.pd_branch_id}
|
||||
this._pd.getLenderContactPersons(param).subscribe(result=>{
|
||||
if(result['dataStatus']){
|
||||
@ -808,32 +842,16 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
if(records.length >0){
|
||||
this.sales_and_credit_person.sales_person=records.filter(val=>val.role_type == "SALES")
|
||||
this.sales_and_credit_person.credit_person=records.filter(val=>val.role_type == "CREDIT")
|
||||
console.log(this.sales_and_credit_person);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
|
||||
this._PDtriggerForm.controls['lender_credit_person'].setValue(null)
|
||||
this.sales_and_credit_person=[]
|
||||
this.notifier.notify("warning",result['msg'])
|
||||
}
|
||||
},err=>{this.notifier.notify("error","Network Error")})
|
||||
|
||||
}
|
||||
else{
|
||||
this.sales_and_credit_enable=false;
|
||||
this._PDtriggerForm.controls['lender_sales_person'].setValue("")
|
||||
this._PDtriggerForm.controls['lender_sales_person'].clearValidators()
|
||||
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity()
|
||||
|
||||
this._PDtriggerForm.controls['lender_credit_person'].setValue("")
|
||||
this._PDtriggerForm.controls['lender_credit_person'].clearValidators()
|
||||
this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity()
|
||||
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].setValue("")
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators()
|
||||
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
|
||||
|
||||
this._PDtriggerForm.controls['lender_contact_person'].setValidators(Validators.compose([Validators.required]))
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -78,8 +78,8 @@
|
||||
|
||||
<ng-container matColumnDef="PDType">
|
||||
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<small mat-line>{{details.pd_type_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -78,8 +78,8 @@
|
||||
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
|
||||
|
||||
<ng-container matColumnDef="PDType">
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<small mat-line>{{details.pd_type_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<form [formGroup]="_EditPDtriggerForm" novalidate>
|
||||
<form [formGroup]="_EditPDtriggerForm" novalidate *ngIf="loadControl">
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
@ -21,7 +21,7 @@
|
||||
</mat-card-header> -->
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 29%">
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id">
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson()">
|
||||
<mat-option>
|
||||
Select
|
||||
</mat-option>
|
||||
@ -34,16 +34,44 @@
|
||||
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
|
||||
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
|
||||
<mat-option>
|
||||
Select
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id" >
|
||||
{{LB.branch_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 29%">
|
||||
<input matInput placeholder=" Loan Application ID" formControlName="lender_applicant_id"
|
||||
type="text" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 29%">
|
||||
<!-- <div *ngIf="sales_and_credit_enable"> -->
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-select placeholder="Lender Sales Person" formControlName="lender_sales_person">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let person of sales_and_credit_person.sales_person" [value]="person.userid">{{person.user_name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-select placeholder="Lender Credit Person" formControlName="lender_credit_person">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let person of sales_and_credit_person.credit_person" [value]="person.userid">{{person.user_name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%" *ngIf="sales_and_credit_enable">
|
||||
<input matInput autocomplete="off" placeholder="Financial Institution" formControlName="imgc_fin_institute">
|
||||
</mat-form-field><br/>
|
||||
<!-- </div> -->
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person"
|
||||
type="text" required>
|
||||
type="text" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 29%">
|
||||
<mat-form-field style="width: 23%">
|
||||
<input matInput placeholder="Lender Mobile Number" formControlName="pd_contact_mobileno"
|
||||
type="text" maxlength="10" ForMobileNumbers>
|
||||
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter
|
||||
@ -56,23 +84,23 @@
|
||||
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter
|
||||
Valid STD Code. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 20%">
|
||||
<mat-form-field style="width: 15%">
|
||||
<input matInput placeholder="LandLine Number" formControlName="lender_landline"
|
||||
type="text" maxlength="8" ForMobileNumbers>
|
||||
<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: 21.5%">
|
||||
<mat-select placeholder="Branch" formControlName="pd_branch_id">
|
||||
<!-- <mat-form-field style="width: 21.5%">
|
||||
<mat-select placeholder="Branch" formControlName="pd_branch_id"> -->
|
||||
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
|
||||
<mat-option>
|
||||
<!-- <mat-option>
|
||||
Select
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let LB of lenderBranchList" [value]="LB.entity_lender_branch_id">
|
||||
{{LB.branch_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
<mat-form-field style="width: 29%">
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id"
|
||||
(selectionChange)="getSubproductList(pdMain.fk_product_id.value,2)">
|
||||
|
||||
@ -38,6 +38,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
enablePDButton: boolean;
|
||||
currentPDStatus: string;
|
||||
disableAfterSubmit: boolean;
|
||||
loadControl:boolean=false;
|
||||
|
||||
pincodeflag : any = [];
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
@ -59,6 +60,8 @@ export class EditPdMasterComponent implements OnInit {
|
||||
lenderShortName: any;
|
||||
isSubproductShown: boolean = true;
|
||||
productShortName : any;
|
||||
sales_and_credit_enable: boolean=false;
|
||||
sales_and_credit_person: any=[];
|
||||
constructor(private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
|
||||
@ -70,15 +73,16 @@ export class EditPdMasterComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getLenderList();
|
||||
// this.draftStatus="DRAFT";
|
||||
// this.PDTriggerStatus="TRIGGERED";
|
||||
this.getCustomerSegmentList();
|
||||
this.getLenderList();
|
||||
this.getProductsList();
|
||||
|
||||
// this.getProductsList();
|
||||
this.getStateCityList();
|
||||
this.getPDTypeList();
|
||||
// this.getAddresses();
|
||||
this.loadFormData();
|
||||
|
||||
this.applicantLength=this.data.applicantLength;
|
||||
}
|
||||
|
||||
@ -96,21 +100,69 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.filterProductAbbr(x[0]['short_name'],1);
|
||||
}
|
||||
}
|
||||
this.loadFormData();
|
||||
}
|
||||
|
||||
//, error => this.errorMessage = <any> error);
|
||||
, error => {
|
||||
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
selectedLender(lender){
|
||||
// alert(JSON.stringify(lender['branches ']));
|
||||
this.lenderBranchList = lender['branches'];
|
||||
this.lenderShortName = lender['short_name'];
|
||||
this.filterProductAbbr(lender['short_name'],2);
|
||||
this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
|
||||
// selectedLender(lender){
|
||||
// // alert(JSON.stringify(lender['branches ']));
|
||||
// this.lenderBranchList = lender['branches'];
|
||||
// this.lenderShortName = lender['short_name'];
|
||||
// this.filterProductAbbr(lender['short_name'],2);
|
||||
// this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
|
||||
|
||||
}
|
||||
// }
|
||||
/** FOR Dropdowns */
|
||||
selectedLender(lender) {
|
||||
// console.log('lender',lender);
|
||||
this.lenderBranchList = lender['branches'];
|
||||
this.lenderShortName = lender['short_name'];
|
||||
// console.log(this.lenderShortName);
|
||||
this._EditPDtriggerForm.controls.pd_branch_id.setValue(null);
|
||||
|
||||
if(this.lenderShortName == 'CLIX'){
|
||||
|
||||
let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
|
||||
let ClixProductAbbr = ['BL','LAEP'];
|
||||
let FilteredAbbr: any = [];
|
||||
FilteredAbbr = ClixProductAbbr.map(x => {
|
||||
let findIndex = getProductAbbr.indexOf(x);
|
||||
return this.productAllList[findIndex];
|
||||
});
|
||||
this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
|
||||
}
|
||||
else{
|
||||
this.productList = this.productAllList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// console.log(this.productList);
|
||||
|
||||
// console.log('this.productList',this.productList);
|
||||
this._EditPDtriggerForm.controls['fk_product_id'].setValue('');
|
||||
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue('');
|
||||
this._EditPDtriggerForm.controls['fk_pd_type'].setValue('');
|
||||
this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('');
|
||||
this._EditPDtriggerForm.controls['loan_amount'].setValue('');
|
||||
|
||||
if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
|
||||
// console.log("entered");
|
||||
this._EditPDtriggerForm.controls['fk_product_id'].setValue("3")
|
||||
this._EditPDtriggerForm.controls['fk_pd_type'].setValue("1");
|
||||
this.getSubproductList("3",2)
|
||||
}
|
||||
// console.log("len",lender)
|
||||
}
|
||||
|
||||
filterProductAbbr(param,flag){
|
||||
if(param == 'CLIX'){
|
||||
// console.log(this.productAllList);
|
||||
@ -215,8 +267,11 @@ export class EditPdMasterComponent implements OnInit {
|
||||
pd_id: [this.data.records.pd_id],
|
||||
fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])],
|
||||
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
|
||||
pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])],
|
||||
pd_contact_person: [this.data.records.pd_contact_person, Validators.compose([Validators.required])],
|
||||
pd_branch_id:[this.data.records.pd_branch_id],
|
||||
pd_contact_person: [this.data.records.pd_contact_person],
|
||||
lender_sales_person:[this.data.records.lender_sales_person],
|
||||
lender_credit_person:[this.data.records.lender_credit_person],
|
||||
imgc_fin_institute:[this.data.records.imgc_fin_institute],
|
||||
pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
|
||||
lender_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
|
||||
lender_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
@ -233,6 +288,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
// other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],
|
||||
remarks: [this.data.records.remarks],
|
||||
});
|
||||
|
||||
const addressesArray = this._EditPDtriggerForm.get('addresses') as FormArray;
|
||||
this._pd.getAddressesDetails(this.pdid).subscribe(
|
||||
data => {
|
||||
@ -268,6 +324,8 @@ export class EditPdMasterComponent implements OnInit {
|
||||
addressesArray.push(this.createAddresses(null));
|
||||
}
|
||||
});
|
||||
this.getContactPerson()
|
||||
|
||||
}
|
||||
|
||||
get pdMain() { return this._EditPDtriggerForm.controls; }
|
||||
@ -488,6 +546,9 @@ export class EditPdMasterComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if((this._EditPDtriggerForm.value.pd_contact_person == '' || this._EditPDtriggerForm.value.pd_contact_person == null) && (this._EditPDtriggerForm.value.lender_credit_person== '' || this._EditPDtriggerForm.value.lender_credit_person == null)){
|
||||
// this.notifier.notify("warning","Either Lender contact person or Lender credit person Need..!");
|
||||
// }
|
||||
|
||||
|
||||
if(this.lenderShortName == 'CLIX'){
|
||||
@ -507,11 +568,20 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this._EditPDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
|
||||
|
||||
|
||||
this._EditPDtriggerForm.controls['pd_branch_id'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['pd_branch_id'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['pd_branch_id'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['pd_branch_id'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['pd_contact_person'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity();
|
||||
// this._EditPDtriggerForm.controls['pd_contact_person'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity();
|
||||
|
||||
// this._EditPDtriggerForm.controls['lender_sales_person'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['lender_sales_person'].updateValueAndValidity();
|
||||
|
||||
// this._EditPDtriggerForm.controls['lender_credit_person'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['lender_credit_person'].updateValueAndValidity();
|
||||
|
||||
// this._EditPDtriggerForm.controls['imgc_fin_institute'].setValidators([Validators.required]);
|
||||
// this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity();
|
||||
|
||||
this._EditPDtriggerForm.controls['pd_contact_mobileno'].setValidators([Validators.required]);
|
||||
this._EditPDtriggerForm.controls['pd_contact_mobileno'].updateValueAndValidity();
|
||||
@ -561,6 +631,9 @@ export class EditPdMasterComponent implements OnInit {
|
||||
"lender_applicant_id": my_array.lender_applicant_id,
|
||||
"pd_branch_id":my_array.pd_branch_id,
|
||||
"pd_contact_person": my_array.pd_contact_person,
|
||||
"lender_sales_person":my_array.lender_sales_person,
|
||||
"lender_credit_person":my_array.lender_credit_person,
|
||||
"imgc_fin_institute":my_array.imgc_fin_institute,
|
||||
"pd_contact_mobileno": my_array.pd_contact_mobileno,
|
||||
"pd_contact_landline": concat_landline,
|
||||
"fk_product_id": my_array.fk_product_id,
|
||||
@ -630,4 +703,79 @@ validateAllFormFields(formGroup: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getContactPerson(){
|
||||
|
||||
|
||||
if(this._EditPDtriggerForm.value.fk_lender_id !=null ){
|
||||
let lender_filter= this.checkLender(this._EditPDtriggerForm.value.fk_lender_id)
|
||||
if(lender_filter != ''){
|
||||
|
||||
if(lender_filter=="IMGC"){
|
||||
this.sales_and_credit_enable=true;
|
||||
this._EditPDtriggerForm.controls['pd_contact_person'].setValue(null)
|
||||
this._EditPDtriggerForm.controls['pd_contact_person'].clearValidators()
|
||||
this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity()
|
||||
}
|
||||
else{
|
||||
this.loadControl=true
|
||||
this.sales_and_credit_enable=false;
|
||||
// this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null)
|
||||
this._EditPDtriggerForm.controls['lender_sales_person'].clearValidators()
|
||||
this._EditPDtriggerForm.controls['lender_sales_person'].updateValueAndValidity()
|
||||
|
||||
// this._EditPDtriggerForm.controls['lender_credit_person'].setValue(null)
|
||||
this._EditPDtriggerForm.controls['lender_credit_person'].clearValidators()
|
||||
this._EditPDtriggerForm.controls['lender_credit_person'].updateValueAndValidity()
|
||||
|
||||
this._EditPDtriggerForm.controls['imgc_fin_institute'].setValue(null)
|
||||
this._EditPDtriggerForm.controls['imgc_fin_institute'].clearValidators()
|
||||
this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
|
||||
|
||||
// this._EditPDtriggerForm.controls['pd_contact_person'].setValidators(Validators.compose([Validators.required]))
|
||||
// this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity();
|
||||
|
||||
}
|
||||
|
||||
if(this._EditPDtriggerForm.value.pd_branch_id !=null ){
|
||||
let param={fk_lender_id:this._EditPDtriggerForm.value.fk_lender_id,pd_branch_id:this._EditPDtriggerForm.value.pd_branch_id}
|
||||
this._pd.getLenderContactPersons(param).subscribe(result=>{
|
||||
if(result['dataStatus']){
|
||||
let records=result['records']
|
||||
if(records.length >0){
|
||||
this.sales_and_credit_person.sales_person=records.filter(val=>val.role_type == "SALES")
|
||||
this.sales_and_credit_person.credit_person=records.filter(val=>val.role_type == "CREDIT")
|
||||
}
|
||||
}
|
||||
else{
|
||||
this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null)
|
||||
this._EditPDtriggerForm.controls['lender_credit_person'].setValue(null)
|
||||
this.sales_and_credit_person=[]
|
||||
this.notifier.notify("warning",result['msg'])
|
||||
}
|
||||
this.loadControl=true
|
||||
},err=>{this.notifier.notify("error","Network Error")})
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
this.loadControl=true
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.loadControl=true
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
this.loadControl=true
|
||||
}
|
||||
this.loadControl=true
|
||||
}
|
||||
checkLender(value){
|
||||
if(value != null){
|
||||
return this.lenderList.filter(val=>val.entity_id == value).map(mapping=>mapping.short_name)[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,8 +75,8 @@
|
||||
<br/>
|
||||
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<small mat-line>{{details.pd_type_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -77,8 +77,8 @@
|
||||
<br/>
|
||||
<mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<small mat-line>{{details.pd_type_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -75,8 +75,8 @@
|
||||
<br/>
|
||||
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
|
||||
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<small mat-line>{{details.pd_type_name}}</small>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -318,6 +318,7 @@ export class GeneralInfoComponent implements OnInit {
|
||||
element.age = '',
|
||||
element.qualification = '',
|
||||
element.course_name = '',
|
||||
element.relationship=''
|
||||
individualsControl.push(this.createIndividulas(element));
|
||||
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element, key));
|
||||
|
||||
@ -370,11 +371,12 @@ export class GeneralInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
createPersonsWithRelationships(elementValue: any, indexVal: number) {
|
||||
// console.log('elementValue.applicant_name', elementValue.applicant_name);
|
||||
console.log('elementValue.applicant_name', elementValue,indexVal);
|
||||
return this._fb.group({
|
||||
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
|
||||
applicant_name: [this.titleCase.transform(elementValue.applicant_name)],
|
||||
relationship: [indexVal === 0 ? '0' : elementValue.relationship],
|
||||
// relationship: [indexVal === 0 ? '0' : elementValue.relationship],
|
||||
relationship:[indexVal === 0 && elementValue.relationship== '' ? '0' : elementValue.relationship],
|
||||
relation_to: [elementValue.relation_to],
|
||||
individuals_order_id: [elementValue.individuals_order_id],
|
||||
is_active: [elementValue.is_active]
|
||||
|
||||
@ -68,7 +68,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) {
|
||||
private listPDComponent: ListPdComponent, private _pd: PdTrigerService) {
|
||||
this.startPD = this.route.snapshot.params['pdid'];
|
||||
this.randomString = this.route.snapshot.params['rdmstr'];
|
||||
// console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']);
|
||||
@ -153,7 +153,9 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
else {
|
||||
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
}
|
||||
|
||||
if(checkType == 2){
|
||||
this.loadTemplates(this.startPD,2,this.randomString);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -56,12 +56,19 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
{ '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" },
|
||||
{ 'backEnd_FieldName': "main_applicant", 'frontEnd_FieldName': "Applicant Master" }];
|
||||
{ 'backEnd_FieldName': "main_applicant", 'frontEnd_FieldName': "Applicant Master" },
|
||||
{ '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': "lender_sales_person", 'frontEnd_FieldName': "Lender Sales Person" },
|
||||
{ 'backEnd_FieldName': "lender_credit_person", 'frontEnd_FieldName': "Lender Credit Person" },
|
||||
{ 'backEnd_FieldName': "imgc_fin_institute", 'frontEnd_FieldName': "Financial Institution" }];
|
||||
// localAddressMandortyField: any = [
|
||||
// { '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': "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" }
|
||||
// ];
|
||||
viewID: string;
|
||||
viewParams: any;
|
||||
@ -125,7 +132,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
if (data.status == 200) {
|
||||
let masterData: any = data.records.pd_master_details;
|
||||
this.pdMasterData.push(masterData[0]);
|
||||
// this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
|
||||
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
|
||||
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
|
||||
this.pdApplicantData = data.records.applicants_details;
|
||||
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
|
||||
@ -233,8 +240,13 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
.subscribe(dataresult => {
|
||||
if (flag == 1) {
|
||||
let ffd: any = [];
|
||||
console.log( this.FilteredFieldNames)
|
||||
// frontEnd_FieldName
|
||||
this.FilteredFieldNames.forEach(field => {
|
||||
console.log("field",field)
|
||||
if(field != undefined){
|
||||
ffd.push(field.frontEnd_FieldName);
|
||||
}
|
||||
});
|
||||
|
||||
// this.notifier.notify('info', 'Please Fill ' + ffd.join(' , ') + ' Fields.!');
|
||||
@ -435,13 +447,18 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
// direct trigger the pd
|
||||
directTriggerPD(data: any, masterdetail: any) {
|
||||
directTriggerPD(data: any, masterdetail: any) {
|
||||
|
||||
let pdid = masterdetail.pd_id;
|
||||
let getValues = data.filter(val => val).map(Val => Val);
|
||||
this.FilteredFieldNames = getValues.map(x => {
|
||||
console.log("getvalues",getValues);
|
||||
this.FilteredFieldNames = getValues.map(x => {
|
||||
console.log("x",x)
|
||||
let findIndex = this.localMandatoryFields.map(val => val.backEnd_FieldName).indexOf(x);
|
||||
console.log("find index",findIndex);
|
||||
if(findIndex != -1){
|
||||
return this.localMandatoryFields[findIndex];
|
||||
}
|
||||
});
|
||||
|
||||
if (data.length > 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user