fixing attachment bug and translator issues

MOE_DEV_NEW_TEMPORARY_DESIGN
enadhilal 6 years ago
commit 3b3d06ea8a

@ -75,7 +75,7 @@
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)"> (click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png"> <img class="attachImg" src="../assets/imgs/view.png">
</button> </button>
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img <button float-end class="attachImgBtn" (click)="delelteFile(attachRes)"><img
class="attachImg" src="../assets/imgs/deletegray.png"></button> class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col> </ion-col>
@ -100,7 +100,7 @@
<ion-grid class="approvalList"> <ion-grid class="approvalList">
<div class="approvalTitle">{{'confirmAddEit, approverList' | translate}}</div> <div class="approvalTitle">{{'confirmAddEit, approverList' | translate}}</div>
<div class="noDataDiv" *ngIf="approversList?.length == 0"> <div class="noDataDiv" *ngIf="approversList.length == 0">
<p>{{ 'general, empty' | translate}}</p> <p>{{ 'general, empty' | translate}}</p>
</div> </div>
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0"> <div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">

@ -186,7 +186,7 @@ ion-card-content.confirm-details{
.timeline .timeline-item { .timeline .timeline-item {
width: 40px; // width: 40px;
} }
@ -199,8 +199,8 @@ ion-card-content.confirm-details{
.empImge{ .empImge{
border-radius: 50%; border-radius: 50%;
width:100%; width:60px;
height: 100%; height: 60px;
border: #dedede solid 1px; border: #dedede solid 1px;
} }

@ -1,6 +1,6 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ApproversList } from '../models/approvers'; import { ApproversList } from '../models/approvers';
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 { WorkListButtonRequest } from 'src/app/eit/models/NotificationButtonReq'; import { WorkListButtonRequest } from 'src/app/eit/models/NotificationButtonReq';
@ -16,23 +16,23 @@ import { WorkListAttachViewComponent } from 'src/app/notification/work-list-atta
import { FileUploader } from 'ng2-file-upload'; import { FileUploader } from 'ng2-file-upload';
import { SubmitAbsenceModalComponent } from '../submit-absence-modal/submit-absence-modal.component'; import { SubmitAbsenceModalComponent } from '../submit-absence-modal/submit-absence-modal.component';
@Component({ @Component({
selector: "app-absence-confirm", selector: 'app-absence-confirm',
templateUrl: "./absence-confirm.component.html", templateUrl: './absence-confirm.component.html',
styleUrls: ["./absence-confirm.component.scss"] styleUrls: ['./absence-confirm.component.scss']
}) })
export class AbsenceConfirmComponent implements OnInit { export class AbsenceConfirmComponent implements OnInit {
direction:string; direction:string;
P_TransactionID: number; P_TransactionID: number;
approversList: ApproversList; approversList = [];
selEmp: string = ""; selEmp: string = '';
respID: number; respID: number;
absComments: string = ""; absComments: string = '';
selMenu: MenuResponse; selMenu: MenuResponse;
attachItems: any; attachItems: any;
attachListDisplay: any; attachListDisplay: any;
isTrue: any = 0; isTrue: any = 0;
getPassNotificationDetails: any; getPassNotificationDetails: any;
menuType: string = ""; menuType: string = '';
attachmentRes: any; attachmentRes: any;
objIndex1: any; objIndex1: any;
attachListOver: any = []; attachListOver: any = [];
@ -63,7 +63,7 @@ export class AbsenceConfirmComponent implements OnInit {
true true
); );
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.menuType = "E"; this.menuType = 'E';
this.respID = -999; this.respID = -999;
// this.getApproversList(); // this.getApproversList();
// console.log("this.getPassNotificationDetails.P_NOTIFICATION_ID :"+this.getPassNotificationDetails.NOTIFICATION_ID); // console.log("this.getPassNotificationDetails.P_NOTIFICATION_ID :"+this.getPassNotificationDetails.NOTIFICATION_ID);
@ -130,7 +130,7 @@ export class AbsenceConfirmComponent implements OnInit {
return el.isSuccess == true; return el.isSuccess == true;
}); });
this.attachListOver = filtered; this.attachListOver = filtered;
let msg: string = ""; let msg: string = '';
// msg = this.translate.translate("addAttach.errorMsg"); // msg = this.translate.translate("addAttach.errorMsg");
//this.common.showAlert(msg); //this.common.showAlert(msg);
} }
@ -168,7 +168,7 @@ export class AbsenceConfirmComponent implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.isSubmitBtnClicked = true; this.isSubmitBtnClicked = true;
//if(this.isResubmitAbs==false){ //if(this.isResubmitAbs==false){
let msg: string = this.ts.trPK("general", "messageSuccess"); let msg: string = this.ts.trPK('general', 'messageSuccess');
this.common.presentAlert(msg); this.common.presentAlert(msg);
// } // }
@ -180,7 +180,7 @@ export class AbsenceConfirmComponent implements OnInit {
getApproversList() { getApproversList() {
let body: any = { let body: any = {
P_TRANSACTION_ID: this.P_TransactionID, P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: "SSHRMS", P_AME_TRANSACTION_TYPE: 'SSHRMS',
P_PAGE_NUM: 1, P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000 P_PAGE_LIMIT: 1000
}; };
@ -210,7 +210,7 @@ export class AbsenceConfirmComponent implements OnInit {
}); });
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
if (data == "cancel" || data == "undefined") { if (data == 'cancel' || data == 'undefined') {
return; return;
} else { } else {
if (!str) { if (!str) {
@ -246,7 +246,7 @@ async openSubmitModal() {
.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.startAbApproval(); this.startAbApproval();
@ -324,7 +324,7 @@ async openSubmitModal() {
this.submitConService.updateAttach(req).subscribe((result: any) => { this.submitConService.updateAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
let msg: string = ""; let msg: string = '';
// msg = this.translate.translate("addAttach.attachUpdate"); // msg = this.translate.translate("addAttach.attachUpdate");
// this.common.showAlert(msg); // this.common.showAlert(msg);
@ -351,7 +351,7 @@ async openSubmitModal() {
}; };
this.submitConService.delteAttach(req).subscribe((result: any) => { this.submitConService.delteAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") { if (result.DeleteAttachmentList.P_RETURN_STATUS === 'S') {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID); this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
// let msg: string = ""; // let msg: string = "";
// msg = this.translate.translate("addAttach.deleteAttach"); // msg = this.translate.translate("addAttach.deleteAttach");
@ -394,9 +394,7 @@ async openSubmitModal() {
onFileSelected(input) { onFileSelected(input) {
// this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){ // this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){
console.log("1")
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
console.log("2")
let msg: string = ""; let msg: string = "";
msg = this.ts.trPK("general", "notSupport"); msg = this.ts.trPK("general", "notSupport");
this.common.presentAlert(msg); this.common.presentAlert(msg);
@ -404,7 +402,6 @@ async openSubmitModal() {
} // todo: show alert that you tried uploading wrong files } // todo: show alert that you tried uploading wrong files
else { else {
console.log("3")
const file = input.target.files[0]; const file = input.target.files[0];
// console.log(file); // console.log(file);
@ -433,7 +430,7 @@ async openSubmitModal() {
pushObject(fileData, name, type) { pushObject(fileData, name, type) {
console.log("before push: "+ this.index); console.log('before push: '+ this.index);
//this.attachListOver.length++; //this.attachListOver.length++;
try { try {
let array = name.split('.'); let array = name.split('.');

@ -186,9 +186,9 @@ getAbsenceTransaction() {
} }
} }
} }
doInfinite() { doInfinite(event: any) {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
//this.P_PAGE_NUM++; // this.P_PAGE_NUM++;
const request = { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,

@ -9,9 +9,9 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
styleUrls: ['./submit-absence-modal.component.scss'], styleUrls: ['./submit-absence-modal.component.scss'],
}) })
export class SubmitAbsenceModalComponent implements OnInit { export class SubmitAbsenceModalComponent implements OnInit {
submitAbsAttachmentList :any =[]; submitAbsAttachmentList: any = [];
absComments: string; absComments: string;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){ constructor( public ts: TranslatorService, private modalCtrl: ModalController, private cs: CommonService){
this.submitAbsAttachmentList = this.cs.sharedService.getSharedData('submitAbsAttachmentList', false); this.submitAbsAttachmentList = this.cs.sharedService.getSharedData('submitAbsAttachmentList', false);
this.absComments = this.cs.sharedService.getSharedData('absComments', false); this.absComments = this.cs.sharedService.getSharedData('absComments', false);
} }

@ -1,4 +1,4 @@
import { Component, OnInit, ElementRef } from "@angular/core"; import { Component, OnInit, ElementRef, ChangeDetectorRef } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
@ -27,6 +27,7 @@ import {ReplacementListComponent} from "../../vacation-rule/replacement-list/rep
import {ReplacmentResponse} from "../models/replacment-response"; import {ReplacmentResponse} from "../models/replacment-response";
import { AbsenceResponse } from '../models/absence.response'; import { AbsenceResponse } from '../models/absence.response';
import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component'; import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component';
import { AbsenceNotificatonBodyResponse } from 'src/app/notification/models/AbsenceNotificationBodyRes';
@Component({ @Component({
selector: "app-submit-absence", selector: "app-submit-absence",
templateUrl: "./submit-absence.component.html", templateUrl: "./submit-absence.component.html",
@ -84,10 +85,13 @@ export class SubmitAbsenceComponent implements OnInit {
public datePicker: DatePicker, public datePicker: DatePicker,
public ts: TranslatorService, public ts: TranslatorService,
private elementRef: ElementRef, private elementRef: ElementRef,
private changeDetectorRef: ChangeDetectorRef
) { ) {
////*new add*///// ////*new add*/////
/**********resubmit************ */ /**********resubmit************ */
this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
//this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); //this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
// this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage'); // this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage');
if (this.getPassdirfromNotifiPage) { if (this.getPassdirfromNotifiPage) {
@ -97,7 +101,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID; this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID;
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.respID = -999; this.respID = -999;
//this.submitAbsObjList = this.navParams.get('submitAbsObjList'); this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
console.log()
} else { } else {
this.action = "CREATE"; this.action = "CREATE";
this.selEmp = this.common.sharedService.getSharedData( this.selEmp = this.common.sharedService.getSharedData(
@ -169,6 +174,7 @@ export class SubmitAbsenceComponent implements OnInit {
} }
} }
calcDay() { calcDay() {
console.log("calcDay" );
let msg: string = ""; let msg: string = "";
if ( if (
this.startDate == undefined || this.startDate == undefined ||
@ -260,10 +266,13 @@ export class SubmitAbsenceComponent implements OnInit {
} }
public onTypeAbsenceChange() { public onTypeAbsenceChange() {
console.log("this.absenceType: "+ this.absenceType);
if (this.absenceType) { if (this.absenceType) {
let obj: any = this.absenceTypeList.find( let obj: any = this.absenceTypeList.find(
s => s.ABSENCE_ATTENDANCE_TYPE_ID == this.absenceType s => s.ABSENCE_ATTENDANCE_TYPE_ID == this.absenceType
); );
console.log("obj : "+ obj);
if (obj) this.absenceTypeName = obj.DESC_FLEX_CONTEXT_CODE; if (obj) this.absenceTypeName = obj.DESC_FLEX_CONTEXT_CODE;
else this.absenceTypeName = null; else this.absenceTypeName = null;
this.getAbsenceDffStructure(); this.getAbsenceDffStructure();
@ -1138,6 +1147,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.action = this.submitAbsObjList[i].ACTION; this.action = this.submitAbsObjList[i].ACTION;
if (this.submitAbsObjList[i].SEGMENT_NAME == "ABSENCE_TYPE") { if (this.submitAbsObjList[i].SEGMENT_NAME == "ABSENCE_TYPE") {
this.absenceType = val; this.absenceType = val;
this.changeDetectorRef.detectChanges();
} }
if (this.submitAbsObjList[i].SEGMENT_NAME == "DESC_FLEX_CONTEXT_CODE") { if (this.submitAbsObjList[i].SEGMENT_NAME == "DESC_FLEX_CONTEXT_CODE") {
this.absenceTypeName = val; this.absenceTypeName = val;

@ -1,21 +1,21 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ModalController } from "@ionic/angular"; import { ModalController } from '@ionic/angular';
import { WorkListAttachViewComponent } from "src/app/notification/work-list-attach-view/work-list-attach-view.component"; import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
import { AbsenceAttahcment } from "../models/abs.attach"; import { AbsenceAttahcment } from '../models/abs.attach';
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response"; import { AbsenceAttahcmentResponse } from '../models/abs.attach.response';
@Component({ @Component({
selector: "app-view-attachments", selector: 'app-view-attachments',
templateUrl: "./view-attachments.component.html", templateUrl: './view-attachments.component.html',
styleUrls: ["./view-attachments.component.scss"] styleUrls: ['./view-attachments.component.scss']
}) })
export class ViewAttachmentsComponent implements OnInit { export class ViewAttachmentsComponent implements OnInit {
AttachmentList: AbsenceAttahcment[]; AttachmentList: AbsenceAttahcment[];
constructor( constructor(
public common: CommonService, public common: CommonService,
public modalCtrl: ModalController, public modalCtrl: ModalController,
private ts: TranslatorService public ts: TranslatorService
) {} ) {}
ngOnInit() { ngOnInit() {
@ -26,7 +26,7 @@ export class ViewAttachmentsComponent implements OnInit {
async OpenAttachFiles(value, Type) { async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
{ displayData: value, TypeData: Type }, { displayData: value, TypeData: Type },
"WorkListAttachViewPage" 'WorkListAttachViewPage'
); );
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent component: WorkListAttachViewComponent

@ -33,7 +33,7 @@ export class HomeComponent implements OnInit {
} }
}); });
} }
private getAccrualBalance() { public getAccrualBalance() {
if (this.Sdate) { if (this.Sdate) {
let today = new Date(this.Sdate); let today = new Date(this.Sdate);
let day = today.getDate(); let day = today.getDate();

@ -179,7 +179,7 @@
</div> </div>
<div class="centerDiv homeBox" (click)="openPersonalInfo()"> <div class="centerDiv homeBox">
<div [ngClass]="direction==='ltr'? 'profileDiv':'profileDiv-ar'"> <div [ngClass]="direction==='ltr'? 'profileDiv':'profileDiv-ar'">
<!-- <ion-img class="profileImg" src="{{user_image}}"></ion-img> --> <!-- <ion-img class="profileImg" src="{{user_image}}"></ion-img> -->
<img class="profileImg" [src]="user_image"> <img class="profileImg" [src]="user_image">
@ -258,6 +258,16 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<!-- <ion-item (click)="openChangePassword()"> --> <!-- <ion-item (click)="openChangePassword()"> -->
<ion-item (click)="openChangePassword()"> <ion-item (click)="openChangePassword()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
@ -275,14 +285,7 @@
</button> --> </button> -->
</ion-item> </ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<!-- <ion-item (click)="profile()"> <!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/profile_icon.png" item-left> <img width="30" src="../assets/imgs/profile_icon.png" item-left>
@ -306,7 +309,7 @@
<div class="" style="text-align:center"> <div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg"> <img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{CompanyImageDescription}}</p> <p class="companyTxt">{{companyDesc}}</p>
</div> </div>
<div class="menuFooter"> <div class="menuFooter">
<!-- <div> <img src="../assets/imgs/CS.png" class="CompanyImg"></div> --> <!-- <div> <img src="../assets/imgs/CS.png" class="CompanyImg"></div> -->

@ -129,7 +129,8 @@ export class AppComponent implements OnInit, AfterViewInit {
this.events.subscribe('myTeamFlag', myTeamFlag => { this.events.subscribe('myTeamFlag', myTeamFlag => {
this.TeamFlag = myTeamFlag; this.TeamFlag = myTeamFlag;
}); });
console.log("this.TeamFlag>>>>>>>>>"+ this.TeamFlag); // this.TeamFlag = this.cs.sharedService.getSharedData("myTeamFlag",false);
// console.log("this.TeamFlag>>>>>>>>>"+ this.TeamFlag);
} }
private initializeDirection() { private initializeDirection() {
this.direction = TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentDirection();
@ -155,7 +156,8 @@ export class AppComponent implements OnInit, AfterViewInit {
this.menu.enable(false); this.menu.enable(false);
this.logoutFlage=true; this.logoutFlage=true;
this.events.publish('logoutFlage', this.logoutFlage); this.events.publish('logoutFlage', this.logoutFlage);
this.cs.setUpdateImage("",false);
this.TeamFlag ="false";
this.getLastLoginInfo(); this.getLastLoginInfo();
// this.cs.openLogin(); // this.cs.openLogin();

@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Geolocation } from '@ionic-native/geolocation/ngx'; import { Geolocation } from '@ionic-native/geolocation/ngx';
import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx'; import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -9,39 +11,38 @@ import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
zbarOptions:any; zbarOptions: any;
scannedResult:any; scannedResult: any;
lat : any; lat: any;
longt : any; longt: any;
constructor(private zbar: ZBar, private geolocation: Geolocation) { constructor(public ts: TranslatorService, private zbar: ZBar, private geolocation: Geolocation) {
this.zbarOptions = { this.zbarOptions = {
flash: 'off', flash: 'off',
drawSight: false drawSight: false
} };
console.log("your currnt location is"); console.log('your currnt location is');
this.geolocation.getCurrentPosition().then((resp) => { this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude // resp.coords.latitude
// resp.coords.longitude // resp.coords.longitude
//console.log("Loc 2"); // console.log("Loc 2");
console.log(resp.coords.latitude); console.log(resp.coords.latitude);
console.log(resp.coords.longitude); console.log(resp.coords.longitude);
this.lat=resp.coords.latitude; this.lat = resp.coords.latitude;
this.longt=resp.coords.longitude; this.longt = resp.coords.longitude;
}).catch((error) => { }).catch((error) => {
console.log('Error getting location', error); console.log('Error getting location', error);
}); });
this.scanCode(); this.scanCode();
} }
ngOnInit() {} ngOnInit() {}
onClick() onClick() {
{
this.scanCode(); this.scanCode();
} }
scanCode(){ scanCode() {
this.zbar.scan(this.zbarOptions) this.zbar.scan(this.zbarOptions)
.then(result => { .then(result => {
console.log(result); // Scanned code console.log(result); // Scanned code

@ -27,33 +27,42 @@
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','currentPassword')}}"[(ngModel)]="P_OLD_PASSWORD"></ion-input> <ion-input class="login-input" required type="password"
placeholder="{{ts.trPK('changePassword','currentPassword')}}"
[(ngModel)]="P_OLD_PASSWORD"
minLength="8" min="8"
(ionChange)="onChangeOP()"
></ion-input>
</ion-item> </ion-item>
<p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p> <p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p>
<ion-item class="item-input-login" > <ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}" <ion-input (ionChange)="onChangeNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD"> [(ngModel)]="P_NEW_PASSWORD" minLength="8" min="8" >
</ion-input> </ion-input>
</ion-item> </ion-item>
<ion-item class="item-input-login" > <ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> --> <!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}" <ion-input (ionChange)="onChangeCNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD"> [(ngModel)]="P_Confirm_NEW_PASSWORD" minLength="8" min="8">
</ion-input> </ion-input>
</ion-item> </ion-item>
</ion-grid> </ion-grid>
<page-trailer [small]="true"></page-trailer> <page-trailer [small]="true"></page-trailer>
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</ion-button>
<button [disabled]="!(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD)" [ngClass]=" !(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD) ? 'disabledButton' : '' " class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
</div> </div>
</ion-footer> </ion-footer>

@ -29,3 +29,7 @@
width: 315px; width: 315px;
} }
.disabledButton{
opacity:.5;
}

@ -12,6 +12,7 @@ import { SharedDataService } from 'src/app/hmg-common/services/shared-data-servi
import {LoginComponent} from "src/app/authentication/login/login.component"; import {LoginComponent} from "src/app/authentication/login/login.component";
import { Password } from '../models/password'; import { Password } from '../models/password';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
//import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Component({ @Component({
selector: 'app-change-password', selector: 'app-change-password',
@ -20,14 +21,19 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
}) })
export class ChangePasswordComponent implements OnInit { export class ChangePasswordComponent implements OnInit {
private loginData = new LoginModel(); private loginData = new LoginModel();
public P_NEW_PASSWORD: string; public P_NEW_PASSWORD: string = "";
public P_Confirm_NEW_PASSWORD : string; public P_Confirm_NEW_PASSWORD : string = "";
public P_OLD_PASSWORD : string; public P_OLD_PASSWORD : string = "";
public P_USER_NAME : string; public P_USER_NAME : string;
public logo = "assets/icon/login/lock.png"; public logo = "assets/icon/login/lock.png";
userData: any = {}; userData: any = {};
public isExpiredPwd: boolean = false; public isExpiredPwd: boolean = false;
public NEW_PASSWORD: boolean = false;
public Confirm_NEW_PASSWORD: boolean = false;
public OLD_PASSWORD: boolean = false;
//public profile_form: FormGroup;
constructor( constructor(
public cs: CommonService, public cs: CommonService,
public authService: AuthenticationService, public authService: AuthenticationService,
@ -36,7 +42,9 @@ export class ChangePasswordComponent implements OnInit {
public ts: TranslatorService, public ts: TranslatorService,
public smsService: SmsReaderService, public smsService: SmsReaderService,
public changeDetector: ChangeDetectorRef, public changeDetector: ChangeDetectorRef,
public sharedData: SharedDataService) { public sharedData: SharedDataService,
// public formBuilder: FormBuilder,
) {
console.log("change password constructor"); console.log("change password constructor");
} }
@ -48,6 +56,11 @@ export class ChangePasswordComponent implements OnInit {
this.P_USER_NAME =data.P_USER_NAME; this.P_USER_NAME =data.P_USER_NAME;
console.log(this.isExpiredPwd); console.log(this.isExpiredPwd);
console.log(this.P_USER_NAME); console.log(this.P_USER_NAME);
// this.profile_form = this.formBuilder.group({
// password: ['', Validators.compose([Validators.minLength(8)])]
// });
// this.authService // this.authService
// .loadAuthenticatedUser() // .loadAuthenticatedUser()
// .subscribe((user: AuthenticatedUser) => { // .subscribe((user: AuthenticatedUser) => {
@ -119,6 +132,43 @@ export class ChangePasswordComponent implements OnInit {
} }
}); });
} }
onChangeCNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_Confirm_NEW_PASSWORD.length >= 3) {
this.Confirm_NEW_PASSWORD=true;
}else{
this.Confirm_NEW_PASSWORD=false;
}
}
onChangeNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_NEW_PASSWORD.length >= 3) {
this.NEW_PASSWORD=true;
}else{
this.NEW_PASSWORD=false;
}
}
onChangeOP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_OLD_PASSWORD.length >= 3) {
this.OLD_PASSWORD=true;
}else{
this.OLD_PASSWORD=false;
}
}
} }

@ -44,7 +44,7 @@
</ion-row> </ion-row>
<ion-row [ngClass]=" accessFromOutSide ? 'rowOutside' : ''" [dir]="direction" class="zoomIn"> <ion-row [ngClass]=" accessFromOutSide ? 'rowOutside' : ''" class="zoomIn">
<ng-container *ngFor="let buttonsGroup of buttons"> <ng-container *ngFor="let buttonsGroup of buttons">
<ng-container *ngFor="let button of buttonsGroup"> <ng-container *ngFor="let button of buttonsGroup">

@ -59,7 +59,7 @@
</ion-item> </ion-item>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false"> <div class="centerDiv signupDiv" *ngIf="isAppleStore==false">
<a (click)="signUp()">{{ts.trPK('login','signup')}}</a> <a>{{ts.trPK('login','signup')}}</a>
</div> </div>
<div class="gridDiv" aria-disabled="true"> <div class="gridDiv" aria-disabled="true">
<button class="gridBtn" ion-button (click)="changeLanguage('1')" [ngClass]="{'active':this.currentLang ==1}">English</button> <button class="gridBtn" ion-button (click)="changeLanguage('1')" [ngClass]="{'active':this.currentLang ==1}">English</button>

@ -1,56 +1,28 @@
import { Component, OnInit, NgZone, OnDestroy } from "@angular/core"; import { Component, OnInit, NgZone, OnDestroy } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { Router } from "@angular/router"; import { Router } from '@angular/router';
import { AlertController, Platform, Events } from "@ionic/angular"; import { AlertController, Platform, Events } from '@ionic/angular';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response"; import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response';
import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service"; import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.service';
import { FingerprintAIO } from "@ionic-native/fingerprint-aio/ngx"; import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
import { Device } from "@ionic-native/device/ngx"; import { Device } from '@ionic-native/device/ngx';
import { SplashScreen } from "@ionic-native/splash-screen/ngx"; import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { SharedDataService } from "src/app/hmg-common/services/shared-data-service/shared-data.service"; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { LoginModel } from "../models/LoginModel"; import { LoginModel } from '../models/LoginModel';
import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request"; import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request';
import { Password } from '../models/password'; import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response'; import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response';
import { PushService } from 'src/app/hmg-common/services/push/push.service'; import { PushService } from 'src/app/hmg-common/services/push/push.service';
@Component({ @Component({
selector: "login", selector: 'login',
templateUrl: "./login.component.html", templateUrl: './login.component.html',
styleUrls: ["./login.component.scss"] styleUrls: ['./login.component.scss']
}) })
export class LoginComponent implements OnInit, OnDestroy { export class LoginComponent implements OnInit, OnDestroy {
appLang: number = 1;
isExpired: boolean = false;
isSupportAr: boolean = false;
isAppleStore: boolean = false;
memberLogin: any = {};
private password: string;
private language: string;
private username: string;
private remeberMe: boolean;
private iosLink: string;
private androidLink: string;
private currentLang: any = 1;
private patientOutSA: boolean;
private loginTokenID: string;
private isMobileFingerPrint: boolean;
private FingerPrintPatientIdentificationID: string;
private loginData = new LoginModel();
private empname:any;
private logintype:any;
public loginDiv:boolean =true;
public welcomeBack:boolean =false;
public logo = "assets/icon/login/password.png";
deviceToken: any="";
user: boolean =false;
DeviceType: string;
requestGetLoginInfo:any;
logoutFlage: boolean ;
getuser:any="";
constructor( constructor(
public cs: CommonService, public cs: CommonService,
@ -60,7 +32,7 @@ export class LoginComponent implements OnInit, OnDestroy {
public ts: TranslatorService, public ts: TranslatorService,
public smsService: SmsReaderService, public smsService: SmsReaderService,
private faio: FingerprintAIO, private faio: FingerprintAIO,
public events:Events, public events: Events,
public ngZone: NgZone, public ngZone: NgZone,
public device: Device, public device: Device,
public splash: SplashScreen, public splash: SplashScreen,
@ -68,12 +40,13 @@ export class LoginComponent implements OnInit, OnDestroy {
public plt: Platform, public plt: Platform,
public pushService: PushService public pushService: PushService
) { ) {
this.events.subscribe("logoutFlage", logoutFlage => { this.events.subscribe('logoutFlage', logoutFlage => {
console.log("login compont logoutFlage: "+logoutFlage); console.log('login compont logoutFlage: ' + logoutFlage);
if(logoutFlage == true){ // tslint:disable-next-line: triple-equals
console.log(" subscribe check logoutFlage: "+logoutFlage); if (logoutFlage == true) {
console.log(' subscribe check logoutFlage: ' + logoutFlage);
this.logoutFlage = logoutFlage; this.logoutFlage = logoutFlage;
localStorage.setItem('logoutFlage',logoutFlage); localStorage.setItem('logoutFlage', logoutFlage);
} }
}); });
@ -82,15 +55,44 @@ export class LoginComponent implements OnInit, OnDestroy {
false false
); );
// alert(" this.getuser "+this.getuser); // alert(" this.getuser "+this.getuser);
if(this.getuser){ if (this.getuser) {
this.user = true; this.user = true;
} } else {
else{
this.user = false; this.user = false;
} }
} }
appLang = 1;
isExpired = false;
isSupportAr = false;
isAppleStore = false;
memberLogin: any = {};
public password: string;
private language: string;
public username: string;
public remeberMe: boolean;
private iosLink: string;
private androidLink: string;
public currentLang: any = 1;
private patientOutSA: boolean;
private loginTokenID: string;
private isMobileFingerPrint: boolean;
private FingerPrintPatientIdentificationID: string;
private loginData = new LoginModel();
private empname: any;
private logintype: any;
public loginDiv = true;
public welcomeBack = false;
public logo = 'assets/icon/login/password.png';
deviceToken: any = '';
user = false;
DeviceType: string;
requestGetLoginInfo: any;
logoutFlage: boolean ;
getuser: any = '';
private checkUserResult: CheckUserAuthenticationResponse;
ngOnInit() { ngOnInit() {
console.log("ENAD TEST!!!") console.log("ENAD TEST!!!")
@ -116,8 +118,8 @@ export class LoginComponent implements OnInit, OnDestroy {
// } // }
this.events.subscribe("user", user => { this.events.subscribe('user', user => {
console.log("login compont: "+user); console.log('login compont: ' + user);
this.user = user; this.user = user;
}); });
@ -126,16 +128,16 @@ export class LoginComponent implements OnInit, OnDestroy {
this.deviceToken= localStorage.getItem('devicyeToken'); this.deviceToken = localStorage.getItem('devicyeToken');
console.log("let deviceToken" + this.deviceToken); console.log('let deviceToken' + this.deviceToken);
if (this.deviceToken) { if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken); console.log('login enabled first time: ' + this.deviceToken);
} else { } else {
console.log("no deviceToken" ); console.log('no deviceToken' );
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
// alert('login enabled second time: ' + this.deviceToken); // alert('login enabled second time: ' + this.deviceToken);
}, 1000); }, 1000);
@ -155,22 +157,23 @@ export class LoginComponent implements OnInit, OnDestroy {
//here will delete below part and depdding on user (response from getMobileInfo) // here will delete below part and depdding on user (response from getMobileInfo)
this.username = localStorage.getItem("user"); this.username = localStorage.getItem('user');
this.password = localStorage.getItem("password"); //****// this.password = localStorage.getItem('password'); // ****//
let remember = localStorage.getItem("remember");//****// const remember = localStorage.getItem('remember'); // ****//
this.empname= localStorage.getItem("emp-name"); this.empname = localStorage.getItem('emp-name');
this.logintype= localStorage.getItem("login-type"); this.logintype = localStorage.getItem('login-type');
if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false } // tslint:disable-next-line: triple-equals
if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; }
//here will be check on user if exite then s part and depdding on user (response from getMobileInfo) // here will be check on user if exite then s part and depdding on user (response from getMobileInfo)
if(this.user){ if (this.user) {
// this.loginDiv=false; // this.loginDiv=false;
// this.welcomeBack=true; // this.welcomeBack=true;
}else{ } else {
// this.user=true; // this.user=true;
// this.welcomeBack=false; // this.welcomeBack=false;
} }
@ -200,8 +203,7 @@ export class LoginComponent implements OnInit, OnDestroy {
this.currentLang = TranslatorService.getCurrentLanguageCode(); this.currentLang = TranslatorService.getCurrentLanguageCode();
} }
} }
public forgetPasswordPage() {
private forgetPasswordPage() {
this.cs.openUserForgot(); this.cs.openUserForgot();
} }
@ -214,14 +216,14 @@ export class LoginComponent implements OnInit, OnDestroy {
public addValue(e): void { public addValue(e): void {
// console.log(e.currentTarget.checked); // console.log(e.currentTarget.checked);
this.remeberMe = true;//e.currentTarget.checked; this.remeberMe = true; // e.currentTarget.checked;
this.remeberMyInfo(); this.remeberMyInfo();
} }
public remeberMyInfo() { public remeberMyInfo() {
// if (this.remeberMe) { // if (this.remeberMe) {
if(this.username){localStorage.setItem("user", this.username);} if (this.username) {localStorage.setItem('user', this.username); }
if(this.password){localStorage.setItem("password", this.password);} if (this.password) {localStorage.setItem('password', this.password); }
localStorage.setItem("remember", "true"); localStorage.setItem('remember', 'true');
// } else { // } else {
// localStorage.setItem("user", ""); // localStorage.setItem("user", "");
// localStorage.setItem("password", ""); // localStorage.setItem("password", "");
@ -230,21 +232,21 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
public onLogin() { public onLogin() {
console.log("onLogin"); console.log('onLogin');
// this.checkAppUpdated(); // this.checkAppUpdated();
// this.checkUserAuthentication(); // this.checkUserAuthentication();
this.deviceToken = localStorage.getItem('deviceToken'); this.deviceToken = localStorage.getItem('deviceToken');
console.log("let deviceToken" + this.deviceToken); console.log('let deviceToken' + this.deviceToken);
if (this.deviceToken) { if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken); console.log('login enabled first time: ' + this.deviceToken);
this.checkAppUpdated(); this.checkAppUpdated();
} else { } else {
console.log("no deviceToken" ); console.log('no deviceToken' );
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken'); this.deviceToken = localStorage.getItem('deviceToken');
this.checkAppUpdated(); this.checkAppUpdated();
console.log('login enabled second time: ' + this.deviceToken); console.log('login enabled second time: ' + this.deviceToken);
@ -257,31 +259,34 @@ export class LoginComponent implements OnInit, OnDestroy {
() => { () => {
/* Write code for error */ /* Write code for error */
}).subscribe((result: CheckAppVersionResponse) => { }).subscribe((result: CheckAppVersionResponse) => {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 2 && result.ErrorType == 4) { if (result.MessageStatus == 2 && result.ErrorType == 4) {
this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{ this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.handleAppUpdate(result) this.handleAppUpdate(result);
}); });
// tslint:disable-next-line: triple-equals
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.checkUserAuthentication(); this.checkUserAuthentication();
} }
}); });
} }
private handleAppUpdate(result){ private handleAppUpdate(result) {
this.iosLink = result.IOSLink; this.iosLink = result.IOSLink;
this.androidLink = result.AndroidLink; this.androidLink = result.AndroidLink;
if (this.plt.is('android')) { if (this.plt.is('android')) {
if (this.androidLink) if (this.androidLink) {
window.open(this.androidLink, '_system'); window.open(this.androidLink, '_system');
} }
else if (this.plt.is('ios')) { } else if (this.plt.is('ios')) {
if (this.iosLink) if (this.iosLink) {
window.open(this.iosLink, '_system'); window.open(this.iosLink, '_system');
}
} }
} }
private checkUserAuthentication() { private checkUserAuthentication() {
console.log("debug Here!!"); console.log('debug Here!!');
console.log(this.username); console.log(this.username);
console.log(this.language); console.log(this.language);
console.log(this.password); console.log(this.password);
@ -294,13 +299,13 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log(request); console.log(request);
this.authService this.authService
.login(request, () => { .login(request, () => {
console.log("error here"); console.log('error here');
//console.log(result.MessageStatus); // console.log(result.MessageStatus);
//this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); // this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
//this.userCheck(); // this.userCheck();
}, this.ts.trPK("general", "ok")) }, this.ts.trPK('general', 'ok'))
.subscribe((result: CheckUserAuthenticationResponse) => { .subscribe((result: CheckUserAuthenticationResponse) => {
console.log("success"); console.log('success');
this.cs.stopLoading(); this.cs.stopLoading();
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
// alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList[0].EMPLOYEE_NAME); // alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList[0].EMPLOYEE_NAME);
@ -312,14 +317,14 @@ export class LoginComponent implements OnInit, OnDestroy {
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo(); this.remeberMyInfo();
//this.cs.openSMSPage(); phase#1 one type of OTP // this.cs.openSMSPage(); phase#1 one type of OTP
// if(!this.welcomeBack){ // if(!this.welcomeBack){
this.cs.openConfirmLoginPage();//phase#2 add 4 types for OTP this.cs.openConfirmLoginPage(); // phase#2 add 4 types for OTP
// } // }
} else { } else {
console.log("result.IsPasswordExpired"); console.log('result.IsPasswordExpired');
console.log(result.IsPasswordExpired); console.log(result.IsPasswordExpired);
if (result.IsPasswordExpired) { if (result.IsPasswordExpired) {
this.presentPasswordExpiredDialog(); this.presentPasswordExpiredDialog();
@ -334,11 +339,11 @@ export class LoginComponent implements OnInit, OnDestroy {
async presentPasswordExpiredDialog() { async presentPasswordExpiredDialog() {
const alert = await this.alertController.create({ const alert = await this.alertController.create({
header: this.ts.trPK("general", "confirm"), header: this.ts.trPK('general', 'confirm'),
message: this.ts.trPK("login", "password-expired"), message: this.ts.trPK('login', 'password-expired'),
buttons: [ buttons: [
{ {
text: this.ts.trPK("general", "ok"), text: this.ts.trPK('general', 'ok'),
handler: () => { handler: () => {
console.log('Confirm Okay'); console.log('Confirm Okay');
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
@ -371,23 +376,21 @@ export class LoginComponent implements OnInit, OnDestroy {
}); });
} }
private checkUserResult: CheckUserAuthenticationResponse;
private sendSMSForForgotPassword() { private sendSMSForForgotPassword() {
this.cs.startLoading(); this.cs.startLoading();
let changePwdObj = new LoginRequest(); const changePwdObj = new LoginRequest();
changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
changePwdObj.P_USER_NAME = this.username; changePwdObj.P_USER_NAME = this.username;
changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
this.authService.sendPublicSMS( this.authService.sendPublicSMS(
changePwdObj, changePwdObj,
() => { () => {
//this.sendSMSForForgotPassword(); // this.sendSMSForForgotPassword();
/* Write code for error */ /* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.checkUserResult = result; this.checkUserResult = result;
console.log("2"); console.log('2');
console.log(result); console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
@ -403,31 +406,31 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
login() { login() {
console.log("login emit"); console.log('login emit');
console.log("login"); console.log('login');
// this.checkUserAuthentication(); // this.checkUserAuthentication();
//this.loginDiv=true; // this.loginDiv=true;
this.user=false; this.user = false;
} }
loginWithUser() { loginWithUser() {
console.log("loginWithUser") console.log('loginWithUser');
this.cs.openConfirmLoginPage(); this.cs.openConfirmLoginPage();
} }
/// ///
getLastLoginInfo(){ getLastLoginInfo() {
this.requestGetLoginInfo= { this.requestGetLoginInfo = {
DeviceType:this.cs.getDeviceType(),//"Android",//this.cs.getDeviceType(), DeviceType: this.cs.getDeviceType(), // "Android",//this.cs.getDeviceType(),
DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken DeviceToken: this.deviceToken// "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
} };
this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => { this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) { if (this.cs.validResponse(res)) {
if(res.Mohemm_GetMobileLoginInfoList.length > 0){ if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData( this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0], // res.Patient_SELECTDeviceIMEIbyIMEIList[0],
@ -436,9 +439,8 @@ export class LoginComponent implements OnInit, OnDestroy {
); );
this.user = true; this.user = true;
} } else {
else{ this.user = false;
this.user=false
} }
} }

@ -21,6 +21,8 @@ import { DatePicker } from "@ionic-native/date-picker/ngx";
import { EIT_ACTION } from "../models/submit.eit.action"; import { EIT_ACTION } from "../models/submit.eit.action";
import { AddEitResponse } from "../models/add.eit.response"; import { AddEitResponse } from "../models/add.eit.response";
import { element } from '@angular/core/src/render3'; import { element } from '@angular/core/src/render3';
// import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
@Component({ @Component({
selector: "app-add-eit", selector: "app-add-eit",
@ -87,6 +89,8 @@ export class AddEitComponent implements OnInit {
false false
); );
this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false); this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false);
console.log("addEITData: " + this.addEITData);
console.log("dirfromNotificationPage: " + this.addEITData.dirfromNotificationPage);
this.eitRequest = new EitRequest(); this.eitRequest = new EitRequest();
@ -94,7 +98,7 @@ export class AddEitComponent implements OnInit {
////*new add*///// ////*new add*/////
/**********resubmit************ */ /**********resubmit************ */
// this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING
this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage; this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage;
if (this.getPassdirfromNotifiPage) { if (this.getPassdirfromNotifiPage) {
this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME; this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME;
@ -1555,6 +1559,7 @@ export class AddEitComponent implements OnInit {
validateEITTransaction() { validateEITTransaction() {
// let EITTransactionValues:any= []; // let EITTransactionValues:any= [];
this.arrValues = this.getElementsValues(); this.arrValues = this.getElementsValues();
if (this.arrValues) { if (this.arrValues) {
this.eitRequest = { this.eitRequest = {
@ -1586,7 +1591,8 @@ export class AddEitComponent implements OnInit {
data.eitRequest = this.eitRequest; data.eitRequest = this.eitRequest;
data.updated = this.updatedValues; data.updated = this.updatedValues;
// this.viewCtrl.dismiss(data); // this.viewCtrl.dismiss(data);
this.closemodal(); this.modalController.dismiss(data);
// this.closemodal();
} else { } else {
this.submitEit(); this.submitEit();
// this.navCtrl.push("ConfirmAddEitPage"); // this.navCtrl.push("ConfirmAddEitPage");

@ -24,7 +24,7 @@ export class ConfirmAddEitComponent implements OnInit {
private P_TransactionID: number; private P_TransactionID: number;
private eitRequest: EitRequest; private eitRequest: EitRequest;
approversList: ApproversList; approversList = [];
addrespList: any;//EitRespModel; addrespList: any;//EitRespModel;
eitComments: string = ""; eitComments: string = "";
menuType: string = ""; menuType: string = "";
@ -36,7 +36,7 @@ export class ConfirmAddEitComponent implements OnInit {
headerTitle: string = ""; headerTitle: string = "";
isTrue: any = 0; isTrue: any = 0;
attachItems: any; attachItems: any;
private isResubmitEIT: boolean = false; public isResubmitEIT: boolean = false;
private itemKey: string = ""; private itemKey: string = "";
private pActionMode: string = "SUBMIT"; private pActionMode: string = "SUBMIT";
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest(); attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
@ -78,11 +78,12 @@ export class ConfirmAddEitComponent implements OnInit {
this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false); this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false);
this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) { if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING **
// console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails);
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true); this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); // let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
this.itemKey = notification.ITEM_KEY;
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
this.pActionMode = "RESUBMIT"; this.pActionMode = "RESUBMIT";
this.menuType = "E"; this.menuType = "E";
this.respID = -999; this.respID = -999;

@ -122,7 +122,7 @@
<ion-icon name="create"></ion-icon> <ion-icon name="create"></ion-icon>
</button> --> </button> -->
<button ion-button icon-only (click)="removeAddedItem(i)"> <button ion-button icon-only (click)="removeAddedItem(i)">
<ion-icon name="trash"></ion-icon> <ion-icon class="imgSize" name="trash"></ion-icon>
</button> </button>
</ion-card-header> </ion-card-header>
@ -202,7 +202,7 @@
</ion-col> </ion-col>
</ion-row> --> </ion-row> -->
<ion-row class=""> <ion-row *ngIf="item.DISPLAY_FLAG != 'N' " class="">
<ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''"> <ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''">
<label style="color:#094875;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label> <label style="color:#094875;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label>
<br> <br>

@ -19,27 +19,26 @@ export class EitListComponent implements OnInit {
P_PAGE_NUM: number; P_PAGE_NUM: number;
P_PAGE_LIMIT: number; P_PAGE_LIMIT: number;
IsReachEnd: boolean = false; IsReachEnd = false;
userName: any; userName: any;
isDelete: boolean = false; isDelete = false;
getResEITTransactionList: any = []; getResEITTransactionList: any = [];
eitAddedList: any = []; eitAddedList: any = [];
getPassMnuEntryObj: any; getPassMnuEntryObj: any;
selMenu: MenuResponse = new MenuResponse(); selMenu: MenuResponse = new MenuResponse();
//getMenuResponse :MenuResponse=new MenuResponse
EITTransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest(); EITTransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest();
selEmp: string; selEmp: string;
respID: number; respID: number;
transactionNo: number = 0; transactionNo = 0;
menuType: string = ""; menuType = '';
private functionName: string = ""; public functionName = '';
private eitRequest: EitRequest; private eitRequest: EitRequest;
private eitTransactionTbl: any = []; private eitTransactionTbl: any = [];
private validEitTransactionTbl: any = []; private validEitTransactionTbl: any = [];
private desxFlexCode: string = ""; private desxFlexCode = '';
private selectedIndex: number; private selectedIndex: number;
private pAction: number = 0; private pAction = 0;
public headerTitle: string = ""; public headerTitle = '';
data: any; data: any;
accrualNetInfants: any; accrualNetInfants: any;
accrualUNetChild: any; accrualUNetChild: any;
@ -49,15 +48,16 @@ export class EitListComponent implements OnInit {
cutoutPercentage: 80, cutoutPercentage: 80,
tooltips: { enabled: false }, tooltips: { enabled: false },
legend: { display: false }}; legend: { display: false }};
gaugeType = "full"; gaugeType = 'full';
accrualBalancesList: any; accrualBalancesList: any;
common: any; common: any;
direction: string; direction: string;
// gaugeValue = 11.200; // gaugeValue = 11.200;
// gaugeLabel = ""; // gaugeLabel = "";
constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) { // tslint:disable-next-line: max-line-length
this.direction = TranslatorService.getCurrentLanguageName() constructor(private cs: CommonService, private EITService: EitService, public ts: TranslatorService, private modalCtrl: ModalController) {
this.direction = TranslatorService.getCurrentLanguageName();
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
@ -65,7 +65,6 @@ export class EitListComponent implements OnInit {
this.menuType = this.selMenu.List_Menu.MENU_TYPE; this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.transactionNo = 0; this.transactionNo = 0;
this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
console.log("fN>>>>>>>>>>>>>>>>>"+this.functionName);
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.validEitTransactionTbl = []; this.validEitTransactionTbl = [];
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
@ -79,9 +78,9 @@ export class EitListComponent implements OnInit {
// accrualNetInfants // accrualNetInfants
// accrualUNetChild // accrualUNetChild
// accrualNetAdult // accrualNetAdult
this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT; this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT; this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT; this. accrualNetInfants = this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
this.data = { this.data = {
// labels: ['earingTotal', 'deductionTotal'], // labels: ['earingTotal', 'deductionTotal'],
@ -90,7 +89,7 @@ export class EitListComponent implements OnInit {
backgroundColor: [ backgroundColor: [
'#1FA269', '#1FA269',
'#22C6B3', '#22C6B3',
'#3CB9D5',], '#3CB9D5', ],
borderWidth: 2 borderWidth: 2
} }
] ]
@ -98,7 +97,7 @@ export class EitListComponent implements OnInit {
} }
getEITTransactions() { getEITTransactions() {
console.log("jkfdjkdfsffjhfsdahffg"); console.log('jkfdjkdfsffjhfsdahffg');
this.IsReachEnd = false; this.IsReachEnd = false;
this.EITTransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.EITTransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM; this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
@ -118,9 +117,10 @@ export class EitListComponent implements OnInit {
this.getResEITTransactionList = result.GetEITTransactionList; this.getResEITTransactionList = result.GetEITTransactionList;
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM; this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.getResEITTransactionList.length - 1; const lastItemIndex = this.getResEITTransactionList.length - 1;
if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) { if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) {
let lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]; const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
// tslint:disable-next-line: triple-equals
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true; this.IsReachEnd = true;
} else { } else {
@ -155,31 +155,33 @@ export class EitListComponent implements OnInit {
this.IsReachEnd = true; this.IsReachEnd = true;
} }
} }
//this.P_PAGE_NUM++; // this.P_PAGE_NUM++;
if (infiniteScroll) if (infiniteScroll) {
infiniteScroll.target.complete(); infiniteScroll.target.complete();
}
}, (Error) => console.log(Error), () => infiniteScroll.target.complete()); }, (Error) => console.log(Error), () => infiniteScroll.target.complete());
} else { } else {
if (infiniteScroll) if (infiniteScroll) {
infiniteScroll.target.complete(); infiniteScroll.target.complete();
}
} }
} }
addEITRrq(i) { addEITRrq(i?) {
this.pAction = EIT_ACTION.ADD; this.pAction = EIT_ACTION.ADD;
// this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA); // this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION); this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
// this.navCtrl.push("AddEitPage"); // this.navCtrl.push("AddEitPage");
//this.openEit(i); // this.openEit(i);
this.openEitNew(i); this.openEitNew(i);
} }
updateEITRrq(i) { updateEITRrq(i) {
this.pAction = EIT_ACTION.UPDATE; this.pAction = EIT_ACTION.UPDATE;
this.cs.sharedService.setSharedData(this.getResEITTransactionList[i].Collection_Transaction, EITTransactionsRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.getResEITTransactionList[i].Collection_Transaction, EITTransactionsRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION); this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
//this.fillEitTransactionTable(i); // this.fillEitTransactionTable(i);
//this.navCtrl.push("AddEitPage"); // this.navCtrl.push("AddEitPage");
//this.openEit(i); // this.openEit(i);
this.openEitNew(i); this.openEitNew(i);
} }
deleteEIT(i) { deleteEIT(i) {
@ -193,21 +195,22 @@ export class EitListComponent implements OnInit {
} }
deleteEITRrq(i) { deleteEITRrq(i) {
let list: any = this.getResEITTransactionList[i]; const list: any = this.getResEITTransactionList[i];
// tslint:disable-next-line: triple-equals
if (list.statusID != 2) { if (list.statusID != 2) {
this.selectedIndex = i; this.selectedIndex = i;
// if(this.transactionNo==0) // if(this.transactionNo==0)
this.transactionNo++; this.transactionNo++;
this.pAction = EIT_ACTION.DELETE; this.pAction = EIT_ACTION.DELETE;
//this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA); // this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
// this.sharedData.setSharedData(EIT_ACTION.DELETE,EITTransactionsRequest.SUBMIT_EIT_ACTION); // this.sharedData.setSharedData(EIT_ACTION.DELETE,EITTransactionsRequest.SUBMIT_EIT_ACTION);
this.fillEitTransactionTable(i); this.fillEitTransactionTable(i);
this.validateEITTransaction(); this.validateEITTransaction();
// this.submitEit(); // this.submitEit();
//this.navCtrl.push("AddEitPage"); // this.navCtrl.push("AddEitPage");
} else { } else {
let msg: string = ""; let msg = '';
msg = this.ts.trPK("general", "attemptDel"); msg = this.ts.trPK('general', 'attemptDel');
this.cs.presentAlert(msg); this.cs.presentAlert(msg);
// alert("You are attempting to delete a row that has already been deleted."); // alert("You are attempting to delete a row that has already been deleted.");
@ -215,19 +218,24 @@ export class EitListComponent implements OnInit {
} }
openEitNew(index) { openEitNew(index) {
let item: any = []; let item: any = [];
if (this.pAction == EIT_ACTION.UPDATE) if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResEITTransactionList[index].Collection_Transaction; item = this.getResEITTransactionList[index].Collection_Transaction;
}
this.transactionNo++; this.transactionNo++;
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData') // tslint:disable-next-line: max-line-length
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddEitPage(); this.cs.openAddEitPage();
// this.navCtrl.push('AddEitPage', { dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }); // this.navCtrl.push('AddEitPage', { dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo });
} }
async openEit(index) { async openEit(index) {
let item: any = []; let item: any = [];
if (this.pAction == EIT_ACTION.UPDATE) // tslint:disable-next-line: triple-equals
if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResEITTransactionList[index].Collection_Transaction; item = this.getResEITTransactionList[index].Collection_Transaction;
}
this.transactionNo++; this.transactionNo++;
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData') // tslint:disable-next-line: max-line-length
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
const modalPage = await this.modalCtrl.create({ const modalPage = await this.modalCtrl.create({
component: AddEitComponent component: AddEitComponent
}); });
@ -237,26 +245,29 @@ export class EitListComponent implements OnInit {
.then((data: any) => { .then((data: any) => {
if (data) { if (data) {
// this.transactionNo++; // this.transactionNo++;
//this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated; // this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated;
// this.notificationBodyRes[index].Collection_Transaction=data.updated; // this.notificationBodyRes[index].Collection_Transaction=data.updated;
this.selectedIndex = index; this.selectedIndex = index;
this.desxFlexCode = data.eitRequest.P_DESC_FLEX_CONTEXT_CODE; this.desxFlexCode = data.eitRequest.P_DESC_FLEX_CONTEXT_CODE;
// tslint:disable-next-line: triple-equals
if (this.pAction == EIT_ACTION.ADD) { if (this.pAction == EIT_ACTION.ADD) {
index = this.eitAddedList.length + 1; index = this.eitAddedList.length + 1;
let status = this.ts.trPK("eit", ".added"); const status = this.ts.trPK('eit', '.added');
let statusID = EIT_ACTION.ADD; const statusID = EIT_ACTION.ADD;
let obj = { status: status, statusID: statusID, Collection_Transaction: data.updated }; const obj = { status, statusID, Collection_Transaction: data.updated };
this.eitAddedList.push(obj); this.eitAddedList.push(obj);
} else { } else {
let status = this.ts.trPK("eit", ".updated"); const status = this.ts.trPK('eit', '.updated');
let statusID = EIT_ACTION.UPDATE; const statusID = EIT_ACTION.UPDATE;
this.getResEITTransactionList[this.selectedIndex].status = status; this.getResEITTransactionList[this.selectedIndex].status = status;
this.getResEITTransactionList[this.selectedIndex].statusID = statusID; this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
} }
this.updateTransactionList(data.eitRequest.EITTransactionTBL, false); this.updateTransactionList(data.eitRequest.EITTransactionTBL, false);
} else { } else {
if (this.transactionNo != 0) // tslint:disable-next-line: triple-equals
if (this.transactionNo != 0) {
this.transactionNo--; this.transactionNo--;
}
} }
}); });
@ -291,14 +302,18 @@ export class EitListComponent implements OnInit {
} }
fillEitTransactionTable(index) { fillEitTransactionTable(index) {
var obj = { peiObjVer: null, peiExtraInfoID: null }; let obj = { peiObjVer: null, peiExtraInfoID: null };
let list: any = this.getResEITTransactionList[index].Collection_Transaction; const list: any = this.getResEITTransactionList[index].Collection_Transaction;
let valuseArr: any = []; let valuseArr: any = [];
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
let item = list[i]; const item = list[i];
if (item.APPLICATION_COLUMN_NAME != "PEI_ACTION" && item.APPLICATION_COLUMN_NAME != "PEI_EXTRA_INFO_ID" && item.APPLICATION_COLUMN_NAME != "PEI_OBJECT_VERSION_NUMBER") { // tslint:disable-next-line: triple-equals
// tslint:disable-next-line: max-line-length
if (item.APPLICATION_COLUMN_NAME != 'PEI_ACTION' && item.APPLICATION_COLUMN_NAME != 'PEI_EXTRA_INFO_ID' && item.APPLICATION_COLUMN_NAME != 'PEI_OBJECT_VERSION_NUMBER') {
this.desxFlexCode = item.DESC_FLEX_CONTEXT_CODE; this.desxFlexCode = item.DESC_FLEX_CONTEXT_CODE;
if (item.DATE_VALUE == "") { // tslint:disable-next-line: triple-equals
if (item.DATE_VALUE == '') {
item.DATE_VALUE = null; item.DATE_VALUE = null;
} }
valuseArr.push( valuseArr.push(
@ -309,17 +324,19 @@ export class EitListComponent implements OnInit {
NUMBER_VALUE: item.NUMBER_VALUE, NUMBER_VALUE: item.NUMBER_VALUE,
DATE_VALUE: item.DATE_VALUE, DATE_VALUE: item.DATE_VALUE,
} }
) );
} else { } else {
if (item.APPLICATION_COLUMN_NAME == "PEI_OBJECT_VERSION_NUMBER") if (item.APPLICATION_COLUMN_NAME == 'PEI_OBJECT_VERSION_NUMBER') {
obj.peiObjVer = item.NUMBER_VALUE; obj.peiObjVer = item.NUMBER_VALUE;
else if (item.APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID") }
else if (item.APPLICATION_COLUMN_NAME == 'PEI_EXTRA_INFO_ID') {
obj.peiExtraInfoID = item.NUMBER_VALUE; obj.peiExtraInfoID = item.NUMBER_VALUE;
}
} }
}// end for }// end for
//} // }
valuseArr = this.fillExtraInformation(valuseArr, "DELETE_ROW", obj.peiExtraInfoID, obj.peiObjVer, this.transactionNo); valuseArr = this.fillExtraInformation(valuseArr, 'DELETE_ROW', obj.peiExtraInfoID, obj.peiObjVer, this.transactionNo);
this.eitTransactionTbl = valuseArr; this.eitTransactionTbl = valuseArr;
} }
@ -327,7 +344,7 @@ export class EitListComponent implements OnInit {
values.push( values.push(
{ {
TRANSACTION_NUMBER: transNo, TRANSACTION_NUMBER: transNo,
NAME: "PEI_ACTION", NAME: 'PEI_ACTION',
VARCHAR2_VALUE: peiAction, VARCHAR2_VALUE: peiAction,
NUMBER_VALUE: null, NUMBER_VALUE: null,
DATE_VALUE: null DATE_VALUE: null
@ -335,7 +352,7 @@ export class EitListComponent implements OnInit {
values.push( values.push(
{ {
TRANSACTION_NUMBER: transNo, TRANSACTION_NUMBER: transNo,
NAME: "PEI_EXTRA_INFO_ID", NAME: 'PEI_EXTRA_INFO_ID',
VARCHAR2_VALUE: null, VARCHAR2_VALUE: null,
NUMBER_VALUE: peiExtraInfoID, NUMBER_VALUE: peiExtraInfoID,
DATE_VALUE: null DATE_VALUE: null
@ -343,7 +360,7 @@ export class EitListComponent implements OnInit {
values.push( values.push(
{ {
TRANSACTION_NUMBER: transNo, TRANSACTION_NUMBER: transNo,
NAME: "PEI_OBJECT_VERSION_NUMBER", NAME: 'PEI_OBJECT_VERSION_NUMBER',
VARCHAR2_VALUE: null, VARCHAR2_VALUE: null,
NUMBER_VALUE: peiObjVer, NUMBER_VALUE: peiObjVer,
DATE_VALUE: null DATE_VALUE: null
@ -354,11 +371,11 @@ export class EitListComponent implements OnInit {
submitEit() { submitEit() {
this.eitRequest = new EitRequest(); this.eitRequest = new EitRequest();
let list: any = this.fixTransactionNo(); const list: any = this.fixTransactionNo();
this.eitRequest.EITTransactionTBL = list; this.eitRequest.EITTransactionTBL = list;
this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
this.eitRequest.P_MENU_TYPE = this.menuType; this.eitRequest.P_MENU_TYPE = this.menuType;
this.eitRequest.P_SELECTED_RESP_ID = this.respID;//this.selMenu.List_Menu.RESP_ID,//-999, this.eitRequest.P_SELECTED_RESP_ID = this.respID; // this.selMenu.List_Menu.RESP_ID,//-999,
this.eitRequest.P_FUNCTION_NAME = this.functionName; this.eitRequest.P_FUNCTION_NAME = this.functionName;
this.eitRequest.P_DESC_FLEX_CONTEXT_CODE = this.desxFlexCode; this.eitRequest.P_DESC_FLEX_CONTEXT_CODE = this.desxFlexCode;
@ -370,14 +387,14 @@ export class EitListComponent implements OnInit {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA); this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA);
//this.addrespList=result.SubmitEITTransactionList; // this.addrespList=result.SubmitEITTransactionList;
// this.itemKey=this.addrespList.P_ITEM_KEY; // this.itemKey=this.addrespList.P_ITEM_KEY;
// this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID; // this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID;
// this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA); // this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA);
// //this.cs.sharedService.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit"); // //this.cs.sharedService.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit");
// // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA); // // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA);
this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData') this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData');
this.cs.openConfirmEitPage(); this.cs.openConfirmEitPage();
// this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false, isDelete: this.isDelete }); // this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false, isDelete: this.isDelete });
} }
@ -391,7 +408,7 @@ export class EitListComponent implements OnInit {
P_FUNCTION_NAME: this.functionName, P_FUNCTION_NAME: this.functionName,
P_DESC_FLEX_CONTEXT_CODE: this.desxFlexCode, P_DESC_FLEX_CONTEXT_CODE: this.desxFlexCode,
EITTransactionTBL: this.eitTransactionTbl EITTransactionTBL: this.eitTransactionTbl
} };
this.EITService.validateEITTransaction(this.eitRequest).subscribe((result: any) => { this.EITService.validateEITTransaction(this.eitRequest).subscribe((result: any) => {
this.handleEITValidateTr(result); this.handleEITValidateTr(result);
@ -400,22 +417,23 @@ export class EitListComponent implements OnInit {
private handleEITValidateTr(result) { private handleEITValidateTr(result) {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
// public static SHARED_DATA = 'login-request'; // public static SHARED_DATA = 'login-request';
//this.sharedData.setSharedData(this.eitRequest, EitRequest.SHARED_DATA); // this.sharedData.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
let status = this.ts.trPK("eit", ".deleted"); const status = this.ts.trPK('eit', '.deleted');
let statusID = EIT_ACTION.DELETE; const statusID = EIT_ACTION.DELETE;
this.isDelete = true; this.isDelete = true;
this.getResEITTransactionList[this.selectedIndex].status = status; this.getResEITTransactionList[this.selectedIndex].status = status;
this.getResEITTransactionList[this.selectedIndex].statusID = statusID; this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
this.updateTransactionList(this.eitTransactionTbl, false); this.updateTransactionList(this.eitTransactionTbl, false);
this.submitEit(); this.submitEit();
} else { } else {
if (this.transactionNo != 0) if (this.transactionNo != 0) {
this.transactionNo--; this.transactionNo--;
}
} }
} }
updateTransactionList(list, isRemove) { updateTransactionList(list, isRemove) {
//let newlist = this.validEitTransactionTbl.map(a => a.NAME='PEI_EXTRA_INFO_ID'); // let newlist = this.validEitTransactionTbl.map(a => a.NAME='PEI_EXTRA_INFO_ID');
let isAnewRow: boolean = false; let isAnewRow = false;
let updateDelTransNo: number; let updateDelTransNo: number;
if (this.cs.hasData(this.validEitTransactionTbl)) { if (this.cs.hasData(this.validEitTransactionTbl)) {
this.validEitTransactionTbl.forEach(element => { this.validEitTransactionTbl.forEach(element => {
@ -429,42 +447,45 @@ export class EitListComponent implements OnInit {
} }
list.forEach(element => { list.forEach(element => {
// NAME=PEI_EXTRA_INFO_ID // NAME=PEI_EXTRA_INFO_ID
//const index = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER); // const index = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
// let newlist = this.validEitTransactionTbl.map(a => a.NAME==='PEI_EXTRA_INFO_ID'); // let newlist = this.validEitTransactionTbl.map(a => a.NAME==='PEI_EXTRA_INFO_ID');
if (isAnewRow == true) { if (isAnewRow == true) {
let index: number = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER); const index: number = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
//if(index!=-1) // if(index!=-1)
//this.validEitTransactionTbl.splice(index, 1); // this.validEitTransactionTbl.splice(index, 1);
} else { } else {
let index: number = this.validEitTransactionTbl.findIndex(x => x.NAME === 'PEI_EXTRA_INFO_ID' && x.NUMBER_VALUE === element.NUMBER_VALUE); const index: number = this.validEitTransactionTbl.findIndex(x => x.NAME === 'PEI_EXTRA_INFO_ID' && x.NUMBER_VALUE === element.NUMBER_VALUE);
if (index != -1) { if (index != -1) {
//this.validEitTransactionTbl.splice(index, 1); // this.validEitTransactionTbl.splice(index, 1);
if (!updateDelTransNo) if (!updateDelTransNo) {
updateDelTransNo = this.validEitTransactionTbl[index].TRANSACTION_NUMBER; updateDelTransNo = this.validEitTransactionTbl[index].TRANSACTION_NUMBER;
}
} }
} }
}); });
if (updateDelTransNo) if (updateDelTransNo) {
this.removeItems(updateDelTransNo); this.removeItems(updateDelTransNo);
if (isRemove == false) }
if (isRemove == false) {
this.validEitTransactionTbl = this.validEitTransactionTbl ? this.validEitTransactionTbl.concat(list) : list; this.validEitTransactionTbl = this.validEitTransactionTbl ? this.validEitTransactionTbl.concat(list) : list;
}
} }
fixTransactionNo(): any[] { fixTransactionNo(): any[] {
let list: any = []; const list: any = [];
let newIndex: number = 1; let newIndex = 1;
let length: number = this.validEitTransactionTbl.length; const length: number = this.validEitTransactionTbl.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
// let item :any={}; // let item :any={};
const item = Object.assign({}, this.validEitTransactionTbl[i]); const item = Object.assign({}, this.validEitTransactionTbl[i]);
let transNo: number = item.TRANSACTION_NUMBER; const transNo: number = item.TRANSACTION_NUMBER;
let obj: any = item; const obj: any = item;
if (i == 0) { if (i == 0) {
obj.TRANSACTION_NUMBER = newIndex; obj.TRANSACTION_NUMBER = newIndex;
list.push(obj); list.push(obj);
} else { } else {
let prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER; const prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER;
if (transNo == prevEl) { if (transNo == prevEl) {
obj.TRANSACTION_NUMBER = newIndex; obj.TRANSACTION_NUMBER = newIndex;
list.push(obj); list.push(obj);
@ -478,19 +499,21 @@ export class EitListComponent implements OnInit {
return list; return list;
} }
removeItems(transNo) { removeItems(transNo) {
let list = []; const list = [];
for (let i = 0; i < this.validEitTransactionTbl.length; i++) { for (let i = 0; i < this.validEitTransactionTbl.length; i++) {
if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) {
list.push(this.validEitTransactionTbl[i]); list.push(this.validEitTransactionTbl[i]);
}
} }
this.validEitTransactionTbl = list; this.validEitTransactionTbl = list;
} }
removeAddedItem(index) { removeAddedItem(index) {
let list = []; const list = [];
let item: any = []; let item: any = [];
for (let i = 0; i < this.eitAddedList.length; i++) { for (let i = 0; i < this.eitAddedList.length; i++) {
if (i != index) if (i != index) {
list.push(this.eitAddedList[i]); list.push(this.eitAddedList[i]);
}
} }
item = this.eitAddedList[index]; item = this.eitAddedList[index];
this.eitAddedList = list; this.eitAddedList = list;

@ -1,5 +1,5 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<nav-buttons></nav-buttons> <nav-buttons></nav-buttons>
<ion-title color="light">{{'eit, update-title' | translate}}</ion-title> <ion-title color="light">{{'eit, update-title' | translate}}</ion-title>
</ion-toolbar> </ion-toolbar>
@ -11,34 +11,51 @@
<ion-card *ngFor="let item of notificationBodyRes; let i=index "> <ion-card *ngFor="let item of notificationBodyRes; let i=index ">
<ion-card-header class="hrTitle"> <ion-card-header class="hrTitle">
<div class="hrTitle">{{'workListMain, notfDetails' | translate}} </div> <div class="hrTitle">{{'worklistMain, notfDetails' | translate}} </div>
<!-- <button ion-button icon-only *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)"> <!-- <button ion-button icon-only *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
<ion-icon name="create"></ion-icon> <ion-icon name="create"></ion-icon>
</button> --> </button> -->
<button ion-button *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)"> <div class="editIconDiv"><button ion-button *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
<img class="imgSize" src="../assets/imgs/edit.png"></button> <img class="imgSize" src="../assets/imgs/edit.png"></button>
</div>
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<div *ngFor="let notificationBody of item.Collection_Notification "> <ion-grid class="grids">
<div *ngFor="let notificationBody of item.Collection_Notification ">
<ion-row *ngIf=" notificationBody.DISPLAY_FLAG != 'N' "> <ion-row *ngIf=" notificationBody.DISPLAY_FLAG != 'N' ">
<ion-col class="colBold"> <ion-col class="colBold">
<label for="">{{notificationBody.SEGMENT_PROMPT}}</label> <label style="color:#094875;font-weight: bold;" class="label" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
</ion-col> <!-- </ion-col>
<ion-col> <ion-col class="colBold"> -->
<label for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label> <br>
<label class="label" style="color:black;" for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
<hr style="background-color: grey;height: 1px">
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
</ion-grid>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</div> </div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="resubmitEit()"> <ion-button class="addEitOkButton" color="customnavy" ion-button (click)="resubmitEit()">
{{ 'general, next' | translate }}</ion-button> {{ 'general, next' | translate }}</ion-button>
</div> </div>
</ion-footer> </ion-footer>

@ -0,0 +1,17 @@
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #22c6b3;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.editIconDiv{
right: 10px;
position: absolute;
top: 10px;
}

@ -25,8 +25,8 @@ export class EitUpdateListComponent implements OnInit {
private descFlex: string; private descFlex: string;
constructor(public cs: CommonService, public eitService: EitService, public modalController: ModalController) { constructor(public cs: CommonService, public eitService: EitService, public modalController: ModalController) {
this.notificationBodyRes = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, true); this.notificationBodyRes = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, false);
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);
this.itemKey = notification.ITEM_KEY; this.itemKey = notification.ITEM_KEY;
this.notificationId = notification.NOTIFICATION_ID; this.notificationId = notification.NOTIFICATION_ID;
this.functionName = notification.FUNCTION_NAME; this.functionName = notification.FUNCTION_NAME;
@ -35,7 +35,7 @@ export class EitUpdateListComponent implements OnInit {
this.fillEitTransactionTable(); this.fillEitTransactionTable();
} }
ngOnInit() { } ngOnInit() { console.log("ngOnInit");}
async updateEitNot(index) { async updateEitNot(index) {
let item = this.notificationBodyRes[index].Collection_Notification; let item = this.notificationBodyRes[index].Collection_Notification;
@ -46,10 +46,15 @@ export class EitUpdateListComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data: any) => { .then((data: any) => {
console.log("data" + data);
console.log("data" + data.data.updated);
console.log("data" + data.data.eitRequest.EITTransactionTBL);
if (data) { if (data) {
this.updatedData = this.updatedData ? this.updatedData.concat(data.updated) : data.updated; this.updatedData = this.updatedData ? this.updatedData.concat(data.data.updated) : data.data.updated;
this.notificationBodyRes[index].Collection_Notification = data.updated; this.notificationBodyRes[index].Collection_Notification = data.data.updated;
this.updateTransactionList(data.eitRequest.EITTransactionTBL); this.updateTransactionList(data.data.eitRequest.EITTransactionTBL);
} }
}); });

@ -15,7 +15,7 @@
<!--From Home List--> <!--From Home List-->
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" [hidden]="pageType=='myteam'" *ngIf="pageType=='home'"> <ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" *ngIf="pageType=='home'">
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu.children; let i=index" <ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu.children; let i=index"
(click)="openPage(menuItem, i);"> (click)="openPage(menuItem, i);">
<ion-row style="width: 100%;"> <ion-row style="width: 100%;">
@ -33,7 +33,7 @@
<!-- Child Pages --> <!-- Child Pages -->
<ion-list [hidden]="selectedMenu != i" lines="full"> <ion-list [hidden]="selectedMenu != i" lines="full">
<ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap <ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
(click)="openPage(subPage)"> (click)="openPage(subPage, i2)">
<!-- <ion-row> <!-- <ion-row>
<ion-col size="10" class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> --> <ion-col size="10" class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> -->
<ion-label><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> <ion-label><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span>
@ -54,7 +54,7 @@
<!--From My Team List--> <!--From My Team List-->
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" [hidden]="pageType=='home'" *ngIf="pageType=='myteam'"> <ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" *ngIf="pageType=='myteam'">
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index" <ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index"
(click)="openPage(menuItem, i);"> (click)="openPage(menuItem, i);">
<ion-row style="width: 100%;"> <ion-row style="width: 100%;">
@ -73,7 +73,7 @@
<!-- Child Pages --> <!-- Child Pages -->
<ion-list [hidden]="selectedMenu != i" lines="full"> <ion-list [hidden]="selectedMenu != i" lines="full">
<ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap <ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
(click)="openPage(subPage)"> (click)="openPage(subPage, i2)">
<!-- <ion-row> <!-- <ion-row>
<ion-col size="10" class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> --> <ion-col size="10" class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> -->
<ion-label><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> <ion-label><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span>

@ -17,10 +17,10 @@ export class HomeComponent implements OnInit {
// Selected Side Menu // Selected Side Menu
selectedMenu: any; selectedMenu: any;
direction: string; direction: string;
pageType :string; pageType: string;
constructor(private cs: CommonService, private ts: TranslatorService) { constructor(private cs: CommonService, private ts: TranslatorService) {
this.direction = TranslatorService.getCurrentLanguageName() this.direction = TranslatorService.getCurrentLanguageName();
this.menu = this.cs.sharedService.getSharedData('menuEntries', false); this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false); this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false);
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
@ -44,7 +44,7 @@ export class HomeComponent implements OnInit {
this.selectedMenu = index; this.selectedMenu = index;
} }
} }
console.log("selected>>>>>>>"+this.selectedMenu); console.log('selected>>>>>>>' + this.selectedMenu);
} }
goToRequest(menuEntry) { goToRequest(menuEntry) {
@ -57,7 +57,7 @@ export class HomeComponent implements OnInit {
} else if (menuEntry.REQUEST_TYPE === 'EIT') { } else if (menuEntry.REQUEST_TYPE === 'EIT') {
this.cs.openEitListPage(); this.cs.openEitListPage();
} }
if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){ if (menuEntry.REQUEST_TYPE === 'PAYSLIP') {
this.cs.openPayslipPage(); this.cs.openPayslipPage();
} }
if (menuEntry.REQUEST_TYPE === 'TIME_CARD') { if (menuEntry.REQUEST_TYPE === 'TIME_CARD') {

@ -11,7 +11,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
export class SubmitEitModalComponent implements OnInit { export class SubmitEitModalComponent implements OnInit {
submitAttachmentList :any =[]; submitAttachmentList :any =[];
eitComments: string; eitComments: string;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){ constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){
this.submitAttachmentList = this.cs.sharedService.getSharedData('submitAttachmentList', false); this.submitAttachmentList = this.cs.sharedService.getSharedData('submitAttachmentList', false);
this.eitComments = this.cs.sharedService.getSharedData('eitComments', false); this.eitComments = this.cs.sharedService.getSharedData('eitComments', false);
} }

@ -55,7 +55,7 @@ import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component'; import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
// import { GeofencingService } from './services/geofencing/geofencing.service'; // import { GeofencingService } from './services/geofencing/geofencing.service';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; // import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent } from './ui/button/button.component'; import { ButtonComponent, Modal } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component'; import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox'; import { ListboxModule } from 'primeng/listbox';
import { GenderSelectComponent } from './ui/gender-select/gender-select.component'; import { GenderSelectComponent } from './ui/gender-select/gender-select.component';
@ -91,7 +91,8 @@ import { RateService } from './services/rate/rate.service';
// import { PaymentService } from './ui/payment/service/payment.service'; // import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service'; import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component'; import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileSelectDirective } from 'ng2-file-upload'; import { FileUploadModule } from 'ng2-file-upload';
// import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer'; import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx'; import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
@ -129,7 +130,8 @@ import { ChartModule } from 'primeng/chart';
NgCircleProgressModule.forRoot(), NgCircleProgressModule.forRoot(),
NgCalendarModule, NgCalendarModule,
ChartModule, ChartModule,
NgxGaugeModule NgxGaugeModule,
FileUploadModule
], ],
declarations: [ declarations: [
FabButtonComponent, FabButtonComponent,
@ -183,7 +185,7 @@ import { ChartModule } from 'primeng/chart';
DetailButtonComponent, DetailButtonComponent,
HeaderButtonComponent, HeaderButtonComponent,
ReplacementListComponent, ReplacementListComponent,
FileSelectDirective, // FileSelectDirective,
WorkListAttachViewComponent, WorkListAttachViewComponent,
FileUploderProfileComponent, FileUploderProfileComponent,
AccordinTabCustomComponent, AccordinTabCustomComponent,
@ -195,8 +197,8 @@ import { ChartModule } from 'primeng/chart';
EmployeeInformationComponent, EmployeeInformationComponent,
ConfirmLoginComponent, ConfirmLoginComponent,
CircleCalendarComponent, CircleCalendarComponent,
DateInfoModalComponent DateInfoModalComponent,
Modal
], ],
exports: [ exports: [
FabButtonComponent, FabButtonComponent,
@ -247,7 +249,7 @@ import { ChartModule } from 'primeng/chart';
DetailButtonComponent, DetailButtonComponent,
HeaderButtonComponent, HeaderButtonComponent,
ReplacementListComponent, ReplacementListComponent,
FileSelectDirective, // FileSelectDirective,
WorkListAttachViewComponent, WorkListAttachViewComponent,
FileUploderProfileComponent, FileUploderProfileComponent,
AccordinTabCustomComponent, AccordinTabCustomComponent,
@ -264,8 +266,9 @@ import { ChartModule } from 'primeng/chart';
CircleCalendarComponent, CircleCalendarComponent,
DateInfoModalComponent, DateInfoModalComponent,
NgCalendarModule, NgCalendarModule,
ChartModule ChartModule,
FileUploadModule,
Modal
], ],
providers: [ providers: [
AttendScanService, AttendScanService,

@ -5,15 +5,15 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AttendanceService } from 'src/app/home/services/attendance.services'; import { AttendanceService } from 'src/app/home/services/attendance.services';
import { ZBar } from '@ionic-native/zbar/ngx'; import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from "@ionic-native/geolocation/ngx"; import { Geolocation } from '@ionic-native/geolocation/ngx';
import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request'; import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
import { AuthenticatedUser } from '../authentication/models/authenticated-user'; import { AuthenticatedUser } from '../authentication/models/authenticated-user';
import { CommonService } from '../common/common.service'; import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service'; import { TranslatorService } from '../translator/translator.service';
import { Response } from "src/app/hmg-common/services/models/response"; import { Response } from 'src/app/hmg-common/services/models/response';
import { Camera, CameraOptions,PictureSourceType} from "@ionic-native/Camera/ngx"; import { Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service' import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service';
import { Device } from "@ionic-native/device/ngx"; import { Device } from '@ionic-native/device/ngx';
@Injectable({ @Injectable({
@ -28,24 +28,25 @@ export class AttendScanService {
scannedResult: any; scannedResult: any;
userData: any = {}; userData: any = {};
constructor(private device: Device, constructor(private device: Device,
private zbar: ZBar, private zbar: ZBar,
private geolocation: Geolocation, private geolocation: Geolocation,
private attendance_service: AttendanceService, private attendance_service: AttendanceService,
private barcodeScanner: BarcodeScanner, private barcodeScanner: BarcodeScanner,
private cameraController: Camera, private cameraController: Camera,
public sharedData: SharedDataService, public sharedData: SharedDataService,
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
private permissions: DevicePermissionsService, private permissions: DevicePermissionsService,
public common:CommonService, public common: CommonService,
public ts: TranslatorService,) { public ts: TranslatorService, ) {
this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
} }
public getDeviceLocation() { public getDeviceLocation() {
let isVirtual = this.device.isVirtual; const isVirtual = this.device.isVirtual;
if(isVirtual==true){ // tslint:disable-next-line: triple-equals
alert("emulater>>>>>>>"+isVirtual); if (isVirtual == true) {
alert("You are using virtual device"); alert('emulater>>>>>>>' + isVirtual);
alert('You are using virtual device');
return false; return false;
} }
@ -55,14 +56,12 @@ export class AttendScanService {
this.geolocation this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }) .getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true })
.then(resp => { .then(resp => {
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
this.lat = resp.coords.latitude; this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude; this.longt = resp.coords.longitude;
this.attendance(); this.attendance();
}) })
.catch(error => { .catch(error => {
console.log("Error getting location", error); console.log('Error getting location', error);
}); });
} else { } else {
@ -85,12 +84,11 @@ export class AttendScanService {
public scanCode() { public scanCode() {
this.barcodeScanner.scan().then(barcodeData => { this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData); if (!barcodeData.cancelled) {
// let strResult = JSON.parse(barcodeData); this.scannedResult = barcodeData;
// console.log(strResult.QRValue); this.deviceID = this.device.uuid;
this.scannedResult = barcodeData; this.swipeAttendance();
this.deviceID = this.device.uuid; }
this.swipeAttendance();
}).catch(err => { }).catch(err => {
console.log('Error', err); console.log('Error', err);
}); });
@ -98,26 +96,27 @@ export class AttendScanService {
public swipeAttendance() { public swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat; request.Latitude = this.lat;
request.Longitude = this.longt; request.Longitude = this.longt;
request.QRValue = this.scannedResult.text; request.QRValue = this.scannedResult.text;
request.UID = this.deviceID; request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER; request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request"); console.log('request');
console.log(JSON.stringify(request)); console.log(JSON.stringify(request));
this.attendance_service this.attendance_service
.attendanceSwipeScanner(request, () => { .attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance"); console.log('Error inside in swipe attendance');
}) })
.subscribe((result: Response) => { .subscribe((result: Response) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log("response"); console.log('response');
console.log(result); console.log(result);
this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess")); this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
} else {
this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
} }
// else {
// this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
// }
}); });
} }
} }

@ -1171,6 +1171,11 @@ public getMonthNameAr(value: number): string {
public openItemHistoryPage() { public openItemHistoryPage() {
this.nav.navigateForward(['/notification/item-history-PO']); this.nav.navigateForward(['/notification/item-history-PO']);
} }
public openMOItemHistoryPage(){
this.nav.navigateForward(["/notification/item-history-MO"]);
}
public openQutationAnalysisPage() { public openQutationAnalysisPage() {
this.nav.navigateForward(['/notification/qutation-analysis-PO']); this.nav.navigateForward(['/notification/qutation-analysis-PO']);
} }
@ -1211,6 +1216,10 @@ public getMonthNameAr(value: number): string {
public openPerformanceevaluation() { public openPerformanceevaluation() {
this.nav.navigateForward(["/profile/performanceevaluation"]); this.nav.navigateForward(["/profile/performanceevaluation"]);
} }
public eitUpdate() {
this.nav.navigateForward(["/eit/eit-update-list"]);
}
public navigatePage(path) { public navigatePage(path) {
@ -1399,10 +1408,10 @@ public getMonthNameAr(value: number): string {
return FormatedDate; return FormatedDate;
} }
public setUpdateImage (image){ public setUpdateImage (image,status?){
console.log('setUpdateImage'); console.log('setUpdateImage');
this.setUpdateImg=image; this.setUpdateImg=image;
this.updateImage=true; this.updateImage=status;
} }
public getUpdateImage(){ public getUpdateImage(){
console.log('getUpdateImage'); console.log('getUpdateImage');

@ -21,7 +21,7 @@ export class ConnectorService {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }) headers: new HttpHeaders({ 'Content-Type': 'application/json' })
}; };
public static retryTimes = 0; public static retryTimes = 0;
public static timeOut = 30 * 1000; public static timeOut = 120 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service // public static host = 'http://10.50.100.113:6060/'; // development service
public static host = 'https://uat.hmgwebservices.com/'; public static host = 'https://uat.hmgwebservices.com/';
@ -174,7 +174,9 @@ public static host = 'https://uat.hmgwebservices.com/';
return false; return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) { } else if (result.ErrorType === 2 || result.ErrorType === 4) {
// console.log("error expired"); // console.log("error expired");
this.cs.stopLoading();
} else { } else {
this.cs.stopLoading();
this.cs.showErrorMessageDialog( this.cs.showErrorMessageDialog(
onError, onError,
errorLabel, errorLabel,

@ -13,22 +13,25 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
providedIn: 'root' providedIn: 'root'
}) })
export class DevicePermissionsService { export class DevicePermissionsService {
constructor(
public diagnostic: Diagnostic,
public cs: CommonService,
public nativeStorage: NativeStorage,
public ts: TranslatorService,
public nativeSettings: OpenNativeSettings) { }
public static GRANTED = 'GRANTED'; public static GRANTED = 'GRANTED';
public static DENIED_ALWAYS = 'DENIED_ALWAYS'; public static DENIED_ALWAYS = 'DENIED_ALWAYS';
public static CAMERA_MIC = 'camera_mic_permission'; public static CAMERA_MIC = 'camera_mic_permission';
public static LOCATION = 'location_permission'; public static LOCATION = 'location_permission';
public static APP_SETTINGS = 'application_details';
public onSucess; public onSucess;
public onerror; public onerror;
constructor(
public diagnostic: Diagnostic,
public cs: CommonService,
public nativeStorage: NativeStorage,
public ts: TranslatorService,
public nativeSettings: OpenNativeSettings) { }
public requestCameraPermission(): Observable<boolean> { public requestCameraPermission(): Observable<boolean> {
return Observable.create(observer => { return Observable.create(observer => {
@ -37,16 +40,17 @@ export class DevicePermissionsService {
} }
private requestCamera(observer: any) { private requestCamera(observer: any) {
//console.log("Camera permission????????")
this.hasCameraPermission().then((isAvailable) => { this.hasCameraPermission().then((isAvailable) => {
if (isAvailable) { if (isAvailable) {
// this.requestMicophonePermission(observer); // this.requestMicophonePermission(observer);
this.observerDone(observer, true); this.observerDone(observer, true);
} else { } else {
this.diagnostic.requestCameraAuthorization(true).then((value) => { this.diagnostic.requestCameraAuthorization(true).then((value) => {
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) { if (value == DevicePermissionsService.GRANTED) {
//this.requestMicophonePermission(observer); // this.requestMicophonePermission(observer);
this.observerDone(observer, true); this.observerDone(observer, true);
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) { } else if (value == DevicePermissionsService.DENIED_ALWAYS) {
// this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true); // this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false); this.observerDone(observer, false);
@ -77,8 +81,10 @@ export class DevicePermissionsService {
this.observerDone(observer, true); this.observerDone(observer, true);
} else { } else {
this.diagnostic.requestMicrophoneAuthorization().then((value) => { this.diagnostic.requestMicrophoneAuthorization().then((value) => {
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) { if (value == DevicePermissionsService.GRANTED) {
this.observerDone(observer, true); this.observerDone(observer, true);
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) { } else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true); this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false); this.observerDone(observer, false);
@ -112,8 +118,8 @@ export class DevicePermissionsService {
} }
public async hasCameraAndMicPermissions(): Promise<boolean> { public async hasCameraAndMicPermissions(): Promise<boolean> {
let camera = await this.hasCameraPermission(); const camera = await this.hasCameraPermission();
//let mic = await this.diagnostic.isMicrophoneAuthorized(); // let mic = await this.diagnostic.isMicrophoneAuthorized();
if (camera) { if (camera) {
// await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false); // await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false);
return true; return true;
@ -128,7 +134,7 @@ export class DevicePermissionsService {
resolve(true); resolve(true);
}, this.ts.trPK('general', 'accept'), }, this.ts.trPK('general', 'accept'),
() => { () => {
resolve(false) resolve(false);
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message }, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
); );
}); });
@ -140,15 +146,12 @@ export class DevicePermissionsService {
resolve(true); resolve(true);
}, this.ts.trPK('general', 'settings'), }, this.ts.trPK('general', 'settings'),
() => { () => {
resolve(false) resolve(false);
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message }, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
); );
}); });
} }
public static APP_SETTINGS = 'application_details';
public async openApplicationSettings() { public async openApplicationSettings() {
// return new Promise((resolver, reject) => { // return new Promise((resolver, reject) => {
// this.nativeSettings.open(DevicePermissionsService.APP_SETTINGS).then(result => { // this.nativeSettings.open(DevicePermissionsService.APP_SETTINGS).then(result => {
@ -208,13 +211,13 @@ export class DevicePermissionsService {
if (await this.hasCameraAndMicPermissions()) { if (await this.hasCameraAndMicPermissions()) {
return true; return true;
} else { } else {
let message = this.ts.trPK('permissions', 'camera'); const message = this.ts.trPK('permissions', 'camera');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.CAMERA_MIC)) { // if (await this.isPermissionAlwaysDenied(DevicePermissionsService.CAMERA_MIC)) {
// if (await this.permissionSettingsDialog(message)) { // if (await this.permissionSettingsDialog(message)) {
// return this.openCameraAndMicSettings(); // return this.openCameraAndMicSettings();
// } // }
// } else { // } else {
if (await this.permissionRequestDialog(message)) { if (await this.permissionRequestDialog(message)) {
return this.requestCameraPermission().toPromise(); return this.requestCameraPermission().toPromise();
} }
// } // }
@ -227,17 +230,16 @@ export class DevicePermissionsService {
public async requestLocationAutherization() { public async requestLocationAutherization() {
if ( await this.isLocationEnabled()) { if ( await this.isLocationEnabled()) {
if (await this.hasLocationPermissions()) { if (await this.hasLocationPermissions()) {
return true; return true;
} else { } else {
let message = this.ts.trPK('permissions', 'location'); const message = this.ts.trPK('permissions', 'location');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.LOCATION)) { // if (await this.isPermissionAlwaysDenied(DevicePermissionsService.LOCATION)) {
// if (await this.permissionSettingsDialog(message)) { // if (await this.permissionSettingsDialog(message)) {
// return this.openLocationSettings(); // return this.openLocationSettings();
// } // }
// } else { // } else {
if (await this.permissionRequestDialog(message)) { if (await this.permissionRequestDialog(message)) {
return this.requestLocationPermission(); return this.requestLocationPermission();
} }
// } // }
@ -249,7 +251,7 @@ export class DevicePermissionsService {
} }
private async isLocationEnabled() { private async isLocationEnabled() {
let isAvailable = await this.diagnostic.isLocationEnabled(); const isAvailable = await this.diagnostic.isLocationEnabled();
if (!isAvailable) { if (!isAvailable) {
this.cs.presentAlert(this.ts.trPK('permissions', 'enable-location'), () => { this.cs.presentAlert(this.ts.trPK('permissions', 'enable-location'), () => {
}); });
@ -258,7 +260,7 @@ export class DevicePermissionsService {
} }
public async hasLocationPermissions(): Promise<boolean> { public async hasLocationPermissions(): Promise<boolean> {
let location = await this.diagnostic.isLocationAvailable(); const location = await this.diagnostic.isLocationAvailable();
if (location) { if (location) {
await this.setAlwaysDenied(DevicePermissionsService.LOCATION, false); await this.setAlwaysDenied(DevicePermissionsService.LOCATION, false);
return true; return true;
@ -280,12 +282,14 @@ export class DevicePermissionsService {
private async requestLocationPermission() { private async requestLocationPermission() {
let hasPermissions = await this.hasLocationPermissions(); const hasPermissions = await this.hasLocationPermissions();
if (!hasPermissions) { if (!hasPermissions) {
let value = await this.diagnostic.requestLocationAuthorization(); const value = await this.diagnostic.requestLocationAuthorization();
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) { if (value == DevicePermissionsService.GRANTED) {
return true; return true;
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) { } else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.LOCATION, true); this.setAlwaysDenied(DevicePermissionsService.LOCATION, true);
} }

@ -1,5 +1,5 @@
<calendar #slider [dateFormatter]="calendar.dateFormatter" <calendar #slider
[monthviewEventDetailTemplate]="template" [monthviewEventDetailTemplate]="template"
[calendarMode]="calendar.mode" [calendarMode]="calendar.mode"
[currentDate]="currentDateParent" [currentDate]="currentDateParent"

@ -69,8 +69,7 @@ export class CircleCalendarComponent implements OnInit {
@ViewChild('slider') slides: ElementRef; @ViewChild('slider') slides: ElementRef;
ngOnInit() { ngOnInit() {
this.reRenderCalendar(); // this.reRenderCalendar();
console.log(this.currentDateParent);
} }
// tslint:disable-next-line: use-life-cycle-interface // tslint:disable-next-line: use-life-cycle-interface
@ -118,6 +117,7 @@ export class CircleCalendarComponent implements OnInit {
} }
}); });
}); });
this.common.stopLoading();
} }
onDayClicked(event) { onDayClicked(event) {

@ -1,5 +1,5 @@
<ion-content> <ion-content>
<ion-slides [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)" #slides> <ion-slides #slides pager="true" [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)" class="slider-container">
<ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index"> <ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index">
<ion-grid class="headerGrid"> <ion-grid class="headerGrid">
<ion-row style="padding: 5px 10px;"> <ion-row style="padding: 5px 10px;">

@ -203,18 +203,22 @@ height: 360px !important;
border-bottom-left-radius: 5px; border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
} }
.slider-container {
padding-bottom: 20px;
}
.col{ .col{
border-bottom: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204);
border-right: 1px solid rgb(204, 204, 204); border-right: 1px solid rgb(204, 204, 204);
flex: 0 0 calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); flex: 0 0 calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
max-width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); max-width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
} }
.col-ar{ .col-ar{
border-bottom: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204);
border-left: 1px solid rgb(204, 204, 204); border-left: 1px solid rgb(204, 204, 204);
flex: 0 0 calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); flex: 0 0 calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
max-width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%); max-width: calc(calc(6 / var(--ion-grid-columns, 12)) * 100%);
} }

@ -89,7 +89,7 @@ export class FileUploaderComponent implements OnInit {
const fileInput = this.getFileElement(); const fileInput = this.getFileElement();
fileInput.click(); fileInput.click();
} }
private deleteFiles(index: number) { public deleteFiles(index: number) {
this.inputFiles.splice(index, 1); this.inputFiles.splice(index, 1);
this.fileSelected.emit( { this.fileSelected.emit( {
name: null, name: null,

@ -26,11 +26,10 @@
<div *ngIf="data" class="uploader-icons"> <!-- <div *ngIf="data" class="uploader-icons">
<ion-item lines="none"> <ion-item lines="none">
<p slot="start"> <img [src]="attachmentImg" /> {{data.name}}</p> <p slot="start"> <img [src]="attachmentImg" /> {{data.name}}</p>
<p slot="end"><img [src]="deleteImg" (click)="deleteFiles(i)"></p> <p slot="end"><img [src]="deleteImg" (click)="deleteFiles(i)"></p>
</ion-item> </ion-item>
</div> </div> -->

@ -1,13 +1,11 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ActionSheetController,Events, NavController } from '@ionic/angular'; import { ActionSheetController, Events, NavController } from '@ionic/angular';
import {CameraOptions,Camera,PictureSourceType} from '@ionic-native/Camera/ngx'; import {CameraOptions, Camera, PictureSourceType} from '@ionic-native/Camera/ngx';
// import { FileChooser } from '@ionic-native/file-chooser'; import { FilePath } from '@ionic-native/file-path/ngx';
import { FilePath } from "@ionic-native/file-path/ngx"; import { File } from '@ionic-native/file/ngx';
import { File } from "@ionic-native/file/ngx";
import { TranslatorService } from '../../services/translator/translator.service'; import { TranslatorService } from '../../services/translator/translator.service';
import { Base64 } from "@ionic-native/base64/ngx"; import { Base64 } from '@ionic-native/base64/ngx';
import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service'; import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service';
// import { Chooser } from '@ionic-native/chooser';
@Component({ @Component({
selector: 'app-file-uploder-profile', selector: 'app-file-uploder-profile',
@ -15,7 +13,6 @@ import { DevicePermissionsService } from '../../services/device-permissions/devi
styleUrls: ['./file-uploder-profile.component.scss'], styleUrls: ['./file-uploder-profile.component.scss'],
}) })
export class FileUploderProfileComponent implements OnInit { export class FileUploderProfileComponent implements OnInit {
@Input() multiupload = false; @Input() multiupload = false;
@Input() attachmentname = 'attachment-loader'; @Input() attachmentname = 'attachment-loader';
public attachmentData: string; public attachmentData: string;
@ -26,22 +23,22 @@ export class FileUploderProfileComponent implements OnInit {
public attachmentImg = 'assets/icon/attachment.png'; public attachmentImg = 'assets/icon/attachment.png';
public deleteImg = 'assets/icon/delete.png'; public deleteImg = 'assets/icon/delete.png';
public defultProfile = '../../../../assets/imgs/profile.png'; public defultProfile = '../../../../assets/imgs/profile.png';
public selectedImage:any; public selectedImage: any;
public nativePath: any; public nativePath: any;
public errorMsg:any; public errorMsg: any;
public allowdType: any = ["jpg", "jpeg", "png"]; public allowdType: any = ['jpg', 'jpeg', 'png'];
camera: boolean camera: boolean;
constructor( constructor(
public cameraController:Camera, public cameraController: Camera,
public actionSheetCtrl:ActionSheetController, public actionSheetCtrl: ActionSheetController,
public event:Events, public event: Events,
public nav: NavController, public nav: NavController,
private filePath: FilePath, private filePath: FilePath,
// public FileChooser:FileChooser, // public FileChooser:FileChooser,
private file: File, private file: File,
public ts: TranslatorService, public ts: TranslatorService,
public base64:Base64, public base64: Base64,
private permissions: DevicePermissionsService private permissions: DevicePermissionsService
// private chooser: Chooser // private chooser: Chooser
@ -60,10 +57,10 @@ export class FileUploderProfileComponent implements OnInit {
return this.image; return this.image;
} }
//open the presentsheet // open the presentsheet
//selected attach // selected attach
//need convert // need convert
//insert or display // insert or display
private permissionsToOpenCamera() { private permissionsToOpenCamera() {
this.permissions.requestCameraAutherization().then(granted => { this.permissions.requestCameraAutherization().then(granted => {
@ -76,7 +73,7 @@ export class FileUploderProfileComponent implements OnInit {
} }
async openFile(){ async openFile() {
const actionSheet = await this.actionSheetCtrl.create({ const actionSheet = await this.actionSheetCtrl.create({
header: 'Change Profile Photo', header: 'Change Profile Photo',
buttons: [{ buttons: [{
@ -117,31 +114,31 @@ export class FileUploderProfileComponent implements OnInit {
} }
public takePicture(sourceType: PictureSourceType) { public takePicture(sourceType: PictureSourceType) {
console.log("sourceType: "+sourceType); console.log('sourceType: ' + sourceType);
const options: CameraOptions = { const options: CameraOptions = {
quality: 50, quality: 50,
destinationType: this.cameraController.DestinationType.DATA_URL, destinationType: this.cameraController.DestinationType.DATA_URL,
encodingType: this.cameraController.EncodingType.JPEG, encodingType: this.cameraController.EncodingType.JPEG,
sourceType: sourceType, sourceType,
correctOrientation:true, correctOrientation: true,
targetWidth: 512, targetWidth: 512,
targetHeight: 512 targetHeight: 512
}; };
this.cameraController.getPicture(options).then(imageData => { this.cameraController.getPicture(options).then(imageData => {
const data = "data:image/jpeg;base64," + imageData; const data = 'data:image/jpeg;base64,' + imageData;
this.event.publish('Image', {message:"hello"}); this.event.publish('Image', {message: 'hello'});
this.selectedImage = "data:image/jpeg;base64, " + imageData; this.selectedImage = 'data:image/jpeg;base64, ' + imageData;
this.onimgLoad.emit(this.selectedImage); this.onimgLoad.emit(this.selectedImage);
}); });
} }
public deleteCurrent(){ public deleteCurrent() {
// send empty image // send empty image
//this.onimgLoad.emit(""); // this.onimgLoad.emit("");
console.log("deleteCurrent"); console.log('deleteCurrent');
this.encodeFiles(this.defultProfile); this.encodeFiles(this.defultProfile);
} }
@ -155,7 +152,7 @@ export class FileUploderProfileComponent implements OnInit {
this.errorMsg = null; this.errorMsg = null;
this.encodeFiles(entry); this.encodeFiles(entry);
} else { } else {
this.errorMsg = this.ts.trPK("general", "large-file"); this.errorMsg = this.ts.trPK('general', 'large-file');
} }
}); });
}); });
@ -163,15 +160,15 @@ export class FileUploderProfileComponent implements OnInit {
} }
encodeFiles(entry) { encodeFiles(entry) {
alert("encodeFiles") alert('encodeFiles');
this.base64.encodeFile(entry).then( this.base64.encodeFile(entry).then(
(base64File: string) => { (base64File: string) => {
// const type = this.nativePath.substr( // const type = this.nativePath.substr(
// this.nativePath.lastIndexOf(".") + 1 // this.nativePath.lastIndexOf(".") + 1
// ); // );
alert("base64File 1" + base64File); alert('base64File 1' + base64File);
// if (this.allowdType.includes(type.toLowerCase())) { // if (this.allowdType.includes(type.toLowerCase())) {
// } else { // } else {

@ -34,6 +34,7 @@ export class InternationalMobileComponent implements OnInit {
public options: OptionModel[]; public options: OptionModel[];
private dataLoaded = false; private dataLoaded = false;
private phoneSetProgramatically = false; private phoneSetProgramatically = false;
public default = '';
@ViewChild( SearchableSelectComponent) searchableSelectComponent: SearchableSelectComponent; @ViewChild( SearchableSelectComponent) searchableSelectComponent: SearchableSelectComponent;
constructor( constructor(
public cs: CommonService, public cs: CommonService,

@ -25,12 +25,12 @@
<ion-item> <ion-item>
<!-- <ion-label>{{'verificationcode.verificationcode' | translate}}</ion-label> --> <!-- <ion-label>{{'verificationcode.verificationcode' | translate}}</ion-label> -->
<!-- <img class="item-icon" src="assets/imgs/password.png" item-start /> --> <!-- <img class="item-icon" src="assets/imgs/password.png" item-start /> -->
<ion-input required type="tel" [(ngModel)]="activationCode" placeholder="{{ts.trPK('verificationcode','verificationcode')}}"></ion-input> <!-- <ion-input required type="tel" [(ngModel)]="activationCode" placeholder="{{ts.trPK('verificationcode','verificationcode')}}"></ion-input> -->
</ion-item> </ion-item>
</div> </div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<button ion-button (click)="checkVerificationCode()">{{'general.submit' | translate}}</button> <!-- <button ion-button (click)="checkVerificationCode()">{{'general.submit' | translate}}</button> -->
</div> </div>
</ion-footer> </ion-footer>

@ -18,31 +18,14 @@ import { AlertController } from '@ionic/angular';
styleUrls: ['./sms.page.scss'], styleUrls: ['./sms.page.scss'],
}) })
export class SmsPage implements OnInit { export class SmsPage implements OnInit {
public timeInSeconds : number ;
public time : number;
public runTimer : boolean;
public static SHARED_DATA = 'h2o-login-details';
public hasStarted : boolean;
public countryCode: CountryCode;
public hasFinished : boolean;
public remainingTime : number;
public displayTime : string = "";
// public userData: UserDetailsModel;
public mobile : string;
public country_code : string;
public id : string;
public MobileNumber : string;
public token : string;
public resend : boolean = false;
public smc_code : any;
constructor(public cs: CommonService, constructor(public cs: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public alertController: AlertController, public alertController: AlertController,
public smsService: SmsReaderService, public smsService: SmsReaderService,
public sharedData: SharedDataService, public sharedData: SharedDataService,
private modalCtrl:ModalController, private modalCtrl: ModalController,
private navParams: NavParams, private navParams: NavParams,
public smsservice: SMSService) { public smsservice: SMSService) {
this.initTimer(); this.initTimer();
this.startTimer(); this.startTimer();
@ -59,13 +42,30 @@ export class SmsPage implements OnInit {
// } // }
// }); // });
} }
public static SHARED_DATA = 'h2o-login-details';
public timeInSeconds: number ;
public time: number;
public runTimer: boolean;
public hasStarted: boolean;
public countryCode: CountryCode;
public hasFinished: boolean;
public remainingTime: number;
public displayTime = '';
// public userData: UserDetailsModel;
public mobile: string;
// tslint:disable-next-line: variable-name
public country_code: string;
public id: string;
public MobileNumber: string;
public token: string;
public resend = false;
public smc_code: any;
ngOnInit() { ngOnInit() {
} }
closeModal() closeModal() {
{
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
} }
@ -107,8 +107,7 @@ export class SmsPage implements OnInit {
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
if (this.remainingTime > 0) { if (this.remainingTime > 0) {
this.timerTick(); this.timerTick();
} } else {
else {
this.hasFinished = true; this.hasFinished = true;
this.resend = true; this.resend = true;
} }
@ -116,22 +115,21 @@ export class SmsPage implements OnInit {
} }
getSecondsAsDigitalClock(inputSeconds: number) { getSecondsAsDigitalClock(inputSeconds: number) {
var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param let sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600); let hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60); let minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60); let seconds = sec_num - (hours * 3600) - (minutes * 60);
var hoursString = ''; let hoursString = '';
var minutesString = ''; let minutesString = '';
var secondsString = ''; let secondsString = '';
hoursString = (hours < 10) ? "0" + hours : hours.toString(); hoursString = (hours < 10) ? '0' + hours : hours.toString();
minutesString = (minutes < 10) ? "0" + minutes : minutes.toString(); minutesString = (minutes < 10) ? '0' + minutes : minutes.toString();
secondsString = (seconds < 10) ? "0" + seconds : seconds.toString(); secondsString = (seconds < 10) ? '0' + seconds : seconds.toString();
return minutesString + ':' + secondsString; return minutesString + ':' + secondsString;
} }
validate() validate() {
{ // this.checkSMSActivationCode(this.smc_code);
//this.checkSMSActivationCode(this.smc_code);
SMSService.code = this.smc_code; SMSService.code = this.smc_code;
this.stopSMSMonitoring(); this.stopSMSMonitoring();
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
@ -160,16 +158,15 @@ export class SmsPage implements OnInit {
this.smsService.stopSMSMonitoring(); this.smsService.stopSMSMonitoring();
} }
public ResendOTP() public ResendOTP() {
{ this.id = SMSService.national_id;
this.id= SMSService.national_id; this.mobile = SMSService.mobile_number;
this.mobile= SMSService.mobile_number; this.country_code = SMSService.country_code;
this.country_code= SMSService.country_code;
console.log(this.id); console.log(this.id);
console.log(this.mobile); console.log(this.mobile);
console.log(this.country_code); console.log(this.country_code);
let zip =this.country_code; const zip = this.country_code;
// if (this.country_code.indexOf('+') !== -1) { // if (this.country_code.indexOf('+') !== -1) {
// zip = this.country_code.substring(this.country_code.indexOf('+') + 1); // zip = this.country_code.substring(this.country_code.indexOf('+') + 1);
// } // }

@ -25,19 +25,6 @@
</ion-slides> </ion-slides>
</ion-row> </ion-row>
<!-- <ion-row *ngFor="let item of menuList; let i=index">
<ng-container *ngIf="item.MENU_TYPE === 'M'">
<ion-col [size]="12">
<ion-label>{{item.MENU_NAME}}</ion-label>
</ion-col>
<app-services-button
(click)="openMyTeamPage()"
[title]="item.MENU_NAME"
icon="assets/icon/new-design/leave_balance.png">
</app-services-button>
</ng-container>
</ion-row> -->
<ion-row *ngFor="let menuItem of menuEntries; let i=index"> <ion-row *ngFor="let menuItem of menuEntries; let i=index">
<ion-row class="attendance-module" *ngIf="i == 1"> <ion-row class="attendance-module" *ngIf="i == 1">
@ -71,9 +58,6 @@
> >
</app-services-button> </app-services-button>
</ion-slide> </ion-slide>
<!-- icon="vacationRuleIcon"
icon="myTeamIcon" -->
</ion-slides> </ion-slides>
</ion-row> </ion-row>
@ -103,7 +87,7 @@
</circle-progress> </circle-progress>
</div> </div>
<div class="fixed-shift-timer" *ngIf="isCheckedIn === false"> <div class="fixed-shift-timer" *ngIf="isCheckedIn === false">
<fab-button (trigger)="attendance()"></fab-button> <fab-button (trigger)="getDeviceLocation()"></fab-button>
<page-trailer [small] = "true"></page-trailer> <page-trailer [small] = "true"></page-trailer>
</div> </div>
</ion-content> </ion-content>

@ -249,7 +249,7 @@ export class HomePage implements OnInit {
this.attendance(); this.attendance();
}) })
.catch(error => { .catch(error => {
console.log('Error getting location', error); this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}); });
} else { } else {
return false; return false;
@ -283,18 +283,6 @@ export class HomePage implements OnInit {
// }); // });
// } // }
ionViewDidEnter() {
this.geolocation
.getCurrentPosition()
.then(resp => {
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
})
.catch(error => {
console.log('Error getting location', error);
});
}
private openMenu() { private openMenu() {
this.menu.toggle(); this.menu.toggle();
} }
@ -331,7 +319,6 @@ export class HomePage implements OnInit {
this.showOpenMissingSwipes(); this.showOpenMissingSwipes();
this.showAttendanceTracking(); this.showAttendanceTracking();
this.getAccrualBalance(); this.getAccrualBalance();
// this.common.stopLoading();
} }
public Vacation_Rule() { public Vacation_Rule() {
@ -372,6 +359,7 @@ export class HomePage implements OnInit {
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
if (this.menuList[i].MENU_TYPE === 'M') { if (this.menuList[i].MENU_TYPE === 'M') {
this.events.publish('myTeamFlag', 'true'); this.events.publish('myTeamFlag', 'true');
// this.common.sharedService.setSharedData('true', "myTeamFlag");
} }
} }
@ -487,9 +475,11 @@ export class HomePage implements OnInit {
this.barcodeScanner this.barcodeScanner
.scan() .scan()
.then(barcodeData => { .then(barcodeData => {
this.scannedResult = barcodeData; if (!barcodeData.cancelled) {
this.deviceID = this.device.uuid; this.scannedResult = barcodeData;
this.swipeAttendance(); this.deviceID = this.device.uuid;
this.swipeAttendance();
}
}) })
.catch(err => { .catch(err => {
console.log('Error', err); console.log('Error', err);

@ -133,7 +133,7 @@ export class HomeComponent implements OnInit {
} }
} }
private getSpecialistInfo(i) { public getSpecialistInfo(i) {
// this.navCtrl.push("MyTeamPage", { employee: this.specialistEmpList[i], isSpecialist: true }); // this.navCtrl.push("MyTeamPage", { employee: this.specialistEmpList[i], isSpecialist: true });
this.cs.sharedService.setSharedData(this.specialistEmpList[i], MyTeamService.EMPLOYEE_SHARED_DATA); this.cs.sharedService.setSharedData(this.specialistEmpList[i], MyTeamService.EMPLOYEE_SHARED_DATA);
this.cs.sharedService.setSharedData(true, 'isSpecialist'); this.cs.sharedService.setSharedData(true, 'isSpecialist');

@ -159,7 +159,7 @@
<ion-col [size]="3"> <ion-col [size]="3">
<div class="attendance-information"> <div class="attendance-information">
<span>{{ts.trPK('attendance-tracking','non-analyzed')}}</span> <span>{{ts.trPK('attendance-tracking','non-analyzed')}}</span>
<h2>{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}</h2> <h2>{{timeCardSummaryData.NOT_ANALYZED_DAYS}}</h2>
</div> </div>
</ion-col> </ion-col>

@ -75,7 +75,7 @@ export class DetailsComponent implements OnInit {
}; };
public data = {}; public data = {};
public isPostNoLoad = true;
public previousActiveIndex = 0; public previousActiveIndex = 0;
public currentActiveIndex = 0; public currentActiveIndex = 0;
public searchNameOrUserName = ''; public searchNameOrUserName = '';
@ -96,11 +96,13 @@ export class DetailsComponent implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
this.common.startLoading();
this.intializeMemberDetail(); this.intializeMemberDetail();
this.showAttendanceTracking(); this.showAttendanceTracking();
} }
showAttendanceTracking() { showAttendanceTracking() {
this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
const request = { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
@ -116,6 +118,7 @@ export class DetailsComponent implements OnInit {
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
if (this.activeSegment === 'Attendance') { if (this.activeSegment === 'Attendance') {
this.common.startLoading();
this.initAttendance(); this.initAttendance();
} }
} }
@ -139,7 +142,6 @@ export class DetailsComponent implements OnInit {
} }
public getDayHoursTypeDetails(month?, year?) { public getDayHoursTypeDetails(month?, year?) {
console.log('getDayHoursTypeDetails');
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest(); const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
this.monthName = month; this.monthName = month;
this.yearDate = year; this.yearDate = year;
@ -156,17 +158,17 @@ export class DetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber; dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100; dayAndHoursReqObj.P_PAGE_LIMIT = 100;
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => { this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log(result.GetDayHoursTypeDetailsList); console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList); this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
} }
}); });
} }
nextSlide() { nextSlide() {
this.common.startLoading();
if (this.currentMonthName !== this.month) { if (this.currentMonthName !== this.month) {
this.showData = false; this.showData = false;
if (this.nextMonth > 12) { if (this.nextMonth > 12) {
@ -181,6 +183,7 @@ export class DetailsComponent implements OnInit {
} }
previousSlide() { previousSlide() {
this.common.startLoading();
this.showData = false; this.showData = false;
if (this.preMonth === 0) { if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1; this.currentYear = this.currentYear - 1;
@ -255,17 +258,11 @@ export class DetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName; timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate; timeCardSummaryReqObj.SearchYear = this.yearDate;
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => { this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0]; this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS; this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS; this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
// if (this.absentDays === 0 && this.attendedDays === 0) {
// this.futrueDays = this.totalAttendancePrecentage;
// }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays; this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) { if (this.totalAttendancePrecentage > 0) {
this.data = { this.data = {

@ -25,7 +25,7 @@ export class ApplyActionModalComponent implements OnInit {
messageSuccess: boolean; messageSuccess: boolean;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService, constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService,
) { ) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false);

@ -25,7 +25,7 @@
<p-chart *ngIf="showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart> <p-chart *ngIf="showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div> </div>
<ion-row class="filters-row"> <ion-row class="filters-row" *ngIf="showChart">
<ion-slides [options]="slideOptsOne"> <ion-slides [options]="slideOptsOne">
<ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''"> <ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''">
<app-card-filter <app-card-filter
@ -50,7 +50,7 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row *ngIf='selectedFilter === "ITG"'> <ion-row *ngIf='selectedFilter === "ITG"' class="filters-row">
<ion-col> <ion-col>
<ion-slides> <ion-slides>
<ion-slide class='slideCss' *ngFor="let segment of ITGSegment"> <ion-slide class='slideCss' *ngFor="let segment of ITGSegment">
@ -63,7 +63,7 @@
</ion-row> </ion-row>
<div style="position: relative;"> <div style="position: relative;">
<div [ngClass]="showFormattedData.length > 0 && direction == 'en'? 'work-list-container' : 'work-list-container-ar'" *ngIf='selectedFilter != "ITG"'> <div [ngClass]="showFormattedData.length > 0 && direction == 'en'? 'work-list-container' : 'work-list-container-ar'" *ngIf='selectedFilter != "ITG" && showFormattedData.length > 0'>
<div *ngFor="let formattedData of showFormattedData; let i = index"> <div *ngFor="let formattedData of showFormattedData; let i = index">
<span [ngClass]="direction == 'en'? 'date-span':'date-span-ar'">{{formattedData.date}}</span> <span [ngClass]="direction == 'en'? 'date-span':'date-span-ar'">{{formattedData.date}}</span>
<div class="date-data" *ngFor="let workList of formattedData.data; let j = index"> <div class="date-data" *ngFor="let workList of formattedData.data; let j = index">
@ -73,12 +73,25 @@
</div> </div>
</div> </div>
<div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" > <div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> <!-- <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> -->
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' >
<div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
<span class="date-span">{{segmentInfo.ModifiedDate |date}}</span> <span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
<div class="date-data"> <div class="date-data">
<p>{{segmentInfo.Title}}</p> <p>{{segmentInfo.Title}}</p>
</div> </div>
</div> </div>
<div *ngIf="activeSegment == 'All'" >
<div *ngFor="let data of segmentInfo" (click)="openITGAll(data.ID, data.ItemID)">
<span class="date-span">{{data.ModifiedDate | date}}</span>
<div class="date-data">
<p>{{data.Title}}</p>
</div>
</div>
</div>
</div>
</div> </div>
<div class="no-data-available" *ngIf="showFormattedData.length === 0"> <div class="no-data-available" *ngIf="showFormattedData.length === 0">
<span>{{ts.trPK('work-list','No-data-available')}}</span> <span>{{ts.trPK('work-list','No-data-available')}}</span>

@ -11,6 +11,7 @@ import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/wor
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { timeout } from 'rxjs/operators';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -23,6 +24,8 @@ export class HomeComponent implements OnInit {
public static ALL_REQUEST = 'all_request'; public static ALL_REQUEST = 'all_request';
public static NOTIFICATION_DATA = 'notification_data'; public static NOTIFICATION_DATA = 'notification_data';
public static NOTIFICATION_ARR = 'notification_arr'; public static NOTIFICATION_ARR = 'notification_arr';
public static NAMES_ALL_iTEMS = 'names-all-items';
public static IS_ALL_NAME = 'is_all_names';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
private WorkListObj: WorkListRequest; private WorkListObj: WorkListRequest;
WorkListResObj: any; WorkListResObj: any;
@ -50,10 +53,11 @@ export class HomeComponent implements OnInit {
// public direction = 'ltr'; // public direction = 'ltr';
public direction: string; public direction: string;
public ITGCount = 0; public ITGCount = 0;
public ITGSegment: {name: string, code: any, data: any, style: boolean} [] = []; public ITGSegment: { name: string, code: any, data: any, style: boolean, names?: any }[] = [];
public ITGAllItem: any = []; public ITGAllItem: any = [];
public selectedITGToActive = false; public selectedITGToActive = false;
public ITGItem: any = []; public ITGItem: any = [];
public ITGAllItems: any = [];
public activeSegment: any; public activeSegment: any;
public currentActiveIndex = 0; public currentActiveIndex = 0;
@ -81,17 +85,17 @@ export class HomeComponent implements OnInit {
}; };
public data = { public data = {
datasets: [ datasets: [
{ {
data: [0, 0, 0, 0, 0], data: [0, 0, 0, 0, 0],
backgroundColor: [ backgroundColor: [
'#18a169', '#18a169',
'#38c9b3', '#38c9b3',
'#114475', '#114475',
'#3cb9d5', '#3cb9d5',
'#cc3232' '#cc3232'
], ],
borderWidth: 5 borderWidth: 5
}] }]
}; };
public filters = [ public filters = [
{ {
@ -166,20 +170,15 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_PAGE_LIMIT = 50; this.WorkListObj.P_PAGE_LIMIT = 50;
} }
ionViewDidEnter() { ionViewDidEnter() {
console.log("ionViewDidEnter"); console.log('ionViewDidEnter');
// this.direction = TranslatorService.getCurrentDirection();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
// this.direction = TranslatorService.getCurrentDirection();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
} }
ngOnInit() { ngOnInit() {
this.common.startLoading();
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
this.common.startLoading();
this.openNotificationsDashboard(); this.openNotificationsDashboard();
} }
@ -224,6 +223,7 @@ export class HomeComponent implements OnInit {
} }
} }
this.showChart = true; this.showChart = true;
this.common.stopLoading();
} }
activeFilter(index: number) { activeFilter(index: number) {
@ -246,15 +246,15 @@ export class HomeComponent implements OnInit {
disableFilters() { disableFilters() {
for (const filter of this.filters) { for (const filter of this.filters) {
if (filter.key === this.itemType) { if (filter.key === this.itemType) {
filter.disable = false; filter.disable = false;
filter.active = true; filter.active = true;
this.selectedFilter = filter.name; this.selectedFilter = filter.name;
} else if (this.itemType === '') { } else if (this.itemType === '') {
filter.disable = false; filter.disable = false;
filter.active = false; filter.active = false;
} else { } else {
filter.disable = true; filter.disable = true;
filter.active = false; filter.active = false;
} }
} }
if (this.itemType === '') { if (this.itemType === '') {
@ -425,12 +425,14 @@ export class HomeComponent implements OnInit {
} else { } else {
this.newWorkListResponse = this.newWorkListResponse.concat(result); this.newWorkListResponse = this.newWorkListResponse.concat(result);
} }
const categorizedWorkListResponse = this.categorizeData(this.newWorkListResponse); let categorizedWorkListResponse = [];
this.assignDataToFilters(); categorizedWorkListResponse = this.categorizeData(this.newWorkListResponse);
this.showFormattedData = this.sortArray(categorizedWorkListResponse); if (categorizedWorkListResponse.length > 0) {
this.allFormattedData = this.showFormattedData; this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); this.allFormattedData = this.showFormattedData;
this.common.stopLoading(); this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
this.assignDataToFilters();
}
} else { } else {
this.newWorkListResponse = []; this.newWorkListResponse = [];
} }
@ -478,57 +480,67 @@ export class HomeComponent implements OnInit {
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
if (!this.isReachEnd && this.selectedFilter !== 'ITG') { if (!this.isReachEnd && this.selectedFilter !== 'ITG') {
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { this.common.startLoading();
if (this.common.validResponse(result)) { this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
this.handleWorkListResult(result.GetWorkList); if (this.common.validResponse(result)) {
} this.handleWorkListResult(result.GetWorkList);
});
} else {
if (this.infiniteScroll) {
this.infiniteScroll.complete();
} }
});
} else {
if (this.infiniteScroll) {
this.infiniteScroll.complete();
} }
}
} }
Count() { Count() {
this.workListService.getITGCount('', '', this.isPostNoLoad) const datas = [];
.subscribe((result: any) => { const names = [];
for (let i = 0; i < result.RequestType.length; i++) { this.ITGSegment[0] = {
this.ITGSegment[i] = { name: 'All',
name: result.RequestType[i].RequestTypeName, code: 'All',
code: result.RequestType[i].RequestTypeCode, data: null,
data: result.RequestType[i].RequestDetails, style: false
style: false };
}; this.workListService.getITGCount('', '', this.isPostNoLoad)
} .subscribe((result: any) => {
if(this.ITGSegment.length != 0 ){ for (let i = 1; i < result.RequestType.length; i++) {
this.setActive(this.ITGSegment[0].code); this.ITGSegment[i] = {
} name: result.RequestType[i].RequestTypeName,
console.log(this.ITGSegment); code: result.RequestType[i].RequestTypeCode,
}); data: result.RequestType[i].RequestDetails,
style: false
};
datas[i] = result.RequestType[i].RequestDetails;
names[i] = result.RequestType[i].RequestTypeCode;
}
this.ITGSegment[0].data = datas;
this.ITGSegment[0].names = names;
this.setActive(this.ITGSegment[0].code);
});
} }
Details() { Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad) this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => { .subscribe((result: any) => {
this.ITGCount = result.TotalCount; this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount; this.filters[5].value = result.TotalCount;
this.filters[5].value = result.TotalCount; });
});
} }
ITGNotification() { ITGNotification() {
this.isAll = false; // this.Details();
this.isPR = false; this.isAll = false;
this.isPO = false; this.isPR = false;
this.isMR = false; this.isPO = false;
this.isHR = false; this.isMR = false;
this.isITG = true; this.isHR = false;
this.isITG = true;
} }
searchBtn() { searchBtn() {
this.isSearch = !this.isSearch; this.isSearch = !this.isSearch;
} }
setActive(selectedSegment) { setActive(selectedSegment) {
@ -545,13 +557,38 @@ export class HomeComponent implements OnInit {
this.ITGSegment[i].style = false; this.ITGSegment[i].style = false;
} }
} }
console.log(this.ITGSegment);
} }
openITG(segmentInfo) { openITG(segmentInfo, name?) {
if (name) {
this.common.sharedService.setSharedData(name, HomeComponent.REQUSET_NAME);
this.common.sharedService.setSharedData(this.ITGSegment, HomeComponent.NAMES_ALL_iTEMS);
this.common.sharedService.setSharedData(true, HomeComponent.IS_ALL_NAME);
} else {
this.common.sharedService.setSharedData(this.activeSegment, HomeComponent.REQUSET_NAME);
this.common.sharedService.setSharedData(false, HomeComponent.IS_ALL_NAME);
}
this.common.sharedService.setSharedData(segmentInfo, HomeComponent.REQUSET_INFO); this.common.sharedService.setSharedData(segmentInfo, HomeComponent.REQUSET_INFO);
this.common.sharedService.setSharedData(this.activeSegment, HomeComponent.REQUSET_NAME);
this.common.sharedService.setSharedData(this.ITGItem, HomeComponent.ALL_REQUEST); this.common.sharedService.setSharedData(this.ITGItem, HomeComponent.ALL_REQUEST);
this.common.openWorklistITGPage(); this.common.openWorklistITGPage();
} }
openITGAll(id, item) {
let count = 0;
let ITEM: any;
let NAME: any;
for (let i = 1; i < this.ITGSegment.length; i++) {
// tslint:disable-next-line: prefer-for-of
for (let j = 0; j < this.ITGSegment[i].data.length; j++) {
if (this.ITGSegment[i].data[j].ID === id && this.ITGSegment[i].data[j].ItemID === item) {
ITEM = this.ITGSegment[i].data[j];
NAME = this.ITGSegment[i].code;
count++;
}
}
}
this.openITG(ITEM, NAME);
}
} }

@ -26,7 +26,7 @@ export class ItemHistoryComponent implements OnInit {
constructor( constructor(
public worklistMainService: WorklistMainService, public worklistMainService: WorklistMainService,
private cs: CommonService, private cs: CommonService,
private ts: TranslatorService, public ts: TranslatorService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
public worklistService: WorklistService public worklistService: WorklistService
) { ) {

@ -1,3 +1,226 @@
<p> <ion-header>
mo-item-history works! <ion-toolbar class="header-toolbar-new">
</p> <nav-buttons></nav-buttons>
<ion-title color="light">
{{ts.trPK('worklistMain','ITEM_HIS')}}
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="colorBG">
<!-- <ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{'worklistMain, actionHis' | translate}}</div>
</ion-card-header>
<ion-card-content> -->
<!-- <ion-card class="cardContent"> -->
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> -->
<!-- <ion-card-content> -->
<div class="noDataDiv" [hidden]="itemHistoryRes && itemHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<ion-list class="itemeHistoryist" *ngIf="itemHistoryRes && itemHistoryRes.length > 0 ">
<ion-grid class="gridItemReq">
<ion-item class="itemReqContent" *ngFor="let itemHistory of itemHistoryRes; let i=index; ">
<div class="itemReqDiv">
<!-- // <ion-row> -->
<!-- <ion-col class="colItemReqHeader"> -->
<!-- <label for="">{{ts.trPK('worklistMain','description')}}
</label> -->
<!-- </ion-col>
<ion-col> {{itemHistory.OU_NAME}}-->
<!-- <label for="">{{i+1}}. </label> -->
<!-- </ion-col> -->
<!-- </ion-row> -->
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','request_number')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.REQUEST_NUMBER}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','uom')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.UNIT_OF_MEASURE}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.QUANTITY}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6"class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Date_Req')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.DATE_REQUIRED}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','line_status')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.LINE_STATUS_DIS}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','date_status')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.STATUS_DATE}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','trans_type')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.TRANSACTION_TYPE_NAME}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','organization')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.ORGANIZATION_NAME}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','organization_code')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.ORGANIZATION_CODE}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','operating_unit')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.OPERATING_UNIT_NAME}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','from_subinventory')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.FROM_SUBINVENTORY_CODE}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','from_locator')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.FROM_LOCATOR}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to_subinventory')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.TO_SUBINVENTORY_CODE}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col size="6" class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to_locator')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.TO_LOCATOR}} </ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipToLocation')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{itemHistory.SHIP_TO_LOCATION}} </ion-label>
</ion-col>
</ion-row>
</div>
</ion-item>
</ion-grid>
</ion-list>
<!-- </ion-card-content>
</ion-card> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>

@ -0,0 +1,31 @@
.itemeHistoryist {
background: #f0efef;
padding: 6px;
/* margin-top: 20px; */
/* width: 100%;*/
}
ion-label.labelValue.sc-ion-label-ios-h.sc-ion-label-ios-s.ios.hydrated,
ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
{
// white-space: pre-wrap !important;
// --color: initial;
// display: block;
// color: var(--color);
// font-family: var(--ion-font-family,inherit);
// font-size: inherit;
// text-overflow: ellipsis;
// overflow: hidden;
// -webkit-box-sizing: border-box;
// box-sizing: border-box
--color: initial;
display: contents !important;
font-family: var(--ion-font-family, inherit);
font-size: inherit;
text-overflow: ellipsis !important;
white-space: pre;
overflow: hidden;
box-sizing: border-box;
}

@ -1,4 +1,11 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { WorklistMainService } from '../service/work-list.main.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ModalController } from '@ionic/angular';
import { WorklistService } from '../service/worklist.service';
import { MOItemHistoryReq } from '../models/MOItemHistoryReq';
import { MOItemHistoryRes } from '../models/MOItemHistoryRes';
@Component({ @Component({
selector: 'app-mo-item-history', selector: 'app-mo-item-history',
@ -6,12 +13,111 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./mo-item-history.component.scss'], styleUrls: ['./mo-item-history.component.scss'],
}) })
export class MoItemHistoryComponent implements OnInit { export class MoItemHistoryComponent implements OnInit {
getPassMOInfo: any;
itemHistoryRes: any;
IsReachEnd: boolean = false;
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 50;
MOItemHistoryReq: any;
constructor() { } constructor(
public worklistMainService: WorklistMainService,
private cs: CommonService,
private ts: TranslatorService,
public worklistService: WorklistService
) {
this.getPassMOInfo = this.cs.sharedService.getSharedData('passMOReq');
this.MOItemHistoryReq = new MOItemHistoryReq();
this.MOItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
this.MOItemHistoryReq.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.MOItemHistoryReq.P_ITEM_ID= this.getPassMOInfo.P_ITEM_ID;
this.MOItemHistoryReq.P_ORG_ID= this.getPassMOInfo.P_ORG_ID;
}
ngOnInit() { ngOnInit() {
this.getMOItemHistory(this.getPassMOInfo.P_ITEM_ID,this.getPassMOInfo.P_ORG_ID);
} }
getMOItemHistory(itemID ,orgID) {
console.log(itemID);
this.IsReachEnd = false;
const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID);
request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM = 1;
request.P_ORG_ID= parseInt(orgID);
this.worklistMainService.getMOItemHistory(request).
subscribe((result: MOItemHistoryRes) => {
this.handleItemHistoryResult(result);
});
}
handleItemHistoryResult(result) {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetMoItemHistoryList)) {
this.itemHistoryRes = result.GetMoItemHistoryList;
this.P_PAGE_NUM++;
this.MOItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.itemHistoryRes.length - 1;
if (result.GetMoItemHistoryList[lastItemIndex]) {
let lastitem = result.GetMoItemHistoryList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
}
}
}
}
doInfinite(infiniteScroll) {
if (!this.IsReachEnd) {
// this.POItemHistoryReq.P_PAGE_NUM = this.P_PAGE_NUM;
this.worklistMainService.getMOItemHistory(this.MOItemHistoryReq).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.GetMoItemHistoryList != undefined) {
this.MOItemHistoryReq.P_PAGE_NUM=this.P_PAGE_NUM++;
(result.GetMoItemHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.itemHistoryRes.push(element);
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
}// if list length >0
else {
this.IsReachEnd = true;
}
}// if response == 1
//this.pageNum++;
infiniteScroll.target.complete();
});
} else {
if (infiniteScroll)
infiniteScroll.target.complete();
}
}//end infiniteScroll
} }

@ -11,7 +11,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
export class MoreActionModalComponent implements OnInit { export class MoreActionModalComponent implements OnInit {
actionBtns :any =[]; actionBtns :any =[];
radioButtonValue: any; radioButtonValue: any;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){} constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){}
ngOnInit() { ngOnInit() {
console.log("modal"); console.log("modal");

@ -27,10 +27,10 @@ import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis
import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component'; import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component';
import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component'; import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component';
import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component'; import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component';
// import { WorklistMainComponent } from './worklist-main/worklist-main.component'; // import { WorklistMainComponent } from './worklist-main/worklist-main.component';
import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component' import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component'
import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component'; import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component';
import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component';
const routes: Routes = [ const routes: Routes = [
@ -114,7 +114,11 @@ const routes: Routes = [
{ {
path: 'worklist-replacement-itg', path: 'worklist-replacement-itg',
component: WorkListReplacementItgComponent component: WorkListReplacementItgComponent
} },
{
path: 'item-history-MO',
component: MoItemHistoryComponent
}
] ]
} }
]; ];
@ -148,7 +152,8 @@ const routes: Routes = [
WorklistMainMRComponent, WorklistMainMRComponent,
WorklistAdvancedSearchComponent, WorklistAdvancedSearchComponent,
WorkListMainItgComponent, WorkListMainItgComponent,
WorkListReplacementItgComponent WorkListReplacementItgComponent,
MoItemHistoryComponent
// WorklistMainComponent // WorklistMainComponent
], ],
entryComponents: [ entryComponents: [

@ -28,7 +28,7 @@ export class QutationAnalysisComponent implements OnInit {
doInfiniteReq: any; doInfiniteReq: any;
constructor(public worklistMainService: WorklistMainService, constructor(public worklistMainService: WorklistMainService,
private cs: CommonService, private cs: CommonService,
private ts: TranslatorService, public ts: TranslatorService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
public worklistService: WorklistService) { public worklistService: WorklistService) {
this.getPassPOItemID = this.cs.sharedService.getSharedData('passPOInfo',false); this.getPassPOItemID = this.cs.sharedService.getSharedData('passPOInfo',false);

@ -34,7 +34,7 @@ export class WorklistMainService {
public static getPRNotificationBody = public static getPRNotificationBody =
"Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "GET_MO_ITEM_HISTORY"; public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
public static getNotificationButtons = public static getNotificationButtons =
"Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation"; public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation";

@ -8,7 +8,7 @@
</ion-header> </ion-header>
<ion-content class="colorBG"> <ion-content class="colorBG">
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" <ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)"
[value]="defaultSegment" class="ion-segment-all"> [value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="{{segmentVal.name}}" <ion-segment-button value="{{segmentVal.name}}"
@ -74,8 +74,9 @@
<img src="../assets/imgs/noteSmall.png"> <img src="../assets/imgs/noteSmall.png">
</button> </button>
<div <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', 'bg-gray-dot':approvalInfo.Action === ''}" [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'"> [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'"
[ngClass]="{'bg-gray-dot' : approvalInfo.Action === ''}">
</div> </div>
<p style="margin-left: -20%; font-size: 12px !important;">{{approvalInfo.Action}}</p> <p style="margin-left: -20%; font-size: 12px !important;">{{approvalInfo.Action}}</p>
</div> </div>

@ -26,6 +26,8 @@ export class WorkListMainItgComponent implements OnInit {
public request_info: any; public request_info: any;
public request_name: any; public request_name: any;
public all_request: any; public all_request: any;
public all_request_names: any;
public is_all_items_sents: any;
public request = new itgRequest(); public request = new itgRequest();
public activeSegment: any = "info"; public activeSegment: any = "info";
public request_details: any; public request_details: any;
@ -49,7 +51,9 @@ export class WorkListMainItgComponent implements OnInit {
public ExchangeServerSelected: any; public ExchangeServerSelected: any;
public ExchangeServerDBSelected: any; public ExchangeServerDBSelected: any;
public actionBTN: { name: string, image: string, isAvailable: boolean }[] = []; public actionBTN: { name: string, image: string, isAvailable: boolean }[] = [];
index2: number;
direction: string; direction: string;
defaultSegment = '';
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
@ -61,6 +65,8 @@ export class WorkListMainItgComponent implements OnInit {
this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO); this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO);
this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME); this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME);
this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST); this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST);
this.all_request_names = this.common.sharedService.getSharedData(HomeComponent.NAMES_ALL_iTEMS);
this.is_all_items_sents = this.common.sharedService.getSharedData(HomeComponent.IS_ALL_NAME);
this.all_request = this.all_request[0]; this.all_request = this.all_request[0];
this.changeITGForm(this.request_info, this.request_name); this.changeITGForm(this.request_info, this.request_name);
} }
@ -78,10 +84,9 @@ export class WorkListMainItgComponent implements OnInit {
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => { this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
this.request_details = result.ITGRequest; this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields; this.grantInfo = result.ITGRequest.GrantFields;
let count = 0;
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) { for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: 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} this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields }
} }
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.workList = this.request_details.WFHistory; this.workList = this.request_details.WFHistory;
@ -89,7 +94,9 @@ export class WorkListMainItgComponent implements OnInit {
this.activeSegment = this.segmentsArray[0].name; this.activeSegment = this.segmentsArray[0].name;
for (let i = 0; i < this.options.length; i++) { for (let i = 0; i < this.options.length; i++) {
this.imageURL(this.options[i].Action); this.imageURL(this.options[i].Action);
this.actionBTN[i] = { name: this.options[i].Action, image: this.imageURL(this.options[i].Action), isAvailable: this.options[i].IsAvailable } this.actionBTN[i] = {
name: this.options[i].Action, image: this.imageURL(this.options[i].Action), isAvailable: this.options[i].IsAvailable
};
} }
if (this.grantInfo) { if (this.grantInfo) {
@ -136,20 +143,44 @@ export class WorkListMainItgComponent implements OnInit {
} }
skip() { skip() {
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request if (this.is_all_items_sents) {
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found. for (let i = 1; i < this.all_request_names.length; i++) {
this.index = i + 1; for (let j = 0; j < this.all_request_names[i].data.length; j++) {
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request. if (this.request_info.ID === this.all_request_names[i].data[j].ID
this.clearDataArray(); && this.request_info.ItemID === this.all_request_names[i].data[j].ItemID) {
this.changeITGForm(this.all_request[this.index], this.request_name); this.index2 = j + 1;
break; this.index = i + 1;
if (this.all_request_names[i].data.length !== this.index2) {// if there is another request with same type
this.clearDataArray();
this.changeITGForm(this.all_request_names[i].data[this.index2], this.all_request_names[i].code);
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);
return false;
}
} else if (this.index === this.all_request_names.length) { //if its the end request redirecte to worklist home
this.common.openNotificationPage();
return false;
}
}
}
} else {
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
this.index = i + 1;
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
this.clearDataArray();
this.changeITGForm(this.all_request[this.index], this.request_name);
break
} else {
this.common.openNotificationPage();
break
}
} else { } else {
this.common.openNotificationPage(); this.common.openNotificationPage();
break; break
} }
} else {
this.common.openNotificationPage();
break;
} }
} }
} }

@ -11,7 +11,7 @@
<ion-item lines="none"> <ion-item lines="none">
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label> <ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}' <ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchBy"> [(ngModel)]="searchBy" (ionChange)="onChangeSelect($event)">
<ion-select-option value="1" selected="true">{{'addAttach, name' | translate}}</ion-select-option> <ion-select-option value="1" selected="true">{{'addAttach, name' | translate}}</ion-select-option>
<ion-select-option value="2">{{'login, username' | translate}}</ion-select-option> <ion-select-option value="2">{{'login, username' | translate}}</ion-select-option>
<ion-select-option value="3">{{'general, email' | translate}}</ion-select-option> <ion-select-option value="3">{{'general, email' | translate}}</ion-select-option>
@ -19,11 +19,11 @@
</ion-item> </ion-item>
<ion-item lines="none"> <ion-item lines="none">
<ion-button class="filterBtn" button-type="clear" (click)="getreplacmentemployee()" item-end> <ion-button [ngClass]="(!searchKeyEnter || !isSelect) ? 'disabledButton' : '' " [disabled]="(!searchKeyEnter || !isSelect) " class="filterBtn" button-type="clear" (click)="getreplacmentemployee()" item-end>
<ion-icon slot="icon-only" color="white" name="search"></ion-icon> <ion-icon slot="icon-only" color="white" name="search"></ion-icon>
</ion-button> </ion-button>
<ion-input class="filterInput" [(ngModel)]="inputSearch" placeholder='{{"general, search" | translate}}'></ion-input> <ion-input (ionChange)="onChangeInput()" class="filterInput" [(ngModel)]="inputSearch" placeholder='{{"general, search" | translate}}'></ion-input>
<!-- <button ion-button icon-only (click)="getreplacmentemployee()" clear type="button" item-end> <!-- <button ion-button icon-only (click)="getreplacmentemployee()" clear type="button" item-end>
<ion-icon name="search"></ion-icon> <ion-icon name="search"></ion-icon>

@ -121,6 +121,12 @@ button.item-button.button.button-md.button-clear.button-clear-md {
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
} }
.disabledButton{
opacity:.5;
}

@ -38,6 +38,8 @@ export class WorkListReplacementRollComponent implements OnInit {
getpassResAttr: any = []; getpassResAttr: any = [];
active: any; active: any;
demoeAttach:any=[]; demoeAttach:any=[];
isSelect: boolean =false;
searchKeyEnter: boolean = false;
messageSuccess: boolean =false; messageSuccess: boolean =false;
constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
@ -333,5 +335,26 @@ export class WorkListReplacementRollComponent implements OnInit {
closeModal() { closeModal() {
this.modalCtrl.dismiss(); this.modalCtrl.dismiss();
} }
onChangeSelect(select){
console.log(select.detail.value);
let selectValue= select.detail.value;
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;
}
}
} }

@ -1,6 +1,6 @@
<ion-content> <ion-content>
<div class="search-header" (click)="dismissModal()"> <div class="search-header" (click)="dismissModal()">
<h2>{{ts.trPK('general','sadvanced-search')}}</h2> <h2>{{ts.trPK('general','advanced-search')}}</h2>
<ion-icon slot="icon-only" name="md-close"></ion-icon> <ion-icon slot="icon-only" name="md-close"></ion-icon>
</div> </div>

@ -8,13 +8,13 @@
</ion-header> </ion-header>
<ion-content *ngIf="!messageSuccess" class="colorBG"> <ion-content class="colorBG">
<div *ngIf="!messageSuccess" > <div *ngIf="!messageSuccess" >
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div> <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<!-- add segemnt part --> <!-- add segemnt part -->
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all"> [value]="defaultSegment" class="ion-segment-all">
@ -408,6 +408,25 @@
</ion-row> </ion-row>
<ion-row >
<ion-col>
<div style="text-align: center">
<button ion-button class="itemHISBtn"
(click)="getMOItemHistory(notificationList.ITEM_ID , notificationList.ORG_ID)">
{{ts.trPK('worklistMain','ITEM_HIS')}}
</button>
</div>
</ion-col>
</ion-row>
@ -640,13 +659,12 @@
<ion-tabs> <ion-tabs>
<ion-tab-bar class="tabBar" slot="bottom"> <ion-tab-bar class="tabBar" slot="bottom">
<ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVE')"> <ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVED')">
<img src="../assets/imgs/action-approve.png"> <img src="../assets/imgs/action-approve.png">
<ion-label>Approve</ion-label> <ion-label>Approve</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECT <ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECTED')">
')">
<img src="../assets/imgs/action-reject.png"> <img src="../assets/imgs/action-reject.png">
<ion-label>Reject</ion-label> <ion-label>Reject</ion-label>
</ion-tab-button> </ion-tab-button>
@ -660,7 +678,7 @@
<ion-label>Skip</ion-label> <ion-label>Skip</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button (click)="openMoreActions()"> <ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png"> <img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label> <ion-label>More</ion-label>
</ion-tab-button> </ion-tab-button>

@ -1,17 +1,17 @@
import { Component, OnInit, ElementRef } from "@angular/core"; import { Component, OnInit, ElementRef } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { WorkListBodyRequest } from "../models/NotificationBodyReq"; import { WorkListBodyRequest } from '../models/NotificationBodyReq';
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; import { EITNotificatonBodyResponse } from '../models/EITNotificationBodyRes';
import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes"; import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes';
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 { 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 { 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';
import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
@ -31,6 +31,8 @@ import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-mo
import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'; import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { MOItemHistoryRes } from '../models/MOItemHistoryRes';
import { MOItemHistoryReq } from '../models/MOItemHistoryReq';
@Component({ @Component({
selector: 'app-worklist-main-mr', selector: 'app-worklist-main-mr',
@ -45,17 +47,17 @@ export class WorklistMainMRComponent implements OnInit {
private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest;
private WorkListAttachObj: WorkListButtonRequest; private WorkListAttachObj: WorkListButtonRequest;
private PRList: PRNotificatonBodyList private PRList: PRNotificatonBodyList
public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; public static PASS_NOTIFICATION_INFO = 'passNotificationInfo';
public static PASS_ACTION_MODE = "passActionMode"; public static PASS_ACTION_MODE = 'passActionMode';
getPassNotificationDetails: any; getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr"; public static PASS_RES_ATTR = 'passResAttr';
TransactionID: number = -999; TransactionID: number = -999;
notificationBodyRes: any; notificationBodyRes: any;
actionHistoryRes: any; actionHistoryRes: any;
notificationButtonRes: any; notificationButtonRes: any;
actionMode: any; actionMode: any;
pInformation: string = ""; pInformation: string = '';
pQuestion: string = ""; pQuestion: string = '';
RespondAttributesListRes: any; RespondAttributesListRes: any;
schemaNotific: any; schemaNotific: any;
NotRespondAttributeList: any; NotRespondAttributeList: any;
@ -66,7 +68,7 @@ export class WorklistMainMRComponent implements OnInit {
dataOfAttr: any; dataOfAttr: any;
P_RESPOND_ATTRIBUTES_TBL: any; P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = '';
notificationArray: any; notificationArray: any;
notificationDynamicAttributeArr: any; notificationDynamicAttributeArr: any;
private textInput: TextInput; private textInput: TextInput;
@ -87,7 +89,7 @@ export class WorklistMainMRComponent implements OnInit {
confirmMsg: string; confirmMsg: string;
delMsg: string; delMsg: string;
closeMsg: string; closeMsg: string;
activeSegment: any = "item-req"; activeSegment: any = 'item-req';
lines_note_limit: any = 24; lines_note_limit: any = 24;
orgNote: string; orgNote: string;
truncating: boolean; truncating: boolean;
@ -99,8 +101,10 @@ export class WorklistMainMRComponent implements OnInit {
approveDis: boolean = false; approveDis: boolean = false;
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
public static PASS_MO_REQ = "passMOReq";
moreDisabled: boolean = true;
direction: string; direction: string;
defaultSegment = '';
constructor( constructor(
@ -133,14 +137,14 @@ export class WorklistMainMRComponent implements OnInit {
} }
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value); console.log(' event.detail.value: ' + event.detail.value);
} }
intializeNotificationDetail() { intializeNotificationDetail() {
if (this.messageSuccess) { if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById('notificationDynamicFields').innerHTML = '';
} }
console.log("intializeNotificationDetail"); console.log('intializeNotificationDetail');
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
@ -163,9 +167,9 @@ export class WorklistMainMRComponent implements OnInit {
this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = '';
this.WorkListActionObj.P_ACTION_MODE = ""; this.WorkListActionObj.P_ACTION_MODE = '';
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = '';
this.WorkListActionObj.P_APPROVER_INDEX = null; this.WorkListActionObj.P_APPROVER_INDEX = null;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
@ -178,15 +182,15 @@ export class WorklistMainMRComponent implements OnInit {
this.getNotificationResAttr(this.WorkListButtonsObj); this.getNotificationResAttr(this.WorkListButtonsObj);
this.getActionHistory(this.WorkListActionHistoryObj); this.getActionHistory(this.WorkListActionHistoryObj);
this.getAttachmentNotification(this.WorkListAttachObj); this.getAttachmentNotification(this.WorkListAttachObj);
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.getEITNotificationDetails(this.WorkListBodyObj); this.getEITNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.getAbsenceNotificationDetails(this.WorkListBodyObj); this.getAbsenceNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'PO') {
this.getPONotificationDetails(this.WorkListBodyObj); this.getPONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'MO') {
this.getMONotificationDetails(this.WorkListBodyObj); this.getMONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'PR') {
this.getPRNotificationDetails(this.WorkListBodyObj); this.getPRNotificationDetails(this.WorkListBodyObj);
} }
} }
@ -195,7 +199,7 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getPRNotificationBody(notificationBodyObj) .getPRNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => { .subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "PR"); this.handleWorkListBodyResult(result, 'PR');
}); });
} }
@ -203,7 +207,7 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getMONotificationBody(notificationBodyObj) .getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => { .subscribe((result: MONotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "MO"); this.handleWorkListBodyResult(result, 'MO');
}); });
} }
@ -212,7 +216,7 @@ export class WorklistMainMRComponent implements OnInit {
.getPONotificationBody(notificationBodyObj) .getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => { .subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, "PO"); this.handleWorkListBodyResult(result, 'PO');
}); });
} }
@ -220,7 +224,7 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getEITNotificationBody(notificationBodyObj) .getEITNotificationBody(notificationBodyObj)
.subscribe((result: EITNotificatonBodyResponse) => { .subscribe((result: EITNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "EIT"); this.handleWorkListBodyResult(result, 'EIT');
}); });
} }
@ -228,16 +232,16 @@ export class WorklistMainMRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getAbsencesNotificationBody(notificationBodyObj) .getAbsencesNotificationBody(notificationBodyObj)
.subscribe((result: AbsenceNotificatonBodyResponse) => { .subscribe((result: AbsenceNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "ABSENCE"); this.handleWorkListBodyResult(result, 'ABSENCE');
}); });
} }
handleWorkListBodyResult(result, Type) { handleWorkListBodyResult(result, Type) {
this.notificationBodyRes = {}; this.notificationBodyRes = [];
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.pInformation = result.P_INFORMATION; this.pInformation = result.P_INFORMATION;
this.pQuestion = result.P_QUESTION; this.pQuestion = result.P_QUESTION;
if (Type == "MO") { if (Type == 'MO') {
if (result.GetMoNotificationBodyList) { if (result.GetMoNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetMoNotificationBodyList; result.GetMoNotificationBodyList;
@ -262,18 +266,25 @@ export class WorklistMainMRComponent implements OnInit {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetNotificationButtonsList != null) { if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList; this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); 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++) { for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
this.approveDis = true; this.approveDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED" ) {
this.rejectDis = true; this.rejectDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if(
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} // if result == null } // if result == null
@ -328,7 +339,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); console.log('actionButton' + action);
// alert("don't forget"); // alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;
@ -337,13 +348,13 @@ export class WorklistMainMRComponent implements OnInit {
for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) { for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) {
let obj: any = {}; let obj: any = {};
obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME; obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME;
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])) { // else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = 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;
} }
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
@ -351,20 +362,20 @@ export class WorklistMainMRComponent implements OnInit {
let repUserName = this.selEmployeeID; let repUserName = this.selEmployeeID;
if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
let obj: any = {}; let obj: any = {};
repUserName = ""; repUserName = '';
obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME;
obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
if ( if (
ButtonAction == "APPROVE" || ButtonAction == "APPROVED" ||
ButtonAction == "REJECT" || ButtonAction == "REJECTED" ||
ButtonAction == "DEL" || ButtonAction == "DEL" ||
ButtonAction == "CLOSE" ButtonAction == "CLOSE"
) { ) {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = '';
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = '';
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
//sheardData //sheardData
@ -374,30 +385,30 @@ export class WorklistMainMRComponent implements OnInit {
); );
///////////////////////////////////////////// /////////////////////////////////////////////
if (ButtonAction == "APPROVE") { if (ButtonAction == "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
} }
else if (ButtonAction == "REJECT") { else if (ButtonAction == "REJECTED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
} }
else if (ButtonAction == "DEL") { else if (ButtonAction == 'DEL') {
this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg')
} }
else if (ButtonAction == "CLOSE") { else if (ButtonAction == 'CLOSE') {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
} }
this.openApplyModal(this.WorkListActionObj); // this.openApplyModal(this.WorkListActionObj);
// this.common.confirmAlertDialogAction( this.common.confirmAlertDialogAction(
// () => { () => {
// this.applyAction(this.WorkListActionObj); this.applyAction(this.WorkListActionObj);
// }, this.ts.trPK('general', 'ok'), }, this.ts.trPK('general', 'ok'),
// () => { }, 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);
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
@ -416,7 +427,7 @@ export class WorklistMainMRComponent implements OnInit {
////////////this.applyAction(this.WorkListActionObj); ////////////this.applyAction(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;
// this.navCtrl.push("WorkListRfcPage", { // this.navCtrl.push("WorkListRfcPage", {
@ -438,9 +449,9 @@ export class WorklistMainMRComponent implements OnInit {
); );
// this.common.openWorklistRFCPage(); // this.common.openWorklistRFCPage();
this.openRFCModal(); this.openRFCModal();
} else if (ButtonAction == "ANSWER_INFO") { } else if (ButtonAction == 'ANSWER_INFO') {
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,
WorklistMainMRComponent.PASS_NOTIFICATION_INFO WorklistMainMRComponent.PASS_NOTIFICATION_INFO
@ -456,12 +467,12 @@ export class WorklistMainMRComponent implements OnInit {
//this.common.openWorklistRollReplacement(); //this.common.openWorklistRollReplacement();
this.openReplacementRoll(); this.openReplacementRoll();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == 'DELEGATE' ||
ButtonAction == "REQUEST_INFO" || ButtonAction == 'REQUEST_INFO' ||
ButtonAction == "TRANSFER" || ButtonAction == 'TRANSFER' ||
ButtonAction == "TRANSFER_INFO" || ButtonAction == 'TRANSFER_INFO' ||
ButtonAction == "APPROVE_AND_FORWARD" || ButtonAction == 'APPROVE_AND_FORWARD' ||
ButtonAction == "FORWARD" ButtonAction == 'FORWARD'
) { ) {
@ -487,10 +498,10 @@ export class WorklistMainMRComponent implements OnInit {
// this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openReplacementRoll(); this.openReplacementRoll();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == 'UPDATE_ACTION' ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == 'CONTINUE_ACTION'
) { ) {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA EITNotificatonBodyResponse.SHARED_DATA
@ -500,7 +511,7 @@ export class WorklistMainMRComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("EitUpdateListPage"); // this.navCtrl.push("EitUpdateListPage");
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA AbsenceNotificatonBodyResponse.SHARED_DATA
@ -518,15 +529,15 @@ export class WorklistMainMRComponent implements OnInit {
} }
else if (this.notificationButtonRes.length > 0 && !ButtonAction) { else if (this.notificationButtonRes.length > 0 && !ButtonAction) {
(this.elementRef.nativeElement.querySelectorAll( (this.elementRef.nativeElement.querySelectorAll(
"ion-item" 'ion-item'
) as HTMLElement[]).forEach(x => { ) as HTMLElement[]).forEach(x => {
if (x.classList.contains("requiredItem")) { if (x.classList.contains('requiredItem')) {
x.classList.add("ng-touched"); x.classList.add('ng-touched');
x.classList.remove("ng-untouched"); x.classList.remove('ng-untouched');
} }
}); });
this.common.presentAlert( this.common.presentAlert(
this.ts.trPK("worklistMain", "actionRequird") this.ts.trPK('worklistMain', 'actionRequird')
); );
} }
} }
@ -569,7 +580,7 @@ export class WorklistMainMRComponent implements OnInit {
this.NotRespondAttributeList = this.NotRespondAttributeList =
result.NotificationGetRespondAttributesList; result.NotificationGetRespondAttributesList;
if ( if (
result.NotificationRespondRolesList != "" && result.NotificationRespondRolesList != '' &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null && result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined
) { ) {
@ -592,20 +603,20 @@ export class WorklistMainMRComponent implements OnInit {
notificationDynamicFields(notificationAttr) { notificationDynamicFields(notificationAttr) {
const containerId = 'notificationDynamicFields'; const containerId = 'notificationDynamicFields';
for (let i = 0; i < notificationAttr.length; i++) { for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") { if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', '');
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'DATE') {
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "NUMBER") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'NUMBER') {
} }
} }
} }
openNotificationBody() { openNotificationBody() {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA EITNotificatonBodyResponse.SHARED_DATA
@ -615,9 +626,9 @@ export class WorklistMainMRComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" });
this.common.sharedService.setSharedData("EIT", "NotBodyType"); this.common.sharedService.setSharedData('EIT', 'NotBodyType');
this.common.openNotificationDetailsPage(); this.common.openNotificationDetailsPage();
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA AbsenceNotificatonBodyResponse.SHARED_DATA
@ -626,7 +637,7 @@ export class WorklistMainMRComponent implements OnInit {
this.getPassNotificationDetails, this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST AbsenceNotificatonBodyResponse.NOT_WORKLIST
); );
this.common.sharedService.setSharedData("ABSENCE", "NotBodyType"); this.common.sharedService.setSharedData('ABSENCE', 'NotBodyType');
//this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" }); //this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
this.common.openNotificationDetailsPage(); this.common.openNotificationDetailsPage();
} }
@ -641,7 +652,7 @@ export class WorklistMainMRComponent implements OnInit {
if (this.notificationCount <= 0) { if (this.notificationCount <= 0) {
this.notificationCount = null; this.notificationCount = null;
} }
this.events.publish("getNotCount", this.notificationCount); this.events.publish('getNotCount', this.notificationCount);
} }
}); });
} }
@ -699,7 +710,7 @@ export class WorklistMainMRComponent implements OnInit {
async openNoteDetail(note, sender) { async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present(); // modalPage.present();
console.log("note" + note); console.log('note' + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -715,7 +726,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
console.log("doInfinite action history MR"); console.log('doInfinite action history MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -800,7 +811,7 @@ export class WorklistMainMRComponent implements OnInit {
doInfiniteNotificationBody(infiniteScroll) { doInfiniteNotificationBody(infiniteScroll) {
console.log("doInfiniteNotificationBody MR"); console.log('doInfiniteNotificationBody MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj). this.worklistMainService.getMONotificationBody(this.WorkListActionHistoryObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -835,9 +846,9 @@ export class WorklistMainMRComponent implements OnInit {
loadMoreNotificationBody() { loadMoreNotificationBody() {
console.log("loadMoreNotificationBody MR"); console.log('loadMoreNotificationBody MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log("this.IsReachEnd" + this.IsReachEnd); console.log('this.IsReachEnd' + this.IsReachEnd);
this.worklistMainService.getMONotificationBody(this.WorkListBodyObj). this.worklistMainService.getMONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -855,7 +866,7 @@ export class WorklistMainMRComponent implements OnInit {
this.notificationBodyRes.push(element); this.notificationBodyRes.push(element);
}, (Error) => console.log(Error), () => }, (Error) => console.log(Error), () =>
//infiniteScroll.target.complete() //infiniteScroll.target.complete()
console.log("test") console.log('test')
); );
}// if list length >0 }// if list length >0
else { else {
@ -872,7 +883,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
}//end infiniteScroll }//end infiniteScroll
loadMoreActionHistory() { loadMoreActionHistory() {
console.log("doInfinite action history MR"); console.log('doInfinite action history MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -891,7 +902,7 @@ export class WorklistMainMRComponent implements OnInit {
this.actionHistoryRes.push(element); this.actionHistoryRes.push(element);
}, (Error) => console.log(Error), () => }, (Error) => console.log(Error), () =>
//infiniteScroll.target.complete() //infiniteScroll.target.complete()
console.log("TEST")); console.log('TEST'));
}// if list length >0 }// if list length >0
else { else {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -922,7 +933,7 @@ export class WorklistMainMRComponent implements OnInit {
.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 {
@ -945,7 +956,7 @@ export class WorklistMainMRComponent implements OnInit {
/////////////////////////////////////////// ///////////////////////////////////////////
public checkLines(note) { public checkLines(note) {
console.log(note.split("\n").length); console.log(note.split('\n').length);
console.log(note.length); console.log(note.length);
if (note && note != null) { if (note && note != null) {
@ -970,7 +981,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
this.actionHistoryRes = actionHis; this.actionHistoryRes = actionHis;
console.log("test"); console.log('test');
} }
@ -986,9 +997,9 @@ export class WorklistMainMRComponent implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().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.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
@ -1018,9 +1029,9 @@ export class WorklistMainMRComponent implements OnInit {
.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.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
@ -1035,4 +1046,52 @@ export class WorklistMainMRComponent implements OnInit {
} }
getMOItemHistory(itemID ,orgID) {
console.log(itemID);
this.IsReachEnd = false;
const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID);
request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM = 1;
request.P_ORG_ID= parseInt(orgID);
this.worklistMainService.getMOItemHistory(request).
subscribe((result: MOItemHistoryRes) => {
// this.common.sharedService.setSharedData(
// result.GetItemHistoryList,
// WorklistMainPoComponent.ItemHistoryList
// );
this.common.sharedService.setSharedData(
request,
WorklistMainMRComponent.PASS_MO_REQ
);
//open page
// this.common.openItemHistoryPage();
this.handleItemHistoryResult(result);
});
}
handleItemHistoryResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMoItemHistoryList)) {
this.common.openMOItemHistoryPage();
}
}
else {
this.common.presentAlert(
this.ts.trPK("general", "empty")
);
}
}
} }

@ -15,7 +15,7 @@
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div> <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<!-- add segemnt part --> <!-- add segemnt part -->
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all"> [value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="line_details" <ion-segment-button value="line_details"
@ -796,7 +796,7 @@
<ion-label>Skip</ion-label> <ion-label>Skip</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button (click)="openMoreActions()"> <ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png"> <img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label> <ion-label>More</ion-label>
</ion-tab-button> </ion-tab-button>

@ -115,8 +115,9 @@ export class WorklistMainPoComponent implements OnInit {
approveDis: boolean = false; approveDis: boolean = false;
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
moreDisabled: boolean = true;
direction: string; direction: string;
defaultSegment = '';
constructor( constructor(
public common: CommonService, public common: CommonService,
@ -307,6 +308,13 @@ export class WorklistMainPoComponent implements OnInit {
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} // valid it } // valid it

@ -12,7 +12,7 @@
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div> <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<!-- add segemnt part --> <!-- add segemnt part -->
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all"> [value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="item-req" <ion-segment-button value="item-req"
@ -508,7 +508,7 @@
<ion-label>Skip</ion-label> <ion-label>Skip</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button (click)="openMoreActions()"> <ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png"> <img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label> <ion-label>More</ion-label>
</ion-tab-button> </ion-tab-button>

@ -1,17 +1,17 @@
import { Component, OnInit, ElementRef } from "@angular/core"; import { Component, OnInit, ElementRef } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { WorkListBodyRequest } from "../models/NotificationBodyReq"; import { WorkListBodyRequest } from '../models/NotificationBodyReq';
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; import { EITNotificatonBodyResponse } from '../models/EITNotificationBodyRes';
import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes"; import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes';
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 { 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 { 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';
import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
@ -45,17 +45,17 @@ export class WorklistMainPRComponent implements OnInit {
private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest;
private WorkListAttachObj: WorkListButtonRequest; private WorkListAttachObj: WorkListButtonRequest;
private PRList: PRNotificatonBodyList private PRList: PRNotificatonBodyList
public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; public static PASS_NOTIFICATION_INFO = 'passNotificationInfo';
public static PASS_ACTION_MODE = "passActionMode"; public static PASS_ACTION_MODE = 'passActionMode';
getPassNotificationDetails: any; getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr"; public static PASS_RES_ATTR = 'passResAttr';
TransactionID: number = -999; TransactionID: number = -999;
notificationBodyRes: any; notificationBodyRes: any;
actionHistoryRes: any; actionHistoryRes: any;
notificationButtonRes: any; notificationButtonRes: any;
actionMode: any; actionMode: any;
pInformation: string = ""; pInformation: string = '';
pQuestion: string = ""; pQuestion: string = '';
RespondAttributesListRes: any; RespondAttributesListRes: any;
schemaNotific: any; schemaNotific: any;
NotRespondAttributeList: any; NotRespondAttributeList: any;
@ -66,7 +66,7 @@ export class WorklistMainPRComponent implements OnInit {
dataOfAttr: any; dataOfAttr: any;
P_RESPOND_ATTRIBUTES_TBL: any; P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = '';
notificationArray: any; notificationArray: any;
notificationDynamicAttributeArr: any; notificationDynamicAttributeArr: any;
private textInput: TextInput; private textInput: TextInput;
@ -96,11 +96,13 @@ export class WorklistMainPRComponent implements OnInit {
demoeAttach: any = []; demoeAttach: any = [];
notiActionBtnMore: any = []; notiActionBtnMore: any = [];
messageSuccess: boolean = false; messageSuccess: boolean = false;
activeSegment: any = "item-req"; activeSegment: any = 'item-req';
approveDis: boolean; approveDis: boolean;
rejectDis: boolean; rejectDis: boolean;
requestDis: boolean; requestDis: boolean;
moreDisabled: boolean = true;
direction: string; direction: string;
defaultSegment = '';
constructor( constructor(
@ -137,10 +139,10 @@ export class WorklistMainPRComponent implements OnInit {
intializeNotificationDetail() { intializeNotificationDetail() {
if (this.messageSuccess) { if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById('notificationDynamicFields').innerHTML = '';
} }
console.log("intializeNotificationDetail"); console.log('intializeNotificationDetail');
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
@ -163,9 +165,9 @@ export class WorklistMainPRComponent implements OnInit {
this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = '';
this.WorkListActionObj.P_ACTION_MODE = ""; this.WorkListActionObj.P_ACTION_MODE = '';
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = '';
this.WorkListActionObj.P_APPROVER_INDEX = null; this.WorkListActionObj.P_APPROVER_INDEX = null;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
@ -179,28 +181,28 @@ export class WorklistMainPRComponent implements OnInit {
this.getActionHistory(this.WorkListActionHistoryObj); this.getActionHistory(this.WorkListActionHistoryObj);
this.getAttachmentNotification(this.WorkListAttachObj); this.getAttachmentNotification(this.WorkListAttachObj);
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.getEITNotificationDetails(this.WorkListBodyObj); this.getEITNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.getAbsenceNotificationDetails(this.WorkListBodyObj); this.getAbsenceNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'PO') {
this.getPONotificationDetails(this.WorkListBodyObj); this.getPONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'MO') {
this.getMONotificationDetails(this.WorkListBodyObj); this.getMONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'PR') {
this.getPRNotificationDetails(this.WorkListBodyObj); this.getPRNotificationDetails(this.WorkListBodyObj);
} }
} }
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value); console.log(' event.detail.value: ' + event.detail.value);
} }
getPRNotificationDetails(notificationBodyObj) { getPRNotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.getPRNotificationBody(notificationBodyObj) .getPRNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => { .subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "PR"); this.handleWorkListBodyResult(result, 'PR');
}); });
} }
@ -217,7 +219,7 @@ export class WorklistMainPRComponent implements OnInit {
.getPONotificationBody(notificationBodyObj) .getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => { .subscribe((result: PONotificatonBodyResponse) => {
console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
this.handleWorkListBodyResult(result, "PO"); this.handleWorkListBodyResult(result, 'PO');
}); });
} }
@ -225,7 +227,7 @@ export class WorklistMainPRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getEITNotificationBody(notificationBodyObj) .getEITNotificationBody(notificationBodyObj)
.subscribe((result: EITNotificatonBodyResponse) => { .subscribe((result: EITNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "EIT"); this.handleWorkListBodyResult(result, 'EIT');
}); });
} }
@ -233,7 +235,7 @@ export class WorklistMainPRComponent implements OnInit {
this.worklistMainService this.worklistMainService
.getAbsencesNotificationBody(notificationBodyObj) .getAbsencesNotificationBody(notificationBodyObj)
.subscribe((result: AbsenceNotificatonBodyResponse) => { .subscribe((result: AbsenceNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "ABSENCE"); this.handleWorkListBodyResult(result, 'ABSENCE');
}); });
} }
@ -242,20 +244,20 @@ export class WorklistMainPRComponent implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.pInformation = result.P_INFORMATION; this.pInformation = result.P_INFORMATION;
this.pQuestion = result.P_QUESTION; this.pQuestion = result.P_QUESTION;
if (Type == "EIT") { if (Type == 'EIT') {
if (result.GetEITCollectionNotificationBodyList) { if (result.GetEITCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetEITCollectionNotificationBodyList; result.GetEITCollectionNotificationBodyList;
} }
} else if (Type == "ABSENCE") { } else if (Type == 'ABSENCE') {
console.log("ABSENCE"); console.log('ABSENCE');
if (result.GetAbsenceCollectionNotificationBodyList) { if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
} }
} else if (Type == "PR") { } else if (Type == 'PR') {
if (result.GetPrNotificationBodyList) { if (result.GetPrNotificationBodyList) {
console.log("PR"); console.log('PR');
this.PRHeader = result.GetPrNotificationBodyList.PRHeader; this.PRHeader = result.GetPrNotificationBodyList.PRHeader;
this.PRLines = result.GetPrNotificationBodyList.PRLines; this.PRLines = result.GetPrNotificationBodyList.PRLines;
@ -296,18 +298,24 @@ export class WorklistMainPRComponent implements OnInit {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetNotificationButtonsList != null) { if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList; this.notificationButtonRes = result.GetNotificationButtonsList;
this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); 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++) { for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { if (this.notificationButtonRes[i].BUTTON_ACTION == 'APPROVE') {
this.approveDis = true; this.approveDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { if (this.notificationButtonRes[i].BUTTON_ACTION == 'REJECT') {
this.rejectDis = true; this.rejectDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} }
} // valid it } // valid it
@ -361,7 +369,7 @@ export class WorklistMainPRComponent implements OnInit {
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); console.log('actionButton' + action);
//alert("don't forget"); //alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;
@ -372,13 +380,13 @@ export class WorklistMainPRComponent implements OnInit {
for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) { for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) {
let obj: any = {}; let obj: any = {};
obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME; obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME;
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])) { // else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = 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;
} }
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
@ -386,20 +394,20 @@ export class WorklistMainPRComponent implements OnInit {
let repUserName = this.selEmployeeID; let repUserName = this.selEmployeeID;
if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
let obj: any = {}; let obj: any = {};
repUserName = ""; repUserName = '';
obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME;
obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
if ( if (
ButtonAction == "APPROVE" || ButtonAction == 'APPROVE' ||
ButtonAction == "REJECT" || ButtonAction == 'REJECT' ||
ButtonAction == "DEL" || ButtonAction == 'DEL' ||
ButtonAction == "CLOSE" ButtonAction == 'CLOSE'
) { ) {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = '';
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = '';
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
//sheardData //sheardData
@ -407,18 +415,18 @@ export class WorklistMainPRComponent implements OnInit {
// this.WorkListActionObj, // this.WorkListActionObj,
// WorklistMainPRComponent.PASS_NOTIFICATION_INFO // WorklistMainPRComponent.PASS_NOTIFICATION_INFO
// ); // );
if (ButtonAction == "APPROVE") { if (ButtonAction == 'APPROVE') {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
} }
else if (ButtonAction == "REJECT") { else if (ButtonAction == 'REJECT') {
this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
} }
else if (ButtonAction == "DEL") { else if (ButtonAction == 'DEL') {
this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg')
} }
else if (ButtonAction == "CLOSE") { else if (ButtonAction == 'CLOSE') {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
} }
@ -448,7 +456,7 @@ export class WorklistMainPRComponent implements OnInit {
////////////this.applyAction(this.WorkListActionObj); ////////////this.applyAction(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;
// this.navCtrl.push("WorkListRfcPage", { // this.navCtrl.push("WorkListRfcPage", {
@ -470,14 +478,14 @@ export class WorklistMainPRComponent 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", { // this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion, // pQuestion: this.pQuestion,
// passNotificationInfo: this.getPassNotificationDetails, // passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction, // passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL // 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,
WorklistMainPRComponent.PASS_NOTIFICATION_INFO WorklistMainPRComponent.PASS_NOTIFICATION_INFO
@ -493,12 +501,12 @@ export class WorklistMainPRComponent implements OnInit {
// this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal(); this.openRepRolModal();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == 'DELEGATE' ||
ButtonAction == "REQUEST_INFO" || ButtonAction == 'REQUEST_INFO' ||
ButtonAction == "TRANSFER" || ButtonAction == 'TRANSFER' ||
ButtonAction == "TRANSFER_INFO" || ButtonAction == 'TRANSFER_INFO' ||
ButtonAction == "APPROVE_AND_FORWARD" || ButtonAction == 'APPROVE_AND_FORWARD' ||
ButtonAction == "FORWARD" ButtonAction == 'FORWARD'
) { ) {
@ -524,10 +532,10 @@ export class WorklistMainPRComponent implements OnInit {
// this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal(); this.openRepRolModal();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == 'UPDATE_ACTION' ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == 'CONTINUE_ACTION'
) { ) {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA EITNotificatonBodyResponse.SHARED_DATA
@ -537,7 +545,7 @@ export class WorklistMainPRComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("EitUpdateListPage"); // this.navCtrl.push("EitUpdateListPage");
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA AbsenceNotificatonBodyResponse.SHARED_DATA
@ -555,15 +563,15 @@ export class WorklistMainPRComponent implements OnInit {
} }
else if (this.notificationButtonRes.length > 0 && !ButtonAction) { else if (this.notificationButtonRes.length > 0 && !ButtonAction) {
(this.elementRef.nativeElement.querySelectorAll( (this.elementRef.nativeElement.querySelectorAll(
"ion-item" 'ion-item'
) as HTMLElement[]).forEach(x => { ) as HTMLElement[]).forEach(x => {
if (x.classList.contains("requiredItem")) { if (x.classList.contains('requiredItem')) {
x.classList.add("ng-touched"); x.classList.add('ng-touched');
x.classList.remove("ng-untouched"); x.classList.remove('ng-untouched');
} }
}); });
this.common.presentAlert( this.common.presentAlert(
this.ts.trPK("worklistMain", "actionRequird") this.ts.trPK('worklistMain', 'actionRequird')
); );
} }
} }
@ -606,7 +614,7 @@ export class WorklistMainPRComponent implements OnInit {
this.NotRespondAttributeList = this.NotRespondAttributeList =
result.NotificationGetRespondAttributesList; result.NotificationGetRespondAttributesList;
if ( if (
result.NotificationRespondRolesList != "" && result.NotificationRespondRolesList != '' &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null && result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined
) { ) {
@ -629,20 +637,20 @@ export class WorklistMainPRComponent implements OnInit {
notificationDynamicFields(notificationAttr) { notificationDynamicFields(notificationAttr) {
const containerId = 'notificationDynamicFields'; const containerId = 'notificationDynamicFields';
for (let i = 0; i < notificationAttr.length; i++) { for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") { if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', '');
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'DATE') {
} else if (notificationAttr[i].ATTRIBUTE_TYPE == "NUMBER") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'NUMBER') {
} }
} }
} }
openNotificationBody() { openNotificationBody() {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == 'EIT') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA EITNotificatonBodyResponse.SHARED_DATA
@ -652,9 +660,9 @@ export class WorklistMainPRComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" });
this.common.sharedService.setSharedData("EIT", "NotBodyType"); this.common.sharedService.setSharedData('EIT', 'NotBodyType');
this.common.openNotificationDetailsPage(); this.common.openNotificationDetailsPage();
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == 'ABSENCE') {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA AbsenceNotificatonBodyResponse.SHARED_DATA
@ -663,7 +671,7 @@ export class WorklistMainPRComponent implements OnInit {
this.getPassNotificationDetails, this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST AbsenceNotificatonBodyResponse.NOT_WORKLIST
); );
this.common.sharedService.setSharedData("ABSENCE", "NotBodyType"); this.common.sharedService.setSharedData('ABSENCE', 'NotBodyType');
//this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" }); //this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
this.common.openNotificationDetailsPage(); this.common.openNotificationDetailsPage();
} }
@ -678,7 +686,7 @@ export class WorklistMainPRComponent implements OnInit {
if (this.notificationCount <= 0) { if (this.notificationCount <= 0) {
this.notificationCount = null; this.notificationCount = null;
} }
this.events.publish("getNotCount", this.notificationCount); this.events.publish('getNotCount', this.notificationCount);
} }
}); });
} }
@ -735,7 +743,7 @@ export class WorklistMainPRComponent implements OnInit {
async openNoteDetail(note, sender) { async openNoteDetail(note, sender) {
// let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
// modalPage.present(); // modalPage.present();
console.log("note" + note); console.log('note' + note);
this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
@ -832,9 +840,9 @@ export class WorklistMainPRComponent implements OnInit {
loadMoreNotificationBody() { loadMoreNotificationBody() {
console.log("loadMoreNotificationBody PR"); console.log('loadMoreNotificationBody PR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log("this.IsReachEnd" + this.IsReachEnd); console.log('this.IsReachEnd' + this.IsReachEnd);
this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj). this.worklistMainService.getPRNotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -852,7 +860,7 @@ export class WorklistMainPRComponent implements OnInit {
this.notificationBodyRes.push(element); this.notificationBodyRes.push(element);
}, (Error) => console.log(Error), () => }, (Error) => console.log(Error), () =>
//infiniteScroll.target.complete() //infiniteScroll.target.complete()
console.log("test") console.log('test')
); );
}// if list length >0 }// if list length >0
else { else {
@ -869,7 +877,7 @@ export class WorklistMainPRComponent implements OnInit {
} }
}//end infiniteScroll }//end infiniteScroll
loadMoreActionHistory() { loadMoreActionHistory() {
console.log("doInfinite action history MR"); console.log('doInfinite action history MR');
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj). this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
@ -887,7 +895,7 @@ export class WorklistMainPRComponent implements OnInit {
this.actionHistoryRes.push(element); this.actionHistoryRes.push(element);
}, (Error) => console.log(Error), () => }, (Error) => console.log(Error), () =>
//infiniteScroll.target.complete() //infiniteScroll.target.complete()
console.log("TEST")); console.log('TEST'));
}// if list length >0 }// if list length >0
else { else {
this.IsReachEnd = true; this.IsReachEnd = true;
@ -905,7 +913,7 @@ export class WorklistMainPRComponent implements OnInit {
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
public checkLines(note) { public checkLines(note) {
console.log(note.split("\n").length); console.log(note.split('\n').length);
console.log(note.length); console.log(note.length);
if (note && note != null) { if (note && note != null) {
@ -935,7 +943,7 @@ export class WorklistMainPRComponent implements OnInit {
// return obj; // return obj;
// }) // })
this.actionHistoryRes = actionHis; this.actionHistoryRes = actionHis;
console.log("test"); console.log('test');
} }
@ -955,7 +963,7 @@ export class WorklistMainPRComponent implements OnInit {
.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 {
@ -989,9 +997,9 @@ export class WorklistMainPRComponent implements OnInit {
.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.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
@ -1020,7 +1028,7 @@ export class WorklistMainPRComponent implements OnInit {
.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 {

@ -10,7 +10,7 @@
<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 [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)" <ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all"> [value]="defaultSegment" class="ion-segment-all">
@ -68,7 +68,7 @@
<div style="margin: 10px; " *ngIf="subordinatesleaveList != undefined">Employee will also on leave </div> <div style="margin: 10px; " *ngIf="subordinatesleaveList != undefined">Employee will also on leave </div>
<ion-item class="subOrdinateList" *ngFor="let List of subordinatesleaveList;"> <ion-item lines="none" class="subOrdinateList" *ngFor="let List of subordinatesleaveList;">

@ -185,6 +185,7 @@
--background: transparent; --background: transparent;
margin-left: -15px; margin-left: -15px;
margin-right: 6px; margin-right: 6px;
margin-bottom:8px;
} }
.status{ .status{
text-align: center; text-align: center;

@ -94,7 +94,9 @@ export class WorklistMainComponent implements OnInit {
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
moreDisabled: boolean = true; moreDisabled: boolean = true;
dirfromNotificationPage: boolean = false;
direction: string; direction: string;
defaultSegment = '';
constructor( constructor(
public worklistService: WorklistService, public worklistService: WorklistService,
@ -312,7 +314,7 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else ( else if(
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO") this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{ {
this.moreDisabled = false; this.moreDisabled = false;
@ -545,6 +547,7 @@ export class WorklistMainComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("EitUpdateListPage"); // this.navCtrl.push("EitUpdateListPage");
this.common.eitUpdate();// must be test
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
@ -558,7 +561,18 @@ export class WorklistMainComponent implements OnInit {
// dirfromNotificationPage: true, // dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// }); // });
this.common.openConfirmAbsece(); //this.common.openConfirmAbsece();
this.dirfromNotificationPage=true,
this.common.sharedService.setSharedData(
this.dirfromNotificationPage,
"dirfromNotificationPage"
);
this.common.sharedService.setSharedData(
this.notificationBodyRes[0].Collection_Notification,
"submitAbsObjList"
);
this.common.openSubmitAbsencePage();
} }
} }
else if (this.notificationButtonRes.length > 0 && !ButtonAction) { else if (this.notificationButtonRes.length > 0 && !ButtonAction) {

@ -76,7 +76,7 @@
</div> </div>
<ion-slides [options]="slideOptsOne" #slideWithNav (ionSlideDidChange)="SlideDidChange(sliderOne,slideWithNav)"> <ion-slides [options]="slideOptsOne" #slideWithNav>
<ion-slide > <ion-slide >
<ion-grid class="headerGrid"> <ion-grid class="headerGrid">

@ -8,7 +8,7 @@
<div> <div>
<div class="centerDiv homeBox" (click)="openPersonalInfo()"> <div class="centerDiv homeBox">
<!-- <div class="profileDiv"> --> <!-- <div class="profileDiv"> -->
<img class="profileImg" [src]="user_image"> <img class="profileImg" [src]="user_image">
</div> </div>

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Platform, Events, MenuController } from "@ionic/angular"; import { Platform, Events, MenuController } from '@ionic/angular';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response'; import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
@ -19,13 +19,13 @@ import { DomSanitizer } from '@angular/platform-browser';
export class EditProfileComponent implements OnInit { export class EditProfileComponent implements OnInit {
User_name_Emp: string = ""; User_name_Emp: string = '';
User_Job_name: string; User_Job_name: string;
public direction: string; public direction: string;
private menu: MenuController; private menu: MenuController;
setImage:any; setImage:any;
// imageSrc: any = "../assets/imgs/profile.png"; // imageSrc: any = "../assets/imgs/profile.png";
user_image: any = "../assets/imgs/profile.png"; user_image: any = '../assets/imgs/profile.png';
personalInfo: any; personalInfo: any;
appraisalArr :any =[]; appraisalArr :any =[];
public performanceData: any=[]; public performanceData: any=[];
@ -45,9 +45,9 @@ export class EditProfileComponent implements OnInit {
) )
{ {
this.direction = TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentDirection();
this.events.subscribe("img-change", displayImg => { this.events.subscribe('img-change', displayImg => {
console.log("app compont: "+displayImg); console.log('app compont: '+displayImg);
this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,'+displayImg);
}); });
@ -59,7 +59,7 @@ export class EditProfileComponent implements OnInit {
} }
getProfile() { getProfile() {
console.log("getProfile"); console.log('getProfile');
this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
@ -68,16 +68,16 @@ export class EditProfileComponent implements OnInit {
this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME; this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME;
this.User_Job_name=this.personalInfo.JOB_NAME; this.User_Job_name=this.personalInfo.JOB_NAME;
if(this.cs.getUpdateImage().status){ if(this.cs.getUpdateImage().status){
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img); this.user_image =this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,'+this.cs.getUpdateImage().img);
}else{ }else{
this.user_image = user.EMPLOYEE_IMAGE this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png"; : '../assets/imgs/profile.png';
} }
console.log("name: "+ this.personalInfo.EMPLOYEE_NAME); console.log('name: '+ this.personalInfo.EMPLOYEE_NAME);
console.log("user name: "+ user.EMPLOYEE_NAME); console.log('user name: '+ user.EMPLOYEE_NAME);
console.log("name: "+ this.personalInfo.JOB_NAME); console.log('name: '+ this.personalInfo.JOB_NAME);
console.log("job name: "+ user.JOB_NAME); console.log('job name: '+ user.JOB_NAME);
}}); }});
@ -110,7 +110,7 @@ private handlePerformanceAppraisalResult(result){
for(let i=0;i<this.appraisalArr.length;i++){ for(let i=0;i<this.appraisalArr.length;i++){
this.performanceData.push({name:this.appraisalArr[i].APPRAISAL_YEAR,value :parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed()}); this.performanceData.push({name:this.appraisalArr[i].APPRAISAL_YEAR,value :parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed()});
} }
console.log("PerformanceAppraisalResponse"); console.log('PerformanceAppraisalResponse');
this.sharedData.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA); this.sharedData.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA);
//localStorage.setItem("performanceData", this.performanceData) //localStorage.setItem("performanceData", this.performanceData)
this.cs.openPerformanceevaluation(); this.cs.openPerformanceevaluation();

@ -28,7 +28,7 @@
<!-- <div class="centerDiv profileDiv"> --> <!-- <div class="centerDiv profileDiv"> -->
<div class="centerDiv homeBox"> <div class="centerDiv homeBox">
<div class="centerDiv homeBox" (click)="openPersonalInfo()"> <div class="centerDiv homeBox">
<!-- <div class="profileDiv"> --> <!-- <div class="profileDiv"> -->
<img class="profileImg" [src]="imageSrc"> <img class="profileImg" [src]="imageSrc">
</div> </div>

@ -1,19 +1,19 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
import { Events } from "@ionic/angular"; import { Events } from '@ionic/angular';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
@Component({ @Component({
selector: "app-home", selector: 'app-home',
templateUrl: "./home.component.html", templateUrl: './home.component.html',
styleUrls: ["./home.component.scss"] styleUrls: ['./home.component.scss']
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
personalInfo: any; personalInfo: any;
setImage:any; setImage:any;
imageSrc: any = "../assets/imgs/profile.png"; imageSrc: any = '../assets/imgs/profile.png';
public direction: string; public direction: string;
// user_image: any = "../assets/imgs/profile.png"; // user_image: any = "../assets/imgs/profile.png";
constructor( constructor(
@ -26,11 +26,11 @@ export class HomeComponent implements OnInit {
) { ) {
this.direction = TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentDirection();
this.events.subscribe("img-change", displayImg => { this.events.subscribe('img-change', displayImg => {
// alert("1 - profile home : "+displayImg); // alert("1 - profile home : "+displayImg);
//this.user_image = "data:image/png;base64"+displayImg; //this.user_image = "data:image/png;base64"+displayImg;
this.setImage = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); this.setImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,'+displayImg);
this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); this.imageSrc = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,'+displayImg);
}); });
@ -41,33 +41,33 @@ export class HomeComponent implements OnInit {
this.getProfile(); this.getProfile();
} }
getProfile() { getProfile() {
console.log("getProfile"); console.log('getProfile');
this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.personalInfo = user; this.personalInfo = user;
console.log("name: "+ this.personalInfo.EMPLOYEE_NAME); console.log('name: '+ this.personalInfo.EMPLOYEE_NAME);
console.log("user name: "+ user.EMPLOYEE_NAME); console.log('user name: '+ user.EMPLOYEE_NAME);
if(this.cs.getUpdateImage().status){ if(this.cs.getUpdateImage().status){
// this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img); // this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img);
this.imageSrc =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img); this.imageSrc =this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,'+this.cs.getUpdateImage().img);
}else{ }else{
this.imageSrc = user.EMPLOYEE_IMAGE this.imageSrc = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.imageSrc; : this.imageSrc;
console.log("2-"+user); console.log('2-'+user);
} }
} }
else { else {
console.log("3-"+user); console.log('3-'+user);
} }
}); });
} }
private ChangeImage() { public ChangeImage() {
this.cs.openChangeImagePage(); this.cs.openChangeImagePage();
} }
} }

@ -32,7 +32,7 @@
<!-- [showText]="showText" --> <!-- [showText]="showText" -->
<ngx-charts-gauge [view]="view" [scheme]="colorScheme" [results]="performanceData" [min]="0" [max]="100" <ngx-charts-gauge [view]="view" [scheme]="colorScheme" [results]="performanceData" [min]="0" [max]="100"
[angleSpan]="240" [startAngle]="-120" [bigSegments]="5" [angleSpan]="240" [startAngle]="-120" [bigSegments]="5"
[smallSegments]="10" (select)="onSelect($event)"> [smallSegments]="10">
</ngx-charts-gauge> </ngx-charts-gauge>

@ -1,13 +1,13 @@
import { Component, OnInit, NgModule } from '@angular/core'; import { Component, OnInit, NgModule } from '@angular/core';
import { Platform, Events, MenuController } from "@ionic/angular"; import { Platform, Events, MenuController } from '@ionic/angular';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response'; import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response';
// import { DomSanitizer } from '@angular/platform-browser'; // import { DomSanitizer } from '@angular/platform-browser';
// import {NgxGaugeModule} from 'ngx-gauge'; // import {NgxGaugeModule} from 'ngx-gauge';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
@ -18,7 +18,7 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
}) })
export class PerformanceEvaluationComponent implements OnInit { export class PerformanceEvaluationComponent implements OnInit {
personalInfo: any; personalInfo: any;
user_image: any = "../assets/imgs/profile.png"; user_image: any = '../assets/imgs/profile.png';
setImage: any; setImage: any;
view: any = [380, 450]; view: any = [380, 450];
public performanceData: any = []; public performanceData: any = [];
@ -64,7 +64,7 @@ export class PerformanceEvaluationComponent implements OnInit {
for (let i = 0; i < this.performanceData.length; i++) { for (let i = 0; i < this.performanceData.length; i++) {
this.performanceData[i].color = this.colorScheme.domain[i]; this.performanceData[i].color = this.colorScheme.domain[i];
console.log(i + " : " + this.performanceData[i].name) console.log(i + ' : ' + this.performanceData[i].name)
} }
console.log(this.performanceData[0].color) console.log(this.performanceData[0].color)
@ -72,19 +72,19 @@ export class PerformanceEvaluationComponent implements OnInit {
} }
ngAfterViewInit() { ngAfterViewInit() {
document.querySelector("svg .gauge.chart > text").remove(); document.querySelector('svg .gauge.chart > text').remove();
} }
getProfile() { getProfile() {
console.log("getProfile"); console.log('getProfile');
this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.personalInfo = user; this.personalInfo = user;
this.user_image = user.EMPLOYEE_IMAGE this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png"; : '../assets/imgs/profile.png';
} }

@ -75,7 +75,7 @@ public setImage:any;
handleUpdateImageProfileResult(result) { handleUpdateImageProfileResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.common.setUpdateImage(this.displayImg); this.common.setUpdateImage(this.displayImg,true);
this.event.publish('img-change', this.displayImg); this.event.publish('img-change', this.displayImg);
let msg: string = this.ts.trPK("userProfile", "successChange"); let msg: string = this.ts.trPK("userProfile", "successChange");
this.common.presentAlert(msg); this.common.presentAlert(msg);

@ -13,6 +13,7 @@ export class SelectPeriodComponent implements OnInit {
public dateFrom: any; public dateFrom: any;
public dateTo: any; public dateTo: any;
public selectedShiftType: any; public selectedShiftType: any;
public Select = '';
public filtersArray: any = [ public filtersArray: any = [
{ {

@ -45,31 +45,51 @@ export class TimeCardService {
public getTimeCardSummary( public getTimeCardSummary(
timeCardSummaryReq, timeCardSummaryReq,
onError?: any, onError?: any,
errorLabel?: string errorLabel?: string,
isPostNoLoad = false
): Observable<GetTimeCardSummaryResponse> { ): Observable<GetTimeCardSummaryResponse> {
const request = timeCardSummaryReq; const request = timeCardSummaryReq;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(
TimeCardService.getTimeCardSummaryUrl,
request,
onError,
errorLabel
);
} else {
return this.con.post( return this.con.post(
TimeCardService.getTimeCardSummaryUrl, TimeCardService.getTimeCardSummaryUrl,
request, request,
onError, onError,
errorLabel errorLabel
); );
}
} }
public getDayHoursTypeDetails( public getDayHoursTypeDetails(
dayHoursDetailsReq, dayHoursDetailsReq,
onError?: any, onError?: any,
errorLabel?: string errorLabel?: string,
isPostNoLoad = false
): Observable<GetDayAndHoursDetailsResponse> { ): Observable<GetDayAndHoursDetailsResponse> {
const request = dayHoursDetailsReq; const request = dayHoursDetailsReq;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post( if (isPostNoLoad) {
TimeCardService.getDayHourDetailsUrl, return this.con.postNoLoad(
request, TimeCardService.getDayHourDetailsUrl,
onError, request,
errorLabel onError,
); errorLabel
);
} else {
return this.con.post(
TimeCardService.getDayHourDetailsUrl,
request,
onError,
errorLabel
);
}
} }
public getShiftDetail( public getShiftDetail(

@ -3,7 +3,6 @@ import { TimeCardService } from 'src/app/time-card/service/time-card.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { ModalController, IonSlides } from '@ionic/angular'; import { ModalController, IonSlides } from '@ionic/angular';
import { SelectPeriodComponent } from '../select-period/select-period.component';
import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request'; import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request';
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request'; import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
@ -66,7 +65,7 @@ export class TimeCardDetailsComponent implements OnInit {
public currentYear = new Date().getFullYear(); public currentYear = new Date().getFullYear();
public dayHoursTypeDetailsList = []; public dayHoursTypeDetailsList = [];
public currentDate = new Date(); public currentDate = new Date();
public isPostNoLoad = true;
public options = { public options = {
cutoutPercentage: 80, cutoutPercentage: 80,
tooltips: { enabled: false }, tooltips: { enabled: false },
@ -75,6 +74,7 @@ export class TimeCardDetailsComponent implements OnInit {
public data = {}; public data = {};
ngOnInit() { ngOnInit() {
this.common.startLoading();
this.showData = false; this.showData = false;
this.nextMonth = new Date().getMonth() + 2; this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth(); this.preMonth = new Date().getMonth();
@ -106,7 +106,7 @@ export class TimeCardDetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber; dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100; dayAndHoursReqObj.P_PAGE_LIMIT = 100;
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => { this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log(result.GetDayHoursTypeDetailsList); console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
@ -168,17 +168,11 @@ export class TimeCardDetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName; timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate; timeCardSummaryReqObj.SearchYear = this.yearDate;
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => { this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0]; this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS; this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS; this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
// if (this.absentDays === 0 && this.attendedDays === 0) {
// this.futrueDays = this.totalAttendancePrecentage;
// }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays; this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) { if (this.totalAttendancePrecentage > 0) {
this.data = { this.data = {
@ -198,6 +192,7 @@ export class TimeCardDetailsComponent implements OnInit {
} }
nextSlide() { nextSlide() {
this.common.startLoading();
if (this.currentMonthName !== this.month) { if (this.currentMonthName !== this.month) {
this.showData = false; this.showData = false;
if (this.nextMonth > 12) { if (this.nextMonth > 12) {
@ -212,6 +207,7 @@ export class TimeCardDetailsComponent implements OnInit {
} }
previousSlide() { previousSlide() {
this.common.startLoading();
this.showData = false; this.showData = false;
if (this.preMonth === 0) { if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1; this.currentYear = this.currentYear - 1;

@ -27,6 +27,8 @@ export class HomeComponent implements OnInit {
RespondAttributeList: any; RespondAttributeList: any;
add:any='add'; add:any='add';
button: ButtonInput; button: ButtonInput;
direction = '';
notBadge = '';
// dateTime: DateTimeInput; // dateTime: DateTimeInput;
// date: DateInput; // date: DateInput;
// numberInput: NumberInput; // numberInput: NumberInput;

@ -16,7 +16,7 @@
<ion-item> <ion-item>
<ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label> <ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}' <ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchKeySelect"> [(ngModel)]="searchKeySelect" (ionChange)="onChangeSelect($event)">
<ion-select-option value="1" selected="true">{{'vacation-rule, search-by-name' | translate}}</ion-select-option> <ion-select-option value="1" selected="true">{{'vacation-rule, search-by-name' | translate}}</ion-select-option>
<ion-select-option value="2">{{'vacation-rule, search-by-username' | translate}}</ion-select-option> <ion-select-option value="2">{{'vacation-rule, search-by-username' | translate}}</ion-select-option>
<ion-select-option value="3">{{'vacation-rule, search-by-email' | translate}}</ion-select-option> <ion-select-option value="3">{{'vacation-rule, search-by-email' | translate}}</ion-select-option>
@ -24,10 +24,10 @@
</ion-item> </ion-item>
<ion-item lines="none"> <ion-item lines="none">
<ion-button class="filterBtn" button-type="clear" button-type="clear" (click)="SearchReplacementList()"> <ion-button [ngClass]="(!searchKeyEnter || !isSelect) ? 'disabledButton' : '' " [disabled]="(!searchKeyEnter || !isSelect) " class="filterBtn" button-type="clear" button-type="clear" (click)="SearchReplacementList()">
<ion-icon slot="icon-only" color="white" name="search"></ion-icon> <ion-icon slot="icon-only" color="white" name="search"></ion-icon>
</ion-button> </ion-button>
<ion-input class="filterInput" [(ngModel)]="searchKey" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input> <ion-input (ionChange)="onChangeInput()" class="filterInput" [(ngModel)]="searchKey" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input>
</ion-item> </ion-item>
@ -53,7 +53,7 @@
</ion-radio-group> </ion-radio-group>
</ion-list> --> </ion-list> -->
<ion-item> <ion-item lines="none">
<div *ngIf="ReplacementList" class="square-container"> <div *ngIf="ReplacementList" class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square"> <div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv"> <div class="profileImageDiv">

@ -164,4 +164,7 @@ button.item-button.button.button-md.button-clear.button-clear-md {
border: #dedede solid 1px; border: #dedede solid 1px;
} }
.disabledButton{
opacity:.5;
}

@ -29,12 +29,20 @@ export class ReplacementListComponent implements OnInit {
isAbs: boolean = false; isAbs: boolean = false;
isSave: boolean = false; isSave: boolean = false;
active: any; active: any;
isSelect: boolean =false;
searchKeyEnter: boolean = false;
request: ReplacementServiceRequest;
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public modalController: ModalController) { } constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public modalController: ModalController) { }
ngOnInit() { } ngOnInit() {
this.request = new ReplacementServiceRequest();
}
SearchReplacementList() { SearchReplacementList() {
console.log("this.searchKeySelect" + this.searchKeySelect);
this.ReplacementList = []; this.ReplacementList = [];
this.IsReachEnd = false; this.IsReachEnd = false;
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
@ -73,15 +81,15 @@ export class ReplacementListComponent implements OnInit {
this.P_SEARCH_EMAIL_ADDRESS = ""; this.P_SEARCH_EMAIL_ADDRESS = "";
} }
const request = new ReplacementServiceRequest(); // const request = new ReplacementServiceRequest();
request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME; this.request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME;
request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; this.request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME;
request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS; this.request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS;
request.P_PAGE_NUM = this.P_PAGE_NUM; this.request.P_PAGE_NUM = this.P_PAGE_NUM;
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; this.request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
this.vacationRuleService.getReplacementList(request). this.vacationRuleService.getReplacementList(this.request).
subscribe((result: any) => { subscribe((result: any) => {
this.handleReplacment(result); this.handleReplacment(result);
}); });
@ -161,13 +169,14 @@ export class ReplacementListComponent implements OnInit {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
const request = new ReplacementServiceRequest(); ///const request = new ReplacementServiceRequest();
request.P_PAGE_NUM = this.P_PAGE_NUM; console.log(this.request.P_SEARCH_USER_NAME + "-" + this.request.P_SEARCH_EMAIL_ADDRESS + "-" + this.request.P_SEARCH_EMPLOYEE_DISPLAY_NAME )
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.request.P_PAGE_NUM = this.P_PAGE_NUM;
this.request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
// request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp; // request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp;
this.vacationRuleService.getReplacementList(request). this.vacationRuleService.getReplacementList(this.request).
subscribe((result: any) => { subscribe((result: any) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.ReplacementList)) { if (this.cs.hasData(result.ReplacementList)) {
@ -198,4 +207,27 @@ export class ReplacementListComponent implements OnInit {
infiniteScroll.target.complete(); infiniteScroll.target.complete();
} }
} }
onChangeSelect(select){
console.log(select.detail.value);
let selectValue= select.detail.value;
if(selectValue == "1" || selectValue == "2" ||selectValue == "3"){
this.isSelect=true;
}
else{
this.isSelect=false;
}
}
onChangeInput(){
if (this.searchKey.length >0) {
this.searchKeyEnter=true;
}else{
this.searchKeyEnter=false;
}
}
} }

@ -868,6 +868,10 @@
} }
}, },
"home": { "home": {
"position-error": {
"en": "Error getting your location. Please try again!",
"ar": "Error getting your location. Please try again!"
},
"dashboard": { "dashboard": {
"en": "My Dashboard", "en": "My Dashboard",
"ar": "الرئيسية" "ar": "الرئيسية"
@ -2283,6 +2287,10 @@
"line_details":{ "line_details":{
"en": "Line Details", "en": "Line Details",
"ar":"Line Details" "ar":"Line Details"
},
"request_number":{
"en": "Request Number",
"ar":"Request Number"
} }
}, },
@ -2459,8 +2467,8 @@
"ar":" check out" "ar":" check out"
}, },
"confirm-alert3":{ "confirm-alert3":{
"en":"You did't complate today shift", "en":"You didn't complete today shift",
"ar":"You did't complate today shift" "ar":"You didn't complete today shift"
}, },
"shift-time":{ "shift-time":{
"en":"Shift Time", "en":"Shift Time",

@ -1368,7 +1368,7 @@ border:0px
} }
.calendar-modal { .calendar-modal {
--height: 13.5cm !important; --height: 14.5cm !important;
--width: 88% !important; --width: 88% !important;
--border-radius: 0.4cm; --border-radius: 0.4cm;
} }
@ -1506,3 +1506,11 @@ table.monthview-datetable th small {
// --border-radius: 0.4cm; // --border-radius: 0.4cm;
// } // }
.calendar-modal .swiper-container-horizontal > .swiper-pagination-bullets{
top: auto;
bottom: -8px;
.swiper-pagination-bullet-active {
background: #094875;
}
}

@ -33,6 +33,7 @@
} }
.itemReqDiv{ .itemReqDiv{
padding:10px; padding:10px;
width: 100%;
// padding-bottom: 10px; // padding-bottom: 10px;
// padding-top: 10px; // padding-top: 10px;
} }
@ -231,7 +232,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
.timeline .timeline-item { .timeline .timeline-item {
width: 40px; // width: 40px;
} }
@ -547,9 +548,9 @@ left: 66px;
height:70px height:70px
} }
.empImge{ .empImge{
border-radius: 50%; border-radius: 50% !important;
width:100%; width: 60px !important;
height: 100%; height: 60px !important;
border: #dedede solid 1px; border: #dedede solid 1px;
} }

Loading…
Cancel
Save