agencyid issues resolved
This commit is contained in:
parent
b63a42ef6f
commit
aaa0852b8d
@ -62,14 +62,17 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
|||||||
if(this.currentUser.dataStatus == true){
|
if(this.currentUser.dataStatus == true){
|
||||||
|
|
||||||
this.currentUser = this.currentUser.records[0];
|
this.currentUser = this.currentUser.records[0];
|
||||||
|
|
||||||
localStorage.setItem("LocalSetEntity",this.currentUser.fk_entity_id);
|
localStorage.setItem("LocalSetEntity",this.currentUser.fk_entity_id);
|
||||||
|
|
||||||
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
|
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
|
||||||
this.roleName = this.currentUser.role_name;
|
this.roleName = this.currentUser.role_name;
|
||||||
|
|
||||||
console.log('this.currentUser',this.currentUser);
|
console.log('this.currentUser',this.currentUser);
|
||||||
|
console.log(this.currentUser.userid);
|
||||||
localStorage.setItem('len_user_role_id',this.currentUser.user_role);
|
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);
|
window.localStorage.setItem('LenderRoleID', this.currentUser.user_role);
|
||||||
// FOR TELLING entity id updated to localstorage for list pd component
|
// FOR TELLING entity id updated to localstorage for list pd component
|
||||||
this.users.messageSubject.next('all_tab')
|
this.users.messageSubject.next('all_tab')
|
||||||
|
|||||||
@ -1192,6 +1192,8 @@ searchFun(control:any,i:number,option){
|
|||||||
console.log(result,JSON.stringify(result));
|
console.log(result,JSON.stringify(result));
|
||||||
// let formValues = {}
|
// let formValues = {}
|
||||||
let records = result.records
|
let records = result.records
|
||||||
|
|
||||||
|
|
||||||
if(records ) {
|
if(records ) {
|
||||||
// records.forEach(val=>{
|
// records.forEach(val=>{
|
||||||
Object.keys(records).forEach(key_name=>{
|
Object.keys(records).forEach(key_name=>{
|
||||||
@ -1212,6 +1214,7 @@ searchFun(control:any,i:number,option){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(key_name == 'address_details') {
|
if(key_name == 'address_details') {
|
||||||
|
|
||||||
this.addressList = records['address_details']
|
this.addressList = records['address_details']
|
||||||
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
control_address.get('addressline1').disable()
|
control_address.get('addressline1').disable()
|
||||||
@ -1230,6 +1233,9 @@ searchFun(control:any,i:number,option){
|
|||||||
}
|
}
|
||||||
onChangeSelectedAddress(value) {
|
onChangeSelectedAddress(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
|
|
||||||
|
let city_id=value.city;
|
||||||
|
this.getvendor(city_id)
|
||||||
if(value) {
|
if(value) {
|
||||||
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
console.log(control_address);
|
console.log(control_address);
|
||||||
|
|||||||
@ -71,7 +71,7 @@ export class ListPdComponent implements OnInit, OnDestroy {
|
|||||||
this.userService.getroles().subscribe(res=>{
|
this.userService.getroles().subscribe(res=>{
|
||||||
let role_name = this.userService.takeDecisionRouting(res['records'][0])
|
let role_name = this.userService.takeDecisionRouting(res['records'][0])
|
||||||
console.log('userrole');
|
console.log('userrole');
|
||||||
|
console.log(res);
|
||||||
localStorage.setItem('smc_agency_id',res['records'][0].smc_agency_id);
|
localStorage.setItem('smc_agency_id',res['records'][0].smc_agency_id);
|
||||||
localStorage.setItem('len_user_role',role_name);
|
localStorage.setItem('len_user_role',role_name);
|
||||||
this.user_role_name=role_name
|
this.user_role_name=role_name
|
||||||
|
|||||||
@ -106,12 +106,12 @@ export class PdAllocationComponent implements OnInit {
|
|||||||
this.usertype=localStorage.getItem('usertype');
|
this.usertype=localStorage.getItem('usertype');
|
||||||
if(this.usertype=='true')
|
if(this.usertype=='true')
|
||||||
{
|
{
|
||||||
|
|
||||||
this.updateData = {
|
this.updateData = {
|
||||||
"pd_id":this.data.pd_id,
|
"pd_id":this.data.pd_id,
|
||||||
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
|
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
|
||||||
"fk_pd_allocated_to":allocateDetails.userid,
|
"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
|
else
|
||||||
|
|||||||
@ -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 == '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 == '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="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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -38,6 +38,8 @@ export class PdTrigerService {
|
|||||||
usertype: string;
|
usertype: string;
|
||||||
LenderRoleID: string;
|
LenderRoleID: string;
|
||||||
entity_id: string;
|
entity_id: string;
|
||||||
|
pdagencyid: string;
|
||||||
|
userRoleType: string;
|
||||||
|
|
||||||
constructor(private _http: HttpClient,
|
constructor(private _http: HttpClient,
|
||||||
private _aws: AwsService) {
|
private _aws: AwsService) {
|
||||||
@ -171,21 +173,46 @@ export class PdTrigerService {
|
|||||||
|
|
||||||
// get pd details
|
// get pd details
|
||||||
getPdDetails(lenderId): Observable<any> {
|
getPdDetails(lenderId): Observable<any> {
|
||||||
|
|
||||||
|
this.userRoleType=localStorage.getItem('user_role');
|
||||||
this.usertype=localStorage.getItem('usertype');
|
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()
|
let userid1=this._aws.getlocale()
|
||||||
|
|
||||||
const Lender:any = this.entity_id ?
|
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)
|
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", Lender)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -212,18 +239,36 @@ export class PdTrigerService {
|
|||||||
getTabStatusPdDetails(status: string,lenderId): Observable<any> {
|
getTabStatusPdDetails(status: string,lenderId): Observable<any> {
|
||||||
|
|
||||||
this.usertype=localStorage.getItem('usertype');
|
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 userid1=this._aws.getlocale()
|
||||||
let paramHttp1:any= this.entity_id && status ?
|
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)
|
paramHttp1.params = paramHttp1.params.set('createdby',userid1)
|
||||||
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp1)
|
return this._http.get<any[]>(this.apiUrl + "listLessPDDetails/get", paramHttp1)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -706,7 +751,7 @@ export class PdTrigerService {
|
|||||||
// if(LenderRoleID == '25') {
|
// if(LenderRoleID == '25') {
|
||||||
if(this.usertype=='true')
|
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
|
searchItem.createdby = userid
|
||||||
// }
|
// }
|
||||||
@ -952,7 +997,9 @@ loadTemplate(form_id) {
|
|||||||
}
|
}
|
||||||
getSMCVendorPDOfficersList(roleid)
|
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(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user