copied code from CS folder for making a release

master-newdesign-15-Dec-location
umasoodch 5 years ago
parent 8ca4123af7
commit 5cdfe47be3

@ -1,5 +1,5 @@
<ion-content *ngIf="userInfo.CompanyMainCompany == 'CS'" dir="ltr">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%;" src="../assets/imgs/IDTOP.png">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%; height: 30%;" src="../assets/imgs/IDTOP.png">
<img *ngIf="userInfo.PAYROLL_CODE !== 'CS' " style="width: 100%; max-width: 100%;" src="../assets/imgs/IDTOP_HMG.png.png">
<ion-grid>
<ion-row>
@ -8,7 +8,7 @@
[src]="'data:image/png;base64,'+userInfo.EMPLOYEE_IMAGE">
</ion-col>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE == null">
<img style="width: 80%;height: 215%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;"
<img style="width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;"
src="../assets/imgs/profilePic.png">
</ion-col>
<ion-col size="6">
@ -23,7 +23,7 @@
</ion-row>
<ion-row>
<ion-col>
<img style="width: 65%; max-width: 100%; margin-left: 60px;" [src]="userInfo.EmployeeQR">
<img style="width: 50%; max-width: 100%; margin-left: 25%;" [src]="userInfo.EmployeeQR">
</ion-col>
</ion-row>
</ion-grid>

@ -11,6 +11,7 @@
width: 315px;
}
@media only screen and (max-device-height: 640px) {
.digital-id-image-size{
width: 70% !important;
@ -26,3 +27,5 @@
width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;
}

@ -24,8 +24,10 @@
<ion-item class="item-input-login">
<img style="margin: 9px 8px 9px 0 !important;" class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input class="login-input" required type="password" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}">
<ion-input class="login-input" required [type]="inputType" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}">
</ion-input>
<ion-icon *ngIf='inputType === "text"' name="ios-eye" (click)="showPassword()"></ion-icon>
<ion-icon *ngIf='inputType === "password"' name="ios-eye-off" (click)="hidePassword()"></ion-icon>
</ion-item>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false">

@ -100,6 +100,7 @@ export class LoginComponent implements OnInit, OnDestroy {
getlastlogin: any;
public keyboardOpened = false;
private checkUserResult: CheckUserAuthenticationResponse;
public inputType = "password";
ngOnInit() {
this.monitorKeyboardChange();
@ -392,4 +393,12 @@ export class LoginComponent implements OnInit, OnDestroy {
return await modal.present();
}
showPassword(){
this.inputType = 'password';
}
hidePassword(){
this.inputType = 'text';
}
}

@ -1213,8 +1213,9 @@ export class AddEitComponent implements OnInit {
this.eitResponse[i].DISPLAY_FLAG != "N"
) {
//standard date time
elemVal = elem.dataset.dtvalue;
elemVal = this.cs.formatStandardDate(elemVal);
// elemVal = elem.dataset.dtvalue;
// elemVal = this.cs.formatStandardDate(elemVal);
elemVal = this.cs.formatDate(elemVal);
} else if (
this.eitResponse[i].FORMAT_TYPE == "I" &&
this.eitResponse[i].DISPLAY_FLAG != "N"

@ -133,8 +133,8 @@ export class AuthenticationService {
}else{
mobileType = 'android';
}
request.VersionID = 2.8;
request.Channel = 33;
request.VersionID = 2.9;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;
@ -209,7 +209,7 @@ export class AuthenticationService {
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
@ -466,7 +466,7 @@ export class AuthenticationService {
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}
@ -654,11 +654,37 @@ export class AuthenticationService {
this.ts.trPK("general", "idle-relogin"),
() => {
this.cs.sharedService.clearAll();
this.cs.openLogin();
// this.cs.openLogin();
this.getLastLoginInfo();
}
);
}
public getLastLoginInfo() {
let deviceToken = localStorage.getItem('deviceToken');
const requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
};
this.getLoginInfo(requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else {}
});
}
/*
reset and start idling interval
*/

@ -9,6 +9,10 @@ import { catchError, retry, tap, timeout } from 'rxjs/operators';
import { CommonService } from '../common/common.service';
// import { Response } from "../models/response";
import { Response } from 'src/app/hmg-common/services/models/response';
import { Events } from "@ionic/angular";
import { GetLoginInfoResponse } from "src/app/hmg-common/services/authentication/models/get-login-info.response";
import { GetLoginInfoRequest } from "src/app/hmg-common/services/authentication/models/get-login-info.request";
import { TranslatorService } from "../translator/translator.service";
@Injectable({
providedIn: 'root'
@ -26,7 +30,10 @@ export class ConnectorService {
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient, public cs: CommonService) {}
constructor(public httpClient: HttpClient,
public cs: CommonService,
private events: Events,
public ts: TranslatorService) {}
public post(
service: string,
@ -173,6 +180,44 @@ export class ConnectorService {
}
}
public getLoginInfo(
request: any,
onError: any,
errorLabel: string
): Observable<GetLoginInfoResponse> {
//this.setPublicFields(request);
return this.post(
'Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW',
request,
onError,
errorLabel
);
}
public getLastLoginInfo() {
let deviceToken = localStorage.getItem('deviceToken');
const requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
};
this.getLoginInfo(requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], 'imei-user-data');
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else {}
});
}
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
if (!isPostNoLoad) {
this.cs.stopLoading();
@ -182,8 +227,8 @@ export class ConnectorService {
this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.cs.sharedService.clearAll();
this.cs.openLogin();
// this.cs.openLogin();
this.getLastLoginInfo();
});
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
@ -212,9 +257,9 @@ export class ConnectorService {
this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
console.log("presentAcceptDialog");
this.cs.sharedService.clearAll();
this.cs.openLogin();
this.cs.sharedService.clearAll();
// this.cs.openLogin();
this.getLastLoginInfo();
});
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {

@ -51,7 +51,7 @@
</ion-row>
<ion-row>
<ion-col>
<ion-button *ngIf="userInfo" class="button-digital-id" (click)="testLogin()">
<ion-button *ngIf="userInfo" class="button-digital-id" (click)="loginWithDigitalID()">
<p style="color: black;">{{ts.trPK('general','digital-id')}}</p>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button>

@ -224,18 +224,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.loginWithUser.emit();
}
testLogin(){
let x = {
title: 'login,verify-with-whatsapp',
url: null,
icon: 'assets/icon/login/104.png',
settings: new ButtonSettings(true, true, true, true),
value: 4,
visible: true,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
};
loginWithDigitalID(){
this.confimLogin.checkAccess(this.logintype, true, this.logintype);
}

@ -153,7 +153,7 @@ export class ApplyActionModalComponent implements OnInit {
setTimeout(() => {
this.messageSuccess = false;
}, 5000);
}, 2000);
this.cs.openNotificationPage();
// this.getNotificationCountAfterSubmit();

