for role based sales pd list

This commit is contained in:
venbatechnologies@gmail.com 2022-01-31 18:26:53 +05:30
parent f306a10301
commit cdf4a07e4d
8 changed files with 69 additions and 10 deletions

View File

@ -1,3 +1,4 @@
<div *ngIf="role!='11'">
<mat-card-content style="padding: 0;">
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
@ -79,7 +80,7 @@
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<div class="example-container" >
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)=" details.pd_status != 'BOUNCED' || details.fk_pd_allocated_to == user_id ? viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string) : ''" class="webhide">
<!--Start Mobile View Code-->
<!-- <div (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" class="webhide"> -->
@ -278,4 +279,9 @@
<h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content>
<notifier-container></notifier-container>
<notifier-container></notifier-container>
</div>
<div *ngIf="role=='11'">
<p>data</p>
</div>

View File

@ -176,7 +176,41 @@ console.log(this.displayedColumns)
// load inprogress pd list
public LenderRoleID : string = localStorage.getItem('LenderRoleID');
loadPDDetails() {
const role=localStorage.getItem('len_user_role_id');
alert(role);
if(role=='11')
{
alert('if');
this._pd.getSalesPd()
.subscribe(
data => {
this.loaderService.closeMatSpinnerDialog();
if (data.status == 200) {
this.PdListData = data.records;
console.log('pddataabi');
console.log(this.PdListData);
// this.PdListData = <GetOrInitializeYourListHere>;
if(this.startIndex && this.endIndex) {
this.pagedList.next(this.PdListData.slice(this.startIndex, this.endIndex));
}
else {
this.pagedList.next(this.PdListData.slice(0, 10));
}
this.length = this.PdListData.length;
this.PdListData.forEach(value=>{
let original=value.pd_sno
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
})
// this.dataLengthTab1 = data.records.length;
// this.dataSourceTab1.data = this.PdListData;
this.recordStatus=false;
this.limitMsg = true
}
})
}
else
{
this.LenderRoleID = localStorage.getItem('LenderRoleID');
if(this.PdListData.length == 0) {
@ -227,6 +261,7 @@ console.log(this.displayedColumns)
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!' + '-' + error.error_text + ' occur');
alert(error.html_format);
});
}
}
OnPageChange(event: PageEvent){

View File

@ -166,7 +166,7 @@
</mat-list-item>
</mat-list>
<!-- </form> -->
</mat-dialog-content>

View File

@ -100,7 +100,7 @@ export class PdAllocationComponent implements OnInit {
}
}, error => this.errorMessage = <any> error);
}, error => this.errorMessage = <any> error);
}
getSmcVendorPdOfficerList1(){
@ -148,6 +148,8 @@ export class PdAllocationComponent implements OnInit {
"pd_agency_id":allocateDetails.entity_id
}
}
console.log(this.updateData);
//return
this._pd.updatePdOfficer(this.updateData).subscribe(
result => {
if (result.status == 200) {

View File

@ -77,10 +77,10 @@
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>-->
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="editForm(details)"
<!--<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" color="primary" (click)="editForm(details)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>
</button>-->
<!-- <button style="float: right" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger Credit PD" *ngIf="user_type == 'credit'" [disabled]="details.status != 'COMPLETED'"
matTooltipPosition="above" color="primary" (click)="newcreditTrigger(details)"><mat-icon>add</mat-icon></button> -->
</mat-cell>

View File

@ -21,6 +21,9 @@ export interface Menu {
children?: ChildrenItems[];
}
const roleh=localStorage.getItem('len_user_role_id');
alert(roleh);
alert('tension1');
const HORIZONTALMENUITEMS = [
// {
// state: 'home',
@ -93,7 +96,11 @@ const salesmenu = [
// icon:'report',
// },
];
// if(roleh=='12')
// {
// const index = salesmenu.findIndex(user1 => user1.name == 'Sales PD');
// salesmenu.splice(index, 1);
// }
@Injectable()
export class HorizontalMenuItems {
getAll(): Menu[] {

View File

@ -30,6 +30,9 @@ export interface Menu {
children?: ChildrenItems[];
multichild?:Multichild[];
}
const role=localStorage.getItem('len_user_role_id');
alert(role);
alert('tension');
const MENUITEMS : Menu[] = [
// {
@ -175,7 +178,13 @@ const salesMenus: Menu[]= [
// icon:'report',
// }
];
console.log(salesMenus);
console.log('salesman');
if(role=='12')
{
const index = salesMenus.findIndex(user => user.name == 'Sales PD');
salesMenus.splice(index, 1);
}
@Injectable()
export class MenuItems {
getAll(): Menu[] {
@ -194,3 +203,4 @@ export class MenuItems {
MENUITEMS.push(menu);
}
}

View File

@ -175,7 +175,6 @@
],
"is_repeatable":"1",
"group_title":"Remarks",
"group_title_shown":"0",
"group_key":"pd_officer_recommendation_remarks"
} ] }
] },