From 5a5e6bc0be8a878de8778c4735cf57ed46480bed Mon Sep 17 00:00:00 2001 From: enadhilal Date: Thu, 6 May 2021 12:26:01 +0300 Subject: [PATCH] no message --- .../authentication/login/login.component.html | 4 +- .../authentication/login/login.component.ts | 9 + .../apply-action-modal.component.ts | 2 +- .../app/notification/home/home.component.ts | 251 +++++++++--------- .../work-list-main-itg.component.html | 19 +- .../work-list-main-itg.component.ts | 91 ++++--- .../work-list-replacement-roll.component.html | 6 +- .../work-list-replacement-roll.component.ts | 110 ++++---- .../worklist-main-mr.component.scss | 4 +- .../worklist-main-mr.component.ts | 105 ++++---- .../worklist-main-po.component.scss | 4 +- .../worklist-main-po.component.ts | 193 +++++++------- .../worklist-main-pr.component.scss | 5 +- .../worklist-main-pr.component.ts | 54 ++-- .../worklist-main.component.html | 16 +- .../worklist-main.component.scss | 23 +- .../worklist-main/worklist-main.component.ts | 155 +++++++---- 17 files changed, 598 insertions(+), 453 deletions(-) diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html index 638b6265..e8219d21 100644 --- a/Mohem/src/app/authentication/login/login.component.html +++ b/Mohem/src/app/authentication/login/login.component.html @@ -24,8 +24,10 @@ -
diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 447b9d2b..eadc6411 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -100,6 +100,7 @@ export class LoginComponent implements OnInit, OnDestroy { getlastlogin: any; public keyboardOpened = false; private checkUserResult: CheckUserAuthenticationResponse; + private inputType = "password"; ngOnInit() { this.monitorKeyboardChange(); @@ -392,4 +393,12 @@ export class LoginComponent implements OnInit, OnDestroy { return await modal.present(); } + showPassword(){ + this.inputType = 'password'; + } + + hidePassword(){ + this.inputType = 'text'; + } + } diff --git a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts index 43ea2773..7b7d05e0 100644 --- a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts +++ b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts @@ -153,7 +153,7 @@ export class ApplyActionModalComponent implements OnInit { setTimeout(() => { this.messageSuccess = false; - }, 5000); + }, 2000); this.cs.openNotificationPage(); // this.getNotificationCountAfterSubmit(); diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index ec019152..fc4f266c 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -156,22 +156,22 @@ export class HomeComponent implements OnInit { spaceBetween: 10 }; constructor( - public common: CommonService, - public ts: TranslatorService, - // tslint:disable-next-line: no-shadowed-variable - public WorklistService: WorklistService, - public workListService: WorklistMainService, - public modalController: ModalController, - public DS: DashboredService - ) { - this.WorkListObj = new WorkListRequest(); - this.WorkListObj.P_NOTIFICATION_TYPE = '1'; - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_PAGE_NUM = 0; - this.WorkListObj.P_PAGE_LIMIT = 50; + public common: CommonService, + public ts: TranslatorService, + // tslint:disable-next-line: no-shadowed-variable + public WorklistService: WorklistService, + public workListService: WorklistMainService, + public modalController: ModalController, + public DS: DashboredService + ) { + this.WorkListObj = new WorkListRequest(); + this.WorkListObj.P_NOTIFICATION_TYPE = '1'; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_PAGE_NUM = 0; + this.WorkListObj.P_PAGE_LIMIT = 50; } ngOnInit() { @@ -247,17 +247,17 @@ export class HomeComponent implements OnInit { for (const notification of openNotificationsArray) { if (notification.ITEM_TYPE === 'HRSSA') { - this.filters[1].value = this.totalHR; - this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; + this.filters[1].value = this.totalHR; + this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'POAPPRV') { - this.filters[2].value = this.totalPO; - this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; + this.filters[2].value = this.totalPO; + this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'REQAPPRV') { - this.filters[3].value = this.totalPR; - this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; + this.filters[3].value = this.totalPR; + this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; } else if (notification.ITEM_TYPE === 'INVMOA') { - this.filters[4].value = this.totalMR; - this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; + this.filters[4].value = this.totalMR; + this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; } } // this.data.datasets[0].data[4] = this.ITGCount; @@ -266,7 +266,7 @@ export class HomeComponent implements OnInit { this.isLoading = false; } - checkLoadingStatus () { + checkLoadingStatus() { if (this.showChart && this.receivedITGCount) { this.common.stopLoading(); return true; @@ -322,28 +322,28 @@ export class HomeComponent implements OnInit { }); modal.onDidDismiss().then(result => { if (result.data) { - if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { - this.common.startLoading(); - this.isLoading = true; - this.showSearchButton = true; - this.itemType = result.data.itemType; - this.notificationType = result.data.notificationType; - this.selectedValue = result.data.selectedValue; - this.inputDate = result.data.inputDate; - this.inputSearch = result.data.inputSearch; - this.WorkListObj.P_PAGE_NUM = 1; - this.newWorkListResponse = []; - this.showFormattedData = []; - this.selectedFilter = 'ALL'; - this.filters[this.currentActiveIndex].active = false; - this.currentActiveIndex = 0; - this.previousActiveIndex = 0; - this.filters[this.currentActiveIndex].active = true; - if (this.itemType !== '') { - this.disableFilters(); - } - this.isPostNoLoad = false; - this.getAllPushNotificationFun(); + if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { + this.common.startLoading(); + this.isLoading = true; + this.showSearchButton = true; + this.itemType = result.data.itemType; + this.notificationType = result.data.notificationType; + this.selectedValue = result.data.selectedValue; + this.inputDate = result.data.inputDate; + this.inputSearch = result.data.inputSearch; + this.WorkListObj.P_PAGE_NUM = 1; + this.newWorkListResponse = []; + this.showFormattedData = []; + this.selectedFilter = 'ALL'; + this.filters[this.currentActiveIndex].active = false; + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + this.filters[this.currentActiveIndex].active = true; + if (this.itemType !== '') { + this.disableFilters(); + } + this.isPostNoLoad = false; + this.getAllPushNotificationFun(); } } }); @@ -351,41 +351,41 @@ export class HomeComponent implements OnInit { } getAllPushNotificationFun() { - this.WorkListObj.P_PAGE_NUM = 1; - this.isReachEnd = false; - 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_SENT_DATE = (this.inputDate && this.selectedValue === '3') - ? moment(this.inputDate).format('DD-MMM-YYYY') : ''; - 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_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1'; - if (this.selectedValue === '5') { - this.WorkListObj.P_SEARCH_FROM_USER = ''; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; - this.WorkListObj.P_SEARCH_SENT_DATE = ''; - this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_PAGE_NUM = 1; + this.isReachEnd = false; + 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_SENT_DATE = (this.inputDate && this.selectedValue === '3') + ? moment(this.inputDate).format('DD-MMM-YYYY') : ''; + 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_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1'; + if (this.selectedValue === '5') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + 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) { if (filter === 'ALL') { this.showFormattedData = this.allFormattedData; } else { - let arrayToFilter; - arrayToFilter = this.newWorkListResponse.filter((workList) => { - return workList.ITEM_TYPE === filter; - }); - const categorizeData = this.categorizeData(arrayToFilter); - this.showFormattedData = this.sortArray(categorizeData); - // const sortData = this.sortArray(arrayToFilter); - // this.showFormattedData = this.categorizeData(sortData); + let arrayToFilter; + arrayToFilter = this.newWorkListResponse.filter((workList) => { + return workList.ITEM_TYPE === filter; + }); + const categorizeData = this.categorizeData(arrayToFilter); + this.showFormattedData = this.sortArray(categorizeData); + // const sortData = this.sortArray(arrayToFilter); + // this.showFormattedData = this.categorizeData(sortData); } } @@ -393,11 +393,11 @@ export class HomeComponent implements OnInit { let existsBefore = false; let index = 0; for (let i = 0; i < formattedData.length; i++) { - if (formattedData[i].date === currentDate) { - existsBefore = true; - index = i; - break; - } + if (formattedData[i].date === currentDate) { + existsBefore = true; + index = i; + break; + } } return { exists: existsBefore, @@ -409,7 +409,7 @@ export class HomeComponent implements OnInit { if (workList.ITEM_TYPE === 'HRSSA') { this.totalHR = this.totalHR + 1; } else if (workList.ITEM_TYPE === 'POAPPRV') { - this.totalPO = this.totalPO + 1; + this.totalPO = this.totalPO + 1; } else if (workList.ITEM_TYPE === 'REQAPPRV') { this.totalPR = this.totalPR + 1; } else if (workList.ITEM_TYPE === 'INVMOA') { @@ -418,41 +418,41 @@ export class HomeComponent implements OnInit { } categorizeData(arrayToCategorize: any) { - this.totalHR = 0; - this.totalPO = 0; - this.totalPR = 0; - this.totalMR = 0; - - const datePipe = new DatePipe('en-US'); - const formattedData = []; - for (const workList of arrayToCategorize) { - this.addCountInFilters(workList); - const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); - const currentObject = { - date: '', - data: [] - }; - if (formattedData.length === 0) { - currentObject.date = currentDate; - currentObject.data.push(workList); - formattedData.push(currentObject); - } else { - const existsBefore = this.checkDateExistance(currentDate, formattedData); - if (existsBefore.exists) { - formattedData[existsBefore.indexNumber].data.push(workList); - } else { - currentObject.date = currentDate; - currentObject.data.push(workList); - formattedData.push(currentObject); - } - } + this.totalHR = 0; + this.totalPO = 0; + this.totalPR = 0; + this.totalMR = 0; + + const datePipe = new DatePipe('en-US'); + const formattedData = []; + for (const workList of arrayToCategorize) { + this.addCountInFilters(workList); + const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); + const currentObject = { + date: '', + data: [] + }; + if (formattedData.length === 0) { + currentObject.date = currentDate; + currentObject.data.push(workList); + formattedData.push(currentObject); + } else { + const existsBefore = this.checkDateExistance(currentDate, formattedData); + if (existsBefore.exists) { + formattedData[existsBefore.indexNumber].data.push(workList); + } else { + currentObject.date = currentDate; + currentObject.data.push(workList); + formattedData.push(currentObject); + } } - return formattedData; + } + return formattedData; } sortArray(arrayToSort: 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.showChart = true; // this.common.stopLoading(); - this.isLoading =false; + this.isLoading = false; } } openNotificationDetail(obj) { - this.common.sharedService.setSharedData(false, 'loadWorkList'); - this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); - if (obj.REQUEST_TYPE === 'PR') { + this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter'); + this.common.sharedService.setSharedData(false, 'loadWorkList'); + this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); + if (obj.REQUEST_TYPE === 'PR') { this.common.openWorklistMainPRPage(); - } else if (obj.REQUEST_TYPE === 'PO') { - this.common.openWorklistMainPOPage(); - } else if (obj.REQUEST_TYPE === 'MO') { - this.common.openWorklistMainMRPage(); - } else { - this.common.openWorklistMainPage(); - } + } else if (obj.REQUEST_TYPE === 'PO') { + this.common.openWorklistMainPOPage(); + } else if (obj.REQUEST_TYPE === 'MO') { + this.common.openWorklistMainMRPage(); + } else { + this.common.openWorklistMainPage(); + } } resetData() { @@ -562,9 +563,9 @@ export class HomeComponent implements OnInit { Count() { const datas = []; const names = []; - this.workListService.getITGCount('', '', this.isPostNoLoad) + this.workListService.getITGCount('', '', this.isPostNoLoad) .subscribe((result: any) => { - if(result.RequestType.length > 0){ + if (result.RequestType.length > 0) { this.ITGSegment[0] = { name: 'All', code: 'All', @@ -576,7 +577,7 @@ export class HomeComponent implements OnInit { this.setActive(this.ITGSegment[0].code); } console.log(result.RequestType); - let count =1; + let count = 1; for (let i = 0; i < result.RequestType.length; i++) { console.log() this.ITGSegment[count] = { diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index 6a644cae..0f66b227 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -1,7 +1,7 @@ - + @@ -450,8 +450,19 @@ + +
+ + + + +
{{'worklistMain, Tran_Succ' | translate}}
+
+
+
+ - + @@ -462,8 +473,8 @@ (click)="selectAtion(action.name)" [ngClass]="i === 0 ? 'tabs-margin' : ''"> - {{action.name}} - Request Information + {{action.name}} + Request Info diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 111682e1..e863feae 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -8,6 +8,7 @@ import { ModalController } from '@ionic/angular'; 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 { IonSlides } from '@ionic/angular'; +import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; @Component({ selector: 'app-work-list-main-itg', @@ -58,6 +59,7 @@ export class WorkListMainItgComponent implements OnInit { direction: string; defaultSegment = ''; public slideIndex = 0; + private messageSuccess = false; constructor( public common: CommonService, public ts: TranslatorService, @@ -270,13 +272,13 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - - this.confirmMsg(1) - // this.common.openNotificationPage(); - this.skip(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.confirmMsg(1); + this.skip(); + }, 2000); } }); } else if (action == 2) {//reject @@ -287,12 +289,15 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.confirmMsg(2) - // this.common.openNotificationPage(); - this.skip(); + setTimeout(() => { + this.messageSuccess = true; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); + // this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.confirmMsg(2); + this.skip(); + this.messageSuccess = false; + }, 2000); } }); } else if (action == 3) {//request more info @@ -310,12 +315,15 @@ export class WorkListMainItgComponent implements OnInit { } if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.confirmMsg(3) - // this.common.openNotificationPage(); - this.skip(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); + 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')); } else if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.confirmMsg(4) - // this.common.openNotificationPage(); - this.skip(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); + this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.confirmMsg(4); + this.skip(); + }, 2000); } }); } else if (action == 5) { //answer @@ -347,12 +358,15 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.confirmMsg(5) - // this.common.openNotificationPage(); - this.skip(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); + 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')); } else if (result.MessageStatus == 1) { - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); - this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.confirmMsg(6) - // this.common.openNotificationPage(); - this.skip(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.common.sharedService.setSharedData(true, 'loadWorkList'); + // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); + this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.confirmMsg(6); + this.skip(); + }, 2000); } }); } else { diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html index 2a655824..f6d2571c 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -148,10 +148,10 @@
- {{"replacementRoll, enterNote" | translate}} - + - +

diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index 1db43447..e2c9f2ed 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -37,10 +37,10 @@ export class WorkListReplacementRollComponent implements OnInit { private WorkListActionObj: WorkListActionRequest; getpassResAttr: any = []; active: any; - demoeAttach:any=[]; - isSelect: boolean =false; + demoeAttach: any = []; + isSelect: boolean = false; searchKeyEnter: boolean = false; - messageSuccess: boolean =false; + messageSuccess: boolean = false; public direction: string; P_RESPOND_ATTRIBUTES_TBL: any[]; 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") { this.isAnswer = true; } - + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; 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_ACTION_MODE = ""; this.WorkListActionObj.P_COMMENTS = ""; - this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr; + this.WorkListActionObj.RespondAttributeList = [];// this.getpassResAttr; this.WorkListActionObj.P_APPROVER_INDEX = null; 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); - this.selEmp=selectEmp - this.active=index; + this.selEmp = selectEmp + this.active = index; } clear() { this.selEmpName = ""; @@ -208,18 +208,18 @@ export class WorkListReplacementRollComponent implements OnInit { } submitAction() { - + if (this.selEmp && this.isAnswer == false) { // this.selectedUserInf = this.ReplacementList[this.selEmp]; - this.selectedUserInf = this.selEmp; - console.log("selEmp "+ this.selEmp.USER_NAME); + this.selectedUserInf = this.selEmp; + console.log("selEmp " + this.selEmp.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.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"); 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"); 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); this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; 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; - }else{ + } else { + - - - this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; - this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; - this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr - // this.modalCtrl.dismiss(); + + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; + this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + // this.modalCtrl.dismiss(); } this.workListMainService.actionButton(this.WorkListActionObj). subscribe((result: any) => { this.handleApplayActionResult(result); }); - + } else { let msg: string = this.ts.trPK("replacementRoll", "enterNote"); this.cs.showErrorMessageDialog(() => { @@ -291,21 +291,25 @@ export class WorkListReplacementRollComponent implements OnInit { if (result.MessageStatus == 1) { this.cs.sharedService.setSharedData(true, 'loadWorkList'); - - this.messageSuccess = true; - setTimeout(() => { - this.messageSuccess = false; - //this.modalCtrl.dismiss(succ); + // this.messageSuccess = true; + + // setTimeout(() => { + // this.messageSuccess = false; + // //this.modalCtrl.dismiss(succ); + // this.modalCtrl.dismiss({ + // 'dismissed': true, + // data: "Success" + // }); + + // }, 2000); + + // this.cs.openNotificationPage(); this.modalCtrl.dismiss({ 'dismissed': true, data: "Success" }); - - }, 5000); - - this.cs.openNotificationPage(); - } + } } // not valid it @@ -358,33 +362,33 @@ export class WorkListReplacementRollComponent implements OnInit { } } - public col(){ + public col() { alert("test"); } closeModal() { this.modalCtrl.dismiss(); } - onChangeSelect(select){ + onChangeSelect(select) { console.log(select.detail.value); - let selectValue= select.detail.value; + let selectValue = select.detail.value; - if(selectValue == "1" || selectValue == "2" ||selectValue == "3"){ - this.isSelect=true; - } - else{ - this.isSelect=false; + if (selectValue == "1" || selectValue == "2" || selectValue == "3") { + this.isSelect = true; + } + else { + this.isSelect = false; - } + } } - onChangeInput(){ - if (this.inputSearch.length >0) { - this.searchKeyEnter=true; - - }else{ - this.searchKeyEnter=false; - - } + onChangeInput() { + if (this.inputSearch.length > 0) { + this.searchKeyEnter = true; + + } else { + this.searchKeyEnter = false; + + } } } diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss index 8e9c423c..b539fa22 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss @@ -137,6 +137,6 @@ } .action-btn { - white-space: pre-wrap; - font-size: 12px; + white-space: nowrap; + font-size: 10px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index 62fa3497..180ef69d 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -117,6 +117,7 @@ export class WorklistMainMRComponent implements OnInit { reqInfo_label: any=""; close_label: any; closeDis: boolean = false; + selectedFilter: string; constructor( @@ -141,7 +142,7 @@ export class WorklistMainMRComponent implements OnInit { ngOnInit() { this.WorkListAttachObj = new WorkListButtonRequest(); - + this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); this.intializeNotificationDetail(); } @@ -191,7 +192,7 @@ export class WorklistMainMRComponent implements OnInit { public segmentChanged1(event: any) { this.activeSegment = event.detail.value; - console.log(' event.detail.value: ' + event.detail.value); + // console.log(' event.detail.value: ' + event.detail.value); } intializeNotificationDetail() { @@ -205,12 +206,12 @@ export class WorklistMainMRComponent implements OnInit { if (this.messageSuccess) { document.getElementById('notificationDynamicFieldsMR').innerHTML = ''; } - console.log('intializeNotificationDetail'); + // console.log('intializeNotificationDetail'); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, false ); - console.log(this.getPassNotificationDetails.ROW_NUM); + // console.log(this.getPassNotificationDetails.ROW_NUM); this.notificationArray = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_ARR, false @@ -276,7 +277,7 @@ export class WorklistMainMRComponent implements OnInit { this.worklistMainService .getPONotificationBody(notificationBodyObj) .subscribe((result: PONotificatonBodyResponse) => { - console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); this.handleWorkListBodyResult(result, 'PO'); }); } @@ -329,7 +330,7 @@ export class WorklistMainMRComponent implements OnInit { if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; 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++) { if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) { this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL; @@ -413,41 +414,46 @@ export class WorklistMainMRComponent implements OnInit { public nextNotfification() { //let itemExist = false; if( document.getElementById("notificationDynamicFieldsMR") != null){ - document.getElementById("notificationDynamicFieldsMR").innerHTML = ""; } let itemNo = this.getPassNotificationDetails.ROW_NUM; - console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); - console.log(index); - console.log(this.notificationArray); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; index += 1; - + if (index < this.notificationArray.length) { this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); - 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(); + this.activeSegment = 'info'; + if (this.selectedFilter === 'ALL') { + this.checkRequestType(index); + } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { + this.checkRequestType(index); + } else { + this.common.openNotificationPage(); } - - } - else{ + } 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.intializeNotificationDetail(); + } else { + this.common.openWorklistMainPage(); + } + } + actionButton(action) { - console.log('actionButton' + action); + // console.log('actionButton' + action); // alert("don't forget"); //let ButtonAction: string = this.actionType; let ButtonAction: string = action; @@ -675,7 +681,7 @@ export class WorklistMainMRComponent implements OnInit { } getNotificationResAttr(notificationButtonsObj) { - console.log("getNotificationResAttr"); + // console.log("getNotificationResAttr"); this.NotRespondAttributeList=[]; this.worklistMainService .notificationResponseAttr(notificationButtonsObj) @@ -715,7 +721,7 @@ export class WorklistMainMRComponent 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') { @@ -823,7 +829,7 @@ export class WorklistMainMRComponent implements OnInit { async openNoteDetail(note, sender) { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); - console.log('note' + note); + // console.log('note' + note); this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') @@ -839,7 +845,7 @@ export class WorklistMainMRComponent implements OnInit { } doInfinite(infiniteScroll) { - console.log('doInfinite action history MR'); + // console.log('doInfinite action history MR'); if (!this.IsReachEnd) { this.worklistService.getActionHistory(this.WorkListActionHistoryObj). @@ -909,7 +915,7 @@ export class WorklistMainMRComponent implements OnInit { modal.onDidDismiss() .then((data) => { - console.log(data); // Here's your selected user! + // console.log(data); // Here's your selected user! }); // data => { @@ -924,7 +930,7 @@ export class WorklistMainMRComponent implements OnInit { doInfiniteNotificationBody(infiniteScroll) { - console.log('doInfiniteNotificationBody MR'); + // console.log('doInfiniteNotificationBody MR'); if (!this.IsReachEnd) { this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj). subscribe((result: any) => { @@ -959,9 +965,9 @@ export class WorklistMainMRComponent implements OnInit { loadMoreNotificationBody() { - console.log('loadMoreNotificationBody MR'); + // console.log('loadMoreNotificationBody MR'); if (!this.IsReachEnd) { - console.log('this.IsReachEnd' + this.IsReachEnd); + // console.log('this.IsReachEnd' + this.IsReachEnd); this.worklistMainService.getMONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { @@ -996,7 +1002,7 @@ export class WorklistMainMRComponent implements OnInit { } }//end infiniteScroll loadMoreActionHistory() { - console.log('doInfinite action history MR'); + // console.log('doInfinite action history MR'); if (!this.IsReachEnd) { this.worklistService.getActionHistory(this.WorkListActionHistoryObj). @@ -1044,7 +1050,7 @@ export class WorklistMainMRComponent implements OnInit { modal.onDidDismiss() .then((data) => { - console.log(data.data); + // console.log(data.data); if (data.data == 'cancel' || data.data == undefined) { return; @@ -1052,7 +1058,7 @@ export class WorklistMainMRComponent implements OnInit { // this.selectedAction = data.data; this.actionType = data.data.BUTTON_ACTION; - console.log(this.actionType); + // console.log(this.actionType); ///call Action button this.actionButton(this.actionType); } @@ -1069,8 +1075,8 @@ export class WorklistMainMRComponent implements OnInit { /////////////////////////////////////////// public checkLines(note) { - console.log(note.split('\n').length); - console.log(note.length); + // console.log(note.split('\n').length); + // console.log(note.length); if (note && note != null) { @@ -1094,7 +1100,7 @@ export class WorklistMainMRComponent implements OnInit { } this.actionHistoryRes = actionHis; - console.log('test'); + // console.log('test'); } @@ -1108,13 +1114,18 @@ export class WorklistMainMRComponent implements OnInit { modal.cssClass = 'replaceRoll-modal'; 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; - } else if (data.data == 'Success') { + } else if (data.data.data == 'Success') { // 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() .then((data) => { - console.log(data.data); + // console.log(data.data); if (data.data == 'cancel' || data.data == undefined) { return; @@ -1160,7 +1171,7 @@ export class WorklistMainMRComponent implements OnInit { getMOItemHistory(itemID ,orgID) { - console.log(itemID); + // console.log(itemID); this.IsReachEnd = false; const request = new MOItemHistoryReq(); request.P_ITEM_ID = parseInt(itemID); diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss index 8c86b6a3..ffee0278 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss @@ -139,6 +139,6 @@ border: 0; } .action-btn { - white-space: pre-wrap; - font-size: 12px; + white-space: nowrap; + font-size: 10px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index cdc5f505..a37979ef 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -64,8 +64,8 @@ export class WorklistMainPoComponent implements OnInit { getPassNotificationDetails: any; public static PASS_RES_ATTR = "passResAttr"; TransactionID: number = -999; - notificationBodyRes : any =[]; - actionHistoryRes: any =[]; + notificationBodyRes: any = []; + actionHistoryRes: any = []; notificationButtonRes: any; actionMode: any; pInformation: string = ""; @@ -127,7 +127,9 @@ export class WorklistMainPoComponent implements OnInit { approve_label: any; reject_label: any; reqInfo_label: any; - closeDis: boolean = false;; + closeDis: boolean = false; + selectedFilter: string; +; close_label: any; constructor( @@ -151,52 +153,45 @@ export class WorklistMainPoComponent implements OnInit { ngOnInit() { this.WorkListAttachObj = new WorkListButtonRequest(); + this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); this.intializeNotificationDetail(); }//ngOn public segmentChanged(event: any) { this.activeSegment = event.detail.value; - if(this.activeSegment === 'line_details') - { - this.slides.slideTo(0); - } - else if(this.activeSegment === 'action-history') - { - this.slides.slideTo(1); - } - else if(this.activeSegment === 'attach') - { - this.slides.slideTo(2); - } - else if(this.activeSegment === 'info') - { - this.slides.slideTo(3); - } - console.log(" event.detail.value: " + event.detail.value); + if (this.activeSegment === 'line_details') { + this.slides.slideTo(0); + } + else if (this.activeSegment === 'action-history') { + this.slides.slideTo(1); + } + else if (this.activeSegment === 'attach') { + this.slides.slideTo(2); + } + else if (this.activeSegment === 'info') { + this.slides.slideTo(3); + } + // console.log(" event.detail.value: " + event.detail.value); } public slideChanged(event: any) { this.slides.getActiveIndex().then(index => { - console.log(index); - console.log(event); - if(index === 0) - { + // console.log(index); + // console.log(event); + if (index === 0) { this.activeSegment = 'line_details'; } - else if(index === 1) - { + else if (index === 1) { this.activeSegment = 'action-history'; } - else if(index === 2) - { + else if (index === 2) { this.activeSegment = 'attach'; } - else if(index === 3) - { + else if (index === 3) { this.activeSegment = 'info'; } - console.log(this.activeSegment); + // console.log(this.activeSegment); }); } @@ -207,18 +202,18 @@ export class WorklistMainPoComponent implements OnInit { this.approveDis = false; this.rejectDis = false; this.requestDis = false; - this.closeDis=false; + this.closeDis = false; this.moreDisabled = true; if (this.messageSuccess) { document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; } - console.log("intializeNotificationDetail"); + // console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, false ); - console.log(this.getPassNotificationDetails.ROW_NUM); + // console.log(this.getPassNotificationDetails.ROW_NUM); this.notificationArray = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_ARR, false @@ -260,14 +255,14 @@ export class WorklistMainPoComponent implements OnInit { public segmentChanged1(event: any) { this.activeSegment = event.detail.value; - console.log(" event.detail.value: " + event.detail.value); + // console.log(" event.detail.value: " + event.detail.value); } getPONotificationDetails(notificationBodyObj) { this.worklistMainService .getPONotificationBody(notificationBodyObj) .subscribe((result: PONotificatonBodyResponse) => { - console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); this.handleWorkListBodyResult(result, "PO"); }); } @@ -283,14 +278,14 @@ export class WorklistMainPoComponent implements OnInit { result.GetEITCollectionNotificationBodyList; } } else if (Type == "ABSENCE") { - console.log("ABSENCE"); + // console.log("ABSENCE"); if (result.GetAbsenceCollectionNotificationBodyList) { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } } else if (Type == "PR") { if (result.GetPrNotificationBodyList) { - console.log("PR"); + // console.log("PR"); this.PRHeader = result.GetPrNotificationBodyList.PRHeader; this.PRLines = result.GetPrNotificationBodyList.PRLines; @@ -315,7 +310,7 @@ export class WorklistMainPoComponent implements OnInit { } else if (Type == "PO") { if (result.GetPoNotificationBodyList) { - console.log("PO"); + // console.log("PO"); this.POHeader = result.GetPoNotificationBodyList.POHeader; this.POLines = result.GetPoNotificationBodyList.POLines; @@ -361,34 +356,33 @@ export class WorklistMainPoComponent implements OnInit { if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; 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++) { 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 @@ -397,7 +391,7 @@ export class WorklistMainPoComponent implements OnInit { } applyAction(WorkListActionObj) { - console.log("applyactio"); + // console.log("applyactio"); this.worklistMainService .actionButton(WorkListActionObj) .subscribe((result: any) => { @@ -442,44 +436,50 @@ export class WorklistMainPoComponent implements OnInit { // } public nextNotfification() { - //let itemExist = false; - if( document.getElementById("notificationDynamicFieldsPO") != null){ - - document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; + if (document.getElementById('notificationDynamicFieldsPO') != null) { + document.getElementById('notificationDynamicFieldsPO').innerHTML = ''; + } - } let itemNo = this.getPassNotificationDetails.ROW_NUM; - console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); - console.log(index); - console.log(this.notificationArray); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; + let previousRequestType = this.notificationArray[index].ITEM_TYPE; index += 1; - + if (index < this.notificationArray.length) { this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); - 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(); + this.activeSegment = 'line_details'; + if(this.selectedFilter === 'ALL'){ + this.checkRequestType(index); + } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { + this.checkRequestType(index); + }else { + this.common.openNotificationPage(); } - - } - else{ + } else { 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) { - console.log("actionButton" + action); - // alert("don't forget"); + // console.log("actionButton" + action); + // alert("don't forget"); //let ButtonAction: string = this.actionType; let ButtonAction: string = action; @@ -499,7 +499,7 @@ export class WorklistMainPoComponent implements OnInit { } 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; // if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { @@ -610,7 +610,7 @@ export class WorklistMainPoComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPoComponent.PASS_RES_ATTR ); - console.log("c"+ this.P_RESPOND_ATTRIBUTES_TBL); + // console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL); // this.common.openWorklistRollReplacement(); this.openRepRolModal(); @@ -715,7 +715,7 @@ export class WorklistMainPoComponent implements OnInit { } getNotificationResAttr(notificationButtonsObj) { - console.log("getNotificationResAttr"); + // console.log("getNotificationResAttr"); this.NotRespondAttributeList = []; this.worklistMainService @@ -756,7 +756,7 @@ export class WorklistMainPoComponent 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") { @@ -814,7 +814,7 @@ export class WorklistMainPoComponent implements OnInit { getAttachmentNotification(WorkListAttachObj) { - this.attachmentRes =[]; + this.attachmentRes = []; this.worklistAttachService.getAttach(WorkListAttachObj). subscribe((result: NotificationGetAttachResponse) => { this.handleWorkListAttachResult(result); @@ -832,7 +832,7 @@ export class WorklistMainPoComponent implements OnInit { getActionHistory(WorkListActionHistoryObj) { this.IsReachEnd = true; - this.actionHistoryRes=[]; + this.actionHistoryRes = []; this.worklistService.getActionHistory(WorkListActionHistoryObj). subscribe((result: WorkListActionHistoryResponse) => { this.handleWorkListActionHistoryResult(result); @@ -865,7 +865,7 @@ export class WorklistMainPoComponent implements OnInit { async openNoteDetail(note, sender) { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); - console.log("note" + note); + // console.log("note" + note); this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') @@ -881,7 +881,7 @@ export class WorklistMainPoComponent implements OnInit { } doInfinite(infiniteScroll) { - console.log("doInfinite action history"); + // console.log("doInfinite action history"); if (!this.IsReachEnd) { this.worklistService.getActionHistory(this.WorkListActionHistoryObj). subscribe((result: any) => { @@ -929,7 +929,7 @@ export class WorklistMainPoComponent implements OnInit { } getItemHistory(itemID) { - console.log(itemID); + // console.log(itemID); this.IsReachEnd = false; const request = new POItemHistoryRequest(); request.P_ITEM_ID = parseInt(itemID); @@ -968,7 +968,7 @@ export class WorklistMainPoComponent implements OnInit { } getQutationAnalysis(headerID, itemID) { - console.log(itemID + headerID); + // console.log(itemID + headerID); this.IsReachEnd = false; const request = new QuotationAnalysisRequest(); request.P_ITEM_ID = parseInt(itemID); @@ -1025,9 +1025,9 @@ export class WorklistMainPoComponent implements OnInit { } loadMoreNotificationBody() { - console.log("loadMoreNotificationBody PO"); + // console.log("loadMoreNotificationBody PO"); if (!this.IsReachEnd) { - console.log("this.IsReachEnd" + this.IsReachEnd); + // console.log("this.IsReachEnd" + this.IsReachEnd); this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { @@ -1183,11 +1183,16 @@ export class WorklistMainPoComponent implements OnInit { .then((data) => { console.log(data.data); - if (data.data == "cancel" || data.data == undefined) { + if (data.data.data == "cancel" || data.data.data == undefined) { return; - } else if (data.data == "Success") { + } else if (data.data.data == "Success") { // this.openNotificationsDashboard(); - this.nextNotfification(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.nextNotfification(); + }, 2000); + // this.nextNotfification(); } }); diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss index 635158dc..c58a5c9b 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss @@ -136,6 +136,7 @@ border: 0; } .action-btn { - white-space: pre-wrap; - font-size: 12px; + // white-space: pre-wrap; + white-space: nowrap; + font-size: 10px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index bc8b2585..7fa0f6d3 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -114,6 +114,7 @@ export class WorklistMainPRComponent implements OnInit { reqInfo_label: any; close_label: any; closeDis: boolean = false; + selectedFilter: any; constructor( @@ -138,7 +139,7 @@ export class WorklistMainPRComponent implements OnInit { ngOnInit() { this.WorkListAttachObj = new WorkListButtonRequest(); - + this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); this.intializeNotificationDetail(); } @@ -447,29 +448,39 @@ export class WorklistMainPRComponent implements OnInit { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); console.log(index); console.log(this.notificationArray); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; index += 1; - + if (index < this.notificationArray.length) { this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); - 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(); - } - + this.activeSegment = 'info'; + if(this.selectedFilter === 'ALL'){ + this.checkRequestType(index); + } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { + this.checkRequestType(index); + } else { + this.common.openNotificationPage(); } - else{ + } 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.intializeNotificationDetail(); + } else + if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) { + this.common.openWorklistMainMRPage(); + } else { + this.common.openWorklistMainPage(); + } + } + actionButton(action) { console.log('actionButton' + action); @@ -1105,11 +1116,16 @@ export class WorklistMainPRComponent implements OnInit { .then((data) => { console.log(data.data); - if (data.data == 'cancel' || data.data == undefined) { + if (data.data.data == 'cancel' || data.data.data == undefined) { return; - } else if (data.data == 'Success') { + } else if (data.data.data == 'Success') { // this.openNotificationsDashboard(); - this.nextNotfification(); + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.nextNotfification(); + }, 2000); + // this.nextNotfification(); } }); diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index d13459cc..b9a2af3f 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -5,7 +5,7 @@
-
{{getPassNotificationDetails.SUBJECT}}
+
{{getPassNotificationDetails?.SUBJECT}}
@@ -71,9 +71,11 @@ *ngFor="let List of subordinatesleaveList;">
-


+
+ - - - +

@@ -100,7 +104,7 @@
- + diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss index 7d218c79..a9e8bbf9 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -182,11 +182,12 @@ } .status{ text-align: center; -background: green; +// background: green; border-radius: 10px; -font-size: 12px; +font-size: 10px !important; height: 40px; color: white; +position: relative; } .rowHeader{ border-bottom: 1px solid var(--cusgray); @@ -215,9 +216,9 @@ color: white; } .gridSubordinates{ - margin-left: 38px; - border-top-left-radius: 28px; - border-bottom-left-radius: 40px; + margin-left: 3%;//38px; + border-top-left-radius: 16px;//28px; + border-bottom-left-radius: 16px;//40px; // padding-left: 8px; background:var(--light); border-top-right-radius: 16px; @@ -226,9 +227,11 @@ color: white; .subOrdinateDiv{ z-index: 4; - margin-left: -32px; - position: absolute; - top: -2px; + margin-left: 0px;//-32px; + // position: absolute; + top: 5px;//-2px; + float: left; + margin-right: 10px; } .subOrdinateImg{ width: 85px; @@ -327,6 +330,6 @@ ion-card{ border: 0; } .action-btn { - white-space: pre-wrap; - font-size: 12px; + white-space: nowrap; + font-size: 10px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index 5e732aab..d3642403 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -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 { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { IonSlides } from '@ionic/angular'; +import { ActivatedRoute } from '@angular/router';​ @Component({ selector: "app-worklist-main", @@ -104,6 +105,8 @@ export class WorklistMainComponent implements OnInit { reqInfo_label: any = ""; close_label: any; closeDis: boolean = false; + public selectedFilter: string; + public arr_hr_req_only= []; constructor( public worklistService: WorklistService, @@ -116,19 +119,30 @@ export class WorklistMainComponent implements OnInit { public worklistAttachService: WorklistAttachService, private modalCtrl: ModalController, public dashboredService: DashboredService, - public authService: AuthenticationService - ) { + public authService: AuthenticationService, + public route: ActivatedRoute + ) { this.direction = TranslatorService.getCurrentLanguageName() this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj.P_PAGE_NUM = 1; 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( MenuResponse.SHARED_SEL_EMP, false ); + this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false); if (this.selEmp) { } else { this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { if (user) { @@ -136,28 +150,27 @@ export class WorklistMainComponent implements OnInit { } }); } - this.intializeNotificationDetail(); } + // ionViewWillEnter(){ + // 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); + } console.log(" event.detail.value: " + event.detail.value); } @@ -165,20 +178,16 @@ export class WorklistMainComponent 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); @@ -207,6 +216,11 @@ export class WorklistMainComponent implements OnInit { HomeComponent.NOTIFICATION_ARR, false ); + console.log(this.selectedFilter); + if(this.selectedFilter === 'HRSSA') { + this.arr_hr_req_only = []; + this.sortRequests(); + } this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListButtonsObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest(); @@ -408,7 +422,7 @@ export class WorklistMainComponent implements OnInit { this.messageSuccess = false; // this.openNotificationsDashboard(); this.nextNotfification(); - }, 5000); + }, 2000); } } // valid it } @@ -447,26 +461,60 @@ export class WorklistMainComponent implements OnInit { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); console.log(index); console.log(this.notificationArray); + let previousRequest = this.notificationArray[index].REQUEST_TYPE; index += 1; - if (index < this.notificationArray.length) { - this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); - 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 { + if(index < this.notificationArray.length){ + this.activeSegment = 'info'; + if (this.selectedFilter === 'ALL') { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + this.checkRequestType(index); + } else { + if(this.arr_hr_req_only){ + let requestIndex = this.arr_hr_req_only.findIndex(x => x.ROW_NUM === itemNo); + requestIndex++; + if(requestIndex < this.arr_hr_req_only.length){ + this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA); this.intializeNotificationDetail(); + }else{ + this.common.openNotificationPage(); } - } - else { + } + } + } else { 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.onDidDismiss() .then((data) => { - console.log(data.data); - if (data.data == "cancel" || data.data == undefined) { + if (data.data.data == "cancel" || data.data.data == undefined) { return; - } else if (data.data == "Success") { - this.nextNotfification(); + } else if (data.data.data == "Success") { + this.messageSuccess = true; + setTimeout(() => { + this.messageSuccess = false; + this.nextNotfification(); + }, 2000); + // this.nextNotfification(); } }); 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); + } }