@ -156,22 +156,22 @@ export class HomeComponent implements OnInit {
spaceBetween: 10
};
constructor(
public common: CommonService,
public ts: TranslatorService,
// tslint:disable-next-line: no-shadowed-variable
public WorklistService: WorklistService,
public workListService: WorklistMainService,
public modalController: ModalController,
public DS: DashboredService
) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50;
public common: CommonService,
public ts: TranslatorService,
// tslint:disable-next-line: no-shadowed-variable
public WorklistService: WorklistService,
public workListService: WorklistMainService,
public modalController: ModalController,
public DS: DashboredService
) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50;
}
ngOnInit() {
@ -247,17 +247,17 @@ export class HomeComponent implements OnInit {
for (const notification of openNotificationsArray) {
if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[2].value = this.totalPO;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
this.filters[2].value = this.totalPO;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
}
}
// this.data.datasets[0].data[4] = this.ITGCount;
@ -266,7 +266,7 @@ export class HomeComponent implements OnInit {
this.isLoading = false;
}
checkLoadingStatus () {
checkLoadingStatus() {
if (this.showChart && this.receivedITGCount) {
this.common.stopLoading();
return true;
@ -322,28 +322,28 @@ export class HomeComponent implements OnInit {
});
modal.onDidDismiss().then(result => {
if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading();
this.isLoading = true;
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
this.selectedValue = result.data.selectedValue;
this.inputDate = result.data.inputDate;
this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = [];
this.showFormattedData = [];
this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true;
if (this.itemType !== '') {
this.disableFilters();
}
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading();
this.isLoading = true;
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
this.selectedValue = result.data.selectedValue;
this.inputDate = result.data.inputDate;
this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = [];
this.showFormattedData = [];
this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true;
if (this.itemType !== '') {
this.disableFilters();
}
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
}
}
});
@ -351,41 +351,41 @@ export class HomeComponent implements OnInit {
}
getAllPushNotificationFun() {
this.WorkListObj.P_PAGE_NUM = 1;
this.isReachEnd = false;
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') {
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_PAGE_NUM = 1;
this.isReachEnd = false;
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') {
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
}
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
}
}
);
}
);
}
getFilteredData(filter: string) {
if (filter === 'ALL') {
this.showFormattedData = this.allFormattedData;
} else {
let arrayToFilter;
arrayToFilter = this.newWorkListResponse.filter((workList) => {
return workList.ITEM_TYPE === filter;
});
const categorizeData = this.categorizeData(arrayToFilter);
this.showFormattedData = this.sortArray(categorizeData);
// const sortData = this.sortArray(arrayToFilter);
// this.showFormattedData = this.categorizeData(sortData);
let arrayToFilter;
arrayToFilter = this.newWorkListResponse.filter((workList) => {
return workList.ITEM_TYPE === filter;
});
const categorizeData = this.categorizeData(arrayToFilter);
this.showFormattedData = this.sortArray(categorizeData);
// const sortData = this.sortArray(arrayToFilter);
// this.showFormattedData = this.categorizeData(sortData);
}
}
@ -393,11 +393,11 @@ export class HomeComponent implements OnInit {
let existsBefore = false;
let index = 0;
for (let i = 0; i < formattedData.length; i++) {
if (formattedData[i].date === currentDate) {
existsBefore = true;
index = i;
break;
}
if (formattedData[i].date === currentDate) {
existsBefore = true;
index = i;
break;
}
}
return {
exists: existsBefore,
@ -409,7 +409,7 @@ export class HomeComponent implements OnInit {
if (workList.ITEM_TYPE === 'HRSSA') {
this.totalHR = this.totalHR + 1;
} else if (workList.ITEM_TYPE === 'POAPPRV') {
this.totalPO = this.totalPO + 1;
this.totalPO = this.totalPO + 1;
} else if (workList.ITEM_TYPE === 'REQAPPRV') {
this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVMOA') {
@ -418,41 +418,41 @@ export class HomeComponent implements OnInit {
}
categorizeData(arrayToCategorize: any) {
this.totalHR = 0;
this.totalPO = 0;
this.totalPR = 0;
this.totalMR = 0;
const datePipe = new DatePipe('en-US');
const formattedData = [];
for (const workList of arrayToCategorize) {
this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = {
date: '',
data: []
};
if (formattedData.length === 0) {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
} else {
const existsBefore = this.checkDateExistance(currentDate, formattedData);
if (existsBefore.exists) {
formattedData[existsBefore.indexNumber].data.push(workList);
} else {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
}
}
this.totalHR = 0;
this.totalPO = 0;
this.totalPR = 0;
this.totalMR = 0;
const datePipe = new DatePipe('en-US');
const formattedData = [];
for (const workList of arrayToCategorize) {
this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = {
date: '',
data: []
};
if (formattedData.length === 0) {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
} else {
const existsBefore = this.checkDateExistance(currentDate, formattedData);
if (existsBefore.exists) {
formattedData[existsBefore.indexNumber].data.push(workList);
} else {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
}
}
return formattedData;
}
return formattedData;
}
sortArray(arrayToSort: any) {
return arrayToSort.sort((a: any, b: any) =>
new Date(b.date).getTime() - new Date(a.date).getTime()
new Date(b.date).getTime() - new Date(a.date).getTime()
);
}
@ -493,22 +493,23 @@ export class HomeComponent implements OnInit {
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
// this.common.stopLoading();
this.isLoading =false;
this.isLoading = false;
}
}
openNotificationDetail(obj) {
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter');
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
} else if (obj.REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else if (obj.REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
} else if (obj.REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else if (obj.REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
}
resetData() {
@ -562,9 +563,9 @@ export class HomeComponent implements OnInit {
Count() {
const datas = [];
const names = [];
this.workListService.getITGCount('', '', this.isPostNoLoad)
this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => {
if(result.RequestType.length > 0){
if (result.RequestType.length > 0) {
this.ITGSegment[0] = {
name: 'All',
code: 'All',
@ -576,7 +577,7 @@ export class HomeComponent implements OnInit {
this.setActive(this.ITGSegment[0].code);
}
console.log(result.RequestType);
let count =1;
let count = 1;
for (let i = 0; i < result.RequestType.length; i++) {
console.log()
this.ITGSegment[count] = {

@ -1,29 +1,198 @@
<app-generic-header showBack="true" backLink="/notification/homepage" [headerText]="'worklistMain,title' | translate">
</app-generic-header>
<ion-content class="colorBG">
<ion-content class="colorBG" *ngIf="!messageSuccess">
<ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="activeSegment"
class="ion-segment-all">
<ion-segment-button value="{{segmentVal.name}}"
<!-- <ion-segment-button value="{{segmentVal.name}}"
[ngClass]="activeSegment == segmentVal.name ? 'active-Segment' : 'normal-Segment'"
*ngFor="let segmentVal of segmentsArray">
<p style="font-size: 11px;">{{segmentVal.name}}</p>
</ion-segment-button> -->
<ion-segment-button value="Request Details"
[ngClass]="activeSegment == 'Request Details' ? 'active-Segment' : 'normal-Segment'">
<p style="font-size: 11px;">Request Details</p>
</ion-segment-button>
<ion-segment-button value="Approval Level"
[ngClass]="activeSegment == 'Approval Level' ? 'active-Segment' : 'normal-Segment'">
<p style="font-size: 11px;">Approval Level</p>
</ion-segment-button>
<ion-segment-button value="Requester Details"
[ngClass]="activeSegment == 'Requester Details' ? 'active-Segment' : 'normal-Segment'">
<p style="font-size: 11px;">Requester Details</p>
</ion-segment-button>
</ion-segment>
<!-- <ion-slides #slides pager="false" (ionSlideDidChange)="slideChanged($event)">
<ion-slides #slides pager="false" (ionSlideDidChange)="slideChanged($event)">
<ion-slide>
<p>SLide 1</p>
<ion-card class="cardContent" *ngIf='activeSegment === "Request Details"' style="width: 100%;">
<ion-card-content>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentData[0]?.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label *ngIf="dataContant.Value && dataContant.Type != 'table'">{{dataContant.Value}}</label>
<div *ngIf="dataContant.MultipleValue && dataContant.Type == 'list'">
<label *ngFor="let data of dataContant.MultipleValue">{{data}}<br /></label>
</div>
<div *ngIf="dataContant.Value && dataContant.Type =='table'">
<ion-card class="cardContent">
<ion-card-content>
<div *ngFor="let multiData of dataLabelAndValue">
<div *ngFor="let dataAll of multiData">
<div *ngFor="let dataLabel of dataAll">
<label class="colItemReq">{{dataLabel.label}}
<br /></label>
<div *ngIf="dataLabel.isTable =='false'">
<label *ngIf="dataLabel.textvalue">{{dataLabel.textvalue}}
<br /></label>
<label *ngIf="dataLabel.textvalue==''">none
<br /></label>
<br />
</div>
<div *ngIf="dataLabel.isTable == 'true'">
<div *ngFor="let subData of dataLabel.textvalue">
<div>
<label style="font-weight: bold;">{{subData.label}}
<br /></label>
<label>{{subData.textvalue}}
<br /></label>
<br />
</div>
</div>
</div>
</div>
</div>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-slide>
<ion-slide>
<p>SLide 2</p>
<ion-card class="cardContent" *ngIf='activeSegment === "Approval Level"'>
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-list class="notification-list" style="margin-left: -30px;" *ngFor="let approvalInfo of workList">
<div class="timeline">
<ion-item>
<div class="timeline-item" slot="start">
<div>
<button ion-button style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png">
</button>
<div
[ngClass]="{'bg-blue-dot' : approvalInfo.Action === 'Submit', 'bg-green-dot':approvalInfo.Action === 'Approved', 'bg-red-dot':approvalInfo.Action === 'Rejected', 'bg-gray-dot':approvalInfo.Action === 'Pending'}"
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'"
[ngClass]="{'bg-gray-dot' : approvalInfo.Action === ''}">
</div>
<p style="margin-left: -0%; font-size: 12px !important; width: 66px;">{{approvalInfo.Action}}</p>
</div>
</div>
<div>
<p style="margin-left: 10%; font-weight: bold;">{{approvalInfo.Name}}</p>
<div *ngIf="approvalInfo.Notes">
<p style="margin-left: 10%;">{{ 'submitAbsence, comments' | translate}}:</p>
<p style="margin-left: 10%;">{{approvalInfo.Notes}}</p>
</div>
</div>
</ion-item>
</div>
</ion-list>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-slide>
<ion-slide>
<p>SLide 3</p>
<ion-card class="cardContent" *ngIf='activeSegment === "Requester Details"' style="width: 100%;">
<ion-card-content>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentData[1]?.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label *ngIf="dataContant.Value && dataContant.Type != 'table'">{{dataContant.Value}}</label>
<div *ngIf="dataContant.MultipleValue && dataContant.Type == 'list'">
<label *ngFor="let data of dataContant.MultipleValue">{{data}}<br /></label>
</div>
<div *ngIf="dataContant.Value && dataContant.Type =='table'">
<ion-card class="cardContent">
<ion-card-content>
<div *ngFor="let multiData of dataLabelAndValue">
<div *ngFor="let dataAll of multiData">
<div *ngFor="let dataLabel of dataAll">
<label class="colItemReq">{{dataLabel.label}}
<br /></label>
<div *ngIf="dataLabel.isTable =='false'">
<label *ngIf="dataLabel.textvalue">{{dataLabel.textvalue}}
<br /></label>
<label *ngIf="dataLabel.textvalue==''">none
<br /></label>
<br />
</div>
<div *ngIf="dataLabel.isTable == 'true'">
<div *ngFor="let subData of dataLabel.textvalue">
<div>
<label style="font-weight: bold;">{{subData.label}}
<br /></label>
<label>{{subData.textvalue}}
<br /></label>
<br />
</div>
</div>
</div>
</div>
</div>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides> -->
<ion-slides #slides (ionSlideDidChange)="slideChanged($event)">
</ion-slides>
<!-- <ion-slides #slides (ionSlideDidChange)="slideChanged($event)">
<ion-slide *ngFor='let segmentContant of segmentData'>
<ion-card class="cardContent" *ngIf='activeSegment === segmentContant.name' style="width: 100%;">
<ion-card-content>
@ -84,6 +253,7 @@
</ion-card-content>
</ion-card>
</ion-slide>
<ion-slide>
<ion-card class="cardContent" *ngIf='activeSegment === "Approval Level"'>
<ion-card-content>
@ -126,7 +296,8 @@
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides>
</ion-slides> -->
<!-- <div *ngFor='let segmentContant of segmentData'>
<ion-card class="cardContent" *ngIf='activeSegment === segmentContant.name'>
<ion-card-content>
@ -279,8 +450,19 @@
<!-- END -->
</ion-content>
<ion-content *ngIf="messageSuccess">
<div class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
</ion-col>
<ion-col size="12">
<div style="font-size: 30px !important"> {{'worklistMain, Tran_Succ' | translate}} </div>
</ion-col>
</div>
</ion-content>
<ion-footer class="footerSearchBtn">
<ion-footer class="footerSearchBtn" *ngIf="!messageSuccess">
<ion-tabs>
@ -291,8 +473,8 @@
(click)="selectAtion(action.name)" [ngClass]="i === 0 ? 'tabs-margin' : ''">
<img [src]="action.image">
<ion-label style="font-size: 12px; white-space: pre-wrap !important;" *ngIf="action.name !== 'RequestInformation'">{{action.name}}</ion-label>
<ion-label style="font-size: 12px; white-space: pre-wrap !important;" *ngIf="action.name === 'RequestInformation'">Request Information</ion-label>
<ion-label style="font-size: 12px" *ngIf="action.name !== 'RequestInformation'">{{action.name}}</ion-label>
<ion-label style="font-size: 12px; white-space: nowrap;" *ngIf="action.name === 'RequestInformation'">Request Info</ion-label>
</ion-tab-button>

@ -8,6 +8,7 @@ import { ModalController } from '@ionic/angular';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component';
import { IonSlides } from '@ionic/angular';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
@Component({
selector: 'app-work-list-main-itg',
@ -35,7 +36,7 @@ export class WorkListMainItgComponent implements OnInit {
public segmentsArray: { name: string, number: number }[] = [];
public segmentData: { name: string, data: any }[] = [];
public requestDetailsData: { name: string, data: any }[] = [];
public dataLabelAndValue =[];
public dataLabelAndValue = [];
public header: any = [];
public rows: any = [];
public workList: any;
@ -58,6 +59,7 @@ export class WorkListMainItgComponent implements OnInit {
direction: string;
defaultSegment = '';
public slideIndex = 0;
public messageSuccess = false;
constructor(
public common: CommonService,
public ts: TranslatorService,
@ -86,20 +88,15 @@ export class WorkListMainItgComponent implements OnInit {
this.request.Comments = this.request_info.Comments;
this.request.NewUserEMPId = this.request_info.NewUserEMPId;
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
console.log(this.request);
console.log(result);
this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields;
let count =0;
let count = 0;
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i };
this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields }
for (let j = 0; j < this.segmentData[i].data.length; j++) {
// console.log(this.segmentData[i].data[j])
if(this.segmentData[i].data[j].Type ==="table"){
// console.log(JSON.parse(this.segmentData[i].data[j].Value));
if (this.segmentData[i].data[j].Type === "table") {
this.dataLabelAndValue.push(JSON.parse(this.segmentData[i].data[j].Value))
console.log(this.dataLabelAndValue);
}
// if (this.segmentData[i].data[j].TableValue){
// this.requestDetailsData[count] ={ name:this.segmentData[i].data[j].TableValue.Header,
@ -108,9 +105,9 @@ export class WorkListMainItgComponent implements OnInit {
// }
}
}
console.log(this.dataLabelAndValue)
//console.log(this.requestDetailsData)
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length }
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length };
this.segmentsArray = [this.segmentsArray[1], this.segmentsArray[2], this.segmentsArray[0]];
this.segmentData = [this.segmentData[1], this.segmentData[0]];
this.workList = this.request_details.WFHistory;
this.options = this.request_details.AllowedActions;
this.activeSegment = this.segmentsArray[0].name;
@ -164,12 +161,24 @@ export class WorkListMainItgComponent implements OnInit {
}
public segmentChangedClick(event: any) {
for(let i=0; i< this.segmentsArray.length; i++){
if(this.segmentsArray[i].name === event.detail.value){
this.slides.slideTo(i);
this.activeSegment = event.detail.value;
}
if (event.detail.value === "Request Details") {
this.slides.slideTo(0);
this.activeSegment = event.detail.value;
}
else if (event.detail.value === "Approval Level") {
this.slides.slideTo(1);
this.activeSegment = event.detail.value;
}
else if (event.detail.value === "Requester Details") {
this.slides.slideTo(2);
this.activeSegment = event.detail.value;
}
// for(let i=0; i< this.segmentsArray.length; i++){
// if(this.segmentsArray[i].name === event.detail.value){
// this.slides.slideTo(i);
// this.activeSegment = event.detail.value;
// }
// }
}
slideChanged(event: any) {
@ -179,7 +188,7 @@ export class WorkListMainItgComponent implements OnInit {
}
skip() {
//check if the user clicked on all type of request
// check if the user clicked on all type of request
if (this.is_all_items_sents) {
for (let i = 1; i < this.all_request_names.length; i++) {
for (let j = 0; j < this.all_request_names[i].data.length; j++) {
@ -193,49 +202,42 @@ export class WorkListMainItgComponent implements OnInit {
return false;
} else if (this.index !== this.all_request_names.length) { // if there is another deffernet type.
this.clearDataArray();
this.changeITGForm(this.all_request_names[this.index].data[j], this.all_request_names[this.index].code);
this.changeITGForm(this.all_request_names[this.index].data[0], this.all_request_names[this.index].code);
return false;
}
} else if (this.index === this.all_request_names.length) { //if its the end request redirecte to worklist home
} else if (this.index === this.all_request_names.length) { // if its the end request redirecte to worklist home
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
return false;
}
}
}
}
}
//if user clicked on spicific type of ITG request
else {
console.log(this.all_request);
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
console.log("IF statment check the IDs:");
console.log(this.request_info.ID);
console.log(this.all_request[i].ID);
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
this.index = i + 1;
console.log("value of i: "+i);
console.log("value of index: "+this.index);
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
this.clearDataArray();
console.log(this.all_request[this.index]);
console.log(this.request_name)
this.changeITGForm(this.all_request[this.index], this.request_name);
return;
} else {
console.log("no 1");
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
return;
}
}
}
// else {
// console.log("no 2");
// this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage();
// return;
// }
}
}
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
return;
}
clearDataArray() {
@ -269,34 +271,34 @@ export class WorkListMainItgComponent implements OnInit {
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
console.log("hello action 1");
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1)
// this.common.openNotificationPage();
this.skip();
}
} else if (result.MessageStatus == 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1);
this.skip();
}, 2000);
}
});
} else if (action == 2) {//reject
url = WorkListMainItgComponent.REJECT;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
console.log("hello action 2");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2)
// this.common.openNotificationPage();
this.skip();
}
} else if (result.MessageStatus == 1) {
setTimeout(() => {
this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
// this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
}, 2000);
}
});
} else if (action == 3) {//request more info
request.NewUserEMPId = this.replcamentID;
@ -307,21 +309,22 @@ export class WorkListMainItgComponent implements OnInit {
request.Comments = comments;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
console.log("hello action 3");
if (result.MessageStatus != 1) {
//this.common.presentAlert(result.Message);
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
}
if (result.MessageStatus == 1) {
if (result.MessageStatus == 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(3)
// this.common.openNotificationPage();
this.skip();
}
this.confirmMsg(3);
this.skip();
}, 2000);
}
});
}
} else if (action == 4) {//delegate
@ -329,19 +332,20 @@ export class WorkListMainItgComponent implements OnInit {
url = WorkListMainItgComponent.DELEGATE;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
console.log("hello action 4");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(4)
// this.common.openNotificationPage();
this.skip();
}
} else if (result.MessageStatus == 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(4);
this.skip();
}, 2000);
}
});
} else if (action == 5) { //answer
url = WorkListMainItgComponent.ANSWER;
@ -350,19 +354,20 @@ export class WorkListMainItgComponent implements OnInit {
} else {
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
console.log("hello action 5");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(5)
// this.common.openNotificationPage();
this.skip();
}
} else if (result.MessageStatus == 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(5);
this.skip();
}, 2000);
}
});
}
} else if (action == 6) { //grant
@ -375,18 +380,20 @@ export class WorkListMainItgComponent implements OnInit {
request.AdditionalFields = this.grantRequest;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
console.log("hello action 6");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6)
// this.common.openNotificationPage();
this.skip();
}
} else if (result.MessageStatus == 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
}
});
} else {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
@ -406,7 +413,6 @@ export class WorkListMainItgComponent implements OnInit {
}
confirmMsg(action) {
console.log("confirmMsg");
if (action === 1) {
return this.ts.trPK('worklist', 'approveMsg');
}

@ -148,10 +148,10 @@
<div class="noteInput" *ngIf="isAnswer== false">
<ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<!-- <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label> -->
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
<ion-textarea [(ngModel)]="userNote" placeholder="Enter a note"></ion-textarea>
</ion-item>
</div>
<br/>

@ -37,10 +37,10 @@ export class WorkListReplacementRollComponent implements OnInit {
private WorkListActionObj: WorkListActionRequest;
getpassResAttr: any = [];
active: any;
demoeAttach:any=[];
isSelect: boolean =false;
demoeAttach: any = [];
isSelect: boolean = false;
searchKeyEnter: boolean = false;
messageSuccess: boolean =false;
messageSuccess: boolean = false;
public direction: string;
P_RESPOND_ATTRIBUTES_TBL: any[];
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
@ -56,7 +56,7 @@ export class WorkListReplacementRollComponent implements OnInit {
if (this.getPassActionMode == "ANSWER_INFO") {
this.isAnswer = true;
}
this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
@ -65,12 +65,12 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = "";
this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr;
this.WorkListActionObj.RespondAttributeList = [];// this.getpassResAttr;
this.WorkListActionObj.P_APPROVER_INDEX = null;
this.direction = TranslatorService.getCurrentLanguageName();
}
ngOnInit() {
ngOnInit() {
}
@ -178,10 +178,10 @@ export class WorkListReplacementRollComponent implements OnInit {
}
select(selectEmp,index){
select(selectEmp, index) {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp=selectEmp
this.active=index;
this.selEmp = selectEmp
this.active = index;
}
clear() {
this.selEmpName = "";
@ -208,18 +208,18 @@ export class WorkListReplacementRollComponent implements OnInit {
}
submitAction() {
if (this.selEmp && this.isAnswer == false) {
// this.selectedUserInf = this.ReplacementList[this.selEmp];
this.selectedUserInf = this.selEmp;
console.log("selEmp "+ this.selEmp.USER_NAME);
this.selectedUserInf = this.selEmp;
console.log("selEmp " + this.selEmp.USER_NAME);
if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
console.log("userInfo "+this.selectedUserInf.USER_NAME);
console.log("userInfo " + this.selectedUserInf.USER_NAME);
if (this.userNote) {
if(this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD"){
if (this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD") {
let index_FORWARD = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "FORWARD_TO_USERNAME_RESPONSE");
this.getpassResAttr[index_FORWARD].ATTRIBUTE_TEXT_VALUE = this.selectedUserInf.USER_NAME;
@ -227,30 +227,30 @@ export class WorkListReplacementRollComponent implements OnInit {
let index_Note = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "NOTE");
this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote;
this.P_RESPOND_ATTRIBUTES_TBL= this.getpassResAttr;
this.P_RESPOND_ATTRIBUTES_TBL = this.getpassResAttr;
console.log(this.P_RESPOND_ATTRIBUTES_TBL);
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS =""// response Attr
this.WorkListActionObj.P_COMMENTS = ""// response Attr
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
}else{
} else {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
// this.modalCtrl.dismiss();
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
// this.modalCtrl.dismiss();
}
this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => {
this.handleApplayActionResult(result);
});
} else {
let msg: string = this.ts.trPK("replacementRoll", "enterNote");
this.cs.showErrorMessageDialog(() => {
@ -291,21 +291,25 @@ export class WorkListReplacementRollComponent implements OnInit {
if (result.MessageStatus == 1) {
this.cs.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
//this.modalCtrl.dismiss(succ);
// this.messageSuccess = true;
// setTimeout(() => {
// this.messageSuccess = false;
// //this.modalCtrl.dismiss(succ);
// this.modalCtrl.dismiss({
// 'dismissed': true,
// data: "Success"
// });
// }, 2000);
// this.cs.openNotificationPage();
this.modalCtrl.dismiss({
'dismissed': true,
data: "Success"
});
}, 5000);
this.cs.openNotificationPage();
}
}
} // not valid it
@ -358,33 +362,33 @@ export class WorkListReplacementRollComponent implements OnInit {
}
}
public col(){
public col() {
alert("test");
}
closeModal() {
this.modalCtrl.dismiss();
}
onChangeSelect(select){
onChangeSelect(select) {
console.log(select.detail.value);
let selectValue= select.detail.value;
let selectValue = select.detail.value;
if(selectValue == "1" || selectValue == "2" ||selectValue == "3"){
this.isSelect=true;
}
else{
this.isSelect=false;
if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
this.isSelect = true;
}
else {
this.isSelect = false;
}
}
}
onChangeInput(){
if (this.inputSearch.length >0) {
this.searchKeyEnter=true;
}else{
this.searchKeyEnter=false;
}
onChangeInput() {
if (this.inputSearch.length > 0) {
this.searchKeyEnter = true;
} else {
this.searchKeyEnter = false;
}
}
}

@ -137,6 +137,6 @@
}
.action-btn {
white-space: pre-wrap;
font-size: 12px;
white-space: nowrap;
font-size: 10px;
}

@ -117,6 +117,7 @@ export class WorklistMainMRComponent implements OnInit {
reqInfo_label: any="";
close_label: any;
closeDis: boolean = false;
selectedFilter: string;
constructor(
@ -141,7 +142,7 @@ export class WorklistMainMRComponent implements OnInit {
ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail();
}
@ -191,7 +192,7 @@ export class WorklistMainMRComponent implements OnInit {
public segmentChanged1(event: any) {
this.activeSegment = event.detail.value;
console.log(' event.detail.value: ' + event.detail.value);
// console.log(' event.detail.value: ' + event.detail.value);
}
intializeNotificationDetail() {
@ -205,12 +206,12 @@ export class WorklistMainMRComponent implements OnInit {
if (this.messageSuccess) {
document.getElementById('notificationDynamicFieldsMR').innerHTML = '';
}
console.log('intializeNotificationDetail');
// console.log('intializeNotificationDetail');
this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA,
false
);
console.log(this.getPassNotificationDetails.ROW_NUM);
// console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR,
false
@ -276,7 +277,7 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService
.getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
// console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, 'PO');
});
}
@ -329,7 +330,7 @@ export class WorklistMainMRComponent implements OnInit {
if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore');
console.log('test' + this.notificationButtonRes.length);
// console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
@ -413,41 +414,46 @@ export class WorklistMainMRComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
if( document.getElementById("notificationDynamicFieldsMR") != null){
document.getElementById("notificationDynamicFieldsMR").innerHTML = "";
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE;
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.common.openWorklistMainPOPage();
}else
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){
this.common.openWorklistMainPRPage();
}
else
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.intializeNotificationDetail();
}else{
this.common.openWorklistMainPage();
this.activeSegment = 'info';
if (this.selectedFilter === 'ALL') {
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.openNotificationPage();
}
}
else{
} else {
this.common.openNotificationPage();
}
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
this.common.openWorklistMainPOPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
this.intializeNotificationDetail();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) {
console.log('actionButton' + action);
// console.log('actionButton' + action);
// alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
@ -675,7 +681,7 @@ export class WorklistMainMRComponent implements OnInit {
}
getNotificationResAttr(notificationButtonsObj) {
console.log("getNotificationResAttr");
// console.log("getNotificationResAttr");
this.NotRespondAttributeList=[];
this.worklistMainService
.notificationResponseAttr(notificationButtonsObj)
@ -715,7 +721,7 @@ export class WorklistMainMRComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', '');
console.log(this.textArea );
// console.log(this.textArea );
} else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
@ -823,7 +829,7 @@ export class WorklistMainMRComponent implements OnInit {
async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present();
console.log('note' + note);
// console.log('note' + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -839,7 +845,7 @@ export class WorklistMainMRComponent implements OnInit {
}
doInfinite(infiniteScroll) {
console.log('doInfinite action history MR');
// console.log('doInfinite action history MR');
if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -909,7 +915,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss()
.then((data) => {
console.log(data); // Here's your selected user!
// console.log(data); // Here's your selected user!
});
// data => {
@ -924,7 +930,7 @@ export class WorklistMainMRComponent implements OnInit {
doInfiniteNotificationBody(infiniteScroll) {
console.log('doInfiniteNotificationBody MR');
// console.log('doInfiniteNotificationBody MR');
if (!this.IsReachEnd) {
this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj).
subscribe((result: any) => {
@ -959,9 +965,9 @@ export class WorklistMainMRComponent implements OnInit {
loadMoreNotificationBody() {
console.log('loadMoreNotificationBody MR');
// console.log('loadMoreNotificationBody MR');
if (!this.IsReachEnd) {
console.log('this.IsReachEnd' + this.IsReachEnd);
// console.log('this.IsReachEnd' + this.IsReachEnd);
this.worklistMainService.getMONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => {
@ -996,7 +1002,7 @@ export class WorklistMainMRComponent implements OnInit {
}
}//end infiniteScroll
loadMoreActionHistory() {
console.log('doInfinite action history MR');
// console.log('doInfinite action history MR');
if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -1044,7 +1050,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
// console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) {
return;
@ -1052,7 +1058,7 @@ export class WorklistMainMRComponent implements OnInit {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
// console.log(this.actionType);
///call Action button
this.actionButton(this.actionType);
}
@ -1069,8 +1075,8 @@ export class WorklistMainMRComponent implements OnInit {
///////////////////////////////////////////
public checkLines(note) {
console.log(note.split('\n').length);
console.log(note.length);
// console.log(note.split('\n').length);
// console.log(note.length);
if (note && note != null) {
@ -1094,7 +1100,7 @@ export class WorklistMainMRComponent implements OnInit {
}
this.actionHistoryRes = actionHis;
console.log('test');
// console.log('test');
}
@ -1108,13 +1114,18 @@ export class WorklistMainMRComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss().then((data) => {
console.log(data.data);
// console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) {
if (data.data.data == 'cancel' || data.data.data == undefined) {
return;
} else if (data.data == 'Success') {
} else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.nextNotfification();
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
}
});
@ -1140,7 +1151,7 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
// console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) {
return;
@ -1160,7 +1171,7 @@ export class WorklistMainMRComponent implements OnInit {
getMOItemHistory(itemID ,orgID) {
console.log(itemID);
// console.log(itemID);
this.IsReachEnd = false;
const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID);

@ -139,6 +139,6 @@
border: 0;
}
.action-btn {
white-space: pre-wrap;
font-size: 12px;
white-space: nowrap;
font-size: 10px;
}

@ -64,8 +64,8 @@ export class WorklistMainPoComponent implements OnInit {
getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999;
notificationBodyRes : any =[];
actionHistoryRes: any =[];
notificationBodyRes: any = [];
actionHistoryRes: any = [];
notificationButtonRes: any;
actionMode: any;
pInformation: string = "";
@ -127,7 +127,9 @@ export class WorklistMainPoComponent implements OnInit {
approve_label: any;
reject_label: any;
reqInfo_label: any;
closeDis: boolean = false;;
closeDis: boolean = false;
selectedFilter: string;
;
close_label: any;
constructor(
@ -151,52 +153,45 @@ export class WorklistMainPoComponent implements OnInit {
ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail();
}//ngOn
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if(this.activeSegment === 'line_details')
{
this.slides.slideTo(0);
}
else if(this.activeSegment === 'action-history')
{
this.slides.slideTo(1);
}
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(2);
}
else if(this.activeSegment === 'info')
{
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value);
if (this.activeSegment === 'line_details') {
this.slides.slideTo(0);
}
else if (this.activeSegment === 'action-history') {
this.slides.slideTo(1);
}
else if (this.activeSegment === 'attach') {
this.slides.slideTo(2);
}
else if (this.activeSegment === 'info') {
this.slides.slideTo(3);
}
// console.log(" event.detail.value: " + event.detail.value);
}
public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
if(index === 0)
{
// console.log(index);
// console.log(event);
if (index === 0) {
this.activeSegment = 'line_details';
}
else if(index === 1)
{
else if (index === 1) {
this.activeSegment = 'action-history';
}
else if(index === 2)
{
else if (index === 2) {
this.activeSegment = 'attach';
}
else if(index === 3)
{
else if (index === 3) {
this.activeSegment = 'info';
}
console.log(this.activeSegment);
// console.log(this.activeSegment);
});
}
@ -207,18 +202,18 @@ export class WorklistMainPoComponent implements OnInit {
this.approveDis = false;
this.rejectDis = false;
this.requestDis = false;
this.closeDis=false;
this.closeDis = false;
this.moreDisabled = true;
if (this.messageSuccess) {
document.getElementById("notificationDynamicFieldsPO").innerHTML = "";
}
console.log("intializeNotificationDetail");
// console.log("intializeNotificationDetail");
this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA,
false
);
console.log(this.getPassNotificationDetails.ROW_NUM);
// console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR,
false
@ -260,14 +255,14 @@ export class WorklistMainPoComponent implements OnInit {
public segmentChanged1(event: any) {
this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value);
// console.log(" event.detail.value: " + event.detail.value);
}
getPONotificationDetails(notificationBodyObj) {
this.worklistMainService
.getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
// console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, "PO");
});
}
@ -283,14 +278,14 @@ export class WorklistMainPoComponent implements OnInit {
result.GetEITCollectionNotificationBodyList;
}
} else if (Type == "ABSENCE") {
console.log("ABSENCE");
// console.log("ABSENCE");
if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList;
}
} else if (Type == "PR") {
if (result.GetPrNotificationBodyList) {
console.log("PR");
// console.log("PR");
this.PRHeader = result.GetPrNotificationBodyList.PRHeader;
this.PRLines = result.GetPrNotificationBodyList.PRLines;
@ -315,7 +310,7 @@ export class WorklistMainPoComponent implements OnInit {
} else if (Type == "PO") {
if (result.GetPoNotificationBodyList) {
console.log("PO");
// console.log("PO");
this.POHeader = result.GetPoNotificationBodyList.POHeader;
this.POLines = result.GetPoNotificationBodyList.POLines;
@ -361,34 +356,33 @@ export class WorklistMainPoComponent implements OnInit {
if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
console.log("test" + this.notificationButtonRes.length);
// console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") {
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") {
this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.requestDis = true;
} // if result == null
else if // if result == null
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.closeDis = true;
}
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE")
{
this.moreDisabled = false;
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
this.moreDisabled = false;
}
}
} // valid it
} // valid it
@ -397,7 +391,7 @@ export class WorklistMainPoComponent implements OnInit {
}
applyAction(WorkListActionObj) {
console.log("applyactio");
// console.log("applyactio");
this.worklistMainService
.actionButton(WorkListActionObj)
.subscribe((result: any) => {
@ -442,44 +436,50 @@ export class WorklistMainPoComponent implements OnInit {
// }
public nextNotfification() {
//let itemExist = false;
if( document.getElementById("notificationDynamicFieldsPO") != null){
document.getElementById("notificationDynamicFieldsPO").innerHTML = "";
if (document.getElementById('notificationDynamicFieldsPO') != null) {
document.getElementById('notificationDynamicFieldsPO').innerHTML = '';
}
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE;
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.intializeNotificationDetail();
}else
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){
this.common.openWorklistMainPRPage()
}
else
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
this.activeSegment = 'line_details';
if(this.selectedFilter === 'ALL'){
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
}else {
this.common.openNotificationPage();
}
}
else{
} else {
this.common.openNotificationPage();
}
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.intializeNotificationDetail();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) {
console.log("actionButton" + action);
// alert("don't forget");
// console.log("actionButton" + action);
// alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
@ -499,7 +499,7 @@ export class WorklistMainPoComponent implements OnInit {
}
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
console.log("a"+ this.P_RESPOND_ATTRIBUTES_TBL);
// console.log("a" + this.P_RESPOND_ATTRIBUTES_TBL);
let repUserName = this.selEmployeeID;
// if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
@ -610,7 +610,7 @@ export class WorklistMainPoComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPoComponent.PASS_RES_ATTR
);
console.log("c"+ this.P_RESPOND_ATTRIBUTES_TBL);
// console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
// this.common.openWorklistRollReplacement();
this.openRepRolModal();
@ -715,7 +715,7 @@ export class WorklistMainPoComponent implements OnInit {
}
getNotificationResAttr(notificationButtonsObj) {
console.log("getNotificationResAttr");
// console.log("getNotificationResAttr");
this.NotRespondAttributeList = [];
this.worklistMainService
@ -756,7 +756,7 @@ export class WorklistMainPoComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", "");
console.log(this.textArea );
// console.log(this.textArea);
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") {
@ -814,7 +814,7 @@ export class WorklistMainPoComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) {
this.attachmentRes =[];
this.attachmentRes = [];
this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
@ -832,7 +832,7 @@ export class WorklistMainPoComponent implements OnInit {
getActionHistory(WorkListActionHistoryObj) {
this.IsReachEnd = true;
this.actionHistoryRes=[];
this.actionHistoryRes = [];
this.worklistService.getActionHistory(WorkListActionHistoryObj).
subscribe((result: WorkListActionHistoryResponse) => {
this.handleWorkListActionHistoryResult(result);
@ -865,7 +865,7 @@ export class WorklistMainPoComponent implements OnInit {
async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present();
console.log("note" + note);
// console.log("note" + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -881,7 +881,7 @@ export class WorklistMainPoComponent implements OnInit {
}
doInfinite(infiniteScroll) {
console.log("doInfinite action history");
// console.log("doInfinite action history");
if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
@ -929,7 +929,7 @@ export class WorklistMainPoComponent implements OnInit {
}
getItemHistory(itemID) {
console.log(itemID);
// console.log(itemID);
this.IsReachEnd = false;
const request = new POItemHistoryRequest();
request.P_ITEM_ID = parseInt(itemID);
@ -968,7 +968,7 @@ export class WorklistMainPoComponent implements OnInit {
}
getQutationAnalysis(headerID, itemID) {
console.log(itemID + headerID);
// console.log(itemID + headerID);
this.IsReachEnd = false;
const request = new QuotationAnalysisRequest();
request.P_ITEM_ID = parseInt(itemID);
@ -1025,9 +1025,9 @@ export class WorklistMainPoComponent implements OnInit {
}
loadMoreNotificationBody() {
console.log("loadMoreNotificationBody PO");
// console.log("loadMoreNotificationBody PO");
if (!this.IsReachEnd) {
console.log("this.IsReachEnd" + this.IsReachEnd);
// console.log("this.IsReachEnd" + this.IsReachEnd);
this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => {
@ -1183,11 +1183,16 @@ export class WorklistMainPoComponent implements OnInit {
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
if (data.data.data == "cancel" || data.data.data == undefined) {
return;
} else if (data.data == "Success") {
} else if (data.data.data == "Success") {
// this.openNotificationsDashboard();
this.nextNotfification();
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
}
});

@ -136,6 +136,7 @@
border: 0;
}
.action-btn {
white-space: pre-wrap;
font-size: 12px;
// white-space: pre-wrap;
white-space: nowrap;
font-size: 10px;
}

@ -114,6 +114,7 @@ export class WorklistMainPRComponent implements OnInit {
reqInfo_label: any;
close_label: any;
closeDis: boolean = false;
selectedFilter: any;
constructor(
@ -138,7 +139,7 @@ export class WorklistMainPRComponent implements OnInit {
ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest();
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail();
}
@ -447,29 +448,39 @@ export class WorklistMainPRComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.common.openWorklistMainPOPage()
}else
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){
this.intializeNotificationDetail();
}
else
if(this.notificationArray[index].REQUEST_TYPE == "MO" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
}
this.activeSegment = 'info';
if(this.selectedFilter === 'ALL'){
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.openNotificationPage();
}
else{
} else {
this.common.openNotificationPage();
}
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
this.common.openWorklistMainPOPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
this.intializeNotificationDetail();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
}
actionButton(action) {
console.log('actionButton' + action);
@ -1105,11 +1116,16 @@ export class WorklistMainPRComponent implements OnInit {
.then((data) => {
console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) {
if (data.data.data == 'cancel' || data.data.data == undefined) {
return;
} else if (data.data == 'Success') {
} else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.nextNotfification();
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
}
});

@ -5,7 +5,7 @@
<ion-content class="colorBG">
<div *ngIf="!messageSuccess">
<!-- 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]="activeSegment"
class="ion-segment-all">
@ -71,9 +71,11 @@
*ngFor="let List of subordinatesleaveList;">
<ion-grid [ngClass]=" direction === 'en' ? 'gridSubordinates' :'gridSubordinates-Ar' ">
<div [ngClass]=" direction === 'en' ? 'subOrdinateDiv' :'subOrdinateDiv-Ar' ">
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
style="width: 70px !important; height: 70px !important;"
[src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE">
<img *ngIf="List.EMPLOYEE_IMAGE == null" class="empImgeSub"
style="width: 70px !important; height: 70px !important;"
src="../assets/imgs/profile.png">
</div>
<ion-row class="rowHeader "
@ -83,10 +85,12 @@
</label>
<br />
<label class="label" for="">{{List.POSITION_TITLE}} </label><br />
<br>
<label class="label" style="font-size: 11px !important; position: absolute; left: 0px; color: #000;" for="label">{{List.STATUS}}</label>
</ion-col>
<ion-col class="status" size="3">
<label class="label" style="font-size: 11px;" for="label">{{List.STATUS}}</label>
</ion-col>
<!-- <ion-col class="status" size="3">
</ion-col> -->
</ion-row>
<br />
<ion-row [ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar'">
@ -100,7 +104,7 @@
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
</ion-item>
</ion-col>
</ion-row>

@ -182,11 +182,12 @@
}
.status{
text-align: center;
background: green;
// background: green;
border-radius: 10px;
font-size: 12px;
font-size: 10px !important;
height: 40px;
color: white;
position: relative;
}
.rowHeader{
border-bottom: 1px solid var(--cusgray);
@ -215,9 +216,9 @@ color: white;
}
.gridSubordinates{
margin-left: 38px;
border-top-left-radius: 28px;
border-bottom-left-radius: 40px;
margin-left: 3%;//38px;
border-top-left-radius: 16px;//28px;
border-bottom-left-radius: 16px;//40px;
// padding-left: 8px;
background:var(--light);
border-top-right-radius: 16px;
@ -226,9 +227,11 @@ color: white;
.subOrdinateDiv{
z-index: 4;
margin-left: -32px;
position: absolute;
top: -2px;
margin-left: 0px;//-32px;
// position: absolute;
top: 5px;//-2px;
float: left;
margin-right: 10px;
}
.subOrdinateImg{
width: 85px;
@ -327,6 +330,6 @@ ion-card{
border: 0;
}
.action-btn {
white-space: pre-wrap;
font-size: 12px;
white-space: nowrap;
font-size: 10px;
}

@ -35,6 +35,7 @@ import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { IonSlides } from '@ionic/angular';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: "app-worklist-main",
@ -104,6 +105,8 @@ export class WorklistMainComponent implements OnInit {
reqInfo_label: any = "";
close_label: any;
closeDis: boolean = false;
public selectedFilter: string;
public arr_hr_req_only= [];
constructor(
public worklistService: WorklistService,
@ -116,20 +119,30 @@ export class WorklistMainComponent implements OnInit {
public worklistAttachService: WorklistAttachService,
private modalCtrl: ModalController,
public dashboredService: DashboredService,
public authService: AuthenticationService
) {
public authService: AuthenticationService,
public route: ActivatedRoute
) {
this.direction = TranslatorService.getCurrentLanguageName()
console.log("ENAD TEST LANG: "+this.direction);
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.route.params.subscribe(val => {
setTimeout(() => {
this.ionAlwaysEnter();
}, 100);
});
}
ngOnInit() {
ngOnInit() {}
ionAlwaysEnter(){
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
false
);
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
if (this.selEmp) { } else {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
@ -137,28 +150,27 @@ export class WorklistMainComponent implements OnInit {
}
});
}
this.intializeNotificationDetail();
}
// ionViewWillEnter(){
// this.intializeNotificationDetail();
// }
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if(this.activeSegment === 'info')
{
this.slides.slideTo(0);
}
else if(this.activeSegment === 'item-req' )
{
this.slides.slideTo(1);
}
else if(this.activeSegment === 'action-history')
{
this.slides.slideTo(2);
}
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(3);
}
if (this.activeSegment === 'info') {
this.slides.slideTo(0);
}
else if (this.activeSegment === 'item-req') {
this.slides.slideTo(1);
}
else if (this.activeSegment === 'action-history') {
this.slides.slideTo(2);
}
else if (this.activeSegment === 'attach') {
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value);
}
@ -166,20 +178,16 @@ export class WorklistMainComponent implements OnInit {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
if(index === 0)
{
if (index === 0) {
this.activeSegment = 'info';
}
else if(index === 1)
{
else if (index === 1) {
this.activeSegment = 'item-req';
}
else if(index === 2)
{
else if (index === 2) {
this.activeSegment = 'action-history';
}
else if(index === 3)
{
else if (index === 3) {
this.activeSegment = 'attach';
}
console.log(this.activeSegment);
@ -208,6 +216,11 @@ export class WorklistMainComponent implements OnInit {
HomeComponent.NOTIFICATION_ARR,
false
);
console.log(this.selectedFilter);
if(this.selectedFilter === 'HRSSA') {
this.arr_hr_req_only = [];
this.sortRequests();
}
this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest();
this.WorkListAttachObj = new WorkListButtonRequest();
@ -409,7 +422,7 @@ export class WorklistMainComponent implements OnInit {
this.messageSuccess = false;
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
}, 2000);
}
} // valid it
}
@ -448,26 +461,60 @@ export class WorklistMainComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if (this.notificationArray[index].REQUEST_TYPE == "PO") {
this.common.openWorklistMainPOPage()
} else
if (this.notificationArray[index].REQUEST_TYPE == "PR") {
this.common.openWorklistMainPRPage()
}
else
if (this.notificationArray[index].REQUEST_TYPE == "MO") {
this.common.openWorklistMainMRPage()
} else {
if(index < this.notificationArray.length){
this.activeSegment = 'info';
if (this.selectedFilter === 'ALL') {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.checkRequestType(index);
} else {
if(this.arr_hr_req_only){
let requestIndex = this.arr_hr_req_only.findIndex(x => x.ROW_NUM === itemNo);
requestIndex++;
if(requestIndex < this.arr_hr_req_only.length){
this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
this.intializeNotificationDetail();
}else{
this.common.openNotificationPage();
}
}
else {
}
}
} else {
this.common.openNotificationPage();
}
// if (index < this.notificationArray.length) {
// this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
// this.activeSegment = 'info';
// if (this.selectedFilter === 'ALL') {
// this.checkRequestType(index);
// } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
// this.checkRequestType(index);
// } else if((this.notificationArray[index].ITEM_TYPE === 'HRSSA' && this.notificationArray[index].REQUEST_TYPE === 'EIT') ||
// (this.notificationArray[index].ITEM_TYPE === 'HRSSA' && this.notificationArray[index].REQUEST_TYPE === 'ABSENCE')){
// this.checkRequestType(index);
// } else {
// this.common.openNotificationPage();
// }
// } else {
// this.common.openNotificationPage();
// }
}
checkRequestType(index){
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
} else
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.intializeNotificationDetail();
}
}
@ -925,11 +972,15 @@ export class WorklistMainComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
if (data.data.data == "cancel" || data.data.data == undefined) {
return;
} else if (data.data == "Success") {
this.nextNotfification();
} else if (data.data.data == "Success") {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
}
});
return await modal.present();
@ -1010,4 +1061,13 @@ export class WorklistMainComponent implements OnInit {
}
});
}
sortRequests(){
for(let i=0; i< this.notificationArray.length; i++){
if(this.notificationArray[i].ITEM_TYPE === 'HRSSA'){
this.arr_hr_req_only.push(this.notificationArray[i]);
}
}
console.log(this.arr_hr_req_only);
}
}

Loading…
Cancel
Save