worklist changes

MOHEMM-Q3-DEV-LATEST
Sultan Khan 5 years ago
parent 7881d3db33
commit 821f1ea696

@ -13,7 +13,7 @@
<ion-content padding>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div>
<ion-item lines="none">
<!-- <ion-item lines="none">
<ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchKeySelect">
@ -28,8 +28,45 @@
<ion-button style="width: 19%;" button-type="clear" (click)="SearchReplacementList()">
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-item>
</ion-item> -->
<ion-list>
<ion-list-header>
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
</ion-list-header>
<ion-radio-group [(ngModel)]="searchKeySelect">
<ion-row>
<ion-col class="center">
<ion-radio value="1" checked></ion-radio>
<ion-label class="radio-label">{{'addAttach, name' | translate}}</ion-label>
</ion-col>
<ion-col>
<ion-radio value="2" ></ion-radio>
<ion-label class="radio-label">{{'login, username' | translate}}</ion-label>
</ion-col>
<ion-col>
<ion-radio value="3" ></ion-radio>
<ion-label class="radio-label">{{'general, email' | translate}}</ion-label>
</ion-col>
</ion-row>
</ion-radio-group>
<ion-item lines="none">
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input>
</ion-item>
</ion-list>
<!-- <ion-item>
<ion-list [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
@ -40,7 +77,7 @@
</ion-list>
</ion-item> -->
<ion-list>
<!-- <ion-list>
<ion-radio-group mode="md" [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
@ -48,8 +85,47 @@
<ion-radio value="{{i}}"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</ion-list> -->
<div *ngIf="ReplacementList.length>0" class="uk-margin">
{{'replacementRoll, search-result' | translate}}
</div>
<br/>
<ion-item lines="none">
<div class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} -->
</ion-label>
<div class='star-fav'>
<img src="assets/imgs/fav.svg" />
</div>
</div>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</div>
</ion-item>
</ion-content>
<ion-footer>

@ -0,0 +1,60 @@
.disabledButton{
opacity:.5;
}
.radio-label{
margin: 4px;
position: relative;
bottom: 4px;
}
ion-radio{
--color-checked: #269db8;
}
.center{text-align: center;}
.boldTxtNav{
font-weight: bold;
}
.employee-details{
display:inline-block;
margin: 10px;
}
.empImgeRep{
display: inline-block;
height: 40px;
width: 40px;
}
.star-fav{
float: right;
margin: 15px;
}
.uk-margin{margin: 15px 0px 0px 15px;
font-weight: bold;
clear: both;
position: relative;
top: 10px;}
.uk-padding{ padding: 20px;}
.uk-padding .employee-details{
bottom: 10px;
position: relative;}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterInput-ar{
border: solid var(--gray) 1px;
border-radius: 21px;
--padding-start: 10px !important;
}
.square-container{
width:100%;
clear: both;
}
.square{
clear: both;
}

@ -22,17 +22,18 @@ export class WorkListReplacementItgComponent implements OnInit {
selEmp: string = null;
callback: any;
searchKey: any = "";
searchKeySelect: string = "";
searchKeySelect: string = "1";
replacmentRequest: any = "";
isAbs: boolean = false;
isSave: boolean = false;
constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService,
public cs: CommonService,
isSelect: boolean = false;
typingTimer: any;
constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService,
public cs: CommonService,
public modalController: ModalController) { }
ngOnInit() {}
ngOnInit() { }
SearchReplacementList() {
this.ReplacementList = [];
@ -114,7 +115,7 @@ export class WorkListReplacementItgComponent implements OnInit {
let data: any = null;
if (this.isSave == true) {
if (this.selEmp) {
data = this.ReplacementList[this.selEmp];
data = this.selEmp;
} else {
data = null;
}
@ -128,4 +129,37 @@ export class WorkListReplacementItgComponent implements OnInit {
});
}
}
onChangeSelect(select) {
console.log(select.detail.value);
let selectValue = select.detail.value;
if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
this.isSelect = true;
}
else {
this.isSelect = false;
}
}
getPlaceHolder() {
return this.searchKeySelect == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchKeySelect == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail');
}
onChangeInput() {
this.ReplacementList = [];
clearTimeout(this.typingTimer);
this.typingTimer = setTimeout(() => {
if (this.searchKey.length > 2) {
this.SearchReplacementList();
}
}, 3000);
}
select(selectEmp, index) {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp = selectEmp
// this.active = index;
// this.userSelected = true;
this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.NAME;
this.closePage();
}
}

