fixed worklist slider issue

mohemm-issues-jan-31
umasoodch 5 years ago
parent 88e3796bc3
commit 965229d132

@ -26,14 +26,14 @@
<ion-col [size]="12"> <ion-col [size]="12">
<ion-label>{{menuItem.PROMPT}}</ion-label> <ion-label>{{menuItem.PROMPT}}</ion-label>
</ion-col> </ion-col>
<ion-slides [options]="slideOptsTwo"> <ion-slides [options]="slideOptsTwo">
<ion-slide *ngFor="let subMenu of menuItem.children; let j=index"> <ion-slide *ngFor="let subMenu of menuItem.children; let j=index">
<app-services-button <app-services-button
(click)="openPage(subMenu)" (click)="openPage(subMenu)"
[title]="subMenu.PROMPT" [title]="subMenu.PROMPT"
[icon]="subMenu.ICON"> [icon]="subMenu.ICON">
</app-services-button> </app-services-button>
</ion-slide> </ion-slide>
<ion-slide *ngIf="i == 0 && showVcationRule"> <ion-slide *ngIf="i == 0 && showVcationRule">
<app-services-button <app-services-button
@ -41,8 +41,8 @@
[title]="vacationRuleTitle" [title]="vacationRuleTitle"
> >
</app-services-button> </app-services-button>
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>
<ion-row class="attendance-module" *ngIf="i == 0"> <ion-row class="attendance-module" *ngIf="i == 0">
<ion-col [size]="8"> <ion-col [size]="8">
@ -55,8 +55,8 @@
<ion-col [size]="4"> <ion-col [size]="4">
<img src="assets/icon/new-design/attendance_button_icon.png"/> <img src="assets/icon/new-design/attendance_button_icon.png"/>
</ion-col> </ion-col>
</ion-row>
</ion-row> </ion-row>
</ion-row>
</ion-grid> </ion-grid>
</ion-content> </ion-content>

@ -2,7 +2,7 @@
</app-generic-header> </app-generic-header>
<ion-content class="colorBG"> <ion-content class="colorBG">
<ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="defaultSegment" <ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="activeSegment"
class="ion-segment-all"> class="ion-segment-all">
<ion-segment-button value="{{segmentVal.name}}" <ion-segment-button value="{{segmentVal.name}}"

