fixing ITG issues

MOHEMM-SFH-COLORS
enadhilal 4 years ago
parent d7d46a83f5
commit 3b5743a549

@ -119,21 +119,31 @@
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : approvalInfo.Action === 'Submit' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}"
<!-- <ion-label
[ngClass]="{'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'}"
class=""> {{approvalInfo.Action}}</ion-label> -->
<ion-label
[ngClass]="backgroundColor(approvalInfo.Action)"
class=""> {{approvalInfo.Action}}</ion-label>
<ion-label *ngIf="approvalInfo.Date != ''"
class="dateActionHistory">
{{returnDateTime(approvalInfo.Date) }} </ion-label>
</ion-col>
<ion-col size="4">
<img class="req_info" src="assets/imgs/req info.svg"
(click)="selectAtion('RequestInformation')" />
<img class="req_info deligate" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate')" />
<ion-grid>
<ion-row>
<ion-col size='5'>
<img class="req_info" src="assets/imgs/req info.svg"
(click)="selectAtion('RequestInformation')" />
</ion-col>
<ion-col size='2'></ion-col>
<ion-col size='5'>
<img class="req_info" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate')" />
</ion-col>
</ion-row>
</ion-grid>
</ion-col>
</ion-item>
</div>

@ -23,7 +23,7 @@
}
.footer-btn-img{
max-width: none;
width: 60px;
width: 50px;
}
.timeline-item{
margin: 0;

@ -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';
}
}
}

@ -1117,6 +1117,6 @@ export class WorklistMainComponent implements OnInit {
getMonthNameShort(lang,month) {
lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month];
};
}
}

Loading…
Cancel
Save