no message

MOHEMM-Q3-DEV-LATEST
enadhilal 5 years ago
parent 0aafef42ea
commit 5a5e6bc0be

@ -24,8 +24,10 @@
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img style="margin: 9px 8px 9px 0 !important;" class="item-icon" src="assets/imgs/password.png" item-start /> <img style="margin: 9px 8px 9px 0 !important;" class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input class="login-input" required type="password" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}"> <ion-input class="login-input" required [type]="inputType" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}">
</ion-input> </ion-input>
<ion-icon *ngIf='inputType === "text"' name="ios-eye" (click)="showPassword()"></ion-icon>
<ion-icon *ngIf='inputType === "password"' name="ios-eye-off" (click)="hidePassword()"></ion-icon>
</ion-item> </ion-item>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false"> <div class="centerDiv signupDiv" *ngIf="isAppleStore==false">

@ -100,6 +100,7 @@ export class LoginComponent implements OnInit, OnDestroy {
getlastlogin: any; getlastlogin: any;
public keyboardOpened = false; public keyboardOpened = false;
private checkUserResult: CheckUserAuthenticationResponse; private checkUserResult: CheckUserAuthenticationResponse;
private inputType = "password";
ngOnInit() { ngOnInit() {
this.monitorKeyboardChange(); this.monitorKeyboardChange();
@ -392,4 +393,12 @@ export class LoginComponent implements OnInit, OnDestroy {
return await modal.present(); return await modal.present();
} }
showPassword(){
this.inputType = 'password';
}
hidePassword(){
this.inputType = 'text';
}
} }

@ -153,7 +153,7 @@ export class ApplyActionModalComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
this.messageSuccess = false; this.messageSuccess = false;
}, 5000); }, 2000);
this.cs.openNotificationPage(); this.cs.openNotificationPage();
// this.getNotificationCountAfterSubmit(); // this.getNotificationCountAfterSubmit();

