From 929844d1ef2ce67ec868f84326f29ee56fea7aeb Mon Sep 17 00:00:00 2001 From: ashwaq Date: Thu, 5 Mar 2020 11:49:22 +0300 Subject: [PATCH] fix worklist issue --- .../app/notification/home/home.component.html | 4 ++- .../app/notification/home/home.component.ts | 17 +++++++--- .../item-history/item-history.component.html | 6 ++-- .../mo-item-history.component.html | 3 ++ .../mo-item-history.component.scss | 0 .../mo-item-history.component.spec.ts | 27 +++++++++++++++ .../mo-item-history.component.ts | 17 ++++++++++ .../more-action-modal.component.html | 2 +- .../qutation-analysis.component.html | 2 +- .../qutation-analysis.component.ts | 4 +-- .../work-list-replacement-roll.component.html | 16 +++++++-- .../work-list-replacement-roll.component.ts | 24 +++++++++++--- .../work-list-rfc.component.html | 20 +++++++---- .../work-list-rfc.component.scss | 19 ++++++++++- .../work-list-rfc/work-list-rfc.component.ts | 15 +++++++-- .../worklist-main-mr.component.html | 28 ++++++++-------- .../worklist-main-mr.component.ts | 32 +++++++++++------- .../worklist-main-po.component.html | 30 ++++++++--------- .../worklist-main-po.component.ts | 22 ++++++++----- .../worklist-main-pr.component.html | 28 ++++++++-------- .../worklist-main-pr.component.ts | 15 ++++++--- .../worklist-main.component.html | 24 ++++++++------ .../worklist-main.component.scss | 33 ++++++++++--------- .../worklist-main/worklist-main.component.ts | 17 ++++++---- Mohem/src/theme/worklist.scss | 3 +- 25 files changed, 279 insertions(+), 129 deletions(-) create mode 100644 Mohem/src/app/notification/mo-item-history/mo-item-history.component.html create mode 100644 Mohem/src/app/notification/mo-item-history/mo-item-history.component.scss create mode 100644 Mohem/src/app/notification/mo-item-history/mo-item-history.component.spec.ts create mode 100644 Mohem/src/app/notification/mo-item-history/mo-item-history.component.ts diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 3a4e61fb..ad9e7e6f 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -64,9 +64,11 @@
{{data.key}} -
+
+

{{workList.SUBJECT}}

