Fairoj : SMC credit pd changes
This commit is contained in:
parent
cfbb93d79d
commit
f483c6a6d8
@ -264,7 +264,7 @@
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
<div #applicant_details></div>
|
||||
<mat-card >
|
||||
<mat-card-header>
|
||||
<mat-card-title>Applicant Details</mat-card-title>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild } from '@angular/core';
|
||||
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy, Input, ViewChild, ElementRef } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CustomValidators } from 'ng2-validation';
|
||||
@ -75,6 +75,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
excel_file_id: any = null;
|
||||
choosed_address:FormControl = new FormControl('')
|
||||
addressList:any = []
|
||||
|
||||
@ViewChild('applicant_details') applicant_details_element :ElementRef
|
||||
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
|
||||
private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) {
|
||||
@ -606,9 +608,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this._PDtriggerForm.controls['applicant_name'].updateValueAndValidity();
|
||||
this._PDtriggerForm.controls['applicant_title_name'].setValidators([Validators.required]);
|
||||
this._PDtriggerForm.controls['applicant_title_name'].updateValueAndValidity();
|
||||
|
||||
// console.log("seleccccc", this.lenderShortName)
|
||||
if(this.lenderShortName != 'MWISE') {
|
||||
this._PDtriggerForm.controls['mobile_no'].setValidators([Validators.required]);
|
||||
this._PDtriggerForm.controls['mobile_no'].updateValueAndValidity();
|
||||
}
|
||||
|
||||
// this._PDtriggerForm.controls['addressline1'].setValidators([Validators.required]);
|
||||
// this._PDtriggerForm.controls['addressline1'].updateValueAndValidity();
|
||||
@ -710,7 +714,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
|
||||
if (formValue.mobile_no != null && formValue.mobile_no.length != 10 && this.lenderShortName != 'MWISE'){
|
||||
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
|
||||
return;
|
||||
}
|
||||
@ -830,6 +834,18 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
pd_applicant_details.push(obj1)
|
||||
});
|
||||
|
||||
// FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE
|
||||
if(this.lenderShortName == 'MWISE') {
|
||||
let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null)
|
||||
console.log(mobile_number_check)
|
||||
if(mobile_number_check == 0 || mobile_number_check == -1) {
|
||||
this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'})
|
||||
this.disableAfterSubmit = false;
|
||||
this.notifier.notify("info", "Please provide atleast 1 Mobile Number")
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (formValue.addresses.length > 0) {
|
||||
formValue.addresses.forEach((addressElement, itemIndex) => {
|
||||
let addressobj = {
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers required>
|
||||
<input matInput placeholder="Mobile Number" formControlName="mobile_no" type="text" maxlength="10" ForMobileNumbers>
|
||||
<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: 15%">
|
||||
|
||||
@ -158,11 +158,11 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if((formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){
|
||||
if(this.data.lender_short_name != 'MWISE' && (formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){
|
||||
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
|
||||
return;
|
||||
}
|
||||
else if(formValue.mobile_no.length != 10){
|
||||
else if(this.data.lender_short_name != 'MWISE' && formValue.mobile_no.length != 10){
|
||||
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
|
||||
return;
|
||||
}
|
||||
@ -255,6 +255,16 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
}
|
||||
pd_applicant_details.push(obj1)
|
||||
});
|
||||
// FOR MOBILE NUMBER CHECK FOR MWISE LENDER -- ATLEAST ONE NUMBER TO BE PROVIDED FOR MWISE
|
||||
if(this.data.lender_short_name == 'MWISE') {
|
||||
let mobile_number_check = pd_applicant_details.filter(vv=>vv.mobile_no != '' && vv.mobile_no != null)
|
||||
console.log(mobile_number_check)
|
||||
if(mobile_number_check == 0 || mobile_number_check == -1) {
|
||||
// this.applicant_details_element.nativeElement.scrollIntoView({'behaviour':'smooth'})
|
||||
this.notifier.notify("info", "Please provide atleast 1 Mobile Number")
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.disableAfterSubmit = true;
|
||||
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
|
||||
@ -74,7 +74,7 @@ export class PdStatusChangeDialogueComponent implements OnInit {
|
||||
this.pd.editPdMasterDetails(update_status, status).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.dialogRef.close({update_status:true});
|
||||
this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Discussions Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully');
|
||||
this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Completed Successfully' : this.data.pd_status=='BOUNCED' ? 'PD Rejected Successfully' :'Discussions Updated Successfully');
|
||||
}
|
||||
else {
|
||||
this.dialogRef.close({update_status:false});
|
||||
|
||||
@ -158,6 +158,8 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
// load pd status change dialogue
|
||||
pdStatusDialogue(status: string, checkType: number): void {
|
||||
// checkType==2 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
// return;
|
||||
const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, {
|
||||
data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString,pd_type:this.pdMasterList.fk_pd_type },
|
||||
disableClose: true,
|
||||
@ -167,10 +169,12 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.update_status==true){
|
||||
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
setTimeout(()=>{
|
||||
checkType==2 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
},2000)
|
||||
}
|
||||
else {
|
||||
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
checkType==1 ? this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
|
||||
}
|
||||
if(checkType == 2){
|
||||
// this.loadTemplates(this.startPD,2,this.randomString);
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</button>
|
||||
<button *ngIf="roleAccessDetails.trigger && (LenderRoleID == '25' && (currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED)) || (currentPDStatus==pdStatusCheck.DRAFT)" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)" matTooltipPosition="above" matTooltip="Edit PD Master"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="roleAccessDetails.trigger && 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>
|
||||
<button *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && roleAccessDetails.reports && master.pd_type_name && (currentPDStatus==pdStatusCheck.QC_COMPLETED || currentPDStatus==pdStatusCheck.COMPLETED)" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="smcCreditPDReport(viewID)"><mat-icon>ballot</mat-icon></button>
|
||||
<button *ngIf="(master.lender_short_name != 'MWISE' && currentPDStatus==pdStatusCheck.QC_COMPLETED ) || (master.lender_short_name == 'MWISE' && LenderRoleID != '25' && currentPDStatus==pdStatusCheck.COMPLETED) && roleAccessDetails.reports && master.pd_type_name" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="smcCreditPDReport(viewID)"><mat-icon>ballot</mat-icon></button>
|
||||
<span><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -286,6 +286,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
"pdID": this.viewID,
|
||||
"records": applicantData,
|
||||
"SegmentAbbr":CSAbbr,
|
||||
lender_short_name:this.pdMasterData[0].lender_short_name
|
||||
}
|
||||
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
|
||||
data: setPdDetails,
|
||||
@ -435,10 +436,31 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
}
|
||||
downloadPDReport() {
|
||||
let data = {
|
||||
"pd_id": this.viewID,
|
||||
"random_string":this.pdMasterData[0].random_string
|
||||
};
|
||||
this._pd.generatePDReportPDF(data).subscribe(data => {
|
||||
if (data.dataStatus) {
|
||||
window.open(data.records);
|
||||
this.notifier.notify('success', 'Done Successfully..!');
|
||||
} else {
|
||||
this.notifier.notify('warning', data.msg ? data.msg :'Something Went Wrong Try Again.!');
|
||||
}
|
||||
}, err => {
|
||||
this.notifier.notify('error', err.msg ? err.msg :'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
|
||||
// alert(err.html_format);
|
||||
});
|
||||
}
|
||||
|
||||
smcCreditPDReport(pd_id) {
|
||||
// this.destroyType = 3;
|
||||
// this.router.navigate(['../../../pd_report', pd_id,this.masterRandomString], { relativeTo: this.route });
|
||||
if(this.pdMasterData[0].lender_short_name != 'MWISE') {
|
||||
this.downloadPDReport()
|
||||
return
|
||||
}
|
||||
let params = { "pd_id":pd_id,"fk_createdby":"","regenerate":"0"}
|
||||
this._pd.smcCreditPDReport(params).subscribe(result=>{
|
||||
if(result.dataStatus) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user