@ -156,22 +156,22 @@ export class HomeComponent implements OnInit {
spaceBetween: 10 spaceBetween: 10
}; };
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
// tslint:disable-next-line: no-shadowed-variable // tslint:disable-next-line: no-shadowed-variable
public WorklistService: WorklistService, public WorklistService: WorklistService,
public workListService: WorklistMainService, public workListService: WorklistMainService,
public modalController: ModalController, public modalController: ModalController,
public DS: DashboredService public DS: DashboredService
) { ) {
this.WorkListObj = new WorkListRequest(); this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1'; this.WorkListObj.P_NOTIFICATION_TYPE = '1';
this.WorkListObj.P_SEARCH_FROM_USER = ''; this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_SUBJECT = ''; this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0; this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50; this.WorkListObj.P_PAGE_LIMIT = 50;
} }
ngOnInit() { ngOnInit() {
@ -247,17 +247,17 @@ export class HomeComponent implements OnInit {
for (const notification of openNotificationsArray) { for (const notification of openNotificationsArray) {
if (notification.ITEM_TYPE === 'HRSSA') { if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = this.totalHR; this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') { } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[2].value = this.totalPO; this.filters[2].value = this.totalPO;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') { } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = this.totalPR; this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') { } else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = this.totalMR; this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} }
} }
// this.data.datasets[0].data[4] = this.ITGCount; // this.data.datasets[0].data[4] = this.ITGCount;
@ -266,7 +266,7 @@ export class HomeComponent implements OnInit {
this.isLoading = false; this.isLoading = false;
} }
checkLoadingStatus () { checkLoadingStatus() {
if (this.showChart && this.receivedITGCount) { if (this.showChart && this.receivedITGCount) {
this.common.stopLoading(); this.common.stopLoading();
return true; return true;
@ -322,28 +322,28 @@ export class HomeComponent implements OnInit {
}); });
modal.onDidDismiss().then(result => { modal.onDidDismiss().then(result => {
if (result.data) { if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading(); this.common.startLoading();
this.isLoading = true; this.isLoading = true;
this.showSearchButton = true; this.showSearchButton = true;
this.itemType = result.data.itemType; this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType; this.notificationType = result.data.notificationType;
this.selectedValue = result.data.selectedValue; this.selectedValue = result.data.selectedValue;
this.inputDate = result.data.inputDate; this.inputDate = result.data.inputDate;
this.inputSearch = result.data.inputSearch; this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1; this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = []; this.newWorkListResponse = [];
this.showFormattedData = []; this.showFormattedData = [];
this.selectedFilter = 'ALL'; this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false; this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0; this.currentActiveIndex = 0;
this.previousActiveIndex = 0; this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true; this.filters[this.currentActiveIndex].active = true;
if (this.itemType !== '') { if (this.itemType !== '') {
this.disableFilters(); this.disableFilters();
} }
this.isPostNoLoad = false; this.isPostNoLoad = false;
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
} }
} }
}); });
@ -351,41 +351,41 @@ export class HomeComponent implements OnInit {
} }
getAllPushNotificationFun() { getAllPushNotificationFun() {
this.WorkListObj.P_PAGE_NUM = 1; this.WorkListObj.P_PAGE_NUM = 1;
this.isReachEnd = false; this.isReachEnd = false;
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : ''; this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : ''; this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3') this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : ''; ? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : ''; this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1'; this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') { if (this.selectedValue === '5') {
this.WorkListObj.P_SEARCH_FROM_USER = ''; this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = ''; this.WorkListObj.P_SEARCH_SUBJECT = '';
}
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
} }
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => { }
if (this.common.validResponse(result)) { );
this.handleWorkListResult(result.GetWorkList);
}
}
);
} }
getFilteredData(filter: string) { getFilteredData(filter: string) {
if (filter === 'ALL') { if (filter === 'ALL') {
this.showFormattedData = this.allFormattedData; this.showFormattedData = this.allFormattedData;
} else { } else {
let arrayToFilter; let arrayToFilter;
arrayToFilter = this.newWorkListResponse.filter((workList) => { arrayToFilter = this.newWorkListResponse.filter((workList) => {
return workList.ITEM_TYPE === filter; return workList.ITEM_TYPE === filter;
}); });
const categorizeData = this.categorizeData(arrayToFilter); const categorizeData = this.categorizeData(arrayToFilter);
this.showFormattedData = this.sortArray(categorizeData); this.showFormattedData = this.sortArray(categorizeData);
// const sortData = this.sortArray(arrayToFilter); // const sortData = this.sortArray(arrayToFilter);
// this.showFormattedData = this.categorizeData(sortData); // this.showFormattedData = this.categorizeData(sortData);
} }
} }
@ -393,11 +393,11 @@ export class HomeComponent implements OnInit {
let existsBefore = false; let existsBefore = false;
let index = 0; let index = 0;
for (let i = 0; i < formattedData.length; i++) { for (let i = 0; i < formattedData.length; i++) {
if (formattedData[i].date === currentDate) { if (formattedData[i].date === currentDate) {
existsBefore = true; existsBefore = true;
index = i; index = i;
break; break;
} }
} }
return { return {
exists: existsBefore, exists: existsBefore,
@ -409,7 +409,7 @@ export class HomeComponent implements OnInit {
if (workList.ITEM_TYPE === 'HRSSA') { if (workList.ITEM_TYPE === 'HRSSA') {
this.totalHR = this.totalHR + 1; this.totalHR = this.totalHR + 1;
} else if (workList.ITEM_TYPE === 'POAPPRV') { } else if (workList.ITEM_TYPE === 'POAPPRV') {
this.totalPO = this.totalPO + 1; this.totalPO = this.totalPO + 1;
} else if (workList.ITEM_TYPE === 'REQAPPRV') { } else if (workList.ITEM_TYPE === 'REQAPPRV') {
this.totalPR = this.totalPR + 1; this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVMOA') { } else if (workList.ITEM_TYPE === 'INVMOA') {
@ -418,41 +418,41 @@ export class HomeComponent implements OnInit {
} }
categorizeData(arrayToCategorize: any) { categorizeData(arrayToCategorize: any) {
this.totalHR = 0; this.totalHR = 0;
this.totalPO = 0; this.totalPO = 0;
this.totalPR = 0; this.totalPR = 0;
this.totalMR = 0; this.totalMR = 0;
const datePipe = new DatePipe('en-US'); const datePipe = new DatePipe('en-US');
const formattedData = []; const formattedData = [];
for (const workList of arrayToCategorize) { for (const workList of arrayToCategorize) {
this.addCountInFilters(workList); this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = { const currentObject = {
date: '', date: '',
data: [] data: []
}; };
if (formattedData.length === 0) { if (formattedData.length === 0) {
currentObject.date = currentDate; currentObject.date = currentDate;
currentObject.data.push(workList); currentObject.data.push(workList);
formattedData.push(currentObject); formattedData.push(currentObject);
} else { } else {
const existsBefore = this.checkDateExistance(currentDate, formattedData); const existsBefore = this.checkDateExistance(currentDate, formattedData);
if (existsBefore.exists) { if (existsBefore.exists) {
formattedData[existsBefore.indexNumber].data.push(workList); formattedData[existsBefore.indexNumber].data.push(workList);
} else { } else {
currentObject.date = currentDate; currentObject.date = currentDate;
currentObject.data.push(workList); currentObject.data.push(workList);
formattedData.push(currentObject); formattedData.push(currentObject);
} }
}
} }
return formattedData; }
return formattedData;
} }
sortArray(arrayToSort: any) { sortArray(arrayToSort: any) {
return arrayToSort.sort((a: any, b: any) => return arrayToSort.sort((a: any, b: any) =>
new Date(b.date).getTime() - new Date(a.date).getTime() new Date(b.date).getTime() - new Date(a.date).getTime()
); );
} }
@ -493,22 +493,23 @@ export class HomeComponent implements OnInit {
this.data.datasets[0].data[4] = this.ITGCount; this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true; this.showChart = true;
// this.common.stopLoading(); // this.common.stopLoading();
this.isLoading =false; this.isLoading = false;
} }
} }
openNotificationDetail(obj) { openNotificationDetail(obj) {
this.common.sharedService.setSharedData(false, 'loadWorkList'); this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(false, 'loadWorkList');
if (obj.REQUEST_TYPE === 'PR') { this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage(); this.common.openWorklistMainPRPage();
} else if (obj.REQUEST_TYPE === 'PO') { } else if (obj.REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage(); this.common.openWorklistMainPOPage();
} else if (obj.REQUEST_TYPE === 'MO') { } else if (obj.REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage(); this.common.openWorklistMainMRPage();
} else { } else {
this.common.openWorklistMainPage(); this.common.openWorklistMainPage();
} }
} }
resetData() { resetData() {
@ -562,9 +563,9 @@ export class HomeComponent implements OnInit {
Count() { Count() {
const datas = []; const datas = [];
const names = []; const names = [];
this.workListService.getITGCount('', '', this.isPostNoLoad) this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => { .subscribe((result: any) => {
if(result.RequestType.length > 0){ if (result.RequestType.length > 0) {
this.ITGSegment[0] = { this.ITGSegment[0] = {
name: 'All', name: 'All',
code: 'All', code: 'All',
@ -576,7 +577,7 @@ export class HomeComponent implements OnInit {
this.setActive(this.ITGSegment[0].code); this.setActive(this.ITGSegment[0].code);
} }
console.log(result.RequestType); console.log(result.RequestType);
let count =1; let count = 1;
for (let i = 0; i < result.RequestType.length; i++) { for (let i = 0; i < result.RequestType.length; i++) {
console.log() console.log()
this.ITGSegment[count] = { this.ITGSegment[count] = {

@ -1,7 +1,7 @@
<app-generic-header showBack="true" backLink="/notification/homepage" [headerText]="'worklistMain,title' | translate"> <app-generic-header showBack="true" backLink="/notification/homepage" [headerText]="'worklistMain,title' | translate">
</app-generic-header> </app-generic-header>
<ion-content class="colorBG"> <ion-content class="colorBG" *ngIf="!messageSuccess">
<ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="activeSegment" <ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="activeSegment"
class="ion-segment-all"> class="ion-segment-all">
@ -450,8 +450,19 @@
<!-- END --> <!-- END -->
</ion-content> </ion-content>
<ion-content *ngIf="messageSuccess">
<div class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
</ion-col>
<ion-col size="12">
<div style="font-size: 30px !important"> {{'worklistMain, Tran_Succ' | translate}} </div>
</ion-col>
</div>
</ion-content>
<ion-footer class="footerSearchBtn"> <ion-footer class="footerSearchBtn" *ngIf="!messageSuccess">
<ion-tabs> <ion-tabs>
@ -462,8 +473,8 @@
(click)="selectAtion(action.name)" [ngClass]="i === 0 ? 'tabs-margin' : ''"> (click)="selectAtion(action.name)" [ngClass]="i === 0 ? 'tabs-margin' : ''">
<img [src]="action.image"> <img [src]="action.image">
<ion-label style="font-size: 12px; white-space: pre-wrap !important;" *ngIf="action.name !== 'RequestInformation'">{{action.name}}</ion-label> <ion-label style="font-size: 12px" *ngIf="action.name !== 'RequestInformation'">{{action.name}}</ion-label>
<ion-label style="font-size: 12px; white-space: pre-wrap !important;" *ngIf="action.name === 'RequestInformation'">Request Information</ion-label> <ion-label style="font-size: 12px; white-space: nowrap;" *ngIf="action.name === 'RequestInformation'">Request Info</ion-label>
</ion-tab-button> </ion-tab-button>

@ -8,6 +8,7 @@ import { ModalController } from '@ionic/angular';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component'; import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component';
import { IonSlides } from '@ionic/angular'; import { IonSlides } from '@ionic/angular';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
@Component({ @Component({
selector: 'app-work-list-main-itg', selector: 'app-work-list-main-itg',
@ -58,6 +59,7 @@ export class WorkListMainItgComponent implements OnInit {
direction: string; direction: string;
defaultSegment = ''; defaultSegment = '';
public slideIndex = 0; public slideIndex = 0;
private messageSuccess = false;
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
@ -270,13 +272,13 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg')); this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = true;
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); setTimeout(() => {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1) this.confirmMsg(1);
// this.common.openNotificationPage(); this.skip();
this.skip(); }, 2000);
} }
}); });
} else if (action == 2) {//reject } else if (action == 2) {//reject
@ -287,12 +289,15 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg')); this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); setTimeout(() => {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2) // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
// this.common.openNotificationPage(); // this.common.sharedService.setSharedData(true, 'loadWorkList');
this.skip(); this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
}, 2000);
} }
}); });
} else if (action == 3) {//request more info } else if (action == 3) {//request more info
@ -310,12 +315,15 @@ export class WorkListMainItgComponent implements OnInit {
} }
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = true;
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); setTimeout(() => {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = false;
this.confirmMsg(3) this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage(); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.skip(); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(3);
this.skip();
}, 2000);
} }
}); });
} }
@ -328,12 +336,15 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg')); this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = true;
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); setTimeout(() => {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = false;
this.confirmMsg(4) this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage(); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.skip(); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(4);
this.skip();
}, 2000);
} }
}); });
} else if (action == 5) { //answer } else if (action == 5) { //answer
@ -347,12 +358,15 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg')); this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = true;
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); setTimeout(() => {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = false;
this.confirmMsg(5) this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage(); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.skip(); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(5);
this.skip();
}, 2000);
} }
}); });
} }
@ -370,12 +384,15 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg')); this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = true;
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); setTimeout(() => {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.messageSuccess = false;
this.confirmMsg(6) this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage(); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.skip(); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
} }
}); });
} else { } else {

@ -148,10 +148,10 @@
<div class="noteInput" *ngIf="isAnswer== false"> <div class="noteInput" *ngIf="isAnswer== false">
<ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}} <!-- <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label> </ion-label> -->
<ion-item> <ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea> <ion-textarea [(ngModel)]="userNote" placeholder="Enter a note"></ion-textarea>
</ion-item> </ion-item>
</div> </div>
<br/> <br/>

