agencyid issues resolved

This commit is contained in:
venbatechnologies@gmail.com 2021-11-29 17:05:20 +05:30
parent b63a42ef6f
commit aaa0852b8d
6 changed files with 70 additions and 14 deletions

View File

@ -62,14 +62,17 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
if(this.currentUser.dataStatus == true){
this.currentUser = this.currentUser.records[0];
localStorage.setItem("LocalSetEntity",this.currentUser.fk_entity_id);
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
this.roleName = this.currentUser.role_name;
console.log('this.currentUser',this.currentUser);
console.log(this.currentUser.userid);
localStorage.setItem('len_user_role_id',this.currentUser.user_role);
localStorage.setItem('userid',this.currentUser.userid);
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
this.users.messageSubject.next('all_tab')

View File

@ -1192,6 +1192,8 @@ searchFun(control:any,i:number,option){
console.log(result,JSON.stringify(result));
// let formValues = {}
let records = result.records
if(records ) {
// records.forEach(val=>{
Object.keys(records).forEach(key_name=>{
@ -1212,6 +1214,7 @@ searchFun(control:any,i:number,option){
}
}
if(key_name == 'address_details') {
this.addressList = records['address_details']
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
control_address.get('addressline1').disable()
@ -1230,6 +1233,9 @@ searchFun(control:any,i:number,option){
}
onChangeSelectedAddress(value) {
console.log(value)
let city_id=value.city;
this.getvendor(city_id)
if(value) {
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
console.log(control_address);

View File

@ -71,7 +71,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
this.userService.getroles().subscribe(res=>{
let role_name = this.userService.takeDecisionRouting(res['records'][0])
console.log('userrole');
console.log(res);
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

@ -106,12 +106,12 @@ export class PdAllocationComponent implements OnInit {
this.usertype=localStorage.getItem('usertype');
if(this.usertype=='true')
{
this.updateData = {
"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')
"pd_agency_id":localStorage.getItem('user_role')=='28'|| localStorage.getItem('user_role')=='29'?localStorage.getItem('smc_agency_id'):localStorage.getItem('user_role')
}
}
else

View File

@ -204,7 +204,7 @@
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID == '27' || LenderRoleID == '25' && currentPDStatus == pdStatusCheck.BOUNCED ||LenderRoleID == '28'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && userId == master.fk_pd_allocated_to)|| (currentPDStatus == pdStatusCheck.BOUNCED && userId == master.fk_pd_allocated_to)) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_state)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && (LenderRoleID == '26')"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && master.pd_allocated_to_role_id == '27')) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_city)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED || currentPDStatus == pdStatusCheck.INPROGRESS)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Send back to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && (LenderRoleID == '27' || LenderRoleID == '28'||currentPDStatus!=pdStatusCheck.TRIGGERED)" 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' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && (LenderRoleID == '27' || LenderRoleID == '28'||currentPDStatus!=pdStatusCheck.TRIGGERED)||LenderRoleID == '29'" 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>

View File

@ -38,6 +38,8 @@ export class PdTrigerService {
usertype: string;
LenderRoleID: string;
entity_id: string;
pdagencyid: string;
userRoleType: string;
constructor(private _http: HttpClient,
private _aws: AwsService) {
@ -171,21 +173,46 @@ export class PdTrigerService {
// get pd details
getPdDetails(lenderId): Observable<any> {
this.userRoleType=localStorage.getItem('user_role');
this.usertype=localStorage.getItem('usertype');
if(this.usertype=='true1')
if(this.usertype=='true')
{
if(this.userRoleType=='29')
{
this.pdagencyid = localStorage.getItem('smc_agency_id');
this.entity_id=localStorage.getItem('LocalSetEntity');
let userid1=this._aws.getlocale()
let userid = localStorage.getItem('userid');
const Lender:any = this.entity_id ?
{ params: new HttpParams().set('lenderid', this.entity_id) } :
{};
Lender.params = Lender && Lender.params ? Lender.params.set('createdby',userid1).set('pdagencyid',this.pdagencyid).set('pdofficerid',userid) : {}
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", Lender)
.pipe(
catchError(this.handleError('operation', []))
)
}
else
{
this.pdagencyid = localStorage.getItem('smc_agency_id');
this.entity_id = localStorage.getItem('smc_agency_id');
this.entity_id=localStorage.getItem('LocalSetEntity');
let userid1=this._aws.getlocale()
const Lender:any = this.entity_id ?
{ params: new HttpParams().set('smcagencyid', this.entity_id) } :
{ params: new HttpParams().set('lenderid', this.entity_id) } :
{};
Lender.params = Lender && Lender.params ? Lender.params.set('createdby',userid1) : {}
Lender.params = Lender && Lender.params ? Lender.params.set('createdby',userid1).set('pdagencyid',this.pdagencyid) : {}
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", Lender)
.pipe(
catchError(this.handleError('operation', []))
)
}
}
else
@ -212,18 +239,36 @@ export class PdTrigerService {
getTabStatusPdDetails(status: string,lenderId): Observable<any> {
this.usertype=localStorage.getItem('usertype');
if(this.usertype=='true1')
if(this.usertype=='true')
{
if(this.userRoleType=='29')
{
this.pdagencyid = localStorage.getItem('smc_agency_id');
this.entity_id=localStorage.getItem('LocalSetEntity');
let userid1=this._aws.getlocale()
let userid = localStorage.getItem('userid');
let paramHttp1:any= this.entity_id && status ?
{params : new HttpParams().set('lenderid', this.entity_id).set('status',status).set('pdagencyid',this.pdagencyid).set('pdofficerid',userid)} : {};
paramHttp1.params = paramHttp1.params.set('createdby',userid1)
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp1)
.pipe(
catchError(this.handleError('operation', []))
)
}
this.entity_id = localStorage.getItem('smc_agency_id');
else
{
this.pdagencyid = localStorage.getItem('smc_agency_id');
this.entity_id=localStorage.getItem('LocalSetEntity');
let userid1=this._aws.getlocale()
let paramHttp1:any= this.entity_id && status ?
{params : new HttpParams().set('smcagencyid', this.entity_id).set('status',status)} : {};
{params : new HttpParams().set('lenderid', this.entity_id).set('status',status).set('pdagencyid',this.pdagencyid)} : {};
paramHttp1.params = paramHttp1.params.set('createdby',userid1)
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp1)
.pipe(
catchError(this.handleError('operation', []))
)
}
}
else
{
@ -706,7 +751,7 @@ export class PdTrigerService {
// if(LenderRoleID == '25') {
if(this.usertype=='true')
{
searchItem.smc_agency_id = localStorage.getItem('smc_agency_id');
searchItem.pd_agency_id = localStorage.getItem('smc_agency_id');
}
searchItem.createdby = userid
// }
@ -952,7 +997,9 @@ loadTemplate(form_id) {
}
getSMCVendorPDOfficersList(roleid)
{
return this._http.get(this.apiUrl+'getSMCVendorPDOfficersList?role_id='+roleid)
//let agencyid=localStorage.getItem('user_role')=='28'|| localStorage.getItem('user_role')=='29'?localStorage.getItem('smc_agency_id'):localStorage.getItem('user_role')
let agencyid=this.pdagencyid = localStorage.getItem('smc_agency_id');
return this._http.get(this.apiUrl+'getSMCVendorPDOfficersList?agency_id='+agencyid)
.pipe(
catchError(this.handleError('operation', []))
)