+
diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 7b9e3d72..eca37b01 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -152,7 +152,14 @@ export class HomeComponent implements OnInit { this.WorkListObj.P_PAGE_LIMIT = 50; } - ngOnInit() { + + ngOnInit(){ + + } + + ionViewDidEnter() { + console.log("ionViewDidEnter"); + // this.direction = TranslatorService.getCurrentDirection(); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); this.Details(); @@ -287,6 +294,7 @@ export class HomeComponent implements OnInit { } categorizeData(arrayToCategorize: any) { + console.log("categorizeData"); const datePipe = new DatePipe('en-US'); const formattedData = {}; for (const workList of arrayToCategorize) { @@ -340,12 +348,13 @@ export class HomeComponent implements OnInit { } openNotificationDetail(obj) { - this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA); + console.log(obj); + this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); if (obj.REQUEST_TYPE === 'PR') { this.common.openWorklistMainPRPage(); - } else if (obj[0].REQUEST_TYPE === 'PO') { + } else if (obj.REQUEST_TYPE === 'PO') { this.common.openWorklistMainPOPage(); - } else if (obj[0].REQUEST_TYPE === 'MO') { + } else if (obj.REQUEST_TYPE === 'MO') { this.common.openWorklistMainMRPage(); } else { this.common.openWorklistMainPage(); diff --git a/Mohem/src/app/notification/item-history/item-history.component.html b/Mohem/src/app/notification/item-history/item-history.component.html index 1ac2132a..f3bba0cc 100644 --- a/Mohem/src/app/notification/item-history/item-history.component.html +++ b/Mohem/src/app/notification/item-history/item-history.component.html @@ -1,5 +1,5 @@ - + {{ts.trPK('worklistMain','ITEM_HIS')}} @@ -22,10 +22,10 @@ --> -
+

{{ 'general, empty' | translate}}

- +
diff --git a/Mohem/src/app/notification/mo-item-history/mo-item-history.component.html b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.html new file mode 100644 index 00000000..846a9cfe --- /dev/null +++ b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.html @@ -0,0 +1,3 @@ +

+ mo-item-history works! +

diff --git a/Mohem/src/app/notification/mo-item-history/mo-item-history.component.scss b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/notification/mo-item-history/mo-item-history.component.spec.ts b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.spec.ts new file mode 100644 index 00000000..00e6b861 --- /dev/null +++ b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MoItemHistoryComponent } from './mo-item-history.component'; + +describe('MoItemHistoryComponent', () => { + let component: MoItemHistoryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MoItemHistoryComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MoItemHistoryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/mo-item-history/mo-item-history.component.ts b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.ts new file mode 100644 index 00000000..67073b99 --- /dev/null +++ b/Mohem/src/app/notification/mo-item-history/mo-item-history.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-mo-item-history', + templateUrl: './mo-item-history.component.html', + styleUrls: ['./mo-item-history.component.scss'], +}) +export class MoItemHistoryComponent implements OnInit { + + constructor() { } + + ngOnInit() { + + + } + +} diff --git a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html index 8a39b98e..da57e57b 100644 --- a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html +++ b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html @@ -17,7 +17,7 @@ style="margin-right: -22px;margin-top: -10px;">
- + {{button.BUTTON_LABEL}} diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html index 92236371..6dc47011 100644 --- a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html @@ -1,5 +1,5 @@ - + {{ts.trPK('worklistMain','QUOTATION_ANALYSIS')}} diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts index fe446349..3739b984 100644 --- a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts @@ -60,8 +60,8 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID); const request = new QuotationAnalysisRequest(); request.P_ITEM_ID=parseInt(itemID); request.P_PO_HEADER_ID=headerID; - request.P_PAGE_LIMIT=1; - request.P_PAGE_NUM=50; + request.P_PAGE_LIMIT=100; + request.P_PAGE_NUM=1; this.doInfiniteReq=request; this.worklistMainService.getQutationAnalysis(request). subscribe((result: QuotationAnalysisResponse) => { 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 b4edfb82..24c7ebb4 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 @@ -1,4 +1,4 @@ - + {{ 'replacementRoll, title' | translate}} @@ -6,7 +6,7 @@ - +
{{'replacementRoll, searchBy' | translate}} @@ -109,9 +109,19 @@ + + +
+
+ + + + +
Transaction Successful
+
- +
{{"replacementRoll, question" | 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 12b0d317..e94b9af4 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 @@ -38,6 +38,7 @@ export class WorkListReplacementRollComponent implements OnInit { getpassResAttr: any = []; active: any; demoeAttach:any=[]; + messageSuccess: boolean =false; constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { this.P_PAGE_NUM = 1; @@ -211,7 +212,7 @@ export class WorkListReplacementRollComponent implements OnInit { 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.modalCtrl.dismiss(); this.workListMainService.actionButton(this.WorkListActionObj). subscribe((result: any) => { @@ -233,7 +234,7 @@ export class WorkListReplacementRollComponent implements OnInit { this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr - this.modalCtrl.dismiss(); + // this.modalCtrl.dismiss(); this.workListMainService.actionButton(this.WorkListActionObj). subscribe((result: any) => { @@ -259,10 +260,23 @@ export class WorkListReplacementRollComponent implements OnInit { // this.cs.showAlert(msg); // this.navCtrl.push("HomePage"); // here show succsfull msg - this.cs.openNotificationPage(); - } + + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + //this.modalCtrl.dismiss(succ); + this.modalCtrl.dismiss({ + 'dismissed': true, + data: "Success" + }); + + }, 5000); + + } + + } // not valid it - } // valid it } // cancel() { diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html index f07a3e27..23292874 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html @@ -1,12 +1,12 @@ - + {{ 'workListMain, rfc' | translate}} - - + +
{{'replacementRoll , msgRFC' | translate}}
@@ -49,11 +49,19 @@ - - +
+
+ + + + +
Transaction Successful
+
- + + +
diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss index 6b2ebadc..c40369aa 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss @@ -127,7 +127,24 @@ } - + .succssfullMSG{ + height: 100%; + width: 100%; + background: var(--newgreen); + color: white; + font-weight: bold; + font-size: 20px; + text-align: center; + vertical-align: middle; + padding-top: 30px; + } + + .succssfullIcon{ + width: 60%; + text-align: center; + height: 60%; + } + diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts index a257adbb..50b4a5ee 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts @@ -17,6 +17,7 @@ export class WorkListRfcComponent implements OnInit { private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListActionObj: WorkListActionRequest; + messageSuccess: boolean = false; getPassNotificationDetails: any; RFCEmployeeListListRes: any; @@ -100,7 +101,6 @@ export class WorkListRfcComponent implements OnInit { this.WorkListActionObj.P_ACTION_MODE = "RFC"; this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr this.WorkListActionObj.P_APPROVER_INDEX = this.seqNo; - this.modalCtrl.dismiss(); this.workListMainService.actionButton(this.WorkListActionObj). subscribe((result: any) => { @@ -129,8 +129,19 @@ export class WorkListRfcComponent implements OnInit { // this.navCtrl.push("HomePage"); // this.cs.openHome(); // here show succsfull msg + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + //this.cs.openNotificationPage(); + // this.modalCtrl.dismiss(); + this.modalCtrl.dismiss({ + 'dismissed': true, + data: "Success" + }); + + }, 5000); - this.cs.openNotificationPage(); } } // valid it } diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index e4f7e7a5..b1175b4f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -9,7 +9,7 @@ - +
{{getPassNotificationDetails.SUBJECT}}
@@ -519,7 +519,7 @@ -
+ {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} @@ -565,16 +565,17 @@ - - +
+
+ + + + +
Transaction Successful
+
-
- - -
-
Transaction Successful
-
+ -
-
Transaction Successful
-
- + +
{{getPassNotificationDetails.SUBJECT}}
@@ -657,7 +653,7 @@ -
@@ -671,7 +667,7 @@
-
+
--> {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} @@ -697,14 +693,18 @@
+
+
+ + + + +
Transaction Successful
+
-
- -
-
Transaction Successful
-
+ @@ -777,12 +777,12 @@ - + Approve - + Reject 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 ed8fb3f2..ece975e5 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 @@ -296,10 +296,10 @@ export class WorklistMainPoComponent implements OnInit { this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); console.log("test" + this.notificationButtonRes.length); for (let i = 0; i < this.notificationButtonRes.length; i++) { - if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { this.approveDis = true; } else - if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { this.rejectDis = true; } else if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { @@ -330,10 +330,11 @@ export class WorklistMainPoComponent implements OnInit { setTimeout(() => { this.messageSuccess = false; + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); }, 5000); - this.getNotificationCountAfterSubmit(); - this.nextNotfification(); + } } // valid it } @@ -345,7 +346,7 @@ export class WorklistMainPoComponent implements OnInit { if (itemNo > this.notificationArray.length) { this.common.openNotificationPage(); } else { - for (let i = 0; i <= this.notificationArray.length; i++) { + for (let i = 0; i < this.notificationArray.length; i++) { if (this.notificationArray[i].ROW_NUM == itemNo) { this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); // itemExist = true; @@ -495,7 +496,11 @@ export class WorklistMainPoComponent implements OnInit { ButtonAction == "DELEGATE" || ButtonAction == "REQUEST_INFO" || ButtonAction == "TRANSFER" || - ButtonAction == "TRANSFER_INFO" + ButtonAction == "TRANSFER_INFO" || + ButtonAction == "APPROVE_AND_FORWARD" || + ButtonAction == "FORWARD" + + ) { // alert("multi option: "+ ButtonAction); this.WorkListActionObj.P_ACTION_MODE = ButtonAction; @@ -1052,8 +1057,9 @@ export class WorklistMainPoComponent implements OnInit { if (data.data == "cancel" || data.data == undefined) { return; - } else { - + } else if (data.data == "Success") { + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); } }); diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index 123bdcba..bcec9dc7 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -7,8 +7,8 @@
- - + +
{{getPassNotificationDetails.SUBJECT}}
@@ -379,7 +379,7 @@ -
+ {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} @@ -416,14 +416,16 @@
- - -
- - -
-
Transaction Successful
+
+ + + + +
Transaction Successful
+
+ +
{{getPassNotificationDetails.SUBJECT}}
-
+ {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} @@ -456,13 +456,17 @@
+
+
+ + + + +
Transaction Successful
+
-
- - -
-
Transaction Successful
-
+ + 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 813ab8cb..7fe45a26 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -158,23 +158,24 @@ font-size: 14px; } - .succssfullMSG{ - height: 100%; - width: 100%; - background: var(--newgreen); - color: white; - font-weight: bold; - font-size: 20px; - text-align: center; - vertical-align: middle; - padding-top: 30px; - } + // .succssfullMSG{ + // height: 100%; + // width: 100%; + // background: var(--newgreen); + // color: white; + // font-weight: bold; + // font-size: 20px; + // text-align: center; + // vertical-align: middle; + // padding-top: 30px; + // } - .succssfullIcon{ - width: 60%; - text-align: center; - height: 60%; - } + // .succssfullIcon{ + // width: 60%; + // text-align: center; + // height: 36%; + // padding-top: 100px; + // } //////////////////////////////// .subOrdinateList{ // margin: 10px; 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 916d0c59..b1f94dcf 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -346,10 +346,11 @@ export class WorklistMainComponent implements OnInit { setTimeout(() => { this.messageSuccess = false; + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); }, 5000); - this.getNotificationCountAfterSubmit(); - this.nextNotfification(); + } } // valid it } @@ -361,7 +362,7 @@ export class WorklistMainComponent implements OnInit { if (itemNo > this.notificationArray.length) { this.common.openNotificationPage(); } else { - for (let i = 0; i <= this.notificationArray.length; i++) { + for (let i = 0; i < this.notificationArray.length; i++) { if (this.notificationArray[i].ROW_NUM == itemNo) { this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); // itemExist = true; @@ -886,8 +887,9 @@ export class WorklistMainComponent implements OnInit { if (data.data == "cancel" || data.data == undefined) { return; - } else { - + } else if (data.data == "Success") { + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); } }); @@ -917,8 +919,9 @@ export class WorklistMainComponent implements OnInit { if (data.data == "cancel" || data.data == undefined) { return; - } else { - + } else if (data.data == "Success") { + this.getNotificationCountAfterSubmit(); + this.nextNotfification(); } }); diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index 68377f11..4223f89c 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -516,7 +516,8 @@ left: 66px; .succssfullIcon{ width: 60%; text-align: center; - height: 60%; + height: 36%; + padding-top: 100px; } .subjectNotification{ text-align: center;