@ -37,10 +37,10 @@ export class WorkListReplacementRollComponent implements OnInit {
private WorkListActionObj: WorkListActionRequest; private WorkListActionObj: WorkListActionRequest;
getpassResAttr: any = []; getpassResAttr: any = [];
active: any; active: any;
demoeAttach:any=[]; demoeAttach: any = [];
isSelect: boolean =false; isSelect: boolean = false;
searchKeyEnter: boolean = false; searchKeyEnter: boolean = false;
messageSuccess: boolean =false; messageSuccess: boolean = false;
public direction: string; public direction: string;
P_RESPOND_ATTRIBUTES_TBL: any[]; P_RESPOND_ATTRIBUTES_TBL: any[];
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
@ -56,7 +56,7 @@ export class WorkListReplacementRollComponent implements OnInit {
if (this.getPassActionMode == "ANSWER_INFO") { if (this.getPassActionMode == "ANSWER_INFO") {
this.isAnswer = true; this.isAnswer = true;
} }
this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
@ -65,12 +65,12 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = ""; this.WorkListActionObj.P_ACTION_MODE = "";
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr; this.WorkListActionObj.RespondAttributeList = [];// this.getpassResAttr;
this.WorkListActionObj.P_APPROVER_INDEX = null; this.WorkListActionObj.P_APPROVER_INDEX = null;
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
} }
ngOnInit() { ngOnInit() {
} }
@ -178,10 +178,10 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
select(selectEmp,index){ select(selectEmp, index) {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME); console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp=selectEmp this.selEmp = selectEmp
this.active=index; this.active = index;
} }
clear() { clear() {
this.selEmpName = ""; this.selEmpName = "";
@ -208,18 +208,18 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
submitAction() { submitAction() {
if (this.selEmp && this.isAnswer == false) { if (this.selEmp && this.isAnswer == false) {
// this.selectedUserInf = this.ReplacementList[this.selEmp]; // this.selectedUserInf = this.ReplacementList[this.selEmp];
this.selectedUserInf = this.selEmp; this.selectedUserInf = this.selEmp;
console.log("selEmp "+ this.selEmp.USER_NAME); console.log("selEmp " + this.selEmp.USER_NAME);
if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
console.log("userInfo "+this.selectedUserInf.USER_NAME); console.log("userInfo " + this.selectedUserInf.USER_NAME);
if (this.userNote) { if (this.userNote) {
if(this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD"){ if (this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD") {
let index_FORWARD = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "FORWARD_TO_USERNAME_RESPONSE"); let index_FORWARD = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "FORWARD_TO_USERNAME_RESPONSE");
this.getpassResAttr[index_FORWARD].ATTRIBUTE_TEXT_VALUE = this.selectedUserInf.USER_NAME; this.getpassResAttr[index_FORWARD].ATTRIBUTE_TEXT_VALUE = this.selectedUserInf.USER_NAME;
@ -227,30 +227,30 @@ export class WorkListReplacementRollComponent implements OnInit {
let index_Note = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "NOTE"); let index_Note = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "NOTE");
this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote; this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote;
this.P_RESPOND_ATTRIBUTES_TBL= this.getpassResAttr; this.P_RESPOND_ATTRIBUTES_TBL = this.getpassResAttr;
console.log(this.P_RESPOND_ATTRIBUTES_TBL); console.log(this.P_RESPOND_ATTRIBUTES_TBL);
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS =""// response Attr this.WorkListActionObj.P_COMMENTS = ""// response Attr
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
}else{ } else {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
// this.modalCtrl.dismiss(); // this.modalCtrl.dismiss();
} }
this.workListMainService.actionButton(this.WorkListActionObj). this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => { subscribe((result: any) => {
this.handleApplayActionResult(result); this.handleApplayActionResult(result);
}); });
} else { } else {
let msg: string = this.ts.trPK("replacementRoll", "enterNote"); let msg: string = this.ts.trPK("replacementRoll", "enterNote");
this.cs.showErrorMessageDialog(() => { this.cs.showErrorMessageDialog(() => {
@ -291,21 +291,25 @@ export class WorkListReplacementRollComponent implements OnInit {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
this.cs.sharedService.setSharedData(true, 'loadWorkList'); this.cs.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
setTimeout(() => { // this.messageSuccess = true;
this.messageSuccess = false;
//this.modalCtrl.dismiss(succ); // setTimeout(() => {
// this.messageSuccess = false;
// //this.modalCtrl.dismiss(succ);
// this.modalCtrl.dismiss({
// 'dismissed': true,
// data: "Success"
// });
// }, 2000);
// this.cs.openNotificationPage();
this.modalCtrl.dismiss({ this.modalCtrl.dismiss({
'dismissed': true, 'dismissed': true,
data: "Success" data: "Success"
}); });
}
}, 5000);
this.cs.openNotificationPage();
}
} // not valid it } // not valid it
@ -358,33 +362,33 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
} }
public col(){ public col() {
alert("test"); alert("test");
} }
closeModal() { closeModal() {
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
} }
onChangeSelect(select){ onChangeSelect(select) {
console.log(select.detail.value); console.log(select.detail.value);
let selectValue= select.detail.value; let selectValue = select.detail.value;
if(selectValue == "1" || selectValue == "2" ||selectValue == "3"){ if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
this.isSelect=true; this.isSelect = true;
} }
else{ else {
this.isSelect=false; this.isSelect = false;
} }
} }
onChangeInput(){ onChangeInput() {
if (this.inputSearch.length >0) { if (this.inputSearch.length > 0) {
this.searchKeyEnter=true; this.searchKeyEnter = true;
}else{ } else {
this.searchKeyEnter=false; this.searchKeyEnter = false;
} }
} }
} }