@ -6,27 +6,27 @@
<div *ngIf="!messageSuccess"> <div *ngIf="!messageSuccess">
<!-- add segemnt part --> <!-- add segemnt part -->
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div> <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)" [value]="defaultSegment" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)" [value]="activeSegment"
class="ion-segment-all"> class="ion-segment-all">
<ion-segment-button value="item-req" <ion-segment-button value="item-req"
[ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, details-emp'| translate}}</ion-label> <ion-label class="padding-zero"> {{'worklistMain, details-emp'| translate}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="action-history" <ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, action' | translate}}</ion-label> <ion-label class="padding-zero"> {{'worklistMain, action' | translate}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="attach" <ion-segment-button value="attach"
[ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, attach-file' | translate}}</ion-label> <ion-label class="padding-zero"> {{'worklistMain, attach-file' | translate}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'"> <ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, info'| translate}} </ion-label> <ion-label class="padding-zero"> {{'worklistMain, info'| translate}} </ion-label>
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>

@ -298,4 +298,8 @@ ion-card{
} }
.cardAlignTextAr{ .cardAlignTextAr{
text-align: right; text-align: right;
}
.padding-zero {
padding: 0px !important;
} }

@ -7,9 +7,7 @@ import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBod
import { NotificatonButtonResponse } from "../models/NotificationButtonRes"; import { NotificatonButtonResponse } from "../models/NotificationButtonRes";
import { WorkListActionRequest } from "../models/NotificationActionReq"; import { WorkListActionRequest } from "../models/NotificationActionReq";
import { WorkListButtonRequest } from "../models/NotificationButtonReq"; import { WorkListButtonRequest } from "../models/NotificationButtonReq";
// import { isDate } from 'angular6-json-schema-form';
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 { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { WorklistMainService } from "../service/work-list.main.service"; import { WorklistMainService } from "../service/work-list.main.service";
import { HomeComponent } from "src/app/notification/home/home.component"; import { HomeComponent } from "src/app/notification/home/home.component";
import { TextInput } from 'src/app/uI-elements/text.input'; import { TextInput } from 'src/app/uI-elements/text.input';
@ -78,7 +76,7 @@ export class WorklistMainComponent implements OnInit {
P_PAGE_NUM: number = 1; P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 100;
notificationCount: any; notificationCount: any;
activeSegment: any = "item-req"; activeSegment: any = 'item-req';
lines_note_limit: any = 24; lines_note_limit: any = 24;
attachmentRes: any = []; attachmentRes: any = [];
private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest;
@ -119,19 +117,15 @@ export class WorklistMainComponent implements OnInit {
private modalCtrl: ModalController, private modalCtrl: ModalController,
public dashboredService: DashboredService, public dashboredService: DashboredService,
public authService: AuthenticationService public authService: AuthenticationService
) { ) {
this.direction = TranslatorService.getCurrentLanguageName() this.direction = TranslatorService.getCurrentLanguageName()
console.log("ENAD TEST LANG: "+this.direction); console.log("ENAD TEST LANG: "+this.direction);
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = 1; this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
} }
ngOnInit() { ngOnInit() {
this.selEmp = this.common.sharedService.getSharedData( this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP, MenuResponse.SHARED_SEL_EMP,
false false
@ -140,24 +134,13 @@ export class WorklistMainComponent implements OnInit {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.selEmp = user.ASSIGNMENT_NUMBER; this.selEmp = user.ASSIGNMENT_NUMBER;
} }
}); });
} }
//name=document.getElementById('notificationDynamicFields').value;
//removeElement('parentDiv', name);"
//var navbar = document.getElementById("notificationDynamicFields").value;
// document.querySelector('svg .gauge.chart > text').remove();
// var inputValue = (<HTMLInputElement>document.getElementById("notificationDynamicFields")).value;
console.log(" this.selEmp" + this.selEmp);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} }
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
if(this.activeSegment === 'item-req') if(this.activeSegment === 'item-req')
@ -177,18 +160,38 @@ export class WorklistMainComponent implements OnInit {
this.slides.slideTo(3); this.slides.slideTo(3);
} }
console.log(" event.detail.value: " + event.detail.value); console.log(" event.detail.value: " + event.detail.value);
} }
intializeNotificationDetail() { public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
if(index === 0)
{
this.activeSegment = 'item-req';
}
else if(index === 1)
{
this.activeSegment = 'action-history';
}
else if(index === 2)
{
this.activeSegment = 'attach';
}
else if(index === 3)
{
this.activeSegment = 'info';
}
console.log(this.activeSegment);
});
}
public intializeNotificationDetail() {
this.approveDis = false; this.approveDis = false;
this.rejectDis = false; this.rejectDis = false;
this.requestDis = false; this.requestDis = false;
this.moreDisabled = true; this.moreDisabled = true;
this.closeDis = false; this.closeDis = false;
// this.approve_label="";
// this.reject_label="";
// this.reqInfo_label="";
if (this.messageSuccess) { if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById("notificationDynamicFields").innerHTML = "";
@ -199,7 +202,6 @@ export class WorklistMainComponent implements OnInit {
false false
); );
console.log("for next()" + this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = [] this.notificationArray = []
this.subordinatesleaveList = []; this.subordinatesleaveList = [];
this.notificationArray = this.common.sharedService.getSharedData( this.notificationArray = this.common.sharedService.getSharedData(
@ -273,7 +275,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getMONotificationBody(notificationBodyObj) .getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => { .subscribe((result: MONotificatonBodyResponse) => {
//this.handleWorkListBodyResult(result, "MO");
}); });
} }
@ -281,8 +282,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getPONotificationBody(notificationBodyObj) .getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => { .subscribe((result: PONotificatonBodyResponse) => {
// console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
// this.handleWorkListBodyResult(result, "PO");
}); });
} }
@ -325,13 +324,10 @@ export class WorklistMainComponent implements OnInit {
console.log(this.notificationBodyRes[0].Collection_Notification); console.log(this.notificationBodyRes[0].Collection_Notification);
} }
// getDimensions(this.notificationBodyRes) {
let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) { let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) {
return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE"; return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE";
}); });
// return obj;
// }
this.getSubordinatesleave(obj) this.getSubordinatesleave(obj)
} }
} else if (Type == "PR") { } else if (Type == "PR") {
@ -343,8 +339,6 @@ export class WorklistMainComponent implements OnInit {
} }
} //End handleWorkListBodyResult } //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) { getNotificationButtons(notificationButtonsObj) {
this.notificationButtonRes = []; this.notificationButtonRes = [];
this.worklistMainService this.worklistMainService
@ -383,7 +377,7 @@ export class WorklistMainComponent implements OnInit {
this.moreDisabled = false; this.moreDisabled = false;
} }
} // valid it }
} }
} }
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
@ -416,8 +410,6 @@ export class WorklistMainComponent implements OnInit {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} }
} // valid it } // valid it
} }
@ -448,11 +440,8 @@ export class WorklistMainComponent implements OnInit {
public nextNotfification() { public nextNotfification() {
//let itemExist = false;
if (document.getElementById("notificationDynamicFields") != null) { if (document.getElementById("notificationDynamicFields") != null) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById("notificationDynamicFields").innerHTML = "";
} }
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo); console.log(itemNo);
@ -473,10 +462,8 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationArray[index].REQUEST_TYPE == "MO") { if (this.notificationArray[index].REQUEST_TYPE == "MO") {
this.common.openWorklistMainMRPage() this.common.openWorklistMainMRPage()
} else { } else {
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} }
} }
else { else {
this.common.openNotificationPage(); this.common.openNotificationPage();
@ -501,9 +488,6 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") { if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value; obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
} }
// else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// }
else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") { else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value; obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
} }
@ -520,8 +504,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
console.log("b" + this.P_RESPOND_ATTRIBUTES_TBL);
if ( if (
ButtonAction == "APPROVED" || ButtonAction == "APPROVED" ||
ButtonAction == "REJECTED" || ButtonAction == "REJECTED" ||
@ -546,7 +528,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
// this.applyAction(this.WorkListActionObj);
if (ButtonAction === "APPROVED") { if (ButtonAction === "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
@ -561,7 +542,6 @@ export class WorklistMainComponent implements OnInit {
} }
else if (ButtonAction === "CLOSE") { else if (ButtonAction === "CLOSE") {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
} }
this.common.confirmAlertDialogAction( this.common.confirmAlertDialogAction(
@ -571,15 +551,8 @@ export class WorklistMainComponent implements OnInit {
() => { }, this.ts.trPK('general', 'cancel'), () => { }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'), this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg) this.confirmMsg)
// this.openApplyModal(this.WorkListActionObj);
} }
if (ButtonAction == "RFC") { if (ButtonAction == "RFC") {
// alert("Return For Correction"); // alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
@ -599,12 +572,6 @@ export class WorklistMainComponent implements OnInit {
//this.common.openWorklistRFCPage(); //this.common.openWorklistRFCPage();
this.openRFCModal(); this.openRFCModal();
} else if (ButtonAction == "ANSWER_INFO") { } else if (ButtonAction == "ANSWER_INFO") {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(this.pQuestion, "pQuestion"); this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
@ -628,11 +595,6 @@ export class WorklistMainComponent implements OnInit {
) { ) {
// alert("multi option: "+ ButtonAction); // alert("multi option: "+ ButtonAction);
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
// this.navCtrl.push("WorkListReplacmentRollPage", {
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -646,8 +608,6 @@ export class WorklistMainComponent implements OnInit {
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL); console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
// this.common.openWorklistRollReplacement();
this.openRepRolModal(); this.openRepRolModal();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == "UPDATE_ACTION" ||
@ -673,11 +633,6 @@ export class WorklistMainComponent implements OnInit {
this.getPassNotificationDetails, this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST AbsenceNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("SubmitAbsencePage", {
// dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// });
//this.common.openConfirmAbsece();
this.dirfromNotificationPage = true, this.dirfromNotificationPage = true,
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.dirfromNotificationPage, this.dirfromNotificationPage,
@ -707,9 +662,6 @@ export class WorklistMainComponent implements OnInit {
} }
openActionHistory() { openActionHistory() {
// this.navCtrl.push("WorkListActionHistoryPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -717,12 +669,7 @@ export class WorklistMainComponent implements OnInit {
this.common.openWorklistHistoryPage(); this.common.openWorklistHistoryPage();
} }
openSupportDocuments() { openSupportDocuments() {
// this.navCtrl.push("WorkListAttachPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -741,8 +688,6 @@ export class WorklistMainComponent implements OnInit {
handleNotificationResAttrResult(result) { handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
this.NotRespondAttributeList = []; this.NotRespondAttributeList = [];
result.NotificationGetRespondAttributesList; result.NotificationGetRespondAttributesList;
if ( if (
@ -877,52 +822,32 @@ export class WorklistMainComponent implements OnInit {
} }
public checkLines(note) { public checkLines(note) {
if (note && note != null) { if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false; return (note.length > this.lines_note_limit) ? true : false;
} }
return false; return false;
}; };
public turnCateFun(actionHis) { public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) { for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false; actionHis[i].visible = false;
} }
this.actionHistoryRes = actionHis; this.actionHistoryRes = actionHis;
console.log("test"); console.log("test");
} }
async openMoreActions() { async openMoreActions() {
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: MoreActionModalComponent, component: MoreActionModalComponent,
backdropDismiss: false, backdropDismiss: false,
}); });
modal.cssClass = 'note-modal'; modal.cssClass = 'note-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); console.log(data.data);
if (data.data == "cancel" || data.data == undefined) { if (data.data == "cancel" || data.data == undefined) {
return; return;
} else { } else {
// this.selectedAction = data.data; // this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION; this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType); console.log(this.actionType);
@ -930,21 +855,14 @@ export class WorklistMainComponent implements OnInit {
this.actionButton(this.actionType); this.actionButton(this.actionType);
} }
}); });
return await modal.present(); return await modal.present();
} }
async OpenAttachFiles(value, Type) {
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage')
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent component: WorkListAttachViewComponent
}); });
return await modal.present(); return await modal.present();
} }
@ -952,7 +870,6 @@ export class WorklistMainComponent implements OnInit {
///calling getSubleave ///calling getSubleave
getSubordinatesleave(list) { getSubordinatesleave(list) {
console.log(list); console.log(list);
let to; let to;
let from; let from;
@ -964,33 +881,20 @@ export class WorklistMainComponent implements OnInit {
from = list[i].DATE_VALUE; from = list[i].DATE_VALUE;
} }
} }
console.log(new Date(to));
console.log(new Date(from));
const request = new GetSubordinatesLeavesRequest(); const request = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = "/Date(" + Date.parse(from) + '+0300' + ")/";//new Date(from); request.P_DATE_FROM = "/Date(" + Date.parse(from) + '+0300' + ")/";//new Date(from);
request.P_DATE_TO = "/Date(" + Date.parse(to) + '+0300' + ")/" //new Date(to); request.P_DATE_TO = "/Date(" + Date.parse(to) + '+0300' + ")/" //new Date(to);
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
// ="'/Date(" + Date.parse(from) + ")'"
this.dashboredService.getSubordinatesLeaves(request). this.dashboredService.getSubordinatesLeaves(request).
subscribe((result: any) => { subscribe((result: any) => {
this.handleSubordinatesLeavesResult(result); this.handleSubordinatesLeavesResult(result);
}); });
} }
public handleSubordinatesLeavesResult(result) { public handleSubordinatesLeavesResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
// GetSubordinatesLeavesList it used in dashbored
// if (this.common.hasData(result.GetSubordinatesLeavesList)) {
if (this.common.hasData(result.SubordinatesOnLeavesList)) { if (this.common.hasData(result.SubordinatesOnLeavesList)) {
this.subordinatesleaveList = result.SubordinatesOnLeavesList; this.subordinatesleaveList = result.SubordinatesOnLeavesList;
} }
} }
} }
@ -1002,6 +906,7 @@ export class WorklistMainComponent implements OnInit {
this.handleSubmitterInfoResult(result); this.handleSubmitterInfoResult(result);
}); });
} }
handleSubmitterInfoResult(result) { handleSubmitterInfoResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
@ -1013,107 +918,66 @@ export class WorklistMainComponent implements OnInit {
}// End handleWorkListButtonsResult }// End handleWorkListButtonsResult
async openRepRolModal() { async openRepRolModal() {
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent, component: WorkListReplacementRollComponent,
backdropDismiss: false, backdropDismiss: false,
}); });
modal.cssClass = 'replaceRoll-modal'; modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); console.log(data.data);
if (data.data == "cancel" || data.data == undefined) { if (data.data == "cancel" || data.data == undefined) {
return; return;
} else if (data.data == "Success") { } else if (data.data == "Success") {
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
} }
}); });
return await modal.present(); return await modal.present();
} }
async openRFCModal() { async openRFCModal() {
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: WorkListRfcComponent, component: WorkListRfcComponent,
backdropDismiss: false, backdropDismiss: false,
}); });
modal.cssClass = 'replaceRoll-modal'; modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data.data); console.log(data.data);
if (data.data == "cancel" || data.data == undefined) { if (data.data == "cancel" || data.data == undefined) {
return; return;
} else if (data.data == "Success") { } else if (data.data == "Success") {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
} }
}); });
return await modal.present(); return await modal.present();
} }
async openApplyModal(WorkListActionObj) { async openApplyModal(WorkListActionObj) {
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO); this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage')
// this.common.sharedService.setSharedData(
// this.WorkListActionObj,
// WorklistMainPRComponent.PASS_NOTIFICATION_INFO
// );
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ApplyActionModalComponent, component: ApplyActionModalComponent,
backdropDismiss: false, backdropDismiss: false,
}); });
modal.cssClass = 'note-modal'; modal.cssClass = 'note-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data); // Here's your selected user! console.log(data); // Here's your selected user!
}); });
return await modal.present(); return await modal.present();
} }
loadMoreActionHistory() { loadMoreActionHistory() {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log("doInfinite action history MR"); console.log("doInfinite action history MR");
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; 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;
@ -1131,17 +995,12 @@ export class WorklistMainComponent implements OnInit {
}// if response == 1 }// if response == 1
//this.pageNum++; //this.pageNum++;
// infiniteScroll.target.complete(); // infiniteScroll.target.complete();
}); });
} else { } else {
console.log("no doInfinite action history MR"); console.log("no doInfinite action history MR");
//if (infiniteScroll)
//infiniteScroll.target.complete();
} }
}//end infiniteScroll }//end infiniteScroll
openNotificationsDashboard() { openNotificationsDashboard() {
this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => { this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
@ -1151,29 +1010,4 @@ export class WorklistMainComponent implements OnInit {
} }
}); });
} }
slideChanged() {
this.slides.getActiveIndex().then(index => {
console.log(index);
if(index === 0)
{
this.activeSegment = 'item-req';
}
else if(index === 1)
{
this.activeSegment = 'action-history';
}
else if(index === 2)
{
this.activeSegment = 'attach';
}
else if(index === 3)
{
this.activeSegment = 'info';
}
});
}
} }

Loading…
Cancel
Save