|
|
|
|
@ -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;
|
|
|
|
|
@ -69,17 +72,17 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
};
|
|
|
|
|
public data = {
|
|
|
|
|
datasets: [
|
|
|
|
|
{
|
|
|
|
|
data: [0, 0, 0, 0, 0],
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
'#18a169',
|
|
|
|
|
'#38c9b3',
|
|
|
|
|
'#114475',
|
|
|
|
|
'#3cb9d5',
|
|
|
|
|
'#cc3232'
|
|
|
|
|
],
|
|
|
|
|
borderWidth: 5
|
|
|
|
|
}]
|
|
|
|
|
{
|
|
|
|
|
data: [0, 0, 0, 0, 0],
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
'#18a169',
|
|
|
|
|
'#38c9b3',
|
|
|
|
|
'#114475',
|
|
|
|
|
'#3cb9d5',
|
|
|
|
|
'#cc3232'
|
|
|
|
|
],
|
|
|
|
|
borderWidth: 5
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
public filters = [
|
|
|
|
|
{
|
|
|
|
|
@ -136,20 +139,20 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
spaceBetween: 10
|
|
|
|
|
};
|
|
|
|
|
constructor(
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public WorklistService: WorklistService,
|
|
|
|
|
public workListService: WorklistMainService,
|
|
|
|
|
public modalController: ModalController
|
|
|
|
|
) {
|
|
|
|
|
this.WorkListObj = new WorkListRequest();
|
|
|
|
|
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 0;
|
|
|
|
|
this.WorkListObj.P_PAGE_LIMIT = 50;
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public WorklistService: WorklistService,
|
|
|
|
|
public workListService: WorklistMainService,
|
|
|
|
|
public modalController: ModalController
|
|
|
|
|
) {
|
|
|
|
|
this.WorkListObj = new WorkListRequest();
|
|
|
|
|
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 0;
|
|
|
|
|
this.WorkListObj.P_PAGE_LIMIT = 50;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
@ -167,21 +170,21 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
|
|
|
|
|
for (const notification of openNotificationsArray) {
|
|
|
|
|
if (notification.ITEM_TYPE === 'HRSSA') {
|
|
|
|
|
this.filters[1].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.filters[1].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
} else if (notification.ITEM_TYPE === 'POAPPRV') {
|
|
|
|
|
this.filters[2].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.filters[2].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
|
|
|
|
|
this.filters[3].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.filters[3].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
} else if (notification.ITEM_TYPE === 'INVMOA') {
|
|
|
|
|
this.filters[4].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.filters[4].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
} else if (notification.ITEM_TYPE === 'ITG') {
|
|
|
|
|
this.filters[5].value = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -195,10 +198,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.filters[this.previousActiveIndex].active = false;
|
|
|
|
|
this.filters[this.currentActiveIndex].active = true;
|
|
|
|
|
if (this.filters[this.currentActiveIndex].value !== 0) {
|
|
|
|
|
const selectedKey = this.filters[this.currentActiveIndex].key;
|
|
|
|
|
this.resetData();
|
|
|
|
|
this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : '';
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
const selectedKey = this.filters[this.currentActiveIndex].key;
|
|
|
|
|
this.resetData();
|
|
|
|
|
this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : '';
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
}
|
|
|
|
|
this.selectedFilter = this.filters[this.currentActiveIndex].key;
|
|
|
|
|
}
|
|
|
|
|
@ -211,15 +214,15 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
disableFilters() {
|
|
|
|
|
for (const filter of this.filters) {
|
|
|
|
|
if (filter.key === this.itemType) {
|
|
|
|
|
filter.disable = false;
|
|
|
|
|
filter.active = true;
|
|
|
|
|
this.selectedFilter = filter.name;
|
|
|
|
|
filter.disable = false;
|
|
|
|
|
filter.active = true;
|
|
|
|
|
this.selectedFilter = filter.name;
|
|
|
|
|
} else if (this.itemType === '') {
|
|
|
|
|
filter.disable = false;
|
|
|
|
|
filter.active = false;
|
|
|
|
|
} else {
|
|
|
|
|
filter.disable = true;
|
|
|
|
|
filter.active = false;
|
|
|
|
|
filter.disable = true;
|
|
|
|
|
filter.active = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.itemType === '') {
|
|
|
|
|
@ -237,24 +240,24 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
modal.onDidDismiss().then(result => {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
|
|
|
|
|
this.showSearchButton = true;
|
|
|
|
|
this.itemType = result.data.itemType;
|
|
|
|
|
this.notificationType = result.data.notificationType;
|
|
|
|
|
this.selectedValue = result.data.selectedValue;
|
|
|
|
|
this.inputDate = result.data.inputDate;
|
|
|
|
|
this.inputSearch = result.data.inputSearch;
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 1;
|
|
|
|
|
this.newWorkListResponse = [];
|
|
|
|
|
this.showFormattedData = {};
|
|
|
|
|
this.selectedFilter = 'ALL';
|
|
|
|
|
this.filters[this.currentActiveIndex].active = false;
|
|
|
|
|
this.currentActiveIndex = 0;
|
|
|
|
|
this.previousActiveIndex = 0;
|
|
|
|
|
this.filters[this.currentActiveIndex].active = true;
|
|
|
|
|
if (this.itemType !== '') {
|
|
|
|
|
this.disableFilters();
|
|
|
|
|
}
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
this.showSearchButton = true;
|
|
|
|
|
this.itemType = result.data.itemType;
|
|
|
|
|
this.notificationType = result.data.notificationType;
|
|
|
|
|
this.selectedValue = result.data.selectedValue;
|
|
|
|
|
this.inputDate = result.data.inputDate;
|
|
|
|
|
this.inputSearch = result.data.inputSearch;
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 1;
|
|
|
|
|
this.newWorkListResponse = [];
|
|
|
|
|
this.showFormattedData = {};
|
|
|
|
|
this.selectedFilter = 'ALL';
|
|
|
|
|
this.filters[this.currentActiveIndex].active = false;
|
|
|
|
|
this.currentActiveIndex = 0;
|
|
|
|
|
this.previousActiveIndex = 0;
|
|
|
|
|
this.filters[this.currentActiveIndex].active = true;
|
|
|
|
|
if (this.itemType !== '') {
|
|
|
|
|
this.disableFilters();
|
|
|
|
|
}
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -262,48 +265,48 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAllPushNotificationFun() {
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 1;
|
|
|
|
|
this.isReachEnd = false;
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
|
|
|
|
|
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_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
|
|
|
|
|
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
|
|
|
|
|
if (this.selectedValue === '5') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
}
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 1;
|
|
|
|
|
this.isReachEnd = false;
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
|
|
|
|
|
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_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
|
|
|
|
|
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
|
|
|
|
|
if (this.selectedValue === '5') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleWorkListResult(result.GetWorkList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleWorkListResult(result.GetWorkList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
categorizeData(arrayToCategorize: any) {
|
|
|
|
|
const datePipe = new DatePipe('en-US');
|
|
|
|
|
const formattedData = {};
|
|
|
|
|
for (const workList of arrayToCategorize) {
|
|
|
|
|
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
|
|
|
|
|
if (!(workList.FORMATTED_DATE in formattedData)) {
|
|
|
|
|
formattedData[workList.FORMATTED_DATE] = new Array();
|
|
|
|
|
formattedData[workList.FORMATTED_DATE].push(workList);
|
|
|
|
|
} else {
|
|
|
|
|
formattedData[workList.FORMATTED_DATE].push(workList);
|
|
|
|
|
}
|
|
|
|
|
const datePipe = new DatePipe('en-US');
|
|
|
|
|
const formattedData = {};
|
|
|
|
|
for (const workList of arrayToCategorize) {
|
|
|
|
|
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
|
|
|
|
|
if (!(workList.FORMATTED_DATE in formattedData)) {
|
|
|
|
|
formattedData[workList.FORMATTED_DATE] = new Array();
|
|
|
|
|
formattedData[workList.FORMATTED_DATE].push(workList);
|
|
|
|
|
} else {
|
|
|
|
|
formattedData[workList.FORMATTED_DATE].push(workList);
|
|
|
|
|
}
|
|
|
|
|
return formattedData;
|
|
|
|
|
}
|
|
|
|
|
return formattedData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sortArray(arrayToSort: any) {
|
|
|
|
|
return arrayToSort.sort((a: any, b: any) =>
|
|
|
|
|
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
|
|
|
|
|
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -340,16 +343,16 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openNotificationDetail(obj) {
|
|
|
|
|
this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA);
|
|
|
|
|
if (obj.REQUEST_TYPE === 'PR') {
|
|
|
|
|
this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA);
|
|
|
|
|
if (obj.REQUEST_TYPE === 'PR') {
|
|
|
|
|
this.common.openWorklistMainPRPage();
|
|
|
|
|
} else if (obj[0].REQUEST_TYPE === 'PO') {
|
|
|
|
|
this.common.openWorklistMainPOPage();
|
|
|
|
|
} else if (obj[0].REQUEST_TYPE === 'MO') {
|
|
|
|
|
this.common.openWorklistMainMRPage();
|
|
|
|
|
} else {
|
|
|
|
|
this.common.openWorklistMainPage();
|
|
|
|
|
}
|
|
|
|
|
} else if (obj[0].REQUEST_TYPE === 'PO') {
|
|
|
|
|
this.common.openWorklistMainPOPage();
|
|
|
|
|
} else if (obj[0].REQUEST_TYPE === 'MO') {
|
|
|
|
|
this.common.openWorklistMainMRPage();
|
|
|
|
|
} else {
|
|
|
|
|
this.common.openWorklistMainPage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isEmptyObject() {
|
|
|
|
|
@ -382,54 +385,66 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doInfinite(infiniteScroll) {
|
|
|
|
|
if (!this.isReachEnd && this.selectedFilter !== 'ITG') {
|
|
|
|
|
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleWorkListResult(result.GetWorkList);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if (this.infiniteScroll) {
|
|
|
|
|
this.infiniteScroll.complete();
|
|
|
|
|
if (!this.isReachEnd && this.selectedFilter !== 'ITG') {
|
|
|
|
|
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleWorkListResult(result.GetWorkList);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if (this.infiniteScroll) {
|
|
|
|
|
this.infiniteScroll.complete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Count() {
|
|
|
|
|
this.workListService.getITGCount()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
for (let i = 0; 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
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
this.setActive(this.ITGSegment[0].code);
|
|
|
|
|
});
|
|
|
|
|
let datas =[];
|
|
|
|
|
let names =[];
|
|
|
|
|
this.ITGSegment[0] = {
|
|
|
|
|
name: 'All',
|
|
|
|
|
code: 'All',
|
|
|
|
|
data: null,
|
|
|
|
|
style: false
|
|
|
|
|
};
|
|
|
|
|
this.workListService.getITGCount()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Details() {
|
|
|
|
|
this.workListService.getITGDetails()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
this.filters[5].value = result.TotalCount;
|
|
|
|
|
});
|
|
|
|
|
this.workListService.getITGDetails()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
this.filters[5].value = result.TotalCount;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ITGNotification() {
|
|
|
|
|
// this.Details();
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = true;
|
|
|
|
|
// this.Details();
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchBtn() {
|
|
|
|
|
this.isSearch = !this.isSearch;
|
|
|
|
|
this.isSearch = !this.isSearch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setActive(selectedSegment) {
|
|
|
|
|
@ -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) {
|
|
|
|
|
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.activeSegment, HomeComponent.REQUSET_NAME);
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|