@ -23,6 +23,8 @@ export class HomeComponent implements OnInit {
public static ALL_REQUEST = 'all_request' ;
public static ALL_REQUEST = 'all_request' ;
public static NOTIFICATION_DATA = 'notification_data' ;
public static NOTIFICATION_DATA = 'notification_data' ;
public static NOTIFICATION_ARR = 'notification_arr' ;
public static NOTIFICATION_ARR = 'notification_arr' ;
public static NAMES_ALL_iTEMS = 'names-all-items' ;
public static IS_ALL_NAME = 'is_all_names' ;
@ViewChild ( IonInfiniteScroll ) infiniteScroll : IonInfiniteScroll ;
@ViewChild ( IonInfiniteScroll ) infiniteScroll : IonInfiniteScroll ;
private WorkListObj : WorkListRequest ;
private WorkListObj : WorkListRequest ;
WorkListResObj : any ;
WorkListResObj : any ;
@ -47,12 +49,14 @@ export class HomeComponent implements OnInit {
public noData = false ;
public noData = false ;
public isITG = false ;
public isITG = false ;
public isSearch = false ;
public isSearch = false ;
public direction = 'ltr' ;
// public direction = 'ltr';
public direction : string ;
public ITGCount = 0 ;
public ITGCount = 0 ;
public ITGSegment : { name : string , code : any , data : any , style : boolean } [ ] = [ ] ;
public ITGSegment : { name : string , code : any , data : any , style : boolean , names? : any } [ ] = [ ] ;
public ITGAllItem : any = [ ] ;
public ITGAllItem : any = [ ] ;
public selectedITGToActive = false ;
public selectedITGToActive = false ;
public ITGItem : any = [ ] ;
public ITGItem : any = [ ] ;
public ITGAllItems : any = [ ] ;
public activeSegment : any ;
public activeSegment : any ;
public currentActiveIndex = 0 ;
public currentActiveIndex = 0 ;
@ -165,17 +169,14 @@ export class HomeComponent implements OnInit {
this . WorkListObj . P_PAGE_LIMIT = 50 ;
this . WorkListObj . P_PAGE_LIMIT = 50 ;
}
}
ionViewDidEnter() {
ionViewDidEnter() {
console . log ( "ionViewDidEnter" ) ;
console . log ( 'ionViewDidEnter' ) ;
// this.direction = TranslatorService.getCurrentDirection();
// this.direction = TranslatorService.getCurrentDirection();
this . worklistNotifications = this . common . sharedService . getSharedData ( 'worklistNotifications' , false ) ;
this . worklistNotifications = this . common . sharedService . getSharedData ( 'worklistNotifications' , false ) ;
}
}
ngOnInit() {
ngOnInit() {
this . direction = TranslatorService . getCurrentLanguageName ( ) ;
this . worklistNotifications = this . common . sharedService . getSharedData ( 'worklistNotifications' , false ) ;
this . common . startLoading ( ) ;
this . common . startLoading ( ) ;
this . openNotificationsDashboard ( ) ;
this . openNotificationsDashboard ( ) ;
@ -489,30 +490,42 @@ export class HomeComponent implements OnInit {
}
}
Count() {
Count() {
this . workListService . getITGCount ( '' , '' , this . isPostNoLoad )
const datas = [ ] ;
const names = [ ] ;
this . ITGSegment [ 0 ] = {
name : 'All' ,
code : 'All' ,
data : null ,
style : false
} ;
this . workListService . getITGCount ( )
. subscribe ( ( result : any ) = > {
. subscribe ( ( result : any ) = > {
for ( let i = 0 ; i < result . RequestType . length ; i ++ ) {
for ( let i = 1 ; i < result . RequestType . length ; i ++ ) {
this . ITGSegment [ i ] = {
this . ITGSegment [ i ] = {
name : result.RequestType [ i ] . RequestTypeName ,
name : result.RequestType [ i ] . RequestTypeName ,
code : result.RequestType [ i ] . RequestTypeCode ,
code : result.RequestType [ i ] . RequestTypeCode ,
data : result.RequestType [ i ] . RequestDetails ,
data : result.RequestType [ i ] . RequestDetails ,
style : false
style : false
} ;
} ;
datas [ i ] = result . RequestType [ i ] . RequestDetails ;
names [ i ] = result . RequestType [ i ] . RequestTypeCode ;
}
}
this . ITGSegment [ 0 ] . data = datas ;
this . ITGSegment [ 0 ] . names = names ;
this . setActive ( this . ITGSegment [ 0 ] . code ) ;
this . setActive ( this . ITGSegment [ 0 ] . code ) ;
} ) ;
} ) ;
}
}
Details() {
Details() {
this . workListService . getITGDetails ( '' , '' , this . isPostNoLoad )
this . workListService . getITGDetails ( )
. subscribe ( ( result : any ) = > {
. subscribe ( ( result : any ) = > {
this . ITGCount = result . TotalCount ;
this . totalRequestCount = this . totalRequestCount + result . TotalCount ;
this . totalRequestCount = this . totalRequestCount + result . TotalCount ;
this . filters [ 5 ] . value = result . TotalCount ;
this . filters [ 5 ] . value = result . TotalCount ;
} ) ;
} ) ;
}
}
ITGNotification() {
ITGNotification() {
// this.Details();
this . isAll = false ;
this . isAll = false ;
this . isPR = false ;
this . isPR = false ;
this . isPO = false ;
this . isPO = false ;
@ -539,13 +552,38 @@ export class HomeComponent implements OnInit {
this . ITGSegment [ i ] . style = false ;
this . ITGSegment [ i ] . style = false ;
}
}
}
}
console . log ( this . ITGSegment ) ;
}
}
openITG ( segmentInfo ) {
openITG ( segmentInfo , name ? ) {
this . common . sharedService . setSharedData ( segmentInfo , HomeComponent . REQUSET_INFO ) ;
if ( name ) {
this . common . sharedService . setSharedData ( name , HomeComponent . REQUSET_NAME ) ;
this . common . sharedService . setSharedData ( this . ITGSegment , HomeComponent . NAMES_ALL_iTEMS ) ;
this . common . sharedService . setSharedData ( true , HomeComponent . IS_ALL_NAME ) ;
} else {
this . common . sharedService . setSharedData ( this . activeSegment , HomeComponent . REQUSET_NAME ) ;
this . common . sharedService . setSharedData ( this . activeSegment , HomeComponent . REQUSET_NAME ) ;
this . common . sharedService . setSharedData ( false , HomeComponent . IS_ALL_NAME ) ;
}
this . common . sharedService . setSharedData ( segmentInfo , HomeComponent . REQUSET_INFO ) ;
this . common . sharedService . setSharedData ( this . ITGItem , HomeComponent . ALL_REQUEST ) ;
this . common . sharedService . setSharedData ( this . ITGItem , HomeComponent . ALL_REQUEST ) ;
this . common . openWorklistITGPage ( ) ;
this . common . openWorklistITGPage ( ) ;
}
}
openITGAll ( id , item ) {
let count = 0 ;
let ITEM : any ;
let NAME : any ;
for ( let i = 1 ; i < this . ITGSegment . length ; i ++ ) {
// tslint:disable-next-line: prefer-for-of
for ( let j = 0 ; j < this . ITGSegment [ i ] . data . length ; j ++ ) {
if ( this . ITGSegment [ i ] . data [ j ] . ID === id && this . ITGSegment [ i ] . data [ j ] . ItemID === item ) {
ITEM = this . ITGSegment [ i ] . data [ j ] ;
NAME = this . ITGSegment [ i ] . code ;
count ++ ;
}
}
}
this . openITG ( ITEM , NAME ) ;
}
}
}