Fairoj: Report api integrated and some improvements
This commit is contained in:
parent
350f122f09
commit
658711c8cd
@ -10,6 +10,9 @@
|
||||
"/index.html",
|
||||
"/*.css",
|
||||
"/*.js"
|
||||
],
|
||||
"urls":[
|
||||
"https://fonts.googleapis.com/css?family=Roboto:300,400,700|Material+Icons"
|
||||
]
|
||||
}
|
||||
}, {
|
||||
@ -19,10 +22,6 @@
|
||||
"resources": {
|
||||
"files": [
|
||||
"/assets/**"
|
||||
],
|
||||
"urls": [
|
||||
"https://fonts.googleapis.com/**",
|
||||
"https://fonts.gstatic.com/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,6 +70,12 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
console.log('this.currentUser',this.currentUser);
|
||||
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')
|
||||
// "urls": [
|
||||
// "https://fonts.googleapis.com/**",
|
||||
// "https://fonts.gstatic.com/**"
|
||||
// ]
|
||||
|
||||
if(this.currentUser.fk_entity_type_id == 1 ){
|
||||
this.userDep = "SineEdge";
|
||||
|
||||
@ -74,7 +74,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 fxLayout="row wrap" *ngFor="let details of pagedList" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)" class="webhide">
|
||||
<div fxLayout="row wrap" *ngFor="let details of pagedList | async" (click)="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"> -->
|
||||
<div fxFlex.xs="20" fxFlex.sm="20" class="webhide" style="text-align: center;">
|
||||
@ -121,7 +121,7 @@
|
||||
<!--End Mobile View Code-->
|
||||
|
||||
<!--Start Web View Code-->
|
||||
<div fxLayout="row wrap" *ngFor="let details of pagedList">
|
||||
<div fxLayout="row wrap" *ngFor="let details of pagedList | async">
|
||||
<div fxFlex.xs="20" fxFlex.sm="20" fxFlex.md="12" fxFlex.lg="12" fxFlex.xl="12" class="cell" style="justify-content:flex-end">
|
||||
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
|
||||
<span mat-line class="cell">{{details.pd_type_name}}</span>
|
||||
|
||||
@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { AwsService } from 'app/AwsService/aws.service';
|
||||
import { UserService } from 'app/settings/service/user.service';
|
||||
import { ReplaySubject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-all-pd',
|
||||
@ -51,7 +52,7 @@ export class AllPdComponent implements OnInit, OnChanges {
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
pagedList: any=[];
|
||||
pagedList: ReplaySubject<any> = new ReplaySubject<any>(1);
|
||||
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
|
||||
@ -118,11 +119,11 @@ console.log(this.displayedColumns)
|
||||
|
||||
filterData(text) {
|
||||
if(!text) {
|
||||
this.pagedList = this.PdListData.slice(0, 10);
|
||||
this.pagedList .next(this.PdListData.slice(0, 10));
|
||||
this.length = this.PdListData.length;
|
||||
return
|
||||
}
|
||||
this.pagedList = this.PdListData.filter(v=>{
|
||||
let temp = this.PdListData.filter(v=>{
|
||||
if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1
|
||||
|| v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1
|
||||
||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) {
|
||||
@ -130,9 +131,10 @@ console.log(this.displayedColumns)
|
||||
}
|
||||
return false
|
||||
})
|
||||
this.pagedList.next(temp)
|
||||
// this.pa
|
||||
// this.length = this.pagedList.length
|
||||
console.log(this.PdListData,this.pagedList,text)
|
||||
// console.log(this.PdListData,this.pagedList,text)
|
||||
|
||||
}
|
||||
|
||||
@ -146,7 +148,7 @@ console.log(this.displayedColumns)
|
||||
if (data.status == 200) {
|
||||
this.PdListData = data.records;
|
||||
// this.PdListData = <GetOrInitializeYourListHere>;
|
||||
this.pagedList = this.PdListData.slice(0, 10);
|
||||
this.pagedList.next(this.PdListData.slice(0, 10));
|
||||
this.length = this.PdListData.length;
|
||||
this.PdListData.forEach(value=>{
|
||||
let original=value.pd_sno
|
||||
@ -159,6 +161,7 @@ console.log(this.displayedColumns)
|
||||
}
|
||||
else{
|
||||
this.PdListData=[];
|
||||
this.pagedList.next([])
|
||||
// this.pagedList.forEach(value=>{
|
||||
// let original=value.pd_sno
|
||||
// value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
|
||||
@ -182,7 +185,7 @@ console.log(this.displayedColumns)
|
||||
if(endIndex > this.length){
|
||||
endIndex = this.length;
|
||||
}
|
||||
this.pagedList = this.PdListData.slice(startIndex, endIndex);
|
||||
this.pagedList.next(this.PdListData.slice(startIndex, endIndex));
|
||||
}
|
||||
|
||||
pageChange(e) {
|
||||
@ -281,7 +284,7 @@ console.log(this.displayedColumns)
|
||||
if(res['dataStatus'])
|
||||
{
|
||||
this.PdListData = res['records'];
|
||||
this.pagedList = this.PdListData.slice(0, 10);
|
||||
this.pagedList .next( this.PdListData.slice(0, 10));
|
||||
this.length = this.PdListData.length;
|
||||
this.PdListData.forEach(value=>{
|
||||
let original=value.pd_sno
|
||||
@ -298,7 +301,7 @@ console.log(this.displayedColumns)
|
||||
// this.dataSourceTab1.paginator['pageIndex'] = 0;
|
||||
// this.dataSourceTab1.data = [];
|
||||
this.PdListData = [];
|
||||
this.pagedList = [];
|
||||
this.pagedList .next([]);
|
||||
// this.length = this.PdListData.length;
|
||||
this.recordStatus = true;
|
||||
this.limitMsg = false
|
||||
|
||||
@ -58,20 +58,28 @@ export class ListPdComponent implements OnInit, OnDestroy {
|
||||
localStorage.setItem('len_user_role',role_name);
|
||||
this.user_role_name=role_name
|
||||
})
|
||||
// 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();
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// after view call all tabs component
|
||||
ngAfterViewInit() {
|
||||
let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
if(entity_id) {
|
||||
this.allTabC.loadPDDetails();
|
||||
}
|
||||
else{
|
||||
setTimeout(()=>{
|
||||
this.allTabC.loadPDDetails();
|
||||
},2000)
|
||||
}
|
||||
// let entity_id = localStorage.getItem('LocalSetEntity')
|
||||
// if(entity_id) {
|
||||
// this.allTabC.loadPDDetails();
|
||||
// }
|
||||
// else{
|
||||
// setTimeout(()=>{
|
||||
// this.allTabC.loadPDDetails();
|
||||
// },2000)
|
||||
// }
|
||||
}
|
||||
|
||||
// view pd list in map view
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content style="max-height:100% !important;">
|
||||
<p *ngIf="categoryFormButtons.length == 0" style="text-align: center;">No Template Found</p>
|
||||
<div fxLayout="row wrap" class="child_mat_card">
|
||||
<mat-card fxFlex.xs="100" fxFlex.sm="45" fxFlex.md="32" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of categoryFormButtons;let quesIndex=index" [ngStyle]="{'background-color':formButton.is_answered == '0' ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectDirectForms(formButton)">
|
||||
<mat-card-header>
|
||||
|
||||
@ -26,7 +26,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
pdFullDetails:any=[];
|
||||
|
||||
// category static form buttons
|
||||
categoryFormButtons: any;
|
||||
categoryFormButtons: any =[];
|
||||
formsCategoryEnable: boolean = false;
|
||||
selectedFormsCategory: any;
|
||||
// create values for status check
|
||||
@ -581,7 +581,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
// load pd view component
|
||||
loadPdViewCompoent() {
|
||||
this.router.navigate(['../../../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
|
||||
this.router.navigate(['../../../../../viewpd', this.startPD,this.randomString], {relativeTo: this.route});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</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>
|
||||
<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>
|
||||
@ -163,7 +163,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'"><button *ngIf="roleAccessDetails.discussions && 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.QC_COMPLETED" 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 +204,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'"><button *ngIf="roleAccessDetails.discussions && 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.QC_COMPLETED" 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">
|
||||
|
||||
@ -405,6 +405,22 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
smcCreditPDReport(pd_id) {
|
||||
// this.destroyType = 3;
|
||||
// this.router.navigate(['../../../pd_report', pd_id,this.masterRandomString], { relativeTo: this.route });
|
||||
let params = { "pd_id":pd_id,"fk_createdby":"","regenerate":"0"}
|
||||
this._pd.smcCreditPDReport(params).subscribe(result=>{
|
||||
if(result.dataStatus) {
|
||||
window.open(result.records)
|
||||
}
|
||||
else{
|
||||
this.notifier.notify('error',"Something went wrong!!")
|
||||
}
|
||||
},err=>{
|
||||
this.notifier.notify('error',"Network Error!!")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// updateViewComponent(editBack:string) {
|
||||
|
||||
|
||||
@ -835,6 +835,11 @@ loadTemplate(form_id) {
|
||||
return this._http.post(this.apiUrl+'saveSMCCreditPDImage',{records:params})
|
||||
.pipe(catchError(this.handleError("saveSMCCreditPDImage",[])))
|
||||
}
|
||||
smcCreditPDReport(params):Observable<any> {
|
||||
params.fk_createdby = this._aws.getlocale()
|
||||
return this._http.post(this.apiUrl+'smcCreditPDReport',{records:params})
|
||||
.pipe(catchError(this.handleError("smcCreditPDReport",[])))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { AwsService } from '../../AwsService/aws.service';
|
||||
import { environment } from 'environments/environment';
|
||||
import { Subject } from 'rxjs';
|
||||
// const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
// const apiurl = "http://localhost/sparqapi/api/";
|
||||
const apiurl = environment.apiEndpoint;
|
||||
@ -13,6 +14,7 @@ const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
|
||||
})
|
||||
|
||||
export class UserService {
|
||||
messageSubject : Subject<string> = new Subject<string>();
|
||||
|
||||
localUserId: any;
|
||||
constructor(public http:HttpClient,public aws:AwsService) { }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user