Fairoj : Role differentiation for CPA and CM roles and mwise lender person enabled
This commit is contained in:
parent
d53b7548c8
commit
e78ee3663c
@ -6,7 +6,7 @@
|
||||
<input matInput [(ngModel)]="filterValue" placeholder="Search">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="50" class="pb-0 text-sm-right" *ngIf="user_role_name != 'sales'">
|
||||
<div fxFlex="50" class="pb-0 text-sm-right" *ngIf="user_role_name != 'sales' && LenderRoleID != '26'">
|
||||
<!-- <button mat-fab (click)="viewMapPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Map view" matTooltipPosition="above"><mat-icon>map</mat-icon></button> -->
|
||||
<button mat-fab (click)="addPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Add PD" matTooltipPosition="above" *ngIf="roleAccessDetails.trigger"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
|
||||
@ -59,25 +59,34 @@ export class ListPdComponent implements OnInit, OnDestroy {
|
||||
this.user_role_name=role_name
|
||||
})
|
||||
if(localStorage.getItem('LocalSetEntity')) {
|
||||
let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
if(entity_id) {
|
||||
this.allTabC.loadPDDetails();
|
||||
}
|
||||
this.getUserFromLocal()
|
||||
}
|
||||
else{
|
||||
// for Listening the local storage LocalSetEntity
|
||||
this.userService.messageSubject.subscribe(rr=>{
|
||||
console.log(rr)
|
||||
let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
if(entity_id) {
|
||||
this.allTabC.loadPDDetails();
|
||||
this.userService.messageSubject.unsubscribe()
|
||||
}
|
||||
this.getUserFromLocal()
|
||||
// let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
// if(entity_id) {
|
||||
// this.allTabC.loadPDDetails();
|
||||
// this.userService.messageSubject.unsubscribe()
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
getUserFromLocal() {
|
||||
let user_role_id = localStorage.getItem('LenderRoleID')
|
||||
if(user_role_id) {
|
||||
this.LenderRoleID = user_role_id
|
||||
}
|
||||
let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
if(entity_id) {
|
||||
this.allTabC.loadPDDetails();
|
||||
}
|
||||
}
|
||||
|
||||
// after view call all tabs component
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -74,7 +74,9 @@ export class FormComponent implements OnInit {
|
||||
// this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{
|
||||
let params = {"fk_entity_id":"35","fk_product_id":this.pd_all_details.pdmaster_details.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id}
|
||||
this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{
|
||||
result.dataStatus = false
|
||||
if(!environment.production){
|
||||
// result.dataStatus = false
|
||||
}
|
||||
if(result.dataStatus) {
|
||||
let question_template: any = result.records
|
||||
if (question_template && question_template != null && question_template != undefined
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</button>
|
||||
<button *ngIf="roleAccessDetails.trigger && 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="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' && 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>
|
||||
<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>
|
||||
@ -116,10 +116,11 @@
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="master.lender_sales_person_name != '' && master.lender_sales_person_name != null">
|
||||
<div *ngIf="(master.lender_sales_person_name != '' && master.lender_sales_person_name != null) || (master.mwise_sales_person != '' && master.mwise_sales_person != null)">
|
||||
<!-- <mat-list-item> -->
|
||||
<div><p style="margin: 0px;">Sales Person</p></div>
|
||||
<!-- </mat-list-item> -->
|
||||
<div *ngIf="master.lender_short_name != 'MWISE'">
|
||||
<div fxLayout="row">
|
||||
<!-- <div > -->
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
@ -130,7 +131,16 @@
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<i class="fa-1x fa fa-phone"></i><small style="margin-left: 1%; font-size: inherit">{{master.lender_sales_contact_mobileno}}</small>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="master.lender_short_name == 'MWISE'">
|
||||
<div fxLayout="row">
|
||||
<!-- <div > -->
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<i class="fa-1x fa fa-user"></i><small style="margin-left: 1%; font-size: inherit">{{master.mwise_sales_person}}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -163,7 +173,7 @@
|
||||
<div fxFlex="60" align="right">
|
||||
<!-- <span><button *ngIf="roleAccessDetails.trigger && addresses.assigned_pd==null || addresses.assigned_pd==''" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" [matTooltip]="master.fk_primary_address_id ? 'Initiate PD for this address' : 'Initiate Address for PD Process'" matTooltipPosition="above" (click)="initiateAddtionalPD(master,addresses,master.fk_primary_address_id ? true : false)"><mat-icon>where_to_vote</mat-icon></button></span> -->
|
||||
<!-- <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && master.pd_status!=pdStatusCheck.ADD_ON_PENDING && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master,addresses)"><mat-icon>verified_user</mat-icon></button> -->
|
||||
<span *ngIf="master.lender_short_name == 'MWISE'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -204,7 +214,7 @@
|
||||
<div fxFlex="60" align="right">
|
||||
<!-- <span *ngIf="userRoleID == 10 || userRoleID == 3"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.COMPLETED && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.ADD_ON_PENDING && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master,addresses)"><mat-icon>verified_user</mat-icon></button></span> -->
|
||||
<!-- <span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10 "><button *ngIf="roleAccessDetails.schedule && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.COMPLETED && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.ADD_ON_PENDING && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span> -->
|
||||
<span *ngIf="master.lender_short_name == 'MWISE'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25'"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row nowrap">
|
||||
|
||||
@ -169,10 +169,15 @@ export class PdTrigerService {
|
||||
// get pd details
|
||||
getPdDetails(lenderId): Observable<any> {
|
||||
let entity_id=localStorage.getItem('LocalSetEntity');
|
||||
// let userid=this._aws.getlocale()
|
||||
let LenderRoleID : any = localStorage.getItem('LenderRoleID');
|
||||
let userid=this._aws.getlocale()
|
||||
|
||||
const Lender = entity_id ?
|
||||
{ params: new HttpParams().set('lenderid', entity_id) } : {};
|
||||
const Lender:any = entity_id ?
|
||||
{ params: new HttpParams().set('lenderid', entity_id) } :
|
||||
{ };
|
||||
if(LenderRoleID == '25') {
|
||||
Lender.params = Lender.params.set('createdby',userid)
|
||||
}
|
||||
return this._http.get<any>(this.apiUrl + "listLessPDDetails/get",Lender)
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
@ -185,10 +190,17 @@ export class PdTrigerService {
|
||||
// { params: new HttpParams().set('status', status)} : {};
|
||||
|
||||
let entity_id=localStorage.getItem('LocalSetEntity');
|
||||
let userid_local:string=this._aws.getlocale()
|
||||
let LenderRoleID : any = localStorage.getItem('LenderRoleID');
|
||||
let userid=this._aws.getlocale()
|
||||
|
||||
const paramHttp= entity_id && status ?
|
||||
// const Lender = entity_id && status && LenderRoleID != '25' ?
|
||||
// { params: new HttpParams().set('lenderid', entity_id) } :
|
||||
// { params: new HttpParams().set('createdby', userid) };
|
||||
let paramHttp:any= entity_id && status ?
|
||||
{params : new HttpParams().set('lenderid', entity_id).set('status',status)} : {};
|
||||
if(LenderRoleID == '25') {
|
||||
paramHttp.params = paramHttp.params.set('createdby',userid)
|
||||
}
|
||||
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp)
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
@ -640,6 +652,11 @@ export class PdTrigerService {
|
||||
*/
|
||||
|
||||
overAllSearchFormDetails(searchItem) {
|
||||
let LenderRoleID : any = localStorage.getItem('LenderRoleID');
|
||||
let userid=this._aws.getlocale()
|
||||
if(LenderRoleID == '25') {
|
||||
searchItem.createdby = userid
|
||||
}
|
||||
let records = { 'records': searchItem };
|
||||
return this._http.post(this.apiUrl + 'filterPDList', records).pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user