|
|
|
|
@ -105,8 +105,8 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length };
|
|
|
|
|
this.segmentsArray = [this.segmentsArray[1], this.segmentsArray[2], this.segmentsArray[0]];
|
|
|
|
|
this.segmentData = [this.segmentData[1], this.segmentData[0]];
|
|
|
|
|
// this.workList = this.request_details.WFHistory.reverse();
|
|
|
|
|
this.workList = this.request_details.WFHistory;
|
|
|
|
|
this.workList = this.request_details.WFHistory.reverse();
|
|
|
|
|
// this.workList = this.request_details.WFHistory;
|
|
|
|
|
this.options = this.request_details.AllowedActions;
|
|
|
|
|
this.activeSegment = this.segmentsArray[0].name;
|
|
|
|
|
for (let i = 0; i < this.options.length; i++) {
|
|
|
|
|
@ -283,21 +283,21 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
if (!comments) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
|
|
|
|
|
} else {
|
|
|
|
|
this.workListService.getITGActionRequest(request, url)
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
if (result.MessageStatus !== 1) {
|
|
|
|
|
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
|
|
|
|
|
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) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageSuccess = true;
|
|
|
|
|
this.common.sharedService.setSharedData(true, 'loadWorkList');
|
|
|
|
|
this.confirmMsg(2);
|
|
|
|
|
this.skip();
|
|
|
|
|
this.messageSuccess = false;
|
|
|
|
|
}, 2000);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (result.MessageStatus === 1) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageSuccess = true;
|
|
|
|
|
this.common.sharedService.setSharedData(true, 'loadWorkList');
|
|
|
|
|
this.confirmMsg(2);
|
|
|
|
|
this.skip();
|
|
|
|
|
this.messageSuccess = false;
|
|
|
|
|
}, 2000);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if (action === 3) {// request more info
|
|
|
|
|
request.NewUserEMPId = this.replcamentID;
|
|
|
|
|
@ -534,34 +534,47 @@ export class WorkListMainItgComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
returnDateTime(stringDate: string){
|
|
|
|
|
returnDateTime(stringDate: string) {
|
|
|
|
|
let allDateTime = stringDate.split(' ');
|
|
|
|
|
let time = allDateTime[1].split(':', 2);
|
|
|
|
|
let fullDate = this.transform(stringDate);
|
|
|
|
|
let dateArr= allDateTime[0].split('/')
|
|
|
|
|
let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2];
|
|
|
|
|
let fullDate = this.transform(correctDate);
|
|
|
|
|
return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
locale = {
|
|
|
|
|
en: {
|
|
|
|
|
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
|
|
|
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
|
|
|
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
|
|
|
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
transform(value: string) {
|
|
|
|
|
let x = new Date(Date.parse(value));
|
|
|
|
|
//return value.toLowerCase();
|
|
|
|
|
let month = this.getMonthNameShort('en',x.getMonth())
|
|
|
|
|
return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
|
|
|
|
|
let month = this.getMonthNameShort('en', x.getMonth())
|
|
|
|
|
return "" + x.getDate() + " " + month + " " + x.getFullYear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getMonthNameShort(lang,month) {
|
|
|
|
|
getMonthNameShort(lang, month) {
|
|
|
|
|
lang = lang && (lang in this.locale) ? lang : 'en';
|
|
|
|
|
return this.locale[lang].month_names_short[month];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
backgroundColor(statusName: string){
|
|
|
|
|
// {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}
|
|
|
|
|
switch (statusName) {
|
|
|
|
|
case 'Submit':
|
|
|
|
|
return 'bg-blue-txt';
|
|
|
|
|
case 'Pending':
|
|
|
|
|
return 'bg-orange-txt';
|
|
|
|
|
case 'Not Doable' || 'Rejected':
|
|
|
|
|
return 'bg-red-txt';
|
|
|
|
|
default:
|
|
|
|
|
return 'bg-green-txt';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|