|
|
|
|
@ -221,6 +221,7 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
actionService(action, comments?, grantRequests?) {
|
|
|
|
|
|
|
|
|
|
let url: string;
|
|
|
|
|
let request = new itgRequest();
|
|
|
|
|
request.RequestType = this.request_name;
|
|
|
|
|
@ -236,17 +237,35 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
url = WorkListMainItgComponent.APPROVAL;
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
|
|
|
|
|
} else if (result.MessageStatus == 1) {
|
|
|
|
|
console.log("hello action 1");
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(1)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (action == 2) {//reject
|
|
|
|
|
url = WorkListMainItgComponent.REJECT;
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log("hello action 2");
|
|
|
|
|
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
|
|
|
|
|
} else if (result.MessageStatus == 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(2)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (action == 3) {//request more info
|
|
|
|
|
request.NewUserEMPId = this.replcamentID;
|
|
|
|
|
@ -257,9 +276,20 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
request.Comments = comments;
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
this.confirmMsg(3)
|
|
|
|
|
console.log("hello action 3");
|
|
|
|
|
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
//this.common.presentAlert(result.Message);
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.MessageStatus == 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(3)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if (action == 4) {//delegate
|
|
|
|
|
@ -267,9 +297,18 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
url = WorkListMainItgComponent.DELEGATE;
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log("hello action 4");
|
|
|
|
|
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
|
|
|
|
|
} else if (result.MessageStatus == 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(4)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (action == 5) { //answer
|
|
|
|
|
url = WorkListMainItgComponent.ANSWER;
|
|
|
|
|
@ -278,9 +317,18 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
} else {
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log("hello action 5");
|
|
|
|
|
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
|
|
|
|
|
} else if (result.MessageStatus == 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(5)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if (action == 6) { //grant
|
|
|
|
|
@ -293,9 +341,17 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
request.AdditionalFields = this.grantRequest;
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log("hello action 6");
|
|
|
|
|
if (result.MessageStatus != 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
|
|
|
|
|
} else if (result.MessageStatus == 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
|
|
|
|
|
|
|
|
|
|
this.confirmMsg(6)
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
this.skip();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
|
|
|
|
|
@ -315,6 +371,7 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
confirmMsg(action) {
|
|
|
|
|
console.log("confirmMsg");
|
|
|
|
|
if (action === 1) {
|
|
|
|
|
return this.ts.trPK('worklist', 'approveMsg');
|
|
|
|
|
}
|
|
|
|
|
|