lender admin fixes : ps

This commit is contained in:
VENBA-emp-10 sanjeev 2022-02-22 12:43:25 +05:30
parent 33b70ce766
commit 28b8fce307
6 changed files with 142 additions and 16 deletions

View File

@ -87,6 +87,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
this.status=false;
}
localStorage.setItem('userid',this.currentUser.userid);
console.log('admin-layout @90 -agency id',this.currentUser.smc_agency_id);
localStorage.setItem('smc_agency_id',this.currentUser.smc_agency_id);
window.localStorage.setItem('LenderRoleID', this.currentUser.user_role);
// FOR TELLING entity id updated to localstorage for list pd component

View File

@ -70,8 +70,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
this.allTab=true;
this.userService.getroles().subscribe(res=>{
let role_name = this.userService.takeDecisionRouting(res['records'][0])
console.log('userrole');
console.log(res);
console.log('userrole @73',res,res['records'][0].smc_agency_id);
localStorage.setItem('smc_agency_id',res['records'][0].smc_agency_id);
localStorage.setItem('len_user_role',role_name);
this.user_role_name=role_name

View File

@ -1,4 +1,4 @@
<div *ngIf="data.lender_role_id != '27' || (data.lender_role_id != '30' && this.data.lender_admin_flag == 0)">
<div *ngIf="data.lender_role_id != '27' || data.lender_role_id != '30'">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 10px !important;">
<!--{{pageTitle}}-->
@ -50,13 +50,13 @@
</div>
<div *ngIf="data.lender_role_id != '28'" fxFlex="50" align="right" fxFlex="50" align="right">
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button> -->
<button mat-raised-button mat-icon-button (click)="updateagency(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate11" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
<button mat-raised-button mat-icon-button (click)="updateagency(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
<notifier-container></notifier-container>
</div><!-- div @1 closed here -->
<div *ngIf="data.lender_role_id == '27' || (this.data.lender_role_id == '30' && data.lender_admin_flag == 1)">
<div *ngIf="data.lender_role_id == '27'">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 10px !important;">
Allocation
@ -163,4 +163,119 @@
<notifier-container></notifier-container>
</div><!-- div @60 closed here -->
<div *ngIf="data.lender_role_id == '30'">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" style="padding: 10px !important;">
Allocation
</div>
<div fxFlex="40" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="closeAllocationComponent()" matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-card>
<mat-tab-group>
<mat-tab *ngIf="pdOfficerList.length > 0 && this.localagency == 0">
<ng-template mat-tab-label>Allocation To Credit Manager</ng-template>
<mat-dialog-content class="mat-typography">
<mat-list role="list" *ngIf="pdOfficerList.length > 0">
<mat-list-item role="listitem" *ngFor="let officer of pdOfficerList; let i = index">
<div fxFlex="100">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<mat-radio-button color="primary" [value]="officer" (change)="selectedItem = $event.value">
{{officer.first_name}} {{officer.last_name}}
</mat-radio-button>
</div>
</div>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="pdOfficerList.length == 0">
<mat-list-item>
<p>No <span *ngIf="data.lender_role_id == '25'">Regional </span>Credit Managers available.</p>
</mat-list-item>
</mat-list>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="50" align="left">
<p *ngIf="selectedItem"><span *ngIf="data.lender_role_id == '25'">Regional </span>Credit Manager: {{selectedItem.first_name}}</p>
</div>
<div fxFlex="50" align="right">
<button mat-raised-button mat-icon-button (click)="updatePdOfficer(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</mat-tab>
<mat-tab *ngIf="vendoragencyList.length > 0">
<ng-template mat-tab-label>Allocation To Agency</ng-template>
<mat-dialog-content class="mat-typography">
<mat-list role="list" *ngIf="vendoragencyList.length > 0">
<mat-list-item role="listitem" *ngFor="let v_officer of vendoragencyList; let i = index">
<div fxFlex="100">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<mat-radio-button color="primary" [value]="v_officer" (change)="selectedItem = $event.value">
{{v_officer.full_name}}
</mat-radio-button>
</div>
</div>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="vendoragencyList.length == 0">
<mat-list-item>
<p>No Agency List available.</p>
</mat-list-item>
</mat-list>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="50" align="left">
<p *ngIf="selectedItem"><span *ngIf="data.lender_role_id == '25'">Regional </span>Vendor Manager: {{selectedItem.full_name}}</p>
</div>
<div fxFlex="50" align="right">
<button mat-raised-button mat-icon-button (click)="updateagency(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</mat-tab>
<mat-tab *ngIf="vendorOfficerList.length > 0 && this.localagency != 0">
<ng-template mat-tab-label>Allocation To Vendor Officer</ng-template>
<mat-dialog-content class="mat-typography">
<mat-list role="list" *ngIf="vendorOfficerList.length > 0">
<mat-list-item role="listitem" *ngFor="let v_officer of vendorOfficerList; let i = index">
<div fxFlex="100">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30">
<mat-radio-button color="primary" [value]="v_officer" (change)="selectedItem = $event.value">
{{v_officer.name}}
</mat-radio-button>
</div>
</div>
</div>
</mat-list-item>
</mat-list>
<mat-list *ngIf="vendorOfficerList.length == 0">
<mat-list-item>
<p>No Vendor Officer available.</p>
</mat-list-item>
</mat-list>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="50" align="right">
<button mat-raised-button mat-icon-button (click)="updateagency(selectedItem)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</mat-tab>
</mat-tab-group>
</mat-card>
<notifier-container></notifier-container>
</div><!-- div @168 closed here -->

View File

@ -30,6 +30,8 @@ export class PdAllocationComponent implements OnInit {
fk_pd_allocated_to: any; pd_agency_id: string;
};
userRoleType: string;
vendoragencyList: any;
localagency: string;
@ -47,15 +49,18 @@ export class PdAllocationComponent implements OnInit {
ngOnInit() {
this.usertype=localStorage.getItem('usertype');
this.localagency = localStorage.getItem('smc_agency_id');
this.isDisabled=true;
if(this.data.lender_role_id=='28')
{
this.getSmcVendorPdOfficerList();
}
// else if(this.data.lender_role_id=='30' && this.data.lender_admin_flag == 0){
// this.getSmcVendorPdOfficerList();
// }
else if(this.data.lender_role_id=='30'){
this.getSmcVendorPdOfficerList();
this.getPDOfficerList(this.data.pd_id);
this.getSmcVendorPdOfficerList1();
}
else
{
this.getPDOfficerList(this.data.pd_id);
@ -113,8 +118,11 @@ export class PdAllocationComponent implements OnInit {
console.log('list');
console.log(list);
if(list['status'] == '200') {
this.vendorOfficerList= list['records']
if(localStorage.getItem('user_role')=='30'){
this.vendoragencyList= list['records'];
}else{
this.vendorOfficerList= list['records'];
}
}
}, error => this.errorMessage = <any> error);
@ -135,7 +143,7 @@ export class PdAllocationComponent implements OnInit {
"pd_id":this.data.pd_id,
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
"fk_pd_allocated_to":allocateDetails.userid,
"pd_agency_id":localStorage.getItem('user_role')=='28'|| localStorage.getItem('user_role')=='29'?localStorage.getItem('smc_agency_id'):localStorage.getItem('user_role')
"pd_agency_id":localStorage.getItem('user_role')=='28'|| localStorage.getItem('user_role')=='29' || localStorage.getItem('user_role')=='30'?this.localagency:null
}
}
@ -176,12 +184,12 @@ export class PdAllocationComponent implements OnInit {
updateagency(allocateDetails:any)
{
alert('updateagency'+allocateDetails.entity_id);
this.updateData = {
"pd_id":this.data.pd_id,
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
"fk_pd_allocated_to":allocateDetails.fk_state_id,
"pd_agency_id":allocateDetails.entity_id
"pd_agency_id":allocateDetails.entity_id ? allocateDetails.entity_id :this.localagency
}
console.log(this.updateData);

View File

@ -135,7 +135,8 @@ export class ImageCaptureComponent implements OnInit {
if(this.current_index != 'last') {
if(this.imageData[this.current_index].is_multiple == 1) {
console.log("multi");
let img_param={img_url:watermarked_img,is_base64:true,link:geoCoordinates}
let img_param={img_url:watermarked_img,is_base64:true,link:this.userRoleID != 30 ? null : geoCoordinates}
console.log('param');
console.log(img_param);

View File

@ -132,6 +132,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
userRoleType: string;
is_agency_logged_in: boolean;
currentVendorStatus: any;
pdAgencyid: any;
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
@ -196,6 +197,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.currentVendorStatus=data.records.pd_master_details[0].vendor_status;
this.pdAdditionalReqData = data.records.pd_additional_requirements;
this.pdCollectedDocument=data.records.docs_to_be_collected;
this.pdAgencyid=data.records.pd_master_details[0].pd_agency_id;
// enable pd start time
if (data.records.pd_master_details[0].scheduled_on_for_validation) {
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
@ -614,9 +616,9 @@ dialogRef1.afterClosed().subscribe(rr=>{
// return
let flag : any = null;//admin role means introduce the flag.
if((this.LenderRoleID == '27') || (this.LenderRoleID == '25') || (this.LenderRoleID == '28') || (this.LenderRoleID == '30')){
flag = this.LenderRoleID=='30'&&localStorage.getItem('smc_agency_id')?0:1;//agency id and admin role means 1 else 0 means introduce the flag.
if(this.LenderRoleID=='30' && this.pdAgencyid != "0"){localStorage.setItem('smc_agency_id',this.pdAgencyid);}
const dialogRef1 = this.dialog.open(PdAllocationComponent, {
data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,city_id:this.pdMasterData[0].fk_city,dialogType:'actionOnly',state_id:state_id, lender_role_id:this.LenderRoleID,lender_admin_flag:flag },
data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,city_id:this.pdMasterData[0].fk_city,dialogType:'actionOnly',state_id:state_id, lender_role_id:this.LenderRoleID },
disableClose: true,
minWidth: '30%',
})