@ -59,7 +59,7 @@
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<div [hidden]="isAnswer==true" *ngIf="actionHistory.length >0 && !userSelected">
<div [hidden]="isAnswer==true" *ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0">
<div class="uk-margin">
{{'replacementRoll, related' | translate}}
</div>
@ -84,7 +84,7 @@
</div>
<br/>
<div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length> 0 && !userSelected">
<div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}}
</div>

@ -167,6 +167,9 @@ ion-radio{
.employee-details{
display:inline-block;
margin: 10px;
text-overflow: ellipsis;
white-space: nowrap;
width: 70%;
}
.empImgeRep{
display: inline-block;

@ -437,89 +437,79 @@
<ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent" style="width: 100% !important;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<!-- <div>
<button ion-button
(click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)"
[hidden]="actionHistory.NOTE == '' || actionHistory.NOTE == null"
style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png">
</button>
</div> -->
<div
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png">
</div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;"> {{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore" (click)="actionHistory.visible = !actionHistory.visible">{{
actionHistory.visible ? 'Show less': 'Show More' }}</button>
<ion-card class="cardContent" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col size="8">
<ion-label class="name">
{{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote"
[ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''"
class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<ion-col size="4">
<img class="req_info" src="assets/imgs/req info.svg" (click)="openRequestInfoDel(actionHistory, 'REQUEST_INFO')" />
<img class="req_info" src="assets/imgs/delegate.svg" (click)="openRequestInfoDel(actionHistory, 'DELEGATE')"/>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</div>
<!-- [ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Rejected','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}" -->
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''" class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
</ion-item>
</ion-list>
</div>
</ion-list>
</div>
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()"> {{ 'general,
load-more' | translate}}
</button>
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">
{{ 'general, load-more' | translate}}
</button>
</ion-card-content>
</ion-card-content>
</ion-card>
<!-- </ion-slide> -->
</ng-container>
</ion-slide>
</ng-container> </ion-slide>
<ion-slide>
<ng-container *ngIf="activeSegment === 'attach'">

@ -1,110 +1,3 @@
// .itemHISBtn{
// padding: 5px;
// color: var(--light);
// background: var(--darkgray);
// border-radius: 3px;
// width: 85%;
// height: 40px;
// }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 15px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }
.no-padding-label {
padding: 0px !important;
}
@ -139,4 +32,18 @@
.action-btn {
white-space: nowrap;
font-size: 10px;
}
.req_info{
width: 25px;
height: 25px;
display: inline-block;
margin: 5px;
}
.name{
color:black !important ;font-weight: bold;
}
.timeline-item{
margin: 0;
white-space: nowrap;
font-size: 10px;
}

@ -112,9 +112,9 @@ export class WorklistMainMRComponent implements OnInit {
public isPostNoLoad = true;
public worklistNotifications: any;
public totalRequestCount = 0;
approve_label: any ="";
reject_label: any="";
reqInfo_label: any="";
approve_label: any = "";
reject_label: any = "";
reqInfo_label: any = "";
close_label: any;
closeDis: boolean = false;
selectedFilter: string;
@ -142,47 +142,39 @@ export class WorklistMainMRComponent implements OnInit {
ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail();
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if(this.activeSegment === 'info')
{
this.slides.slideTo(0);
}
else if(this.activeSegment === 'item-req')
{
this.slides.slideTo(1);
}
else if(this.activeSegment === 'action-history')
{
this.slides.slideTo(2);
}
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(3);
}
if (this.activeSegment === 'info') {
this.slides.slideTo(0);
}
else if (this.activeSegment === 'item-req') {
this.slides.slideTo(1);
}
else if (this.activeSegment === 'action-history') {
this.slides.slideTo(2);
}
else if (this.activeSegment === 'attach') {
this.slides.slideTo(3);
}
}
public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
if(index === 0)
{
if (index === 0) {
this.activeSegment = 'info';
}
else if(index === 1)
{
else if (index === 1) {
this.activeSegment = 'item-req';
}
else if(index === 2)
{
else if (index === 2) {
this.activeSegment = 'action-history';
}
else if(index === 3)
{
else if (index === 3) {
this.activeSegment = 'attach';
}
});
@ -316,7 +308,7 @@ export class WorklistMainMRComponent implements OnInit {
getNotificationButtons(notificationButtonsObj) {
this.notificationButtonRes=[];
this.notificationButtonRes = [];
this.worklistMainService
.getNotificationButtons(notificationButtonsObj)
.subscribe((result: NotificatonButtonResponse) => {
@ -332,31 +324,30 @@ export class WorklistMainMRComponent implements OnInit {
this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore');
// console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED" ) {
this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.requestDis = true;
} // if result == null
else if // if result == null
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
else if(
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE")
{
this.moreDisabled = false;
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
this.moreDisabled = false;
}
}
} // valid it
@ -413,10 +404,10 @@ export class WorklistMainMRComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
if( document.getElementById("notificationDynamicFieldsMR") != null){
if (document.getElementById("notificationDynamicFieldsMR") != null) {
document.getElementById("notificationDynamicFieldsMR").innerHTML = "";
}
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
@ -438,23 +429,23 @@ export class WorklistMainMRComponent implements OnInit {
}
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
checkRequestType(index) {
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
this.intializeNotificationDetail();
} else {
this.common.openWorklistMainPage();
}
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
this.intializeNotificationDetail();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) {
// console.log('actionButton' + action);
// alert("don't forget");
// alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject;
@ -514,7 +505,7 @@ export class WorklistMainMRComponent implements OnInit {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
}
// this.openApplyModal(this.WorkListActionObj);
// this.openApplyModal(this.WorkListActionObj);
this.common.confirmAlertDialogAction(
() => {
@ -682,7 +673,7 @@ export class WorklistMainMRComponent implements OnInit {
getNotificationResAttr(notificationButtonsObj) {
// console.log("getNotificationResAttr");
this.NotRespondAttributeList=[];
this.NotRespondAttributeList = [];
this.worklistMainService
.notificationResponseAttr(notificationButtonsObj)
.subscribe((result: NotificatonButtonResponse) => {
@ -779,7 +770,7 @@ export class WorklistMainMRComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) {
this.attachmentRes=[];
this.attachmentRes = [];
this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
@ -797,7 +788,7 @@ export class WorklistMainMRComponent implements OnInit {
getActionHistory(WorkListActionHistoryObj) {
this.IsReachEnd = true;
this.actionHistoryRes=[];
this.actionHistoryRes = [];
this.worklistService.getActionHistory(WorkListActionHistoryObj).
subscribe((result: WorkListActionHistoryResponse) => {
this.handleWorkListActionHistoryResult(result);
@ -1105,7 +1096,7 @@ export class WorklistMainMRComponent implements OnInit {
async openReplacementRoll() {
this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
@ -1118,13 +1109,13 @@ export class WorklistMainMRComponent implements OnInit {
if (data.data.data == 'cancel' || data.data.data == undefined) {
return;
} else if (data.data.data == 'Success') {
} else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
}
@ -1170,17 +1161,17 @@ export class WorklistMainMRComponent implements OnInit {
}
getMOItemHistory(itemID ,orgID) {
getMOItemHistory(itemID, orgID) {
// console.log(itemID);
this.IsReachEnd = false;
const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID);
request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM = 1;
request.P_ORG_ID= parseInt(orgID);
request.P_ORG_ID = parseInt(orgID);
this.worklistMainService.getMOItemHistory(request).
subscribe((result: MOItemHistoryRes) => {
// this.common.sharedService.setSharedData(
@ -1222,6 +1213,10 @@ export class WorklistMainMRComponent implements OnInit {
}
});
}
openRequestInfoDel(userData, flag) {
this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
this.actionButton(flag);
}
}

@ -170,6 +170,81 @@
<ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col size="8">
<ion-label class="name">
{{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote"
[ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''"
class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<ion-col size="4">
<img class="req_info" src="assets/imgs/req info.svg" (click)="openRequestInfoDel(actionHistory, 'REQUEST_INFO')" />
<img class="req_info" src="assets/imgs/delegate.svg" (click)="openRequestInfoDel(actionHistory, 'DELEGATE')"/>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">
{{ 'general, load-more' | translate}}
</button>
</ion-card-content>
</ion-card>
</ng-container>
<!-- <ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent" style="width: 100% i !important;">
<ion-card-content>
@ -243,7 +318,7 @@
</ion-card-content>
</ion-card>
</ng-container>
</ng-container> -->
</ion-slide>
<ion-slide>

@ -1,112 +1,3 @@
// .itemHISBtn{
// padding: 5px;
// color: var(--light);
// background: var(--darkgray);
// border-radius: 3px;
// width: 85%;
// height: 40px;
// }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 16px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }
.no-padding-label {
padding: 0px !important;
@ -141,4 +32,19 @@
.action-btn {
white-space: nowrap;
font-size: 10px;
}
}
.name{
color:black !important ;font-weight: bold;
}
.timeline-item{
margin: 0;
white-space: nowrap;
font-size: 10px;
}
.req_info{
width: 25px;
height: 25px;
display: inline-block;
margin: 5px;
}

@ -129,7 +129,7 @@ export class WorklistMainPoComponent implements OnInit {
reqInfo_label: any;
closeDis: boolean = false;
selectedFilter: string;
;
;
close_label: any;
constructor(
@ -449,11 +449,11 @@ export class WorklistMainPoComponent implements OnInit {
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.activeSegment = 'line_details';
if(this.selectedFilter === 'ALL'){
this.checkRequestType(index);
if (this.selectedFilter === 'ALL') {
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
}else {
} else {
this.common.openNotificationPage();
}
} else {
@ -462,7 +462,7 @@ export class WorklistMainPoComponent implements OnInit {
}
checkRequestType(index){
checkRequestType(index) {
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.intializeNotificationDetail();
} else
@ -1170,7 +1170,7 @@ export class WorklistMainPoComponent implements OnInit {
async openRepRolModal() {
this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
@ -1245,5 +1245,8 @@ export class WorklistMainPoComponent implements OnInit {
});
}
openRequestInfoDel(userData, flag) {
this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
this.actionButton(flag);
}
}

@ -199,44 +199,50 @@
<ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent" style="width: 100% i !important;">
<ion-card class="cardContent" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes; let index=index">
<div class="timeline-item" slot="start">
<div
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png">
</div>
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;">
<ion-col size="8">
<ion-label class="name">
{{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE">
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote"
[ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{
actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote"
[ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
</div>
<ion-label
@ -248,16 +254,25 @@
class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<ion-col size="4">
<img class="req_info" src="assets/imgs/req info.svg" (click)="openRequestInfoDel(actionHistory, 'REQUEST_INFO')" />
<img class="req_info" src="assets/imgs/delegate.svg" (click)="openRequestInfoDel(actionHistory, 'DELEGATE')"/>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">
{{ 'general, load-more' | translate}} </button>
{{ 'general, load-more' | translate}}
</button>
</ion-card-content>
</ion-card>
</ng-container>
</ion-slide>
</ng-container> </ion-slide>
<ion-slide>
<ng-container *ngIf="activeSegment === 'attach'">

@ -1,109 +1,3 @@
// .itemHISBtn{
// padding: 5px;
// color: var(--light);
// background: var(--darkgray);
// border-radius: 3px;
// width: 85%;
// height: 40px;
// }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 16px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }
.no-padding-label {
padding: 0px !important;
@ -139,4 +33,19 @@
// white-space: pre-wrap;
white-space: nowrap;
font-size: 10px;
}
}
.name{
color:black !important ;font-weight: bold;
}
.timeline-item{
margin: 0;
white-space: nowrap;
font-size: 10px;
}
.req_info{
width: 25px;
height: 25px;
display: inline-block;
margin: 5px;
}

@ -146,22 +146,18 @@ export class WorklistMainPRComponent implements OnInit {
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if(this.activeSegment === 'info')
{
this.slides.slideTo(0);
}
else if(this.activeSegment === 'item-req')
{
this.slides.slideTo(1);
}
else if(this.activeSegment === 'action-history')
{
this.slides.slideTo(2);
}
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(3);
}
if (this.activeSegment === 'info') {
this.slides.slideTo(0);
}
else if (this.activeSegment === 'item-req') {
this.slides.slideTo(1);
}
else if (this.activeSegment === 'action-history') {
this.slides.slideTo(2);
}
else if (this.activeSegment === 'attach') {
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value);
}
@ -169,20 +165,16 @@ export class WorklistMainPRComponent implements OnInit {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
if(index === 0)
{
if (index === 0) {
this.activeSegment = 'info';
}
else if(index === 1)
{
else if (index === 1) {
this.activeSegment = 'item-req';
}
else if(index === 2)
{
else if (index === 2) {
this.activeSegment = 'action-history';
}
else if(index === 3)
{
else if (index === 3) {
this.activeSegment = 'attach';
}
console.log(this.activeSegment);
@ -194,7 +186,7 @@ export class WorklistMainPRComponent implements OnInit {
this.approveDis = false;
this.rejectDis = false;
this.requestDis = false;
this.closeDis =false;
this.closeDis = false;
this.moreDisabled = true;
if (this.messageSuccess) {
@ -362,29 +354,28 @@ export class WorklistMainPRComponent implements OnInit {
console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == 'APPROVE') {
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REJECT') {
this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.requestDis = true;
} // if result == null
else if // if result == null
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE")
{
this.moreDisabled = false;
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
this.moreDisabled = false;
}
}
} // valid it
}
} // valid it
@ -438,11 +429,11 @@ export class WorklistMainPRComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
if( document.getElementById("notificationDynamicFieldsPR") != null){
if (document.getElementById("notificationDynamicFieldsPR") != null) {
document.getElementById("notificationDynamicFieldsPR").innerHTML = "";
}
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
@ -454,31 +445,31 @@ export class WorklistMainPRComponent implements OnInit {
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.activeSegment = 'info';
if(this.selectedFilter === 'ALL'){
if (this.selectedFilter === 'ALL') {
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.openNotificationPage();
}
} else {
this.common.openNotificationPage();
}
} else {
this.common.openNotificationPage();
}
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
checkRequestType(index) {
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
this.intializeNotificationDetail();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
this.intializeNotificationDetail();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) {
@ -755,7 +746,7 @@ export class WorklistMainPRComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', '');
console.log(this.textArea );
console.log(this.textArea);
} else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
@ -1104,7 +1095,7 @@ export class WorklistMainPRComponent implements OnInit {
this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
@ -1176,5 +1167,8 @@ export class WorklistMainPRComponent implements OnInit {
}
});
}
openRequestInfoDel(userData, flag) {
this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
this.actionButton(flag);
}
}
Loading…
Cancel
Save