|
|
|
|
@ -21,6 +21,8 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public static ALL_REQUEST = 'all_request';
|
|
|
|
|
public static NOTIFICATION_DATA = 'notification_data';
|
|
|
|
|
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;
|
|
|
|
|
private WorkListObj: WorkListRequest;
|
|
|
|
|
WorkListResObj: any;
|
|
|
|
|
@ -47,10 +49,11 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public isSearch = false;
|
|
|
|
|
public direction = 'ltr';
|
|
|
|
|
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 selectedITGToActive = false;
|
|
|
|
|
public ITGItem: any = [];
|
|
|
|
|
public ITGAllItems: any = [];
|
|
|
|
|
public activeSegment: any;
|
|
|
|
|
|
|
|
|
|
public currentActiveIndex = 0;
|
|
|
|
|
@ -268,7 +271,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
|
|
|
|
|
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; ;
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';;
|
|
|
|
|
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
|
|
|
|
|
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
|
|
|
|
|
if (this.selectedValue === '5') {
|
|
|
|
|
@ -396,16 +399,28 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Count() {
|
|
|
|
|
let datas =[];
|
|
|
|
|
let names =[];
|
|
|
|
|
this.ITGSegment[0] = {
|
|
|
|
|
name: 'All',
|
|
|
|
|
code: 'All',
|
|
|
|
|
data: null,
|
|
|
|
|
style: false
|
|
|
|
|
};
|
|
|
|
|
this.workListService.getITGCount()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
for (let i = 0; i < result.RequestType.length; i++) {
|
|
|
|
|
for (let i = 1; i < result.RequestType.length; i++) {
|
|
|
|
|
this.ITGSegment[i] = {
|
|
|
|
|
name: result.RequestType[i].RequestTypeName,
|
|
|
|
|
code: result.RequestType[i].RequestTypeCode,
|
|
|
|
|
data: result.RequestType[i].RequestDetails,
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -442,17 +457,41 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.ITGSegment[i].style = true;
|
|
|
|
|
this.ITGItem[count] = this.ITGSegment[i].data;
|
|
|
|
|
count++;
|
|
|
|
|
} else {
|
|
|
|
|
}else{
|
|
|
|
|
this.ITGSegment[i].style = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.ITGSegment)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openITG(segmentInfo) {
|
|
|
|
|
this.common.sharedService.setSharedData(segmentInfo, HomeComponent.REQUSET_INFO);
|
|
|
|
|
openITG(segmentInfo, name?) {
|
|
|
|
|
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(false, HomeComponent.IS_ALL_NAME);
|
|
|
|
|
}
|
|
|
|
|
this.common.sharedService.setSharedData(segmentInfo, HomeComponent.REQUSET_INFO);
|
|
|
|
|
this.common.sharedService.setSharedData(this.ITGItem, HomeComponent.ALL_REQUEST);
|
|
|
|
|
this.common.openWorklistITGPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openITGAll(id, item){
|
|
|
|
|
let count =0;
|
|
|
|
|
let ITEM: any;
|
|
|
|
|
let NAME: any;
|
|
|
|
|
for (let i = 1; i < this.ITGSegment.length; i++) {
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|