@ -137,6 +137,6 @@
} }
.action-btn { .action-btn {
white-space: pre-wrap; white-space: nowrap;
font-size: 12px; font-size: 10px;
} }

@ -117,6 +117,7 @@ export class WorklistMainMRComponent implements OnInit {
reqInfo_label: any=""; reqInfo_label: any="";
close_label: any; close_label: any;
closeDis: boolean = false; closeDis: boolean = false;
selectedFilter: string;
constructor( constructor(
@ -141,7 +142,7 @@ export class WorklistMainMRComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} }
@ -191,7 +192,7 @@ export class WorklistMainMRComponent implements OnInit {
public segmentChanged1(event: any) { public segmentChanged1(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
console.log(' event.detail.value: ' + event.detail.value); // console.log(' event.detail.value: ' + event.detail.value);
} }
intializeNotificationDetail() { intializeNotificationDetail() {
@ -205,12 +206,12 @@ export class WorklistMainMRComponent implements OnInit {
if (this.messageSuccess) { if (this.messageSuccess) {
document.getElementById('notificationDynamicFieldsMR').innerHTML = ''; document.getElementById('notificationDynamicFieldsMR').innerHTML = '';
} }
console.log('intializeNotificationDetail'); // console.log('intializeNotificationDetail');
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
); );
console.log(this.getPassNotificationDetails.ROW_NUM); // console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData( this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR, HomeComponent.NOTIFICATION_ARR,
false false
@ -276,7 +277,7 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getPONotificationBody(notificationBodyObj) .getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => { .subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, 'PO'); this.handleWorkListBodyResult(result, 'PO');
}); });
} }
@ -329,7 +330,7 @@ export class WorklistMainMRComponent implements OnInit {
if (result.GetNotificationButtonsList != null) { if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList; this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore'); this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore');
console.log('test' + this.notificationButtonRes.length); // console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) { for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) { if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL; this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
@ -413,41 +414,46 @@ export class WorklistMainMRComponent implements OnInit {
public nextNotfification() { public nextNotfification() {
//let itemExist = false; //let itemExist = false;
if( document.getElementById("notificationDynamicFieldsMR") != null){ if( document.getElementById("notificationDynamicFieldsMR") != null){
document.getElementById("notificationDynamicFieldsMR").innerHTML = ""; document.getElementById("notificationDynamicFieldsMR").innerHTML = "";
} }
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); let previousRequest = this.notificationArray[index].REQUEST_TYPE;
console.log(this.notificationArray); let previousRequestType = this.notificationArray[index].ITEM_TYPE;
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ this.activeSegment = 'info';
this.common.openWorklistMainPOPage(); if (this.selectedFilter === 'ALL') {
}else this.checkRequestType(index);
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.common.openWorklistMainPRPage(); this.checkRequestType(index);
} } else {
else this.common.openNotificationPage();
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.intializeNotificationDetail();
}else{
this.common.openWorklistMainPage();
} }
} else {
}
else{
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
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();
}
}
actionButton(action) { actionButton(action) {
console.log('actionButton' + action); // console.log('actionButton' + action);
// alert("don't forget"); // alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;
@ -675,7 +681,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
getNotificationResAttr(notificationButtonsObj) { getNotificationResAttr(notificationButtonsObj) {
console.log("getNotificationResAttr"); // console.log("getNotificationResAttr");
this.NotRespondAttributeList=[]; this.NotRespondAttributeList=[];
this.worklistMainService this.worklistMainService
.notificationResponseAttr(notificationButtonsObj) .notificationResponseAttr(notificationButtonsObj)
@ -715,7 +721,7 @@ export class WorklistMainMRComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) { for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') { if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', ''); 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') { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
@ -823,7 +829,7 @@ export class WorklistMainMRComponent implements OnInit {
async openNoteDetail(note, sender) { async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present(); // modalPage.present();
console.log('note' + note); // console.log('note' + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -839,7 +845,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
console.log('doInfinite action history MR'); // console.log('doInfinite action history MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -909,7 +915,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data); // Here's your selected user! // console.log(data); // Here's your selected user!
}); });
// data => { // data => {
@ -924,7 +930,7 @@ export class WorklistMainMRComponent implements OnInit {
doInfiniteNotificationBody(infiniteScroll) { doInfiniteNotificationBody(infiniteScroll) {
console.log('doInfiniteNotificationBody MR'); // console.log('doInfiniteNotificationBody MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj). this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -959,9 +965,9 @@ export class WorklistMainMRComponent implements OnInit {
loadMoreNotificationBody() { loadMoreNotificationBody() {
console.log('loadMoreNotificationBody MR'); // console.log('loadMoreNotificationBody MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log('this.IsReachEnd' + this.IsReachEnd); // console.log('this.IsReachEnd' + this.IsReachEnd);
this.worklistMainService.getMONotificationBody(this.WorkListBodyObj). this.worklistMainService.getMONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -996,7 +1002,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
}//end infiniteScroll }//end infiniteScroll
loadMoreActionHistory() { loadMoreActionHistory() {
console.log('doInfinite action history MR'); // console.log('doInfinite action history MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -1044,7 +1050,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); // console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) { if (data.data == 'cancel' || data.data == undefined) {
return; return;
@ -1052,7 +1058,7 @@ export class WorklistMainMRComponent implements OnInit {
// this.selectedAction = data.data; // this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION; this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType); // console.log(this.actionType);
///call Action button ///call Action button
this.actionButton(this.actionType); this.actionButton(this.actionType);
} }
@ -1069,8 +1075,8 @@ export class WorklistMainMRComponent implements OnInit {
/////////////////////////////////////////// ///////////////////////////////////////////
public checkLines(note) { public checkLines(note) {
console.log(note.split('\n').length); // console.log(note.split('\n').length);
console.log(note.length); // console.log(note.length);
if (note && note != null) { if (note && note != null) {
@ -1094,7 +1100,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
this.actionHistoryRes = actionHis; this.actionHistoryRes = actionHis;
console.log('test'); // console.log('test');
} }
@ -1108,13 +1114,18 @@ export class WorklistMainMRComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal'; modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
console.log(data.data); // console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) { if (data.data.data == 'cancel' || data.data.data == undefined) {
return; return;
} else if (data.data == 'Success') { } else if (data.data.data == 'Success') {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} }
}); });
@ -1140,7 +1151,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); // console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) { if (data.data == 'cancel' || data.data == undefined) {
return; return;
@ -1160,7 +1171,7 @@ export class WorklistMainMRComponent implements OnInit {
getMOItemHistory(itemID ,orgID) { getMOItemHistory(itemID ,orgID) {
console.log(itemID); // console.log(itemID);
this.IsReachEnd = false; this.IsReachEnd = false;
const request = new MOItemHistoryReq(); const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID); request.P_ITEM_ID = parseInt(itemID);

@ -139,6 +139,6 @@
border: 0; border: 0;
} }
.action-btn { .action-btn {
white-space: pre-wrap; white-space: nowrap;
font-size: 12px; font-size: 10px;
} }

@ -64,8 +64,8 @@ export class WorklistMainPoComponent implements OnInit {
getPassNotificationDetails: any; getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr"; public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999; TransactionID: number = -999;
notificationBodyRes : any =[]; notificationBodyRes: any = [];
actionHistoryRes: any =[]; actionHistoryRes: any = [];
notificationButtonRes: any; notificationButtonRes: any;
actionMode: any; actionMode: any;
pInformation: string = ""; pInformation: string = "";
@ -127,7 +127,9 @@ export class WorklistMainPoComponent implements OnInit {
approve_label: any; approve_label: any;
reject_label: any; reject_label: any;
reqInfo_label: any; reqInfo_label: any;
closeDis: boolean = false;; closeDis: boolean = false;
selectedFilter: string;
;
close_label: any; close_label: any;
constructor( constructor(
@ -151,52 +153,45 @@ export class WorklistMainPoComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
}//ngOn }//ngOn
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
if(this.activeSegment === 'line_details') if (this.activeSegment === 'line_details') {
{ this.slides.slideTo(0);
this.slides.slideTo(0); }
} else if (this.activeSegment === 'action-history') {
else if(this.activeSegment === 'action-history') this.slides.slideTo(1);
{ }
this.slides.slideTo(1); else if (this.activeSegment === 'attach') {
} this.slides.slideTo(2);
else if(this.activeSegment === 'attach') }
{ else if (this.activeSegment === 'info') {
this.slides.slideTo(2); this.slides.slideTo(3);
} }
else if(this.activeSegment === 'info') // console.log(" event.detail.value: " + event.detail.value);
{
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value);
} }
public slideChanged(event: any) { public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => { this.slides.getActiveIndex().then(index => {
console.log(index); // console.log(index);
console.log(event); // console.log(event);
if(index === 0) if (index === 0) {
{
this.activeSegment = 'line_details'; this.activeSegment = 'line_details';
} }
else if(index === 1) else if (index === 1) {
{
this.activeSegment = 'action-history'; this.activeSegment = 'action-history';
} }
else if(index === 2) else if (index === 2) {
{
this.activeSegment = 'attach'; this.activeSegment = 'attach';
} }
else if(index === 3) else if (index === 3) {
{
this.activeSegment = 'info'; this.activeSegment = 'info';
} }
console.log(this.activeSegment); // console.log(this.activeSegment);
}); });
} }
@ -207,18 +202,18 @@ export class WorklistMainPoComponent implements OnInit {
this.approveDis = false; this.approveDis = false;
this.rejectDis = false; this.rejectDis = false;
this.requestDis = false; this.requestDis = false;
this.closeDis=false; this.closeDis = false;
this.moreDisabled = true; this.moreDisabled = true;
if (this.messageSuccess) { if (this.messageSuccess) {
document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; document.getElementById("notificationDynamicFieldsPO").innerHTML = "";
} }
console.log("intializeNotificationDetail"); // console.log("intializeNotificationDetail");
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
); );
console.log(this.getPassNotificationDetails.ROW_NUM); // console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData( this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR, HomeComponent.NOTIFICATION_ARR,
false false
@ -260,14 +255,14 @@ export class WorklistMainPoComponent implements OnInit {
public segmentChanged1(event: any) { public segmentChanged1(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value); // console.log(" event.detail.value: " + event.detail.value);
} }
getPONotificationDetails(notificationBodyObj) { getPONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.getPONotificationBody(notificationBodyObj) .getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => { .subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, "PO"); this.handleWorkListBodyResult(result, "PO");
}); });
} }
@ -283,14 +278,14 @@ export class WorklistMainPoComponent implements OnInit {
result.GetEITCollectionNotificationBodyList; result.GetEITCollectionNotificationBodyList;
} }
} else if (Type == "ABSENCE") { } else if (Type == "ABSENCE") {
console.log("ABSENCE"); // console.log("ABSENCE");
if (result.GetAbsenceCollectionNotificationBodyList) { if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
} }
} else if (Type == "PR") { } else if (Type == "PR") {
if (result.GetPrNotificationBodyList) { if (result.GetPrNotificationBodyList) {
console.log("PR"); // console.log("PR");
this.PRHeader = result.GetPrNotificationBodyList.PRHeader; this.PRHeader = result.GetPrNotificationBodyList.PRHeader;
this.PRLines = result.GetPrNotificationBodyList.PRLines; this.PRLines = result.GetPrNotificationBodyList.PRLines;
@ -315,7 +310,7 @@ export class WorklistMainPoComponent implements OnInit {
} else if (Type == "PO") { } else if (Type == "PO") {
if (result.GetPoNotificationBodyList) { if (result.GetPoNotificationBodyList) {
console.log("PO"); // console.log("PO");
this.POHeader = result.GetPoNotificationBodyList.POHeader; this.POHeader = result.GetPoNotificationBodyList.POHeader;
this.POLines = result.GetPoNotificationBodyList.POLines; this.POLines = result.GetPoNotificationBodyList.POLines;
@ -361,34 +356,33 @@ export class WorklistMainPoComponent implements OnInit {
if (result.GetNotificationButtonsList != null) { if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList; this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
console.log("test" + this.notificationButtonRes.length); // console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) { for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { 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; this.approveDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { 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; this.rejectDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { 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; this.requestDis = true;
} // if result == null } // if result == null
else if // if result == null else if // if result == null
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") { (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL; this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true; this.closeDis = true;
} }
else if ( 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.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.moreDisabled = false;
}
}
} // valid it } // valid it
} // valid it } // valid it
@ -397,7 +391,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
applyAction(WorkListActionObj) { applyAction(WorkListActionObj) {
console.log("applyactio"); // console.log("applyactio");
this.worklistMainService this.worklistMainService
.actionButton(WorkListActionObj) .actionButton(WorkListActionObj)
.subscribe((result: any) => { .subscribe((result: any) => {
@ -442,44 +436,50 @@ export class WorklistMainPoComponent implements OnInit {
// } // }
public nextNotfification() { public nextNotfification() {
//let itemExist = false; if (document.getElementById('notificationDynamicFieldsPO') != null) {
if( document.getElementById("notificationDynamicFieldsPO") != null){ document.getElementById('notificationDynamicFieldsPO').innerHTML = '';
}
document.getElementById("notificationDynamicFieldsPO").innerHTML = "";
}
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); let previousRequest = this.notificationArray[index].REQUEST_TYPE;
console.log(this.notificationArray); let previousRequestType = this.notificationArray[index].ITEM_TYPE;
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ this.activeSegment = 'line_details';
this.intializeNotificationDetail(); if(this.selectedFilter === 'ALL'){
}else this.checkRequestType(index);
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.common.openWorklistMainPRPage() this.checkRequestType(index);
} }else {
else this.common.openNotificationPage();
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
} }
} else {
}
else{
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.intializeNotificationDetail();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); // console.log("actionButton" + action);
// alert("don't forget"); // alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;
@ -499,7 +499,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
console.log("a"+ this.P_RESPOND_ATTRIBUTES_TBL); // console.log("a" + this.P_RESPOND_ATTRIBUTES_TBL);
let repUserName = this.selEmployeeID; let repUserName = this.selEmployeeID;
// if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { // if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
@ -610,7 +610,7 @@ export class WorklistMainPoComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPoComponent.PASS_RES_ATTR WorklistMainPoComponent.PASS_RES_ATTR
); );
console.log("c"+ this.P_RESPOND_ATTRIBUTES_TBL); // console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
// this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal(); this.openRepRolModal();
@ -715,7 +715,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
getNotificationResAttr(notificationButtonsObj) { getNotificationResAttr(notificationButtonsObj) {
console.log("getNotificationResAttr"); // console.log("getNotificationResAttr");
this.NotRespondAttributeList = []; this.NotRespondAttributeList = [];
this.worklistMainService this.worklistMainService
@ -756,7 +756,7 @@ export class WorklistMainPoComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) { for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") { if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); 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") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") {
@ -814,7 +814,7 @@ export class WorklistMainPoComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) { getAttachmentNotification(WorkListAttachObj) {
this.attachmentRes =[]; this.attachmentRes = [];
this.worklistAttachService.getAttach(WorkListAttachObj). this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => { subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result); this.handleWorkListAttachResult(result);
@ -832,7 +832,7 @@ export class WorklistMainPoComponent implements OnInit {
getActionHistory(WorkListActionHistoryObj) { getActionHistory(WorkListActionHistoryObj) {
this.IsReachEnd = true; this.IsReachEnd = true;
this.actionHistoryRes=[]; this.actionHistoryRes = [];
this.worklistService.getActionHistory(WorkListActionHistoryObj). this.worklistService.getActionHistory(WorkListActionHistoryObj).
subscribe((result: WorkListActionHistoryResponse) => { subscribe((result: WorkListActionHistoryResponse) => {
this.handleWorkListActionHistoryResult(result); this.handleWorkListActionHistoryResult(result);
@ -865,7 +865,7 @@ export class WorklistMainPoComponent implements OnInit {
async openNoteDetail(note, sender) { async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present(); // modalPage.present();
console.log("note" + note); // console.log("note" + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -881,7 +881,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
console.log("doInfinite action history"); // console.log("doInfinite action history");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -929,7 +929,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
getItemHistory(itemID) { getItemHistory(itemID) {
console.log(itemID); // console.log(itemID);
this.IsReachEnd = false; this.IsReachEnd = false;
const request = new POItemHistoryRequest(); const request = new POItemHistoryRequest();
request.P_ITEM_ID = parseInt(itemID); request.P_ITEM_ID = parseInt(itemID);
@ -968,7 +968,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
getQutationAnalysis(headerID, itemID) { getQutationAnalysis(headerID, itemID) {
console.log(itemID + headerID); // console.log(itemID + headerID);
this.IsReachEnd = false; this.IsReachEnd = false;
const request = new QuotationAnalysisRequest(); const request = new QuotationAnalysisRequest();
request.P_ITEM_ID = parseInt(itemID); request.P_ITEM_ID = parseInt(itemID);
@ -1025,9 +1025,9 @@ export class WorklistMainPoComponent implements OnInit {
} }
loadMoreNotificationBody() { loadMoreNotificationBody() {
console.log("loadMoreNotificationBody PO"); // console.log("loadMoreNotificationBody PO");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log("this.IsReachEnd" + this.IsReachEnd); // console.log("this.IsReachEnd" + this.IsReachEnd);
this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -1183,11 +1183,16 @@ export class WorklistMainPoComponent implements OnInit {
.then((data) => { .then((data) => {
console.log(data.data); console.log(data.data);
if (data.data == "cancel" || data.data == undefined) { if (data.data.data == "cancel" || data.data.data == undefined) {
return; return;
} else if (data.data == "Success") { } else if (data.data.data == "Success") {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} }
}); });

@ -136,6 +136,7 @@
border: 0; border: 0;
} }
.action-btn { .action-btn {
white-space: pre-wrap; // white-space: pre-wrap;
font-size: 12px; white-space: nowrap;
font-size: 10px;
} }

@ -114,6 +114,7 @@ export class WorklistMainPRComponent implements OnInit {
reqInfo_label: any; reqInfo_label: any;
close_label: any; close_label: any;
closeDis: boolean = false; closeDis: boolean = false;
selectedFilter: any;
constructor( constructor(
@ -138,7 +139,7 @@ export class WorklistMainPRComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} }
@ -447,29 +448,39 @@ export class WorklistMainPRComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); console.log(index);
console.log(this.notificationArray); console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ this.activeSegment = 'info';
this.common.openWorklistMainPOPage() if(this.selectedFilter === 'ALL'){
}else this.checkRequestType(index);
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.intializeNotificationDetail(); this.checkRequestType(index);
} } else {
else this.common.openNotificationPage();
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
}
} }
else{ } else {
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
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();
}
}
actionButton(action) { actionButton(action) {
console.log('actionButton' + action); console.log('actionButton' + action);
@ -1105,11 +1116,16 @@ export class WorklistMainPRComponent implements OnInit {
.then((data) => { .then((data) => {
console.log(data.data); console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) { if (data.data.data == 'cancel' || data.data.data == undefined) {
return; return;
} else if (data.data == 'Success') { } else if (data.data.data == 'Success') {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} }
}); });

@ -5,7 +5,7 @@
<ion-content class="colorBG"> <ion-content class="colorBG">
<div *ngIf="!messageSuccess"> <div *ngIf="!messageSuccess">
<!-- add segemnt part --> <!-- add segemnt part -->
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div> <div class="subjectNotification">{{getPassNotificationDetails?.SUBJECT}}</div>
<ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)" [value]="activeSegment" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)" [value]="activeSegment"
class="ion-segment-all"> class="ion-segment-all">
@ -71,9 +71,11 @@
*ngFor="let List of subordinatesleaveList;"> *ngFor="let List of subordinatesleaveList;">
<ion-grid [ngClass]=" direction === 'en' ? 'gridSubordinates' :'gridSubordinates-Ar' "> <ion-grid [ngClass]=" direction === 'en' ? 'gridSubordinates' :'gridSubordinates-Ar' ">
<div [ngClass]=" direction === 'en' ? 'subOrdinateDiv' :'subOrdinateDiv-Ar' "> <div [ngClass]=" direction === 'en' ? 'subOrdinateDiv' :'subOrdinateDiv-Ar' ">
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub" <img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
style="width: 70px !important; height: 70px !important;"
[src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE"> [src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE">
<img *ngIf="List.EMPLOYEE_IMAGE == null" class="empImgeSub" <img *ngIf="List.EMPLOYEE_IMAGE == null" class="empImgeSub"
style="width: 70px !important; height: 70px !important;"
src="../assets/imgs/profile.png"> src="../assets/imgs/profile.png">
</div> </div>
<ion-row class="rowHeader " <ion-row class="rowHeader "
@ -83,10 +85,12 @@
</label> </label>
<br /> <br />
<label class="label" for="">{{List.POSITION_TITLE}} </label><br /> <label class="label" for="">{{List.POSITION_TITLE}} </label><br />
<br>
<label class="label" style="font-size: 11px !important; position: absolute; left: 0px; color: #000;" for="label">{{List.STATUS}}</label>
</ion-col> </ion-col>
<ion-col class="status" size="3"> <!-- <ion-col class="status" size="3">
<label class="label" style="font-size: 11px;" for="label">{{List.STATUS}}</label>
</ion-col> </ion-col> -->
</ion-row> </ion-row>
<br /> <br />
<ion-row [ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar'"> <ion-row [ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar'">
@ -100,7 +104,7 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-item> </ion-item>
</ion-col> </ion-col>
</ion-row> </ion-row>

@ -182,11 +182,12 @@
} }
.status{ .status{
text-align: center; text-align: center;
background: green; // background: green;
border-radius: 10px; border-radius: 10px;
font-size: 12px; font-size: 10px !important;
height: 40px; height: 40px;
color: white; color: white;
position: relative;
} }
.rowHeader{ .rowHeader{
border-bottom: 1px solid var(--cusgray); border-bottom: 1px solid var(--cusgray);
@ -215,9 +216,9 @@ color: white;
} }
.gridSubordinates{ .gridSubordinates{
margin-left: 38px; margin-left: 3%;//38px;
border-top-left-radius: 28px; border-top-left-radius: 16px;//28px;
border-bottom-left-radius: 40px; border-bottom-left-radius: 16px;//40px;
// padding-left: 8px; // padding-left: 8px;
background:var(--light); background:var(--light);
border-top-right-radius: 16px; border-top-right-radius: 16px;
@ -226,9 +227,11 @@ color: white;
.subOrdinateDiv{ .subOrdinateDiv{
z-index: 4; z-index: 4;
margin-left: -32px; margin-left: 0px;//-32px;
position: absolute; // position: absolute;
top: -2px; top: 5px;//-2px;
float: left;
margin-right: 10px;
} }
.subOrdinateImg{ .subOrdinateImg{
width: 85px; width: 85px;
@ -327,6 +330,6 @@ ion-card{
border: 0; border: 0;
} }
.action-btn { .action-btn {
white-space: pre-wrap; white-space: nowrap;
font-size: 12px; font-size: 10px;
} }

@ -35,6 +35,7 @@ import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { IonSlides } from '@ionic/angular'; import { IonSlides } from '@ionic/angular';
import { ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: "app-worklist-main", selector: "app-worklist-main",
@ -104,6 +105,8 @@ export class WorklistMainComponent implements OnInit {
reqInfo_label: any = ""; reqInfo_label: any = "";
close_label: any; close_label: any;
closeDis: boolean = false; closeDis: boolean = false;
public selectedFilter: string;
public arr_hr_req_only= [];
constructor( constructor(
public worklistService: WorklistService, public worklistService: WorklistService,
@ -116,19 +119,30 @@ export class WorklistMainComponent implements OnInit {
public worklistAttachService: WorklistAttachService, public worklistAttachService: WorklistAttachService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
public dashboredService: DashboredService, public dashboredService: DashboredService,
public authService: AuthenticationService public authService: AuthenticationService,
) { public route: ActivatedRoute
) {
this.direction = TranslatorService.getCurrentLanguageName() this.direction = TranslatorService.getCurrentLanguageName()
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = 1; this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.route.params.subscribe(val => {
setTimeout(() => {
this.ionAlwaysEnter();
}, 100);
});
} }
ngOnInit() { ngOnInit() {}
ionAlwaysEnter(){
this.selEmp = this.common.sharedService.getSharedData( this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP, MenuResponse.SHARED_SEL_EMP,
false false
); );
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
if (this.selEmp) { } else { if (this.selEmp) { } else {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
@ -136,28 +150,27 @@ export class WorklistMainComponent implements OnInit {
} }
}); });
} }
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} }
// ionViewWillEnter(){
// this.intializeNotificationDetail();
// }
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
if(this.activeSegment === 'info') if (this.activeSegment === 'info') {
{ this.slides.slideTo(0);
this.slides.slideTo(0); }
} else if (this.activeSegment === 'item-req') {
else if(this.activeSegment === 'item-req' ) this.slides.slideTo(1);
{ }
this.slides.slideTo(1); else if (this.activeSegment === 'action-history') {
} this.slides.slideTo(2);
else if(this.activeSegment === 'action-history') }
{ else if (this.activeSegment === 'attach') {
this.slides.slideTo(2); this.slides.slideTo(3);
} }
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value); console.log(" event.detail.value: " + event.detail.value);
} }
@ -165,20 +178,16 @@ export class WorklistMainComponent implements OnInit {
this.slides.getActiveIndex().then(index => { this.slides.getActiveIndex().then(index => {
console.log(index); console.log(index);
console.log(event); console.log(event);
if(index === 0) if (index === 0) {
{
this.activeSegment = 'info'; this.activeSegment = 'info';
} }
else if(index === 1) else if (index === 1) {
{
this.activeSegment = 'item-req'; this.activeSegment = 'item-req';
} }
else if(index === 2) else if (index === 2) {
{
this.activeSegment = 'action-history'; this.activeSegment = 'action-history';
} }
else if(index === 3) else if (index === 3) {
{
this.activeSegment = 'attach'; this.activeSegment = 'attach';
} }
console.log(this.activeSegment); console.log(this.activeSegment);
@ -207,6 +216,11 @@ export class WorklistMainComponent implements OnInit {
HomeComponent.NOTIFICATION_ARR, HomeComponent.NOTIFICATION_ARR,
false false
); );
console.log(this.selectedFilter);
if(this.selectedFilter === 'HRSSA') {
this.arr_hr_req_only = [];
this.sortRequests();
}
this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest(); this.WorkListButtonsObj = new WorkListButtonRequest();
this.WorkListAttachObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest();
@ -408,7 +422,7 @@ export class WorklistMainComponent implements OnInit {
this.messageSuccess = false; this.messageSuccess = false;
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 2000);
} }
} // valid it } // valid it
} }
@ -447,26 +461,60 @@ export class WorklistMainComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); console.log(index);
console.log(this.notificationArray); console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1; index += 1;
if (index < this.notificationArray.length) { if(index < this.notificationArray.length){
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); this.activeSegment = 'info';
if (this.notificationArray[index].REQUEST_TYPE == "PO") { if (this.selectedFilter === 'ALL') {
this.common.openWorklistMainPOPage() this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
} else this.checkRequestType(index);
if (this.notificationArray[index].REQUEST_TYPE == "PR") { } else {
this.common.openWorklistMainPRPage() if(this.arr_hr_req_only){
} let requestIndex = this.arr_hr_req_only.findIndex(x => x.ROW_NUM === itemNo);
else requestIndex++;
if (this.notificationArray[index].REQUEST_TYPE == "MO") { if(requestIndex < this.arr_hr_req_only.length){
this.common.openWorklistMainMRPage() this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
} else {
this.intializeNotificationDetail(); this.intializeNotificationDetail();
}else{
this.common.openNotificationPage();
} }
} }
else { }
} else {
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
// if (index < this.notificationArray.length) {
// this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
// this.activeSegment = 'info';
// if (this.selectedFilter === 'ALL') {
// this.checkRequestType(index);
// } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
// this.checkRequestType(index);
// } else if((this.notificationArray[index].ITEM_TYPE === 'HRSSA' && this.notificationArray[index].REQUEST_TYPE === 'EIT') ||
// (this.notificationArray[index].ITEM_TYPE === 'HRSSA' && this.notificationArray[index].REQUEST_TYPE === 'ABSENCE')){
// this.checkRequestType(index);
// } else {
// this.common.openNotificationPage();
// }
// } else {
// this.common.openNotificationPage();
// }
}
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.common.openWorklistMainMRPage();
} else {
this.intializeNotificationDetail();
}
} }
@ -924,11 +972,15 @@ export class WorklistMainComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal'; modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); if (data.data.data == "cancel" || data.data.data == undefined) {
if (data.data == "cancel" || data.data == undefined) {
return; return;
} else if (data.data == "Success") { } else if (data.data.data == "Success") {
this.nextNotfification(); this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} }
}); });
return await modal.present(); return await modal.present();
@ -1009,4 +1061,13 @@ export class WorklistMainComponent implements OnInit {
} }
}); });
} }
sortRequests(){
for(let i=0; i< this.notificationArray.length; i++){
if(this.notificationArray[i].ITEM_TYPE === 'HRSSA'){
this.arr_hr_req_only.push(this.notificationArray[i]);
}
}
console.log(this.arr_hr_req_only);
}
} }

Loading…
Cancel
Save