Compare commits

...

4 Commits

@ -121,7 +121,7 @@ export class HomeComponent implements OnInit {
this.absService.getAbsenceList(request).subscribe( this.absService.getAbsenceList(request).subscribe(
(result: any) => { (result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetWorkList)) { if (this.common.hasData(result.GetAbsenceTransactionList)) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
result.GetAbsenceTransactionList.forEach(vr => { result.GetAbsenceTransactionList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) { if (vr.ROW_NUM == vr.NO_OF_ROWS) {

@ -103,7 +103,7 @@ export class HomeComponent implements OnInit {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetEmployeeSubordinatesList)) { if (this.cs.hasData(result.GetEmployeeSubordinatesList)) {
this.empSubordinate = result.GetEmployeeSubordinatesList; this.empSubordinate = result.GetEmployeeSubordinatesList;
this.pageNum++; this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
let lastItemIndex = this.empSubordinate.length - 1; let lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) { if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
@ -121,12 +121,14 @@ export class HomeComponent implements OnInit {
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
if (!this.IsReachEnd && this.infiniteRequest) { if (!this.IsReachEnd && this.infiniteRequest) {
this.infiniteRequest.P_PAGE_NUM = this.pageNum; // this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService.getEmployeeSubordinates(this.infiniteRequest). this.myTeamService.getEmployeeSubordinates(this.infiniteRequest).
subscribe((result: any) => { subscribe((result: any) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.pageNum++; // this.pageNum++;
if (this.cs.hasData(result.GetWorkList)) { this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
if (this.cs.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => { result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) { if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -168,7 +168,8 @@ export class DetailsComponent implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
this.empSubordinate = result.GetEmployeeSubordinatesList; this.empSubordinate = result.GetEmployeeSubordinatesList;
this.pageNum++; // this.pageNum++;
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
let lastItemIndex = this.empSubordinate.length - 1; let lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) { if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
@ -185,14 +186,15 @@ export class DetailsComponent implements OnInit {
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
if (!this.IsReachEnd && this.infiniteRequest) { if (!this.IsReachEnd && this.infiniteRequest) {
this.infiniteRequest.P_PAGE_NUM = this.pageNum; // this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest) .getEmployeeSubordinates(this.infiniteRequest)
.subscribe( .subscribe(
(result: any) => { (result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.pageNum++; this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
if (this.common.hasData(result.GetWorkList)) {
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => { result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) { if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -45,7 +45,7 @@
<ion-input [(ngModel)]="searchKey" placeholder="{{ts.trPK('general','enter')}}"></ion-input> <ion-input [(ngModel)]="searchKey" placeholder="{{ts.trPK('general','enter')}}"></ion-input>
</ion-item> </ion-item>
</ion-list> </ion-list>
<div> <!-- <div> -->
<ion-list no-lines *ngIf="empSubordinate && empSubordinate.length>0"> <ion-list no-lines *ngIf="empSubordinate && empSubordinate.length>0">
<ion-item no-border *ngFor="let subordinate of empSubordinate;let i=index" (click)="getDetails(i);"> <ion-item no-border *ngFor="let subordinate of empSubordinate;let i=index" (click)="getDetails(i);">
<ion-avatar slot="start"> <ion-avatar slot="start">
@ -57,10 +57,17 @@
<ion-badge slot="end" class="badge">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge> <ion-badge slot="end" class="badge">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge>
</ion-item> </ion-item>
</ion-list> </ion-list>
<!-- </div> -->
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</div>
</ion-content> </ion-content>
<ion-footer *ngIf="isSearch"> <ion-footer *ngIf="isSearch">
<div class="centerDiv"> <div class="centerDiv">

@ -1,11 +1,11 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit, ViewChild } from "@angular/core";
import { Location } from "@angular/common"; import { Location } from "@angular/common";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { MyTeamService } from "../service/my-team.service"; import { MyTeamService } from "../service/my-team.service";
import { ModalController } from "@ionic/angular"; import { ModalController, IonInfiniteScroll } from "@ionic/angular";
import { DetailsComponent } from '../details/details.component'; import { DetailsComponent } from '../details/details.component';
@Component({ @Component({
selector: "app-home", selector: "app-home",
@ -13,6 +13,8 @@ import { DetailsComponent } from '../details/details.component';
styleUrls: ["./home.component.scss"] styleUrls: ["./home.component.scss"]
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
pageNum: number = 1; pageNum: number = 1;
pageLimit: number = 50; pageLimit: number = 50;
empSubordinate: any; empSubordinate: any;
@ -54,6 +56,7 @@ export class HomeComponent implements OnInit {
if (!this.isSearch) this.getEmpSubordinate(); if (!this.isSearch) this.getEmpSubordinate();
} }
getEmpSubordinate() { getEmpSubordinate() {
console.log("getEmpSubordinate my team home");
this.pageNum = 1; this.pageNum = 1;
this.IsReachEnd = false; this.IsReachEnd = false;
let searchEmpNum = ""; let searchEmpNum = "";
@ -115,8 +118,9 @@ export class HomeComponent implements OnInit {
handleEmpResult(result) { handleEmpResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
this.empSubordinate = result.GetEmployeeSubordinatesList; this.empSubordinate = result.GetEmployeeSubordinatesList;
this.pageNum++; this.infiniteRequest.P_PAGE_NUM++;
const lastItemIndex = this.empSubordinate.length - 1; const lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) { if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
@ -131,8 +135,18 @@ export class HomeComponent implements OnInit {
} }
} }
} }
doInfinite(infiniteScroll) {
doInfinite1(infiniteScroll) {
console.log("test");
if (!this.IsReachEnd && this.infiniteRequest) { if (!this.IsReachEnd && this.infiniteRequest) {
console.log("not ReachEnd");
this.infiniteRequest.P_PAGE_NUM = this.pageNum; this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest) .getEmployeeSubordinates(this.infiniteRequest)
@ -140,7 +154,7 @@ export class HomeComponent implements OnInit {
(result: any) => { (result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.pageNum++; this.pageNum++;
if (this.common.hasData(result.GetWorkList)) { if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => { result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) { if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -169,6 +183,47 @@ export class HomeComponent implements OnInit {
} }
} }
} }
doInfinite(infiniteScroll) {
//this.pageNum= this.pageNum + 1;
console.log("test doInfinite");
if (!this.IsReachEnd) {
console.log("test doInfinite not ReachEnd");
this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest).subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
this.infiniteRequest.P_PAGE_NUM++;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.empSubordinate.push(element);
});
} // if list length >0
else {
this.IsReachEnd = true;
}
} // if response == 1
//this.pageNum++;
this.infiniteScroll.complete();
}
);
} else {
if (this.infiniteScroll)
this.infiniteScroll.complete();
}
} //end infiniteScroll
getDetails(index) { getDetails(index) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.empSubordinate[index], this.empSubordinate[index],

@ -20,7 +20,7 @@ export class ItemHistoryComponent implements OnInit {
itemHistoryRes: any; itemHistoryRes: any;
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
P_PAGE_NUM: number = 1; P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 50;
POItemHistoryReq:any; POItemHistoryReq:any;
getPassItemHistoreyList: any; getPassItemHistoreyList: any;
constructor( constructor(
@ -63,6 +63,7 @@ export class ItemHistoryComponent implements OnInit {
if (this.cs.hasData(result.GetPoItemHistoryList)) { if (this.cs.hasData(result.GetPoItemHistoryList)) {
this.itemHistoryRes = result.GetPoItemHistoryList; this.itemHistoryRes = result.GetPoItemHistoryList;
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.itemHistoryRes.length - 1; let lastItemIndex = this.itemHistoryRes.length - 1;
if (result.GetPoItemHistoryList[lastItemIndex]) { if (result.GetPoItemHistoryList[lastItemIndex]) {
let lastitem = result.GetPoItemHistoryList[lastItemIndex]; let lastitem = result.GetPoItemHistoryList[lastItemIndex];
@ -84,7 +85,7 @@ export class ItemHistoryComponent implements OnInit {
subscribe((result: any) => { subscribe((result: any) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (result.GetPoItemHistoryList != undefined) { if (result.GetPoItemHistoryList != undefined) {
this.P_PAGE_NUM++; this.POItemHistoryReq.P_PAGE_NUM=this.P_PAGE_NUM++;
(result.GetPoItemHistoryList).forEach(element => { (result.GetPoItemHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -25,6 +25,7 @@ export class QutationAnalysisComponent implements OnInit {
getPassPOHeaderID: any; getPassPOHeaderID: any;
getPassItemHistoreyList: any; getPassItemHistoreyList: any;
getQutationAnalysis:any; getQutationAnalysis:any;
doInfiniteReq: any;
constructor(public worklistMainService: WorklistMainService, constructor(public worklistMainService: WorklistMainService,
private cs: CommonService, private cs: CommonService,
private ts: TranslatorService, private ts: TranslatorService,
@ -59,8 +60,9 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
const request = new QuotationAnalysisRequest(); const request = new QuotationAnalysisRequest();
request.P_ITEM_ID=parseInt(itemID); request.P_ITEM_ID=parseInt(itemID);
request.P_PO_HEADER_ID=headerID; request.P_PO_HEADER_ID=headerID;
request.P_PAGE_LIMIT=100; request.P_PAGE_LIMIT=1;
request.P_PAGE_NUM=1; request.P_PAGE_NUM=50;
this.doInfiniteReq=request;
this.worklistMainService.getQutationAnalysis(request). this.worklistMainService.getQutationAnalysis(request).
subscribe((result: QuotationAnalysisResponse) => { subscribe((result: QuotationAnalysisResponse) => {
this.handleQutationAnalysisResult(result); this.handleQutationAnalysisResult(result);
@ -75,7 +77,7 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
//set sheard data //set sheard data
// //
this.getQutationAnalysis = result.GetQuotationAnalysisList; this.getQutationAnalysis = result.GetQuotationAnalysisList;
this.P_PAGE_NUM++; this.doInfiniteReq.P_PAGE_NUM++;
let lastItemIndex = this.getQutationAnalysis.length - 1; let lastItemIndex = this.getQutationAnalysis.length - 1;
if (result.GetQuotationAnalysisList[lastItemIndex]) { if (result.GetQuotationAnalysisList[lastItemIndex]) {
let lastitem = result.GetQuotationAnalysisList[lastItemIndex]; let lastitem = result.GetQuotationAnalysisList[lastItemIndex];
@ -93,12 +95,13 @@ console.log("getPassPOItemID: "+this.getPassPOHeaderID);
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM; // this.getQutationAnalysis.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getQutationAnalysis(this.getQutationAnalysis). this.worklistMainService.getQutationAnalysis(this.doInfiniteReq).
subscribe((result: any) => { subscribe((result: any) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (result.GetQuotationAnalysisList != undefined) { if (result.GetQuotationAnalysisList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.doInfiniteReq.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetQuotationAnalysisList).forEach(element => { (result.GetQuotationAnalysisList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -46,7 +46,8 @@ export class WorkListActionHistoryComponent implements OnInit {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetActionHistoryList)) { if (this.cs.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList; this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++; // this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM++;
let lastItemIndex = this.actionHistoryRes.length - 1; let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) { if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex]; let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -75,12 +76,14 @@ export class WorkListActionHistoryComponent implements OnInit {
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; // this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -665,6 +665,7 @@ export class WorklistMainMRComponent implements OnInit {
if (this.common.hasData(result.GetActionHistoryList)) { if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList; this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1; let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) { if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex]; let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -700,12 +701,13 @@ export class WorklistMainMRComponent implements OnInit {
console.log("doInfinite action history MR"); console.log("doInfinite action history MR");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -783,12 +785,12 @@ export class WorklistMainMRComponent implements OnInit {
doInfiniteNotificationBody(infiniteScroll) { doInfiniteNotificationBody(infiniteScroll) {
console.log("doInfiniteNotificationBody MR"); console.log("doInfiniteNotificationBody MR");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj). this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetMoNotificationBodyList != undefined) { if (result.GetMoNotificationBodyList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetMoNotificationBodyList).forEach(element => { (result.GetMoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -820,12 +822,13 @@ export class WorklistMainMRComponent implements OnInit {
if (!this.IsReachEnd) { 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.getMONotificationBody(this.WorkListBodyObj). this.worklistMainService.getMONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetMoNotificationBodyList != undefined) { if (result.GetMoNotificationBodyList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetMoNotificationBodyList).forEach(element => { (result.GetMoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -855,12 +858,13 @@ export class WorklistMainMRComponent implements OnInit {
console.log("doInfinite action history MR"); console.log("doInfinite action history MR");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -690,6 +690,7 @@ export class WorklistMainPoComponent implements OnInit {
if (this.common.hasData(result.GetActionHistoryList)) { if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList; this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1; let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) { if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex]; let lastitem = result.GetActionHistoryList[lastItemIndex];
@ -724,12 +725,13 @@ export class WorklistMainPoComponent implements OnInit {
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
console.log("doInfinite action history"); console.log("doInfinite action history");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -867,12 +869,12 @@ export class WorklistMainPoComponent implements OnInit {
if (!this.IsReachEnd) { 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.getPONotificationBody(this.WorkListBodyObj). this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetPoNotificationBodyList != undefined) { if (result.GetPoNotificationBodyList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetPoNotificationBodyList).forEach(element => { (result.GetPoNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -903,12 +905,12 @@ export class WorklistMainPoComponent implements OnInit {
console.log("doInfinite action history MR"); console.log("doInfinite action history MR");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -810,12 +810,13 @@ export class WorklistMainPRComponent implements OnInit {
if (!this.IsReachEnd) { 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). this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetPrNotificationBodyList != undefined) { if (result.GetPrNotificationBodyList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetPrNotificationBodyList).forEach(element => { (result.GetPrNotificationBodyList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -845,12 +846,12 @@ export class WorklistMainPRComponent implements OnInit {
console.log("doInfinite action history MR"); console.log("doInfinite action history MR");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) { if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => { (result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true; this.IsReachEnd = true;

@ -30,6 +30,9 @@ export class HomeComponent implements OnInit {
defultSelected: any; defultSelected: any;
IsReachEnd: any; IsReachEnd: any;
private deductionReq: DeductionRequest; private deductionReq: DeductionRequest;
doinfiniteDedReq:any;
doinfinitEarReq:any;
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
constructor( constructor(
@ -85,7 +88,6 @@ export class HomeComponent implements OnInit {
// P_PAGE_NUM: this.P_PAGE_NUM, // P_PAGE_NUM: this.P_PAGE_NUM,
// P_PAGE_LIMIT: this.P_PAGE_LIMIT // P_PAGE_LIMIT: this.P_PAGE_LIMIT
}; };
this.payslipService.getPayslip(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> this.payslipService.getPayslip(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{ {
this.handleRespondGetPayslipResult(result); this.handleRespondGetPayslipResult(result);
@ -180,7 +182,7 @@ getEarings(ActionContextID){
P_PAGE_NUM:1, P_PAGE_NUM:1,
P_PAGE_LIMIT:100 P_PAGE_LIMIT:100
} }
this.doinfinitEarReq=request;
this.payslipService.getEarings(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> this.payslipService.getEarings(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{ {
this.handleGetEaringsResult(result); this.handleGetEaringsResult(result);
@ -207,7 +209,7 @@ getDeduction(ActionContextID){
// this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID; // this.deductionReq.P_ACTION_CONTEXT_ID=ActionContextID;
// this.deductionReq.P_PAGE_NUM=1; // this.deductionReq.P_PAGE_NUM=1;
// this.deductionReq.P_PAGE_LIMIT=100; // this.deductionReq.P_PAGE_LIMIT=100;
this.doinfiniteDedReq=request;
this.payslipService.getDeduction(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=> this.payslipService.getDeduction(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{ {
@ -227,10 +229,10 @@ getDeduction(ActionContextID){
//this.pageNum= this.pageNum + 1; //this.pageNum= this.pageNum + 1;
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.payslipService.getDeduction(this.deductionReq).subscribe( this.payslipService.getDeduction(this.doinfiniteDedReq).subscribe(
(result: any) => { (result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.deductionReq.P_PAGE_NUM++; this.doinfiniteDedReq.P_PAGE_NUM++;
if (this.common.hasData(result.GetDeductionsList)) { if (this.common.hasData(result.GetDeductionsList)) {
result.GetDeductionsList.forEach(element => { result.GetDeductionsList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {
@ -259,10 +261,10 @@ getDeduction(ActionContextID){
//this.pageNum= this.pageNum + 1; //this.pageNum= this.pageNum + 1;
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.payslipService.getEarings(this.deductionReq).subscribe( this.payslipService.getEarings(this.doinfinitEarReq).subscribe(
(result: any) => { (result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.deductionReq.P_PAGE_NUM++; this.doinfinitEarReq.P_PAGE_NUM++;
if (this.common.hasData(result.GetEarningsList)) { if (this.common.hasData(result.GetEarningsList)) {
result.GetEarningsList.forEach(element => { result.GetEarningsList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {

@ -37,7 +37,7 @@ export class HomeComponent implements OnInit {
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) { constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) {
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 100; this.P_PAGE_LIMIT = 1;
//this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y'); //this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y');
// this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y'); // this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');
@ -98,6 +98,7 @@ export class HomeComponent implements OnInit {
}, this.ts.trPK('general', 'retry')).subscribe((result) => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.GetVacationRulesList = result.GetVacationRulesList; this.GetVacationRulesList = result.GetVacationRulesList;
this.P_PAGE_NUM++;
} else { } else {
this.cs.presentAlert(result.ErrorEndUserMessage); this.cs.presentAlert(result.ErrorEndUserMessage);
} }
@ -168,13 +169,14 @@ export class HomeComponent implements OnInit {
let request: VacationRuleRequest = new VacationRuleRequest(); let request: VacationRuleRequest = new VacationRuleRequest();
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
request.P_PAGE_NUM = this.P_PAGE_NUM; request.P_PAGE_NUM = this.P_PAGE_NUM;
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.vacationRuleService.getVacationRule(request, () => { this.vacationRuleService.getVacationRule(request, () => {
// this.getVacationRules(); // this.getVacationRules();
}, this.ts.trPK('general', 'retry')).subscribe((result) => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
request.P_PAGE_NUM++; this.P_PAGE_NUM++;
request.P_PAGE_NUM = this.P_PAGE_NUM;
if (this.cs.hasData(result.GetVacationRulesList)) { if (this.cs.hasData(result.GetVacationRulesList)) {
result.GetVacationRulesList.forEach(element => { result.GetVacationRulesList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) { if (element.ROW_NUM == element.NO_OF_ROWS) {

Loading…
Cancel
Save