From 10458f2e0fe5b5625d902b8f4f56bbc5fb0b0a13 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Tue, 7 Jan 2020 08:51:34 +0300 Subject: [PATCH] fix page P_PAGE_LIMIT --- .../item-history/item-history.component.ts | 2 +- .../qutation-analysis.component.ts | 4 +- .../work-list-action-history.component.ts | 2 +- .../work-list-rfc/work-list-rfc.component.ts | 2 +- .../worklist-main-mr.component.ts | 2 +- .../worklist-main-po.component.ts | 7 +- .../worklist-main-pr.component.ts | 240 +++++++++--------- .../worklist-main/worklist-main.component.ts | 2 +- .../app/vacation-rule/home/home.component.ts | 2 +- 9 files changed, 132 insertions(+), 131 deletions(-) diff --git a/Mohem/src/app/notification/item-history/item-history.component.ts b/Mohem/src/app/notification/item-history/item-history.component.ts index f943fc80..6c2c109b 100644 --- a/Mohem/src/app/notification/item-history/item-history.component.ts +++ b/Mohem/src/app/notification/item-history/item-history.component.ts @@ -20,7 +20,7 @@ export class ItemHistoryComponent implements OnInit { itemHistoryRes: any; IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; POItemHistoryReq:any; getPassItemHistoreyList: any; constructor( 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 1dcb6722..0f68605d 100644 --- a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.ts @@ -19,7 +19,7 @@ import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; export class QutationAnalysisComponent implements OnInit { IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; POQuotationHISReq: QuotationAnalysisRequest; getPassPOItemID: any; getPassPOHeaderID: any; @@ -59,7 +59,7 @@ 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=50; + request.P_PAGE_LIMIT=100; request.P_PAGE_NUM=1; this.worklistMainService.getQutationAnalysis(request). subscribe((result: QuotationAnalysisResponse) => { diff --git a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts index 286f70c9..ef10dcf4 100644 --- a/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts +++ b/Mohem/src/app/notification/work-list-action-history/work-list-action-history.component.ts @@ -19,7 +19,7 @@ export class WorkListActionHistoryComponent implements OnInit { actionHistoryRes: any; IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; constructor(private cs: CommonService, private ts: TranslatorService, private modalCtrl: ModalController, public worklistService: WorklistService) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); 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 ce4e110a..56e32a62 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 @@ -28,7 +28,7 @@ export class WorkListRfcComponent implements OnInit { userNote: any; getpassResAttr: any = []; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); 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 67e07287..e142000d 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 @@ -74,7 +74,7 @@ export class WorklistMainMRComponent implements OnInit { PRLines:any;//change the tpye later IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; headerTotal: any; totalH: any; valueH: any; 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 edbf93fc..fd803635 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 @@ -80,7 +80,7 @@ export class WorklistMainPoComponent implements OnInit { PRLines:any;//change the tpye later IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; headerTotal: any; totalH: any; valueH: any; @@ -773,7 +773,7 @@ export class WorklistMainPoComponent implements OnInit { this.IsReachEnd = false; const request = new POItemHistoryRequest(); request.P_ITEM_ID=parseInt(itemID); - request.P_PAGE_LIMIT=50; + request.P_PAGE_LIMIT=100; request.P_PAGE_NUM=1; this.worklistMainService.getPOItemHistory(request). subscribe((result: POItemHistoryRes) => { @@ -812,7 +812,7 @@ export class WorklistMainPoComponent implements OnInit { const request = new QuotationAnalysisRequest(); request.P_ITEM_ID=parseInt(itemID); request.P_PO_HEADER_ID=headerID; - request.P_PAGE_LIMIT=50; + request.P_PAGE_LIMIT=100; request.P_PAGE_NUM=1; this.worklistMainService.getQutationAnalysis(request). subscribe((result: QuotationAnalysisResponse) => { @@ -898,6 +898,7 @@ export class WorklistMainPoComponent implements OnInit { // infiniteScroll.target.complete(); } }//end infiniteScroll + loadMoreActionHistory() { console.log("doInfinite action history MR"); 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 4c7f8fd1..34ad0028 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 @@ -40,7 +40,7 @@ export class WorklistMainPRComponent implements OnInit { private WorkListActionObj: WorkListActionRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListAttachObj: WorkListButtonRequest; - private PRList:PRNotificatonBodyList + private PRList: PRNotificatonBodyList public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; public static PASS_ACTION_MODE = "passActionMode"; getPassNotificationDetails: any; @@ -64,16 +64,16 @@ export class WorklistMainPRComponent implements OnInit { selEmployeeID: any; actionType: string = ""; notificationArray: any; - notificationDynamicAttributeArr:any; + notificationDynamicAttributeArr: any; private textInput: TextInput; private textArea: TextAreaInput; notificationCount: any; - attachmentRes:any; - PRHeader:any;//change the tpye later - PRLines:any;//change the tpye later + attachmentRes: any; + PRHeader: any;//change the tpye later + PRLines: any;//change the tpye later IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; - P_PAGE_LIMIT: number = 50; + P_PAGE_LIMIT: number = 100; headerTotal: any; totalH: any; valueH: any; @@ -97,12 +97,12 @@ export class WorklistMainPRComponent implements OnInit { public worklistService: WorklistService ) { - //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); + //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; - // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; - } + // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + } ngOnInit() { this.WorkListAttachObj = new WorkListButtonRequest(); @@ -111,41 +111,41 @@ export class WorklistMainPRComponent implements OnInit { let segment = document.querySelector('ion-segment'); let slides = document.querySelector('ion-slides'); - + segment.addEventListener('ionChange', (ev) => onSegmentChange(ev)); slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev)); - + // On Segment change slide to the matching slide function onSegmentChange(ev) { - console.log("ev.detail.value"+ev.detail.value); + console.log("ev.detail.value" + ev.detail.value); slideTo(ev.detail.value); } - + function slideTo(index) { - console.log("index: "+index); + console.log("index: " + index); slides.slideTo(index); } - + // On Slide change update segment to the matching value async function onSlideDidChange(ev) { var index = await slides.getActiveIndex(); - console.log("index: "+index); + console.log("index: " + index); clickSegment(index); } - + function clickSegment(index) { segment.value = index; } - + } - + intializeNotificationDetail() { - document.getElementById("notificationDynamicFields").innerHTML=""; + document.getElementById("notificationDynamicFields").innerHTML = ""; console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, @@ -189,38 +189,38 @@ export class WorklistMainPRComponent implements OnInit { this.getEITNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.getAbsenceNotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ - this.getPONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO"){ + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { + this.getPONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO") { this.getMONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR"){ - this.getPRNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { + this.getPRNotificationDetails(this.WorkListBodyObj); } } - getPRNotificationDetails(notificationBodyObj){ + getPRNotificationDetails(notificationBodyObj) { this.worklistMainService - .getPRNotificationBody(notificationBodyObj) - .subscribe((result: PRNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "PR"); - }); + .getPRNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "PR"); + }); } - - getMONotificationDetails(notificationBodyObj){ - this.worklistMainService + + getMONotificationDetails(notificationBodyObj) { + this.worklistMainService .getMONotificationBody(notificationBodyObj) .subscribe((result: MONotificatonBodyResponse) => { //this.handleWorkListBodyResult(result, "MO"); }); - } - - getPONotificationDetails(notificationBodyObj){ + } + + getPONotificationDetails(notificationBodyObj) { this.worklistMainService - .getPONotificationBody(notificationBodyObj) - .subscribe((result: PONotificatonBodyResponse) => { - console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); - this.handleWorkListBodyResult(result, "PO"); - }); + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "PO"); + }); } getEITNotificationDetails(notificationBodyObj) { @@ -255,27 +255,27 @@ export class WorklistMainPRComponent implements OnInit { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } - }else if (Type == "PR") { + } else if (Type == "PR") { if (result.GetPrNotificationBodyList) { console.log("PR"); - this.PRHeader=result.GetPrNotificationBodyList.PRHeader; - this.PRLines=result.GetPrNotificationBodyList.PRLines; - for( var i = 0; i < this.PRHeader.length; i++){ - if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total'){ - this.totalH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; - this.valueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + this.PRHeader = result.GetPrNotificationBodyList.PRHeader; + this.PRLines = result.GetPrNotificationBodyList.PRLines; + for (var i = 0; i < this.PRHeader.length; i++) { + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; - //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" - } - if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax'){ - this.taxH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; - this.taxvalueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + + } + // HDR_ATTRIBUTE_VALUE } - - // HDR_ATTRIBUTE_VALUE - } this.notificationBodyRes = result.GetPrNotificationBodyList; } @@ -284,7 +284,7 @@ export class WorklistMainPRComponent implements OnInit { } //End handleWorkListBodyResult - + getNotificationButtons(notificationButtonsObj) { this.worklistMainService .getNotificationButtons(notificationButtonsObj) @@ -352,7 +352,7 @@ export class WorklistMainPRComponent implements OnInit { let ButtonAction: string = this.actionType; var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; - for (let i=0;i { this.applyAction(this.WorkListActionObj); - }, this.ts.trPK('general', 'ok'), - () => {}, this.ts.trPK('general', 'cancel'), + }, this.ts.trPK('general', 'ok'), + () => { }, this.ts.trPK('general', 'cancel'), this.ts.trPK('vacation-rule', 'confirmation'), - this.confirmMsg); + this.confirmMsg); + + - - // alert.onDidDismiss((data) => { // if (data == true) { // this.continueDelete(attach); // } // }); - + //this.openApplyModal(this.WorkListActionObj); - - + + ////////////this.applyAction(this.WorkListActionObj); } @@ -590,29 +590,29 @@ export class WorklistMainPRComponent implements OnInit { this.hideForwordEmployee = result.NotificationRespondRolesList[0]; } this.notificationDynamicFields(result.NotificationGetRespondAttributesList); - this.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; + this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList; this.common.sharedService.setSharedData( this.NotificationGetRespondAttributesList, WorklistMainPRComponent.PASS_RES_ATTR ); - this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; + this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); } // valid it } // End handleWorkListButtonsResult - notificationDynamicFields(notificationAttr){ + notificationDynamicFields(notificationAttr) { const containerId = 'notificationDynamicFields'; - for(let i=0;i { @@ -706,17 +706,17 @@ export class WorklistMainPRComponent implements OnInit { } } - async openNoteDetail(note,sender) { + 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') + this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') const modal = await this.modalCtrl.create({ component: ViewNoteModalComponent, - backdropDismiss:false, + backdropDismiss: false, }); modal.cssClass = 'note-modal'; @@ -755,7 +755,7 @@ export class WorklistMainPRComponent implements OnInit { } }//end infiniteScroll -//**********Attachment *****************// + //**********Attachment *****************// async OpenAttachFiles(value, Type) { @@ -776,7 +776,7 @@ export class WorklistMainPRComponent implements OnInit { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); // console.log("note"+note); - this.common.sharedService.setSharedData( this.getPassNotificationDetails,WorklistMainPRComponent.PASS_NOTIFICATION_INFO); + this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainPRComponent.PASS_NOTIFICATION_INFO); this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') // this.common.sharedService.setSharedData( // this.WorkListActionObj, @@ -785,30 +785,30 @@ export class WorklistMainPRComponent implements OnInit { const modal = await this.modalCtrl.create({ component: ApplyActionModalComponent, - backdropDismiss:false, + backdropDismiss: false, }); modal.cssClass = 'note-modal'; - + modal.onDidDismiss() .then((data) => { console.log(data); // Here's your selected user! - }); + }); - // data => { - // console.log('MODAL DATA', data); - // }); + // data => { + // console.log('MODAL DATA', data); + // }); // const { data } = await this.modalCtrl.onWillDismiss(); // console.log(data); return await modal.present(); - + } loadMoreNotificationBody() { console.log("loadMoreNotificationBody PR"); if (!this.IsReachEnd) { - console.log("this.IsReachEnd"+ this.IsReachEnd); + console.log("this.IsReachEnd" + this.IsReachEnd); this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM; this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj). @@ -823,9 +823,9 @@ export class WorklistMainPRComponent implements OnInit { this.IsReachEnd = false; } this.notificationBodyRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("test") + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("test") ); }// if list length >0 else { @@ -833,7 +833,7 @@ export class WorklistMainPRComponent implements OnInit { } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { @@ -858,26 +858,26 @@ export class WorklistMainPRComponent implements OnInit { this.IsReachEnd = false; } this.actionHistoryRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("TEST")); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); }// if list length >0 else { this.IsReachEnd = true; } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { //if (infiniteScroll) - //infiniteScroll.target.complete(); + //infiniteScroll.target.complete(); } }//end infiniteScroll } - - + + 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 dc33107e..983ffb57 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -87,7 +87,7 @@ export class WorklistMainComponent implements OnInit { this.WorkListBodyObj.P_TRANSACTION_ID = this.TransactionID; this.WorkListBodyObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListBodyObj.P_PAGE_NUM = 1; - this.WorkListBodyObj.P_PAGE_LIMIT = 50; + this.WorkListBodyObj.P_PAGE_LIMIT = 100; this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; diff --git a/Mohem/src/app/vacation-rule/home/home.component.ts b/Mohem/src/app/vacation-rule/home/home.component.ts index 9ac071c6..797e7a2a 100644 --- a/Mohem/src/app/vacation-rule/home/home.component.ts +++ b/Mohem/src/app/vacation-rule/home/home.component.ts @@ -37,7 +37,7 @@ export class HomeComponent implements OnInit { constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) { this.P_PAGE_NUM = 1; - this.P_PAGE_LIMIT = 50; + this.P_PAGE_LIMIT = 100; //this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y'); // this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');