|
|
|
@ -26,6 +26,8 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
public request_info: any;
|
|
|
|
public request_info: any;
|
|
|
|
public request_name: any;
|
|
|
|
public request_name: any;
|
|
|
|
public all_request: any;
|
|
|
|
public all_request: any;
|
|
|
|
|
|
|
|
public all_request_names: any;
|
|
|
|
|
|
|
|
public is_all_items_sents: any;
|
|
|
|
public request = new itgRequest();
|
|
|
|
public request = new itgRequest();
|
|
|
|
public activeSegment: any = "info";
|
|
|
|
public activeSegment: any = "info";
|
|
|
|
public request_details: any;
|
|
|
|
public request_details: any;
|
|
|
|
@ -49,6 +51,7 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
public ExchangeServerSelected: any;
|
|
|
|
public ExchangeServerSelected: any;
|
|
|
|
public ExchangeServerDBSelected: any;
|
|
|
|
public ExchangeServerDBSelected: any;
|
|
|
|
public actionBTN: { name: string, image: string, isAvailable: boolean }[] = [];
|
|
|
|
public actionBTN: { name: string, image: string, isAvailable: boolean }[] = [];
|
|
|
|
|
|
|
|
index2: number;
|
|
|
|
constructor(
|
|
|
|
constructor(
|
|
|
|
public common: CommonService,
|
|
|
|
public common: CommonService,
|
|
|
|
public ts: TranslatorService,
|
|
|
|
public ts: TranslatorService,
|
|
|
|
@ -59,6 +62,8 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO);
|
|
|
|
this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO);
|
|
|
|
this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME);
|
|
|
|
this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME);
|
|
|
|
this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST);
|
|
|
|
this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST);
|
|
|
|
|
|
|
|
this.all_request_names = this.common.sharedService.getSharedData(HomeComponent.NAMES_ALL_iTEMS);
|
|
|
|
|
|
|
|
this.is_all_items_sents = this.common.sharedService.getSharedData(HomeComponent.IS_ALL_NAME);
|
|
|
|
this.all_request = this.all_request[0];
|
|
|
|
this.all_request = this.all_request[0];
|
|
|
|
this.changeITGForm(this.request_info, this.request_name);
|
|
|
|
this.changeITGForm(this.request_info, this.request_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -76,10 +81,9 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
|
|
|
|
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
|
|
|
|
this.request_details = result.ITGRequest;
|
|
|
|
this.request_details = result.ITGRequest;
|
|
|
|
this.grantInfo = result.ITGRequest.GrantFields;
|
|
|
|
this.grantInfo = result.ITGRequest.GrantFields;
|
|
|
|
let count = 0;
|
|
|
|
|
|
|
|
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
|
|
|
|
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
|
|
|
|
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i };
|
|
|
|
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i };
|
|
|
|
this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields}
|
|
|
|
this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length }
|
|
|
|
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length }
|
|
|
|
this.workList = this.request_details.WFHistory;
|
|
|
|
this.workList = this.request_details.WFHistory;
|
|
|
|
@ -87,7 +91,9 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
this.activeSegment = this.segmentsArray[0].name;
|
|
|
|
this.activeSegment = this.segmentsArray[0].name;
|
|
|
|
for (let i = 0; i < this.options.length; i++) {
|
|
|
|
for (let i = 0; i < this.options.length; i++) {
|
|
|
|
this.imageURL(this.options[i].Action);
|
|
|
|
this.imageURL(this.options[i].Action);
|
|
|
|
this.actionBTN[i] = { name: this.options[i].Action, image: this.imageURL(this.options[i].Action), isAvailable: this.options[i].IsAvailable }
|
|
|
|
this.actionBTN[i] = {
|
|
|
|
|
|
|
|
name: this.options[i].Action, image: this.imageURL(this.options[i].Action), isAvailable: this.options[i].IsAvailable
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.grantInfo) {
|
|
|
|
if (this.grantInfo) {
|
|
|
|
@ -134,20 +140,44 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
skip() {
|
|
|
|
skip() {
|
|
|
|
|
|
|
|
if (this.is_all_items_sents) {
|
|
|
|
|
|
|
|
for (let i = 1; i < this.all_request_names.length; i++) {
|
|
|
|
|
|
|
|
for (let j = 0; j < this.all_request_names[i].data.length; j++) {
|
|
|
|
|
|
|
|
if (this.request_info.ID === this.all_request_names[i].data[j].ID
|
|
|
|
|
|
|
|
&& this.request_info.ItemID === this.all_request_names[i].data[j].ItemID) {
|
|
|
|
|
|
|
|
this.index2 = j + 1;
|
|
|
|
|
|
|
|
this.index = i + 1;
|
|
|
|
|
|
|
|
if (this.all_request_names[i].data.length !== this.index2) {// if there is another request with same type
|
|
|
|
|
|
|
|
this.clearDataArray();
|
|
|
|
|
|
|
|
this.changeITGForm(this.all_request_names[i].data[this.index2], this.all_request_names[i].code);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
} else if (this.index !== this.all_request_names.length) { // if there is another deffernet type.
|
|
|
|
|
|
|
|
this.clearDataArray();
|
|
|
|
|
|
|
|
this.changeITGForm(this.all_request_names[this.index].data[j], this.all_request_names[this.index].code);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (this.index === this.all_request_names.length) { //if its the end request redirecte to worklist home
|
|
|
|
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
|
|
|
|
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
|
|
|
|
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
|
|
|
|
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
|
|
|
|
this.index = i + 1;
|
|
|
|
this.index = i + 1;
|
|
|
|
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
|
|
|
|
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
|
|
|
|
this.clearDataArray();
|
|
|
|
this.clearDataArray();
|
|
|
|
this.changeITGForm(this.all_request[this.index], this.request_name);
|
|
|
|
this.changeITGForm(this.all_request[this.index], this.request_name);
|
|
|
|
break;
|
|
|
|
break
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
break;
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
break;
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|