Merge branch 'master-newdesign' into home

MOHEMM-Q3-DEV-LATEST
Mohamed Mekawy 6 years ago
commit 08c8ea71b1

1705
Mohem/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -38,7 +38,7 @@
"@ionic-native/file": "^5.18.0", "@ionic-native/file": "^5.18.0",
"@ionic-native/file-path": "^5.18.0", "@ionic-native/file-path": "^5.18.0",
"@ionic-native/fingerprint-aio": "^5.18.0", "@ionic-native/fingerprint-aio": "^5.18.0",
"@ionic-native/firebase-x": "^5.19.1", "@ionic-native/firebase-x": "^5.21.5",
"@ionic-native/geolocation": "^5.10.0", "@ionic-native/geolocation": "^5.10.0",
"@ionic-native/globalization": "^5.18.0", "@ionic-native/globalization": "^5.18.0",
"@ionic-native/health": "^5.4.0", "@ionic-native/health": "^5.4.0",
@ -52,7 +52,6 @@
"@ionic-native/sqlite": "^5.18.0", "@ionic-native/sqlite": "^5.18.0",
"@ionic-native/status-bar": "^5.0.0", "@ionic-native/status-bar": "^5.0.0",
"@ionic-native/themeable-browser": "^5.18.0", "@ionic-native/themeable-browser": "^5.18.0",
"@ionic-native/vibration": "^5.19.1",
"@ionic-native/zbar": "^5.10.0", "@ionic-native/zbar": "^5.10.0",
"@ionic/angular": "^4.1.0", "@ionic/angular": "^4.1.0",
"@ng-bootstrap/ng-bootstrap": "^4.2.2", "@ng-bootstrap/ng-bootstrap": "^4.2.2",
@ -84,7 +83,7 @@
"cordova-plugin-file": "^6.0.2", "cordova-plugin-file": "^6.0.2",
"cordova-plugin-filepath": "^1.5.6", "cordova-plugin-filepath": "^1.5.6",
"cordova-plugin-fingerprint-aio": "^3.0.0", "cordova-plugin-fingerprint-aio": "^3.0.0",
"cordova-plugin-firebasex": "^7.0.1", "cordova-plugin-firebasex": "^7.0.2",
"cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-globalization": "^1.11.0", "cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-inappbrowser": "^3.1.0", "cordova-plugin-inappbrowser": "^3.1.0",
@ -96,7 +95,6 @@
"cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-themeablebrowser": "^0.2.18", "cordova-plugin-themeablebrowser": "^0.2.18",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-whitelist": "^1.3.4", "cordova-plugin-whitelist": "^1.3.4",
"cordova-sqlite-storage": "^3.4.0", "cordova-sqlite-storage": "^3.4.0",
"cordova-support-google-services": "^1.3.2", "cordova-support-google-services": "^1.3.2",
@ -195,8 +193,7 @@
"cordova-plugin-fingerprint-aio": { "cordova-plugin-fingerprint-aio": {
"FACEID_USAGE_DESCRIPTION": "User Authentication" "FACEID_USAGE_DESCRIPTION": "User Authentication"
}, },
"cordova-plugin-firebasex": {}, "cordova-plugin-firebasex": {}
"cordova-plugin-vibration": {}
}, },
"platforms": [ "platforms": [
"browser", "browser",
@ -204,4 +201,4 @@
"android" "android"
] ]
} }
} }

@ -1,4 +1,4 @@
<ion-header > <!-- <ion-header >
<ion-toolbar class="header-toolbar-new"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title> <ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
@ -10,9 +10,135 @@
</button> </button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header> -->
<ion-content class="colorBG">
<div class="header-div">
<!-- <ion-buttons slot="end">
<button class="headerBtn" (click)="AccrualBalances()">
<img class="headerImg" src="../assets/imgs/accubalance.png">
</button>
</ion-buttons> -->
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<p class="Title">{{ts.trPK('absenceList','absenceList')}}</p>
</div>
<div class="">
<div >
<ion-grid class="headerGrid">
<div style="color: black;">
<div class="result-graph">
<div>
<!-- <ion-item> -->
<!-- <ion-label class="datelabel">{{request.P_EFFECTIVE_DATE}}</ion-label> -->
<ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY" placeholder="DD MMMM YYYY"
(ionChange)="getAccrualBalance()"></ion-datetime>
<ion-icon class="iconCalendar" ios="ios-calendar" md="md-calendar"></ion-icon>
<!-- </ion-item> -->
</div>
<div style=" border-bottom: 1px solid #a7a4a4; margin-bottom: 12px;
margin-top: -10px; margin-right: -9px;"></div>
<div class="result-text-container">
<!-- <h2>10</h2> -->
<h2>{{accrualNet + accrualUsed + accrualYearly}}</h2>
<span>{{ts.trPK('absenceList','totalNumber')}}</span>
</div>
<p-chart #chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<div style="position: relative;
left: 82%;
bottom: 128px;
color: black;
background-color: #DDB017;
width: 13%;
height: 6px;">
<ion-col>
<ion-row>
<label class="green-label">{{ts.trPK('absenceList','accrualNet')}}</label>
</ion-row>
<ion-row>
<label class="green-amount">{{accrualNet}}</label>
</ion-row>
</ion-col>
</div>
<div style="position: relative;
left: 59%;
bottom: 131px;
color: black;
background-color: #094875;
width: 13%;
height: 6px;">
<ion-col>
<ion-row>
<label class="blue-label">{{ts.trPK('absenceList','accrualUsed')}}</label>
</ion-row>
<ion-row>
<label class="blue-amount" for="">{{accrualUsed}}</label>
</ion-row>
</ion-col>
</div>
<div style="position: relative;
left: 82%;
bottom: 80px;
color: black;
background-color: #CB3232;
width: 13%;
height: 6px;">
<ion-col>
<ion-row>
<label class="blue-label">{{ts.trPK('absenceList','accrualYearly')}}</label>
</ion-row>
<ion-row>
<label class="blue-amount" for="">{{accrualYearly}}</label>
</ion-row>
</ion-col>
</div>
<!-- <div style="position: relative;
left: 59%;
bottom: 73px;
color: black;
background-color: #094875;
width: 16%;
height: 6px;">
<ion-col>
<ion-row>
<label class="blue-label">text</label>
</ion-row>
<ion-row> -->
<!-- <label class="blue-amount" for="">{{getleaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT}}</label> -->
<!-- </ion-row>
</ion-col>
</div> -->
</div>
</ion-grid>
</div>
</div>
<!-- /////////////////////////////////////////////////////////up -->
<ion-content padding> <ion-content padding>
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" > <div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >

@ -60,8 +60,8 @@
background-color: #22C6B3; background-color: #22C6B3;
text-transform: capitalize; text-transform: capitalize;
height: 160px; height: 160px;
position: relative; /* position: relative; */
display: block; /* display: block; */
margin-bottom: -28px; margin-bottom: -28px;
} }
@ -77,3 +77,131 @@
background: #fff !important; background: #fff !important;
height: 1px; height: 1px;
} }
//////////////////////////////////////////////down
.colorBG{
--background: #f0efef;
}
.Title{
text-align: center;
color: white;
margin-top: -33px;
font-size: 17px;
}
.result-graph{
font-size: 14px;
margin-left: -48px;
margin-right: 3px;
margin-bottom: -30px;
}
.datetime{
// text-align: center;
// font-family: WorkSans-Bold;
// margin-left: 111px;
text-align: center;
font-family: WorkSans-Bold;
margin-left: 47px;
margin-top: -19px;
}
.datelabel{
margin-left: 150px;
color: black !important;
font-family: WorkSans-Bold;
}
.iconCalendar{
// margin-left: -241px;
// margin-top: 5px;
margin-left: 30px !important;
width: 22% !important;
height: 26px !important;
margin-top: -69px !important;
margin-bottom: 20px !important;
}
.today-graph{
// display:block !important;
// height: 150px !important;
// width: 300 !important;
// margin-left: -70px !important;
display: block !important;
height: 196px;
width: 385px;
padding-left: 51px;
// padding-top: 29px;
margin-left: -70px !important;
}
.headerGrid{
background-color: white !important;
border: 1px solid #cac8c8 !important;
border-radius: 20px !important;
padding-top: 28px;
padding-bottom: 14px;
margin-left: 9px;
margin-right: 13px;
margin-top: -94px;
margin-bottom: 10px;
}
.header{
margin-top: -126px;
}
.result-text-container {
padding: 0;
margin: 0;
position: absolute;
left: 31%;
top: 26%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 25px;
font-family: WorkSans-Bold;
margin: 0 auto;
// margin-top: 289px;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
// margin-top: 289px;
font-family: workSans-Regular;
}
}
.green-label{
font-size: 12px;
margin-top: -13px;
}
.green-amount{
font-size: 17px;
font-family: WorkSans-Bold;
margin-top: -3px;
}
.blue-label{
font-size: 12px;
margin-top: -13px;
}
.blue-amount{
font-size: 17px;
font-family: WorkSans-Bold;
margin-top: -4px;
}

@ -6,6 +6,9 @@ import { MenuService } from "src/app/hmg-common/services/menu/menuservice.servic
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response"; import { AbsenceAttahcmentResponse } from "../models/abs.attach.response";
import { AbsenceListService } from "../service/service.service"; import { AbsenceListService } from "../service/service.service";
import { IonInfiniteScroll } from "@ionic/angular"; import { IonInfiniteScroll } from "@ionic/angular";
import { AccrualService } from 'src/app/accrual-balances/services/accrual.service';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
@Component({ @Component({
selector: "app-home", selector: "app-home",
@ -13,6 +16,7 @@ import { IonInfiniteScroll } from "@ionic/angular";
styleUrls: ["./home.component.scss"] styleUrls: ["./home.component.scss"]
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
[x: string]: any;
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
P_PAGE_NUM: number; P_PAGE_NUM: number;
P_PAGE_LIMIT: number; P_PAGE_LIMIT: number;
@ -21,14 +25,55 @@ export class HomeComponent implements OnInit {
selEmp: string = ""; selEmp: string = "";
respID: number; respID: number;
selMenu: MenuResponse; selMenu: MenuResponse;
leaveAccrualBalance: any;
data: any;
accrualNet: any;
getleaveAccrualBalance: any;
accrualUsed: any;
accrualYearly: any;
effectiveDate: any;
Sdate: any;
emp_no: any;
balance: any;
ACCRUAL_NET_ENTITLEMENT: any;
ACCRUAL_USED_ENTITLEMENT: any;
ACCRUAL_YEARLY_ENTITLEMENT: any;
totalnumber: any;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }};
gaugeType = "full";
// gaugeValue = 11.200;
// gaugeLabel = "";
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public menuService: MenuService, public menuService: MenuService,
public absService: AbsenceListService public absService: AbsenceListService,
public accrualService: AccrualService,
public authService: AuthenticationService
) {} ) {}
ngOnInit() { ngOnInit() {
this.Sdate = new Date().toISOString();
this.getUserDetails();
}
private getUserDetails(){
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.emp_no=user.EMPLOYEE_NUMBER;
this.getAccrualBalance();
}
});
this.P_PAGE_LIMIT = 50; this.P_PAGE_LIMIT = 50;
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
this.selMenu = this.common.sharedService.getSharedData( this.selMenu = this.common.sharedService.getSharedData(
@ -43,13 +88,41 @@ export class HomeComponent implements OnInit {
MenuResponse.SHARED_SEL_RESP_ID, MenuResponse.SHARED_SEL_RESP_ID,
false false
); );
this.leaveAccrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false);
console.log("this.leaveAccrualBalance>>>>>>>>>>" + this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT);
/***
ACCRUAL_NET_ENTITLEMENT: 24.59
ACCRUAL_USED_ENTITLEMENT: 0
ACCRUAL_YEARLY_ENTITLEMENT: 50.4*/
this.accrualNet = this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.leaveAccrualBalance.ACCRUAL_USED_ENTITLEMENT;
this.accrualYearly = this.leaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT;
this.request = this.common.sharedService.getSharedData('leaveAccrualBalanceDate', false);
console.log("this.request" + this.request.P_EFFECTIVE_DATE);
this.effectiveDate = this.request.P_EFFECTIVE_DATE;
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
{ data: [this.accrualNet,this.accrualUsed,this.accrualYearly],
backgroundColor: [
'#DDB017',
'#094875',
'#CB3232',],
borderWidth: 2
}
]
};
this.getAbsenceTransaction(); this.getAbsenceTransaction();
} }
AccrualBalances() {
AccrualBalances() {
this.common.openAccuralPage(); this.common.openAccuralPage();
} }
AttachmentDocuments(id) { AttachmentDocuments(id) {
const request = { const request = {
P_ABSENCE_ATTENDANCE_ID: id P_ABSENCE_ATTENDANCE_ID: id
}; };
@ -77,7 +150,7 @@ export class HomeComponent implements OnInit {
//this.GetAbsenceTransactionList =result.GetAbsenceTransactionList; //this.GetAbsenceTransactionList =result.GetAbsenceTransactionList;
} }
} }
getAbsenceTransaction() { getAbsenceTransaction() {
this.IsReachEnd = false; this.IsReachEnd = false;
const request = { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
@ -91,7 +164,7 @@ export class HomeComponent implements OnInit {
}); });
} }
private handleAbsListResult(result) { handleAbsListResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetAbsenceTransactionList)) { if (this.common.hasData(result.GetAbsenceTransactionList)) {
this.GetAbsenceTransactionList = result.GetAbsenceTransactionList; this.GetAbsenceTransactionList = result.GetAbsenceTransactionList;
@ -108,7 +181,7 @@ export class HomeComponent implements OnInit {
} }
} }
} }
doInfinite(infiniteScroll) { doInfinite() {
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
//this.P_PAGE_NUM++; //this.P_PAGE_NUM++;
const request = { const request = {
@ -148,7 +221,53 @@ export class HomeComponent implements OnInit {
} }
} }
} }
createAbsence() { createAbsence() {
this.common.openSubmitAbsencePage(); this.common.openSubmitAbsencePage();
} }
///////////////////////////////////////////////////////////////
getAccrualBalance() {
if (this.Sdate) {
let today = new Date(this.Sdate);
let day = today.getDate();
let month = today.getMonth() + 1;
let year = today.getFullYear();
let todayDate = month + '/' + day + '/' + year;
let effectiveDate = todayDate;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,
P_EFFECTIVE_DATE: effectiveDate
};
this.accrualService
.getAccrualBalances(request)
.subscribe((result: any) => {
this.handleAccrualResult(result);
});
}
}
handleAccrualResult(result) {
if (this.common.validResponse(result)) {
this.balance = result.GetAccrualBalancesList;
}
if(this.balance){
this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT;
this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT;
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
{ data: [this.accrualNet,this.accrualUsed,this.accrualYearly],
backgroundColor: [
'#DDB017',
'#094875',
'#CB3232',],
borderWidth: 2
}
]
};
}
}
} }

@ -1,16 +1,29 @@
<ion-header> <!-- <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light">Attendance Tracking </ion-title> <ion-title color="light">Attendance Tracking </ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons></nav-buttons> <nav-buttons></nav-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header> -->
<!-- <ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons>
</ion-buttons>
<ion-title>Attendance Tracking</ion-title>
</ion-toolbar>
</ion-header> -->
<ion-content> <ion-content>
<div class="back-button-container">
<nav-buttons backLink="/home"></nav-buttons>
</div>
<div class="timer-chart"> <div class="timer-chart">
<ion-label class="shift-title" style="font-weight: bold"> {{curentDate}}</ion-label><br/> <ion-label class="shift-title" style="font-weight: bold; font-size: 20px;"> {{curentDate}}</ion-label><br/>
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','today-time-left')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','today-time-left')}}</ion-label>
<div class="fixed-shift-timer"> <div class="fixed-shift-timer">
@ -46,32 +59,29 @@
</div> </div>
<ion-grid> <ion-grid>
<ion-row class="rowBorder"> <ion-row class="rowBorder">
<ion-label class="shift-title">{{ts.trPK('attendance-tracking','shift-time')}}</ion-label> <ion-col [size]="12" class="colBorder" style="border-right: none;">
<br /><br /> <ion-label class="shift-title">{{ts.trPK('attendance-tracking','shift-time')}}</ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SHT_NAME}} </ion-label> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SHT_NAME}} </ion-label>
</ion-col>
</ion-row> </ion-row>
<ion-row class="rowBorder"> <ion-row class="rowBorder">
<ion-col class="colBorder"> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00</ion-label> <ion-label class="shift-text shift-title">08:00</ion-label>
</ion-col> </ion-col>
<ion-col> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00 </ion-label> <ion-label class="shift-text shift-title">08:00 </ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row style="text-align: center"> <ion-row style="text-align: center">
<ion-col class="colBorder"> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00 </ion-label> <ion-label class="shift-text shift-title">08:00 </ion-label>
</ion-col> </ion-col>
<ion-col> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label>
<br /><br /> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}} </ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS}} </ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>

@ -1,26 +1,29 @@
ion-content {
font-family: WorkSans-Regular;
}
ion-grid {
padding:30px 15px;
}
.timer-chart{ .timer-chart{
padding-top:18px; background: #094773;
background: #094773; text-align: center;
// height: 50%; line-height: .7cm;
text-align: center;
} }
.tracking-content{ .tracking-content{
background: #053c63; background: #053c63;
height: 50%; min-height: 50%;
} }
.rowBorder{ .rowBorder{
text-align: center; text-align: center;
border-bottom: var(--lightblue) solid 1px; border-bottom: var(--lightblue) solid 1px;
} }
.shift-text{ .shift-text{
// text-align: center; font-size: 36px;
// width: 100%; line-height: 36px;
// color: white !important; display: block;
margin-bottom: 12px;
margin-top: -9px;
font-size: 30px;
} }
.shift-title{ .shift-title{
width: 100%; width: 100%;
@ -34,24 +37,32 @@ height: 50%;
} }
.divstopBtn{ .divstopBtn{
text-align: center; text-align: center;
} }
.stopBtn{ .stopBtn{
height: 70px; height: 89px;
width: 70px; width: 89px;
background-color: var(--lightblue) !important; background-color: var(--lightblue) !important;
border-radius: 50%; border-radius: 50%;
display: inline-block; display: inline-block;
margin-top: -24px; margin-top: -40px;
border: solid 3px #053c63; border: solid 5px #053c63;
} }
.colBorder{ .colBorder{
padding: 20px 0px;
text-align: center;
}
.colBorder:nth-child(1){
border-right: var(--lightblue) solid 1px; border-right: var(--lightblue) solid 1px;
} }
.fixed-shift-timer{ .fixed-shift-timer{
margin-top: -50px; margin-top: -50px;
margin-bottom: -30px; margin-bottom: -10px;
}
.back-button-container{
background: #094773;
} }

@ -22,7 +22,6 @@ export class HomeComponent implements OnInit {
public isCheckedIn = undefined; public isCheckedIn = undefined;
public displayTime: any; public displayTime: any;
public percent: any; public percent: any;
constructor( constructor(
public cs: CommonService, public cs: CommonService,
public db: DashboredService, public db: DashboredService,
@ -90,14 +89,10 @@ export class HomeComponent implements OnInit {
} }
convertAndAssignTime(data) { convertAndAssignTime(data) {
console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
this.initTimer(); this.initTimer();
console.log('remainingTime: ' + this.remainingTime);
console.log('scheduledTime: ' + this.scheduledTime);
console.log('isCheckedIn: ' + this.isCheckedIn);
} }
showAttendanceTracking() { showAttendanceTracking() {

@ -5,7 +5,110 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content padding> <ion-content class="colorBG">
<div class="" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'">
<ion-grid class="headerGrid" style="padding-top: 30%;">
<p class="title">{{ts.trPK('absenceList','tickets-balance')}}</p>
<div style="color: black;">
<div class="result-graph">
<p-chart #chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<div>
<ion-row>
<ion-col class="col" size="4">
<div class="light-dote"></div>
<!-- </ion-col>
<ion-col> -->
<label class="light-label">{{ts.trPK('absenceList','adult')}}</label>
</ion-col>
<ion-col class="col" size="4">
<div class="blue-dote"></div>
<!-- </ion-col>
<ion-col> -->
<label class="blue-label">{{ts.trPK('absenceList','child')}}</label>
</ion-col>
<ion-col class="col" size="4">
<div class="green-dote"></div>
<!-- </ion-col>
<ion-col> -->
<label class="green-label">{{ts.trPK('absenceList','infants')}} </label>
</ion-col>
</ion-row>
</div>
</div>
</div>
</ion-grid>
</div>
<!-- ///////////////////////////////////////////////// -->
<ion-grid [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'" >
<div class="gridService">
<ion-row>
<ion-col class="columns">
<div class="adult-dote"></div>
<label>{{ts.trPK('absenceList','adult')}}</label>
<br>
<br>
<label class="service">{{accrualNetAdult}}</label>
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
</ion-col>
<ion-col class="columns">
<div class="child-dote"></div>
<label>{{ts.trPK('absenceList','child')}} </label>
<br>
<br>
<label class="service">{{accrualUNetChild}}</label>
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
</ion-col>
<ion-col class="columns">
<div class="infants-dote"></div>
<label>{{ts.trPK('absenceList','infants')}} </label>
<br>
<br>
<label class="service">{{accrualNetInfants}}</label>
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
</ion-col>
</ion-row>
</div>
</ion-grid>
<!--
<ion-grid class="three-grid">
<ion-row>
<ion-col >
infants
</ion-col>
<ion-col >2</ion-col>
<ion-col >tickit</ion-col>
</ion-row>
<ion-row>
<ion-col >
child
</ion-col>
<ion-col >2</ion-col>
<ion-col >tickit</ion-col>
</ion-row>
<ion-row>
<ion-col >
adult
</ion-col>
<ion-col >2</ion-col>
<ion-col >tickit</ion-col>
</ion-row>
</ion-grid> -->
<!-- //////////////////////////////////////////////////// -->
<!-- <ion-content padding> -->
<div *ngIf="eitAddedList && eitAddedList.length > 0 "> <div *ngIf="eitAddedList && eitAddedList.length > 0 ">
<ion-card *ngFor="let eitAddedObj of eitAddedList; let i=index "> <ion-card *ngFor="let eitAddedObj of eitAddedList; let i=index ">

@ -52,7 +52,7 @@ h4 {
background-color: #22C6B3; background-color: #22C6B3;
text-transform: capitalize; text-transform: capitalize;
height: 160px; height: 160px;
position: relative; // position: relative;
display: block; display: block;
margin-bottom: -28px; margin-bottom: -28px;
} }
@ -82,4 +82,157 @@ h4 {
border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6;
background: #fff !important; background: #fff !important;
height: 1px; height: 1px;
} }
////////////////////////////////
.colorBG{
--background: #f0efef;
}
.Title{
text-align: center;
color: white;
margin-top: -33px;
font-size: 17px;
}
.title{
text-align: center;
color: black;
margin-top: -10px;
font-size: 17px;
}
.today-graph{
display: block !important;
height: 196px;
width: 365px;
/* padding-left: 51px; */
margin-left: 28px !important;
}
.headerGrid{
background-color: white !important;
border: 1px solid #cac8c8 !important;
border-radius: 20px !important;
padding-top: 28px;
padding-bottom: 53px;
margin-left: 9px;
margin-right: 13px;
margin-top: -94px;
margin-bottom: 10px;
}
.result-graph{
font-size: 14px;
margin-left: -48px;
margin-right: 3px;
margin-bottom: -30px;
}
.green-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: 42px;
}
.blue-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: 13px;
}
.light-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: -26px;
}
.light-dote{
background-color: #3CB9D5;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
}
.blue-dote{
background-color: #22C6B3;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
}
.green-dote{
background-color: #1FA269;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
margin-right: -1px;
}
.col{
text-align: right;
}
.gridService{
/* margin-top: 87px; */
border-radius: 10px;
/* margin-bottom: -49px; */
margin-left: 14px;
margin-right: 14px;
}
.columns{
margin: 3px;
margin-bottom: 13px;
background: white;
border-radius: 27px;
padding-left: 30px;
padding-right: 6px;
padding-top: 19px;
padding-bottom: 8px;
border: 1px solid #cac8c8 !important;
}
.service{
font-size: 22px;
color: black;
letter-spacing: 1px;
font-weight: bold;
}
.services{
font-size: 12px;
color: black;
}
.adult-dote{
background-color: #3CB9D5;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
}
.child-dote{
background-color: #22C6B3;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
}
.infants-dote{
background-color: #1FA269;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
// margin-bottom: 6px;
}

@ -40,6 +40,21 @@ export class EitListComponent implements OnInit {
private selectedIndex: number; private selectedIndex: number;
private pAction: number = 0; private pAction: number = 0;
public headerTitle: string = ""; public headerTitle: string = "";
data: any;
accrualNetInfants: any;
accrualUNetChild: any;
accrualNetAdult: any;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }};
gaugeType = "full";
accrualBalancesList: any;
common: any;
// gaugeValue = 11.200;
// gaugeLabel = "";
constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) { constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) {
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
@ -49,6 +64,7 @@ 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;
@ -57,6 +73,26 @@ export class EitListComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getEITTransactions(); this.getEITTransactions();
this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false);
// accrualNetInfants
// accrualUNetChild
// accrualNetAdult
this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
{ data: [this.accrualNetInfants, this.accrualUNetChild, this.accrualNetAdult],
backgroundColor: [
'#1FA269',
'#22C6B3',
'#3CB9D5',],
borderWidth: 2
}
]
};
} }
getEITTransactions() { getEITTransactions() {
@ -455,4 +491,6 @@ export class EitListComponent implements OnInit {
this.eitAddedList = list; this.eitAddedList = list;
this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER); this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER);
} }
} }

@ -1,8 +0,0 @@
import { FeedbackDirective } from './feedback.directive';
describe('FeedbackDirective', () => {
it('should create an instance', () => {
const directive = new FeedbackDirective();
expect(directive).toBeTruthy();
});
});

@ -1,24 +0,0 @@
import { Directive, ElementRef, HostListener } from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service';
import { CommonService } from '../../services/common/common.service';
import { FeedbackService } from './feedback.service';
@Directive({
selector: '[feedback]'
})
export class FeedbackDirective {
constructor(
private cs: CommonService,
private ts: TranslatorService,
private el: ElementRef,
private feedBackService: FeedbackService
) {
}
@HostListener('mousedown') onMouseEnter() {
this.feedBackService.vibrate();
}
}

@ -1,12 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { FeedbackService } from './feedback.service';
describe('FeedbackService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: FeedbackService = TestBed.get(FeedbackService);
expect(service).toBeTruthy();
});
});

@ -1,20 +0,0 @@
import { Injectable } from '@angular/core';
import { Vibration } from '@ionic-native/vibration/ngx';
// import { SettingsService } from 'src/app/settings/service/settings.service';
@Injectable({
providedIn: 'root'
})
export class FeedbackService {
// constructor(private vibration: Vibration, private settings: SettingsService) {}
constructor(private vibration: Vibration) {}
public async vibrate() {
try {
const on = true;
if (on) {
this.vibration.vibrate(500);
}} catch (e) {
}
}
}

@ -43,6 +43,8 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service'; import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service';
import { BarChartComponent } from './ui/bar-chart/bar-chart.component'; import { BarChartComponent } from './ui/bar-chart/bar-chart.component';
import { DonutChartComponent } from './ui/donut-chart/donut-chart.component'; import { DonutChartComponent } from './ui/donut-chart/donut-chart.component';
// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service';
// import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component'; import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx'; import { Badge } from '@ionic-native/badge/ngx';
import { PushService } from './services/push/push.service'; import { PushService } from './services/push/push.service';
@ -51,6 +53,8 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
import { GuidService } from './services/guid/guid.service'; import { GuidService } from './services/guid/guid.service';
import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component'; 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 { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent } from './ui/button/button.component'; import { ButtonComponent } 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';
@ -78,10 +82,13 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { DetailButtonComponent } from './ui/detail-button/detail-button.component'; import { DetailButtonComponent } from './ui/detail-button/detail-button.component';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component'; import { HeaderButtonComponent } from './ui/header-button/header-button.component';
// import { CallNumber } from '@ionic-native/call-number/ngx';
import { AppRate } from '@ionic-native/app-rate/ngx'; import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service'; import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service'; import { RateService } from './services/rate/rate.service';
// import { PaymentComponent } from './ui/payment/payment.component';
// 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 { FileSelectDirective } from 'ng2-file-upload';
@ -89,12 +96,12 @@ 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';
import {File} from '@ionic-native/file/ngx'; import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component' import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component';
import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import {DashboredService} from './services/dashbored/dashbored.service'; import {DashboredService} from './services/dashbored/dashbored.service';
import {NgxGaugeModule} from 'ngx-gauge'; // import {NgxGaugeModule} from 'ngx-gauge';
import { StatsButtonComponent } from './ui/stats-button/stats-button.component'; import { StatsButtonComponent } from './ui/stats-button/stats-button.component';
import { ServicesButtonComponent } from './ui/services-button/services-button.component'; import { ServicesButtonComponent } from './ui/services-button/services-button.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
@ -103,7 +110,9 @@ import {FabButtonComponent} from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service'; import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress'; import { NgCircleProgressModule } from 'ng-circle-progress';
import { ChartModule } from 'primeng/chart'; import {ChartModule} from 'primeng/chart';
import { CardFilterComponent} from './ui/card-filter/card-filter.component';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
@ -116,7 +125,7 @@ import { ChartModule } from 'primeng/chart';
PdfViewerModule, PdfViewerModule,
NgCircleProgressModule.forRoot(), NgCircleProgressModule.forRoot(),
ChartModule, ChartModule,
NgxGaugeModule // NgxGaugeModule
], ],
declarations: [ declarations: [
FabButtonComponent, FabButtonComponent,
@ -135,6 +144,7 @@ import { ChartModule } from 'primeng/chart';
DatePipeTransform, DatePipeTransform,
DateTimePipe, DateTimePipe,
SafeHtmlPipe, SafeHtmlPipe,
// TurncatePipe,
BackButtonComponent, BackButtonComponent,
IfDatePipe, IfDatePipe,
DynamicTableComponent, DynamicTableComponent,
@ -168,7 +178,6 @@ import { ChartModule } from 'primeng/chart';
EmptyDataComponent, EmptyDataComponent,
DetailButtonComponent, DetailButtonComponent,
HeaderButtonComponent, HeaderButtonComponent,
//PaymentComponent,
ReplacementListComponent, ReplacementListComponent,
FileSelectDirective, FileSelectDirective,
WorkListAttachViewComponent, WorkListAttachViewComponent,
@ -177,7 +186,8 @@ import { ChartModule } from 'primeng/chart';
AccordinCustomComponent, AccordinCustomComponent,
StatsButtonComponent, StatsButtonComponent,
ServicesButtonComponent, ServicesButtonComponent,
ConfirmLoginComponent ConfirmLoginComponent,
CardFilterComponent
], ],
exports: [ exports: [
FabButtonComponent, FabButtonComponent,
@ -193,6 +203,7 @@ import { ChartModule } from 'primeng/chart';
DividerComponent, DividerComponent,
NavButtonsComponent, NavButtonsComponent,
DatePipeTransform, DatePipeTransform,
// TurncatePipe,
TranslatePipe, TranslatePipe,
DateTimePipe, DateTimePipe,
SafeHtmlPipe, SafeHtmlPipe,
@ -232,12 +243,13 @@ import { ChartModule } from 'primeng/chart';
FileUploderProfileComponent, FileUploderProfileComponent,
AccordinTabCustomComponent, AccordinTabCustomComponent,
AccordinCustomComponent, AccordinCustomComponent,
NgxGaugeModule, // NgxGaugeModule,
StatsButtonComponent, StatsButtonComponent,
ServicesButtonComponent, ServicesButtonComponent,
ConfirmLoginComponent, ConfirmLoginComponent,
NgCircleProgressModule, NgCircleProgressModule,
ChartModule ChartModule,
CardFilterComponent
], ],
providers: [ providers: [
AttendScanService, AttendScanService,
@ -255,10 +267,14 @@ import { ChartModule } from 'primeng/chart';
NativeStorage, NativeStorage,
ProgressLoadingService, ProgressLoadingService,
PushService, PushService,
// UserLocalNotificationService,
// LocalNotifications,
Badge, Badge,
LifeCycleService, LifeCycleService,
HmgBrowserService, HmgBrowserService,
GuidService, GuidService,
// BackgroundGeolocation,
// GeofencingService,
Keyboard, Keyboard,
KeyboardService, KeyboardService,
Diagnostic, Diagnostic,
@ -273,10 +289,10 @@ import { ChartModule } from 'primeng/chart';
RateService, RateService,
Camera, Camera,
File, File,
// PaymentService,
MenuService, MenuService,
OpenNativeSettings, OpenNativeSettings,
BarcodeScanner, BarcodeScanner
] ]
}) })
export class HmgCommonModule { } export class HmgCommonModule { }

@ -1,4 +1,4 @@
import { Injectable } from "@angular/core"; import { Injectable } from '@angular/core';
import { import {
NavController, NavController,
ToastController, ToastController,
@ -6,74 +6,74 @@ import {
AlertController, AlertController,
Platform, Platform,
MenuController MenuController
} from "@ionic/angular"; } from '@ionic/angular';
import { Router } from "@angular/router"; import { Router } from '@angular/router';
import { TranslatorService } from "../translator/translator.service"; import { TranslatorService } from '../translator/translator.service';
import { AlertControllerService } from "../../ui/alert/alert-controller.service"; import { AlertControllerService } from '../../ui/alert/alert-controller.service';
//import { Response } from "../models/response"; //import { Response } from "../models/response";
import { Response } from 'src/app/hmg-common/services/models/response'; import { Response } from 'src/app/hmg-common/services/models/response';
import { Location, DatePipe } from "@angular/common"; import { Location, DatePipe } from '@angular/common';
import { ThemeableBrowser } from "@ionic-native/themeable-browser/ngx"; import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx';
import { BrowserConfig } from "./models/browser-config"; import { BrowserConfig } from './models/browser-config';
import { import {
LaunchNavigator, LaunchNavigator,
LaunchNavigatorOptions LaunchNavigatorOptions
} from "@ionic-native/launch-navigator/ngx"; } from '@ionic-native/launch-navigator/ngx';
import { Device } from "@ionic-native/device/ngx"; import { Device } from '@ionic-native/device/ngx';
import { ProgressLoadingService } from "../../ui/progressLoading/progress-loading.service"; import { ProgressLoadingService } from '../../ui/progressLoading/progress-loading.service';
import { Observable, throwError } from "rxjs"; import { Observable, throwError } from 'rxjs';
import { SharedDataService } from "../shared-data-service/shared-data.service"; import { SharedDataService } from '../shared-data-service/shared-data.service';
import { Badge } from "@ionic-native/badge/ngx"; import { Badge } from '@ionic-native/badge/ngx';
import { LifeCycleService } from "../life-cycle/life-cycle.service"; import { LifeCycleService } from '../life-cycle/life-cycle.service';
import { Diagnostic } from "@ionic-native/diagnostic/ngx"; import { Diagnostic } from '@ionic-native/diagnostic/ngx';
//import { CallNumber } from "@ionic-native/call-number/ngx"; //import { CallNumber } from "@ionic-native/call-number/ngx";
import { InAppBrowser } from "@ionic-native/in-app-browser/ngx"; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable({ @Injectable({
providedIn: "root" providedIn: 'root'
}) })
export class CommonService { export class CommonService {
public static months_en_long = [ public static months_en_long = [
"January", 'January',
"February", 'February',
"March", 'March',
"April", 'April',
"May", 'May',
"June", 'June',
"July", 'July',
"August", 'August',
"September", 'September',
"October", 'October',
"November", 'November',
"December" 'December'
]; ];
public static months_en = [ public static months_en = [
"Jan", 'Jan',
"Feb", 'Feb',
"Mar", 'Mar',
"Apr", 'Apr',
"May", 'May',
"Jun", 'Jun',
"Jul", 'Jul',
"Aug", 'Aug',
"Sep", 'Sep',
"Oct", 'Oct',
"Nov", 'Nov',
"Dec" 'Dec'
]; ];
public static months_ar = [ public static months_ar = [
"يناير", 'يناير',
"فبراير", 'فبراير',
"مارس", 'مارس',
"أبريل", 'أبريل',
"مايو", 'مايو',
"يونيو", 'يونيو',
"يوليو", 'يوليو',
"أغسطس", 'أغسطس',
"سبتمبر", 'سبتمبر',
"أكتوبر", 'أكتوبر',
"نوفمبر", 'نوفمبر',
"ديسمبر" 'ديسمبر'
]; ];
private progressLoaders: any[] = []; private progressLoaders: any[] = [];
@ -172,7 +172,7 @@ public getMonthNameAr(value: number): string {
public round(value: number, decimal: number): string { public round(value: number, decimal: number): string {
const valueStr = value.toString(); const valueStr = value.toString();
const dotIndex = valueStr.indexOf("."); const dotIndex = valueStr.indexOf('.');
if (dotIndex >= 0) { if (dotIndex >= 0) {
return valueStr.toString().substr(0, dotIndex + decimal); return valueStr.toString().substr(0, dotIndex + decimal);
@ -186,13 +186,13 @@ public getMonthNameAr(value: number): string {
var hours = Math.floor(sec_num / 3600); var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - hours * 3600) / 60); var minutes = Math.floor((sec_num - hours * 3600) / 60);
var seconds = sec_num - hours * 3600 - minutes * 60; var seconds = sec_num - hours * 3600 - minutes * 60;
var hoursString = ""; var hoursString = '';
var minutesString = ""; var minutesString = '';
var secondsString = ""; var 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;
} }
public toastPK(page: string, key: string) { public toastPK(page: string, key: string) {
@ -202,9 +202,9 @@ public getMonthNameAr(value: number): string {
const toast = await this.toastController.create({ const toast = await this.toastController.create({
message: message, message: message,
showCloseButton: true, showCloseButton: true,
position: "middle", position: 'middle',
duration: 2000, duration: 2000,
closeButtonText: this.ts.trPK("general", "close") closeButtonText: this.ts.trPK('general', 'close')
}); });
toast.present(); toast.present();
} }
@ -213,9 +213,9 @@ public getMonthNameAr(value: number): string {
async startLoadingOld() { async startLoadingOld() {
this.stopLoading(); this.stopLoading();
const loader = await this.loadingController.create({ const loader = await this.loadingController.create({
spinner: "bubbles", spinner: 'bubbles',
duration: 30000, duration: 30000,
message: this.ts.trPK("error", "wait"), message: this.ts.trPK('error', 'wait'),
translucent: true translucent: true
}); });
this.progressLoaders.push(loader); this.progressLoaders.push(loader);
@ -228,7 +228,7 @@ public getMonthNameAr(value: number): string {
*/ */
this.stopLoading(); this.stopLoading();
this.progressLoadingService.presentLoading( this.progressLoadingService.presentLoading(
this.ts.trPK("general", "loading") this.ts.trPK('general', 'loading')
); );
} }
@ -248,8 +248,8 @@ public getMonthNameAr(value: number): string {
onAccept(); onAccept();
} }
}, },
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "alert"), this.ts.trPK('general', 'alert'),
message message
); );
} }
@ -257,10 +257,10 @@ public getMonthNameAr(value: number): string {
public presentConfirmDialog(message: string, onAccept: any, onCancel?: any) { public presentConfirmDialog(message: string, onAccept: any, onCancel?: any) {
this.confirmAlertDialog( this.confirmAlertDialog(
onAccept, onAccept,
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
onCancel, onCancel,
this.ts.trPK("general", "cancel"), this.ts.trPK('general', 'cancel'),
this.ts.trPK("general", "confirm"), this.ts.trPK('general', 'confirm'),
message message
); );
} }
@ -268,8 +268,8 @@ public getMonthNameAr(value: number): string {
public presentAcceptDialog(message: string, onAccept: any) { public presentAcceptDialog(message: string, onAccept: any) {
this.alertDialog( this.alertDialog(
onAccept, onAccept,
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "confirm"), this.ts.trPK('general', 'confirm'),
message message
); );
} }
@ -279,8 +279,8 @@ public getMonthNameAr(value: number): string {
() => { () => {
this.back(); this.back();
}, },
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "info"), this.ts.trPK('general', 'info'),
message message
); );
} }
@ -288,9 +288,9 @@ public getMonthNameAr(value: number): string {
this.openHome(); this.openHome();
this.alertDialog( this.alertDialog(
() => {}, () => {},
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "info"), this.ts.trPK('general', 'info'),
this.ts.trPK("general", "not-allowed") this.ts.trPK('general', 'not-allowed')
); );
} }
@ -301,14 +301,14 @@ public getMonthNameAr(value: number): string {
) { ) {
this.alertDialog( this.alertDialog(
onClick, onClick,
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "alert"), this.ts.trPK('general', 'alert'),
message message
); );
} }
public userNeedToReLogin() { public userNeedToReLogin() {
this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => { this.presentAcceptDialog(this.ts.trPK('general', 'relogin'), () => {
this.sharedService.clearAll(); this.sharedService.clearAll();
this.openLogin(); this.openLogin();
}); });
@ -317,9 +317,9 @@ public getMonthNameAr(value: number): string {
public showConnectionErrorDialog(onClick: any, okLabel: string) { public showConnectionErrorDialog(onClick: any, okLabel: string) {
this.alertDialog( this.alertDialog(
onClick, onClick,
this.ts.trPK("general", "ok"), this.ts.trPK('general', 'ok'),
this.ts.trPK("general", "alert"), this.ts.trPK('general', 'alert'),
this.ts.trPK("general", "connError") this.ts.trPK('general', 'connError')
); );
} }
@ -327,15 +327,15 @@ public getMonthNameAr(value: number): string {
this.alertDialog( this.alertDialog(
onClick, onClick,
okLabel, okLabel,
this.ts.trPK("general", "alert"), this.ts.trPK('general', 'alert'),
this.ts.trPK("general", "timeout") this.ts.trPK('general', 'timeout')
); );
} }
async JustAlertDialog(acceptLabel: string, message: string) { async JustAlertDialog(acceptLabel: string, message: string) {
this.clearAllAlerts(); this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({ const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "info"), header: this.ts.trPK('general', 'info'),
message: message, message: message,
buttons: [ buttons: [
{ {
@ -360,13 +360,13 @@ public getMonthNameAr(value: number): string {
) { ) {
this.clearAllAlerts(); this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({ const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "confirm"), header: this.ts.trPK('general', 'confirm'),
message: message, message: message,
buttons: [ buttons: [
{ {
text: cancelLabel, text: cancelLabel,
role: "cancel", role: 'cancel',
cssClass: "cancel-button", cssClass: 'cancel-button',
handler: () => { handler: () => {
if (onCancel) { if (onCancel) {
onCancel(); onCancel();
@ -399,7 +399,7 @@ public getMonthNameAr(value: number): string {
) { ) {
this.clearAllAlerts(); this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({ const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "confirm"), header: this.ts.trPK('general', 'confirm'),
message: message, message: message,
buttons: [ buttons: [
{ {
@ -433,7 +433,7 @@ public getMonthNameAr(value: number): string {
message: message, message: message,
buttons: [ buttons: [
{ {
text:this.ts.trPK("general", "ok"), text:this.ts.trPK('general', 'ok'),
handler: () => { handler: () => {
if (onAccept) { if (onAccept) {
onAccept(); onAccept();
@ -476,13 +476,13 @@ public getMonthNameAr(value: number): string {
) { ) {
this.clearAllAlerts(); this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({ const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "confirm"), header: this.ts.trPK('general', 'confirm'),
message: message, message: message,
buttons: [ buttons: [
{ {
text: cancelLabel, text: cancelLabel,
role: "cancel", role: "cancel",
cssClass: "cancelBtn", cssClass: "checkOutCancelBtn",
handler: () => { handler: () => {
if (onCancel) { if (onCancel) {
onCancel(); onCancel();
@ -492,9 +492,9 @@ public getMonthNameAr(value: number): string {
}, },
{ {
text: acceptLabel, text: acceptLabel,
role: "Confirm", role: 'Confirm',
cssClass: "confirmBtn", cssClass: "checkOutOkBtn",
handler: () => { handler: () => {
@ -558,7 +558,7 @@ public getMonthNameAr(value: number): string {
public clearAllAlerts() { public clearAllAlerts() {
// custom solutions because of async issue // custom solutions because of async issue
const alerts = document.getElementsByTagName("ion-alert"); const alerts = document.getElementsByTagName('ion-alert');
for (let i = 0; i < alerts.length; i++) { for (let i = 0; i < alerts.length; i++) {
const alert = alerts[i]; const alert = alerts[i];
alert.parentNode.removeChild(alert); alert.parentNode.removeChild(alert);
@ -566,15 +566,15 @@ public getMonthNameAr(value: number): string {
} }
public getDeviceInfo(): string { public getDeviceInfo(): string {
if (this.platform.is("mobile")) { if (this.platform.is('mobile')) {
const os = this.platform.is("ios") ? "Iphone" : "android"; const os = this.platform.is('ios') ? 'Iphone' : 'android';
return ( return (
os + os +
" - " + ' - ' +
this.device.platform + this.device.platform +
" - " + ' - ' +
this.device.version + this.device.version +
" , " + ' , ' +
this.device.manufacturer this.device.manufacturer
); );
} else { } else {
@ -583,19 +583,19 @@ public getMonthNameAr(value: number): string {
} }
public getDeviceType(): string { public getDeviceType(): string {
if (this.platform.is("mobile")) { if (this.platform.is('mobile')) {
// return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android"); // return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android");
return (this.platform.is("ios") ? "Iphone" : "android"); return (this.platform.is('ios') ? 'Iphone' : 'android');
} else { } else {
return "Desktop"; return 'Desktop';
} }
} }
public validResponse(result: Response): boolean { public validResponse(result: Response): boolean {
if (result.MessageStatus === 1) { if (result.MessageStatus === 1) {
return true; return true;
} else if (result.MessageStatus === 2) { } else if (result.MessageStatus === 2) {
return this.hasData(result["SameClinicApptList"]); return this.hasData(result['SameClinicApptList']);
} }
return false; return false;
} }
@ -616,15 +616,15 @@ public getMonthNameAr(value: number): string {
} }
private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) { private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) {
const browser = window.open(url, "_blank", "location=no"); const browser = window.open(url, '_blank', 'location=no');
browser.addEventListener("loadstart", () => {}); browser.addEventListener('loadstart', () => {});
browser.addEventListener("loaderror", () => { browser.addEventListener('loaderror', () => {
if (onFaild) { if (onFaild) {
onFaild(); onFaild();
} }
}); });
browser.addEventListener("loadstop", () => { browser.addEventListener('loadstop', () => {
if (onSuccess) { if (onSuccess) {
onSuccess(); onSuccess();
} }
@ -641,14 +641,14 @@ public getMonthNameAr(value: number): string {
this.platform.ready().then(() => { this.platform.ready().then(() => {
const browser = this.iab.create( const browser = this.iab.create(
url, url,
"_blank", '_blank',
"closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no" 'closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no'
); );
// browser.executeScript(...); // browser.executeScript(...);
// browser.insertCSS(...); // browser.insertCSS(...);
browser.on("loaderror").subscribe(event => { browser.on('loaderror').subscribe(event => {
if (onFaild) { if (onFaild) {
onFaild(); onFaild();
} }
@ -664,13 +664,13 @@ public getMonthNameAr(value: number): string {
}); });
*/ */
browser.on("exit").subscribe(event => { browser.on('exit').subscribe(event => {
if (onExit) { if (onExit) {
onExit(); onExit();
} }
}); });
browser.on("loadstart").subscribe(event => { browser.on('loadstart').subscribe(event => {
if (successURLS) { if (successURLS) {
successURLS.forEach((successURL, index) => { successURLS.forEach((successURL, index) => {
if (event.url && event.url.indexOf(successURL) >= 0) { if (event.url && event.url.indexOf(successURL) >= 0) {
@ -687,7 +687,7 @@ public getMonthNameAr(value: number): string {
} }
public imageFromBase64(base64: string) { public imageFromBase64(base64: string) {
return "data:image/jpeg;base64," + base64; return 'data:image/jpeg;base64,' + base64;
} }
public openLocation(lat: number, lng: number) { public openLocation(lat: number, lng: number) {
@ -696,24 +696,24 @@ public getMonthNameAr(value: number): string {
() => {}, () => {},
err => { err => {
// this.failedToOpenMap(); // this.failedToOpenMap();
window.open("https://maps.google.com/?q=" + lat + "," + lng); window.open('https://maps.google.com/?q=' + lat + ',' + lng);
} }
); );
}); });
} }
private failedToOpenMap() { private failedToOpenMap() {
this.presentAlert(this.ts.trPK("error", "map")); this.presentAlert(this.ts.trPK('error', 'map'));
} }
public localizeTime(date: Date) { public localizeTime(date: Date) {
if (!(date.getHours() == 0 && date.getMinutes() == 0)) { if (!(date.getHours() == 0 && date.getMinutes() == 0)) {
let h = date.getHours() % 12 || 12; let h = date.getHours() % 12 || 12;
let hStr = h < 10 ? "0" + h : h; // leading 0 at the left for 1 digit hours let hStr = h < 10 ? '0' + h : h; // leading 0 at the left for 1 digit hours
const m = date.getMinutes(); const m = date.getMinutes();
let mStr = m < 10 ? "0" + m : m; let mStr = m < 10 ? '0' + m : m;
return hStr + ":" + mStr + (date.getHours() < 12 ? " AM" : " PM"); return hStr + ':' + mStr + (date.getHours() < 12 ? ' AM' : ' PM');
} }
return ""; return '';
} }
public localizeDate(date: Date, time = false) { public localizeDate(date: Date, time = false) {
@ -722,20 +722,20 @@ public getMonthNameAr(value: number): string {
if (lng === TranslatorService.AR) { if (lng === TranslatorService.AR) {
dateStr = dateStr =
CommonService.months_ar[date.getMonth()] + CommonService.months_ar[date.getMonth()] +
" " + ' ' +
date.getDate() + date.getDate() +
" " + ' ' +
date.getFullYear(); date.getFullYear();
} else { } else {
dateStr = dateStr =
CommonService.months_en[date.getMonth()] + CommonService.months_en[date.getMonth()] +
" " + ' ' +
date.getDate() + date.getDate() +
"," + ',' +
date.getFullYear(); date.getFullYear();
} }
return time ? dateStr + " " + this.localizeTime(date) : dateStr; return time ? dateStr + ' ' + this.localizeTime(date) : dateStr;
} }
public localizeMonth(monthIndex) { public localizeMonth(monthIndex) {
@ -767,21 +767,21 @@ public getMonthNameAr(value: number): string {
return ( return (
date.getMonth() + date.getMonth() +
1 + 1 +
"/" + '/' +
date date
.getFullYear() .getFullYear()
.toString() .toString()
.substr(2) .substr(2)
); );
} else { } else {
return "--"; return '--';
} }
} }
public convertISODateToJsonDate(isoDate: string): string { public convertISODateToJsonDate(isoDate: string): string {
return "/Date(" + Date.parse(isoDate) + ")/"; return '/Date(' + Date.parse(isoDate) + ')/';
} }
public convertDateToJsonDate(date: Date): string { public convertDateToJsonDate(date: Date): string {
return "/Date(" + date.getTime() + ")/"; return '/Date(' + date.getTime() + ')/';
} }
/* /*
@ -790,13 +790,13 @@ public getMonthNameAr(value: number): string {
*/ */
public convertIsoDateToObject(isoDate: string, isoTime: string): Date { public convertIsoDateToObject(isoDate: string, isoTime: string): Date {
const date = new Date(isoDate); const date = new Date(isoDate);
const parts = isoTime.split(":"); const parts = isoTime.split(':');
if (this.hasData(parts)) { if (this.hasData(parts)) {
// remove if numbers start with 0 // remove if numbers start with 0
let hrsStr = parts[0]; let hrsStr = parts[0];
let msStr = parts[1]; let msStr = parts[1];
hrsStr = hrsStr[0] == "0" ? hrsStr.substr(1) : hrsStr; hrsStr = hrsStr[0] == '0' ? hrsStr.substr(1) : hrsStr;
msStr = msStr[0] == "0" ? msStr.substr(1) : msStr; msStr = msStr[0] == '0' ? msStr.substr(1) : msStr;
date.setHours(Number(hrsStr)); date.setHours(Number(hrsStr));
date.setMinutes(Number(msStr)); date.setMinutes(Number(msStr));
} }
@ -824,9 +824,9 @@ public getMonthNameAr(value: number): string {
public getDateISO(date: Date): string { public getDateISO(date: Date): string {
return ( return (
date.getFullYear().toString() + date.getFullYear().toString() +
"-" + '-' +
this.trailerZero(date.getMonth() + 1) + this.trailerZero(date.getMonth() + 1) +
"-" + '-' +
this.trailerZero(date.getDate()) this.trailerZero(date.getDate())
); );
} }
@ -838,19 +838,19 @@ public getMonthNameAr(value: number): string {
public getTimeISO(date: Date): string { public getTimeISO(date: Date): string {
return ( return (
this.trailerZero(date.getHours()) + this.trailerZero(date.getHours()) +
":" + ':' +
this.trailerZero(date.getMinutes()) + this.trailerZero(date.getMinutes()) +
":00" ':00'
); );
} }
public getDateTimeISO(date: Date): string { public getDateTimeISO(date: Date): string {
return this.getDateISO(date) + " " + this.getTimeISO(date); return this.getDateISO(date) + ' ' + this.getTimeISO(date);
} }
public getDateTimeISOFromString(dateStr: string): string { public getDateTimeISOFromString(dateStr: string): string {
const date = this.evaluteDateAsObject(dateStr); const date = this.evaluteDateAsObject(dateStr);
return this.getDateTimeISO(date) + " " + this.getTimeISO(date); return this.getDateTimeISO(date) + ' ' + this.getTimeISO(date);
} }
public getCurrentTimeISO(): string { public getCurrentTimeISO(): string {
@ -859,7 +859,7 @@ public getMonthNameAr(value: number): string {
private trailerZero(value: number): string { private trailerZero(value: number): string {
const str = value.toString(); const str = value.toString();
return str.length > 1 ? str : "0" + str; return str.length > 1 ? str : '0' + str;
} }
public hasData(array: any[]): boolean { public hasData(array: any[]): boolean {
@ -883,13 +883,13 @@ public getMonthNameAr(value: number): string {
} }
} }
} }
return startIndex ? message.substring(startIndex, endIndex) : ""; return startIndex ? message.substring(startIndex, endIndex) : '';
} }
return null; return null;
} }
public inNumberRange(targetCode: number): boolean { public inNumberRange(targetCode: number): boolean {
const minDigit = "0".charCodeAt(0); const minDigit = '0'.charCodeAt(0);
const maxDigit = "9".charCodeAt(0); const maxDigit = '9'.charCodeAt(0);
return targetCode >= minDigit && targetCode <= maxDigit; return targetCode >= minDigit && targetCode <= maxDigit;
} }
@ -911,24 +911,24 @@ public getMonthNameAr(value: number): string {
title?: string title?: string
) { ) {
this.smsAlertDialog = await this.alertControllerIonic.create({ this.smsAlertDialog = await this.alertControllerIonic.create({
header: title || this.ts.trPK("general", "enter-sms-code"), header: title || this.ts.trPK('general', 'enter-sms-code'),
inputs: [ inputs: [
{ {
name: "sms", name: 'sms',
type: "number", type: 'number',
value: smsCode, value: smsCode,
placeholder: this.ts.trPK("general", "enter-sms") placeholder: this.ts.trPK('general', 'enter-sms')
} }
], ],
buttons: [ buttons: [
{ {
text: this.ts.trPK("general", "cancel"), text: this.ts.trPK('general', 'cancel'),
role: "cancel", role: 'cancel',
cssClass: "cancel-button", cssClass: 'cancel-button',
handler: () => {} handler: () => {}
}, },
{ {
text: this.ts.trPK("general", "ok"), text: this.ts.trPK('general', 'ok'),
handler: data => { handler: data => {
onAccept(data.sms); onAccept(data.sms);
} }
@ -1031,8 +1031,8 @@ public getMonthNameAr(value: number): string {
} }
const dataSets = [ const dataSets = [
this.getGraphDataSet(this.ts.trInline(title1), series1, "#d12026"), this.getGraphDataSet(this.ts.trInline(title1), series1, '#d12026'),
this.getGraphDataSet(this.ts.trInline(title2), series2, "#60686b") this.getGraphDataSet(this.ts.trInline(title2), series2, '#60686b')
]; ];
return this.getGraphMultiSeries(labels, dataSets); return this.getGraphMultiSeries(labels, dataSets);
} }
@ -1048,7 +1048,7 @@ public getMonthNameAr(value: number): string {
} }
public isHtml5VideoSupported(): boolean { public isHtml5VideoSupported(): boolean {
const v = document.createElement("video"); const v = document.createElement('video');
if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) { if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) {
return true; return true;
} }
@ -1062,7 +1062,7 @@ public getMonthNameAr(value: number): string {
} }
public isCordova(): boolean { public isCordova(): boolean {
return this.platform.is("cordova"); return this.platform.is('cordova');
} }
public pageRevisited(pageName: string): Observable<boolean> { public pageRevisited(pageName: string): Observable<boolean> {
@ -1077,118 +1077,125 @@ public getMonthNameAr(value: number): string {
} }
public openEitListPage() { public openEitListPage() {
this.nav.navigateForward(["/eit/eit-list"]); this.nav.navigateForward(['/eit/eit-list']);
} }
public openAddEitPage() { public openAddEitPage() {
this.nav.navigateForward(["/eit/add-eit"]); this.nav.navigateForward(['/eit/add-eit']);
} }
public openConfirmEitPage() { public openConfirmEitPage() {
this.nav.navigateForward(["/eit/confirm-add-eit"]); this.nav.navigateForward(['/eit/confirm-add-eit']);
} }
public openHome() { public openHome() {
this.nav.navigateRoot(["/home"]); this.nav.navigateRoot(['/home']);
} }
public openForgotPassword() { public openForgotPassword() {
this.nav.navigateForward(["/authentication/forgot"]); this.nav.navigateForward(['/authentication/forgot']);
} }
public openChangePassword() { public openChangePassword() {
this.nav.navigateForward(["/authentication/changepassowrd"]); this.nav.navigateForward(['/authentication/changepassowrd']);
} }
public openProfile() { public openProfile() {
this.nav.navigateForward(["/profile/home"]); this.nav.navigateForward(['/profile/home']);
} }
public openEditProfile() { public openEditProfile() {
this.nav.navigateForward(["/profile/editprofile"]); this.nav.navigateForward(["/profile/editprofile"]);
} }
public openAccuralPage() { public openAccuralPage() {
this.nav.navigateForward(["/accrual-balances/home"]); this.nav.navigateForward(['/accrual-balances/home']);
} }
public openEITPage() { public openEITPage() {
this.nav.navigateForward(["/eit/homepage"]); this.nav.navigateForward(['/eit/homepage']);
} }
public openMyTeamPage() { public openMyTeamPage() {
this.nav.navigateForward(["/my-team/home"]); this.nav.navigateForward(['/my-team/home']);
} }
public static myTeamDetailUrl =["/my-team/details","/my-team/details-2"]
public openPage(link: string) {
this.nav.navigateForward([link]);
}
public static myTeamDetailUrl =['/my-team/details','/my-team/details-2']
public openMyTeamDetails() { public openMyTeamDetails() {
this.alternateNavigate(CommonService.myTeamDetailUrl,"teamDetail-open",true); this.alternateNavigate(CommonService.myTeamDetailUrl,'teamDetail-open',true);
// this.nav.navigateForward(["/my-team/details"]); // this.nav.navigateForward(["/my-team/details"]);
} }
public openAbsencePage() { public openAbsencePage() {
this.nav.navigateForward(["/absence/home"]); this.nav.navigateForward(['/absence/home']);
} }
public openSubmitAbsencePage() { public openSubmitAbsencePage() {
this.nav.navigateForward(["/absence/submit-absence"]); this.nav.navigateForward(['/absence/submit-absence']);
} }
public openConfirmAbsece() { public openConfirmAbsece() {
this.nav.navigateForward(["/absence/confirm-absence"]); this.nav.navigateForward(['/absence/confirm-absence']);
} }
public openWorkListAttachViewPage() { public openWorkListAttachViewPage() {
this.nav.navigateForward(["/notification/work-list-attach-view"]); this.nav.navigateForward(['/notification/work-list-attach-view']);
} }
public openviewAbsenceAttachment() { public openviewAbsenceAttachment() {
this.nav.navigateForward(["/absence/view-attachements"]); this.nav.navigateForward(['/absence/view-attachements']);
} }
public openNotificationPage() { public openNotificationPage() {
this.nav.navigateForward(["/notification/homepage"]); this.nav.navigateForward(['/notification/homepage']);
} }
public openWorklistMainPage() { public openWorklistMainPage() {
this.nav.navigateForward(["/notification/worklist-main"]); this.nav.navigateForward(['/notification/worklist-main']);
} }
public openWorklistMainPRPage() { public openWorklistMainPRPage() {
this.nav.navigateForward(["/notification/worklist-main-PR"]); this.nav.navigateForward(['/notification/worklist-main-PR']);
} }
public openWorklistMainPOPage() { public openWorklistMainPOPage() {
this.nav.navigateForward(["/notification/worklist-main-PO"]); this.nav.navigateForward(['/notification/worklist-main-PO']);
} }
public openWorklistReplacementRollPage() { public openWorklistReplacementRollPage() {
this.nav.navigateForward(["/notification/work-list-replacement-roll"]); this.nav.navigateForward(['/notification/work-list-replacement-roll']);
} }
public openNotificationDetailsPage() { public openNotificationDetailsPage() {
this.nav.navigateForward(["/notification/work-list-details"]); this.nav.navigateForward(['/notification/work-list-details']);
} }
public openWorklistHistoryPage() { public openWorklistHistoryPage() {
this.nav.navigateForward(["/notification/work-list-action-history"]); this.nav.navigateForward(['/notification/work-list-action-history']);
} }
public openWorklistAttachPage() { public openWorklistAttachPage() {
this.nav.navigateForward(["/notification/work-list-attach"]); this.nav.navigateForward(['/notification/work-list-attach']);
} }
public openWorklistRFCPage() { public openWorklistRFCPage() {
this.nav.navigateForward(["/notification/work-list-rfc"]); this.nav.navigateForward(['/notification/work-list-rfc']);
} }
public openWorklistRollReplacement() { public openWorklistRollReplacement() {
this.nav.navigateForward(["/notification/work-list-replacement-roll"]); this.nav.navigateForward(['/notification/work-list-replacement-roll']);
} }
public openItemHistoryPage() { public openItemHistoryPage() {
this.nav.navigateForward(["/notification/item-history-PO"]); this.nav.navigateForward(['/notification/item-history-PO']);
} }
public openQutationAnalysisPage() { public openQutationAnalysisPage() {
this.nav.navigateForward(["/notification/qutation-analysis-PO"]); this.nav.navigateForward(['/notification/qutation-analysis-PO']);
} }
public openWorklistMainMRPage() { public openWorklistMainMRPage() {
this.nav.navigateForward(["/notification/worklist-main-MR"]); this.nav.navigateForward(['/notification/worklist-main-MR']);
}
public openWorklistITGPage() {
this.nav.navigateForward(['/notification/worklist-main-ITG']);
} }
public openMySpecialistPage() { public openMySpecialistPage() {
this.nav.navigateForward(["/my-specialist/home"]); this.nav.navigateForward(['/my-specialist/home']);
} }
public openMySubordinatePage() { public openMySubordinatePage() {
this.nav.navigateForward(["/my-subordinate/home"]); this.nav.navigateForward(['/my-subordinate/home']);
} }
public openChangeImagePage() { public openChangeImagePage() {
this.nav.navigateForward(["/profile/profileImg"]); this.nav.navigateForward(['/profile/profileImg']);
} }
public openPayslipPage() { public openPayslipPage() {
this.nav.navigateForward(["/payslip/home"]); this.nav.navigateForward(['/payslip/home']);
} }
public openEarningsPage() { public openEarningsPage() {
this.nav.navigateForward(["/payslip/Earnings"]); this.nav.navigateForward(['/payslip/Earnings']);
} }
public openDeductionsPage() { public openDeductionsPage() {
this.nav.navigateForward(["/payslip/Deductions"]); this.nav.navigateForward(['/payslip/Deductions']);
} }
public openConfirmLoginPage() { public openConfirmLoginPage() {
this.nav.navigateForward(["/authentication/confirmLogin"]); this.nav.navigateForward(['/authentication/confirmLogin']);
} }
public openEditprofile() { public openEditprofile() {
this.nav.navigateForward(["/profile/editProfile"]); this.nav.navigateForward(["/profile/editProfile"]);
@ -1199,7 +1206,7 @@ public getMonthNameAr(value: number): string {
public reload(url: string, from: string) { public reload(url: string, from: string) {
console.log("force reload called from:" + from); console.log('force reload called from:' + from);
// window.location.reload(); // window.location.reload();
location.href = url; location.href = url;
} }
@ -1223,11 +1230,11 @@ public getMonthNameAr(value: number): string {
private alternateNavigate(paths: string[], key: string, root = false) { private alternateNavigate(paths: string[], key: string, root = false) {
let url: string; let url: string;
if (localStorage.getItem(key) === "yes") { if (localStorage.getItem(key) === 'yes') {
localStorage.setItem(key, "no"); localStorage.setItem(key, 'no');
url = paths[0]; url = paths[0];
} else { } else {
localStorage.setItem(key, "yes"); localStorage.setItem(key, 'yes');
url = paths[1]; url = paths[1];
} }
if (root) { if (root) {
@ -1238,14 +1245,14 @@ public getMonthNameAr(value: number): string {
} }
public openLogin() { public openLogin() {
this.nav.navigateRoot(["/authentication/login"]); this.nav.navigateRoot(['/authentication/login']);
} }
public openUserForgot() { public openUserForgot() {
this.nav.navigateForward(["/authentication/checkuser"]); this.nav.navigateForward(['/authentication/checkuser']);
} }
public openSMSPage() { public openSMSPage() {
this.nav.navigateForward(["/authentication/smspage"]); this.nav.navigateForward(['/authentication/smspage']);
} }
public navigateTo(url: string) { public navigateTo(url: string) {
@ -1281,11 +1288,11 @@ public getMonthNameAr(value: number): string {
if (state == this.diagnostic.bluetoothState.POWERED_ON) { if (state == this.diagnostic.bluetoothState.POWERED_ON) {
feedback(); feedback();
} else { } else {
this.presentAlert(this.ts.trPK("bluetooth", "start")); this.presentAlert(this.ts.trPK('bluetooth', 'start'));
} }
}) })
.catch(e => { .catch(e => {
this.presentAlert(this.ts.trPK("bluetooth", "start")); this.presentAlert(this.ts.trPK('bluetooth', 'start'));
}); });
}); });
} }
@ -1315,7 +1322,7 @@ public getMonthNameAr(value: number): string {
} }
for (i = 0; i < list.length; i += 1) { for (i = 0; i < list.length; i += 1) {
node = list[i]; node = list[i];
if (node.PARENT_MENU_NAME !== "") { if (node.PARENT_MENU_NAME !== '') {
// if you have dangling branches check that map[node.parentId] exists // if you have dangling branches check that map[node.parentId] exists
list[map[node.PARENT_MENU_NAME]].children.push(node); list[map[node.PARENT_MENU_NAME]].children.push(node);
} else { } else {
@ -1327,8 +1334,8 @@ public getMonthNameAr(value: number): string {
public reverseFormatDate(date) { public reverseFormatDate(date) {
let FormatedDate; let FormatedDate;
if (date) { if (date) {
FormatedDate = date.replace(/\//g, "-"); FormatedDate = date.replace(/\//g, '-');
FormatedDate = FormatedDate.replace(/ 00:00:00/g, ""); FormatedDate = FormatedDate.replace(/ 00:00:00/g, '');
} else { } else {
FormatedDate = date; FormatedDate = date;
} }
@ -1337,7 +1344,7 @@ public getMonthNameAr(value: number): string {
public formatStandardDate(date) { public formatStandardDate(date) {
let FormatedDate; let FormatedDate;
if (date) { if (date) {
FormatedDate = date.replace(/-/g, "/"); FormatedDate = date.replace(/-/g, '/');
} else { } else {
FormatedDate = date; FormatedDate = date;
} }
@ -1346,7 +1353,7 @@ public getMonthNameAr(value: number): string {
public reverseFormatStandardDate(date) { public reverseFormatStandardDate(date) {
let FormatedDate; let FormatedDate;
if (date) { if (date) {
FormatedDate = date.replace(/\//g, "-"); FormatedDate = date.replace(/\//g, '-');
} else { } else {
FormatedDate = date; FormatedDate = date;
} }
@ -1358,8 +1365,8 @@ public getMonthNameAr(value: number): string {
if (date) { if (date) {
date = date.slice(0, 10); date = date.slice(0, 10);
FormatedDate = date.replace(/-/g, "/"); FormatedDate = date.replace(/-/g, '/');
FormatedDate = FormatedDate + " 00:00:00"; FormatedDate = FormatedDate + ' 00:00:00';
} else { } else {
FormatedDate = date; FormatedDate = date;
} }
@ -1371,8 +1378,8 @@ public getMonthNameAr(value: number): string {
console.log(date); console.log(date);
if (date) { if (date) {
// FormatedDate = date.replace(/-/g, "/"); // FormatedDate = date.replace(/-/g, "/");
FormatedDate = date.split("T")[0]; FormatedDate = date.split('T')[0];
FormatedDate = FormatedDate + " 00:00:00"; FormatedDate = FormatedDate + ' 00:00:00';
console.log(FormatedDate); console.log(FormatedDate);
} else { } else {
FormatedDate = date; FormatedDate = date;
@ -1381,12 +1388,12 @@ public getMonthNameAr(value: number): string {
} }
public setUpdateImage (image){ public setUpdateImage (image){
console.log("setUpdateImage"); console.log('setUpdateImage');
this.setUpdateImg=image; this.setUpdateImg=image;
this.updateImage=true; this.updateImage=true;
} }
public getUpdateImage(){ public getUpdateImage(){
console.log("getUpdateImage"); console.log('getUpdateImage');
const objImg={ const objImg={
img: this.setUpdateImg, img: this.setUpdateImg,
status: this.updateImage status: this.updateImage

@ -4,5 +4,5 @@ export class GetSubordinatesLeavesRequest extends Request{
//public static SHARED_DATA = ''; //public static SHARED_DATA = '';
public P_DATE_FROM :any; public P_DATE_FROM :any;
public P_DATE_TO :any; public P_DATE_TO :any;
public P_SELECTED_EMPLOYEE_NUMBER:any;
} }

@ -49,9 +49,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden !important; overflow: hidden !important;
font-size: 0.46cm; font-size: 16px;
width: 78%; width: 78%;
font-weight: bold; font-weight: bold !important;
} }

@ -0,0 +1,5 @@
<div class="main-container" [ngStyle]="active === true ? {'background': color} : {}">
<div class="main-container-radius" [ngStyle]="active === true ? {'background-color': '#ffffff'} : {'background-color': color}"></div>
<span class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span>
<span class="text-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{text}}</span>
</div>

@ -0,0 +1,32 @@
.main-container{
width: 72px;
background-color: white;
padding: 10px;
border-radius: 20px;
height: 70px;
text-align: right;
font-family: WorkSans-Regular;
padding-top: 25px;
box-shadow: 0 0 6px rgba(0,0,0,0.16);
position: relative;
}
.main-container-radius{
// content: "";
position: absolute;
width: 30px;
height: 6px;
border-radius: 10px;
background-color: red;
left: 10px;
top: 10px;
}
.number-span{
font-size: 19px;
display: block;
line-height: 18px;
}
.text-span{
font-size: 14px;
color: #888;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CardFilterComponent } from './card-filter.component';
describe('CardFilterComponent', () => {
let component: CardFilterComponent;
let fixture: ComponentFixture<CardFilterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CardFilterComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CardFilterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,18 @@
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-card-filter',
templateUrl: './card-filter.component.html',
styleUrls: ['./card-filter.component.scss'],
})
export class CardFilterComponent implements OnInit {
@Input() value: number;
@Input() text: string;
@Input() active: boolean;
@Input() color: string;
constructor() { }
ngOnInit() {}
}

@ -6,6 +6,7 @@ import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { HomePage } from './home.page'; import { HomePage } from './home.page';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { WorklistMainService } from '../notification/service/work-list.main.service';
const routes: Routes = [ const routes: Routes = [
{ {
@ -26,7 +27,8 @@ const routes: Routes = [
HomePage HomePage
], ],
providers: [ providers: [
BarcodeScanner BarcodeScanner,
WorklistMainService
] ]
}) })
export class HomePageModule { } export class HomePageModule { }

@ -16,7 +16,8 @@
<app-stats-button <app-stats-button
[title]="button.title" [title]="button.title"
[statsValue]="button.statsValue" [statsValue]="button.statsValue"
[icon]="button.icon"> [icon]="button.icon"
(click)="openStatsButton(button.link)">
</app-stats-button> </app-stats-button>
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>

@ -39,10 +39,6 @@ ion-label{
position: relative; position: relative;
width: 100%; width: 100%;
} }
.header-md:after {
height: 0px !important;
display: none !important;
}
.contentBg:before { .contentBg:before {
position: absolute; position: absolute;
content: ""; content: "";

@ -33,6 +33,7 @@ import {GetOpenNotificationsResponse} from '../hmg-common/services/dashbored/mod
import {GetSubordinatesAttdStatusResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse' import {GetSubordinatesAttdStatusResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'
import {GetSubordinatesLeavesResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse' import {GetSubordinatesLeavesResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse'
import { AccrualService } from '../accrual-balances/services/accrual.service'; import { AccrualService } from '../accrual-balances/services/accrual.service';
import { WorklistMainService } from '../notification/service/work-list.main.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -57,27 +58,32 @@ export class HomePage implements OnInit {
{ {
title: 'Work List', title: 'Work List',
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/work_list.png' icon: 'assets/icon/new-design/work_list.png',
link: '/notification/homepage'
}, },
{ {
title: 'Pending Request', title: 'Pending Request',
statsValue: 13, statsValue: 13,
icon: 'assets/icon/new-design/pending_request.png' icon: 'assets/icon/new-design/pending_request.png',
link: ''
}, },
{ {
title: 'Missing Swipes', title: 'Missing Swipes',
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/missing_swipe.png' icon: 'assets/icon/new-design/missing_swipe.png',
link: ''
}, },
{ {
title: 'Leave Balance', title: 'Leave Balance',
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/leave_balance.png' icon: 'assets/icon/new-design/leave_balance.png',
link: ''
}, },
{ {
title: 'Ticket Balance', title: 'Ticket Balance',
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/ticket_balance.png' icon: 'assets/icon/new-design/ticket_balance.png',
link: ''
} }
]; ];
@ -117,6 +123,8 @@ export class HomePage implements OnInit {
public displayTime: any; public displayTime: any;
public menuEntries: any; public menuEntries: any;
public percent: any; public percent: any;
accrualBalancesList: any;
public countAllNotification: number =0;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -138,7 +146,8 @@ export class HomePage implements OnInit {
private file: File, private file: File,
private permissions: DevicePermissionsService, private permissions: DevicePermissionsService,
public DS: DashboredService, public DS: DashboredService,
public accrualService: AccrualService public accrualService: AccrualService,
public workListService: WorklistMainService,
) { ) {
this.events.subscribe('img-change', displayImg => { this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg); this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
@ -147,7 +156,7 @@ export class HomePage implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.getUserDetails(); // this.getUserDetails();
// this.getCount(); // this.getCount();
// this.events.subscribe('getNotCount', badge => { // this.events.subscribe('getNotCount', badge => {
@ -155,6 +164,13 @@ export class HomePage implements OnInit {
// }); // });
} }
ionViewWillEnter() {
this.remainingTime = 0;
this.displayTime = '00:00:00';
this.runTimer = false;
this.getUserDetails();
}
initTimer() { initTimer() {
this.runTimer = false; this.runTimer = false;
this.hasStarted = false; this.hasStarted = false;
@ -250,7 +266,7 @@ export class HomePage implements OnInit {
// }); // });
// } // }
ionViewDidLoad() { ionViewDidEnter() {
this.geolocation this.geolocation
.getCurrentPosition() .getCurrentPosition()
.then(resp => { .then(resp => {
@ -443,9 +459,10 @@ export class HomePage implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess')); this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
this.showAttendanceTracking(); this.showAttendanceTracking();
} else {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed'));
} }
// else {
// this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed'));
// }
}); });
} }
@ -489,9 +506,6 @@ export class HomePage implements OnInit {
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
this.initTimer(); this.initTimer();
console.log('remainingTime: ' + this.remainingTime);
console.log('scheduledTime: ' + this.scheduledTime);
console.log('isCheckedIn: ' + this.isCheckedIn);
} }
showAttendanceTracking() { showAttendanceTracking() {
@ -515,11 +529,20 @@ export class HomePage implements OnInit {
this.DS.getOpenNotifications( () => { console.log('Error '); }).subscribe((result: GetOpenNotificationsResponse) => { this.DS.getOpenNotifications( () => { console.log('Error '); }).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
const key = 'P_OPEN_NTF_NUMBER'; const key = 'P_OPEN_NTF_NUMBER';
this.statsButtons[0].statsValue = result[key]; this.countAllNotification = result[key];
this.ITGCountAllNotification();
this.common.sharedService.setSharedData(result, 'worklistNotifications');
} }
}); });
} }
ITGCountAllNotification(){
this.workListService.getITGDetails()
.subscribe((result: any) => {
this.statsButtons[0].statsValue = this.countAllNotification + result.TotalCount;
});
}
getSubordinatesLeaves() { getSubordinatesLeaves() {
const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest(); const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test
@ -546,6 +569,7 @@ export class HomePage implements OnInit {
} }
openPage(subMenu) { openPage(subMenu) {
console.log("openPage");
let selMenu: MenuResponse = new MenuResponse(); let selMenu: MenuResponse = new MenuResponse();
selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = subMenu; selMenu.GetMenuEntriesList = subMenu;
@ -579,9 +603,14 @@ export class HomePage implements OnInit {
.subscribe((result: any) => { .subscribe((result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
let totalTicketsLeft = 0; let totalTicketsLeft = 0;
this.accrualBalancesList = result.GetAccrualBalancesList;
for (const accrualBalance of result.GetAccrualBalancesList) { for (const accrualBalance of result.GetAccrualBalancesList) {
if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') { if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') {
this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT; this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT;
this.common.sharedService.setSharedData( accrualBalance, 'leaveAccrualBalance');
this.common.sharedService.setSharedData( request, 'leaveAccrualBalanceDate');
this.common.sharedService.setSharedData( this.accrualBalancesList, 'tickitsbalance')
} else { } else {
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
} }
@ -599,6 +628,11 @@ export class HomePage implements OnInit {
this.common.openEditProfile(); this.common.openEditProfile();
} }
openStatsButton(link: string) {
console.log(link);
this.common.openPage(link);
}
} }

@ -19,9 +19,9 @@ export class ApplyActionModalComponent implements OnInit {
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService, constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService,
) { ) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false);
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr' ,false);
this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage'); this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage',false);
} }

@ -1,227 +1,94 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title> <ion-buttons slot="start">
<ion-buttons slot="start"> <nav-buttons backLink="/home"></nav-buttons>
<nav-buttons backLink="/home"></nav-buttons> </ion-buttons>
</ion-buttons> <ion-title>WORK LIST</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content [ngClass]=" direction == 'ltr' ? 'left' : 'right'">
<!-- first select type view -->
<!-- <ion-item>
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="notificationType"
(ionChange)=onChangeView($event)>
<ion-select-option value="1" selected="true">{{ts.trPK('worklist','openNot')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
</ion-select>
</ion-item>
<ion-item> <ion-content>
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label> <div class="contentBg">
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="searchBy" <div class="result-graph">
(ionChange)="getValueSelected($event)"> <div class="request-heading">
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option> <span>Open Request Analysis</span>
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option> </div>
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option> <div class="result-text-container">
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option> <h2>{{totalRequestCount}}</h2>
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option> <span>TOTAL <br> OPEN REQUEST</span>
</div>
</ion-select> <p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</ion-item> --> </div>
<ion-grid>
<ion-row> <ion-row class="filters-row">
<ion-col size='3' class="ion-no-padding , menuListCol"> <ion-slides [options]="slideOptsOne">
<ion-list class="menuList"> <ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''">
<ion-item class="menuListItem" lines="none"> <app-card-filter
[value]="filter.value"
<ion-button class="menuListBtn" (click)="AllNotification()"> [text]="filter.name"
<img *ngIf="!isAll" src="../assets/imgs/menuTabs/All1.png" /> [color]="filter.color"
<img *ngIf="isAll" src="../assets/imgs/menuTabs/All2.png" /> [active]="filter.active"
</ion-button> (click)="activeFilter(i)"
</ion-item> ></app-card-filter>
<ion-item class="menuListItem" lines="none"> </ion-slide>
<!-- <ion-item lines="none" class="activeTabMenu"*ngIf="isPR"></ion-item> --> </ion-slides>
<!-- <ion-button class="menuListBtn" (click)="PRNotification()"><p style="color: black;">PR</p></ion-button> --> </ion-row>
<ion-button ion-button class="menuListBtn" (click)="PRNotification()">
<img *ngIf="!isPR" src="../assets/imgs/menuTabs/PR1.png" /> <ion-row class="search-container">
<img *ngIf="isPR" src="../assets/imgs/menuTabs/PR2.png" /> <ion-col style="float: left;" size=[6] *ngIf="showSearchButton" (click)="clearSearch()">
</ion-button> <span style="margin-left: 5px;">Clear Search</span>
</ion-item> <ion-icon name="close" ></ion-icon>
<ion-item class="menuListItem" lines="none"> </ion-col>
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter === 'ALL'">
<ion-button class="menuListBtn" (click)="PONotification()"> <ion-icon name="search" ></ion-icon>
<img *ngIf="!isPO" src="../assets/imgs/menuTabs/PO1.png" /> <span>Advanced Search</span>
<img *ngIf="isPO" src="../assets/imgs/menuTabs/PO2.png" /> </ion-col>
</ion-button> </ion-row>
</ion-item> <!-- <div class="total-result" *ngIf="isEmptyObject() && selectedFilter === 'ALL' && showSearchButton === false">
<ion-item class="menuListItem" lines="none"> <span>showing {{newWorkListResponse.length}} of {{filters[0].value}}</span>
</div> -->
<ion-button class="menuListBtn" (click)="MRNotification()">
<img *ngIf="!isMR" src="../assets/imgs/menuTabs/MR1.png" />
<img *ngIf="isMR" src="../assets/imgs/menuTabs/MR2.png" />
</ion-button>
</ion-item>
<ion-item class="menuListItem" lines="none">
<ion-button class="menuListBtn" (click)="HRNotification()"> <ion-row *ngIf='selectedFilter === "ITG"'>
<img *ngIf="!isHR" src="../assets/imgs/menuTabs/HR1.png" /> <ion-col>
<img *ngIf="isHR" src="../assets/imgs/menuTabs/HR2.png" /> <ion-slides>
</ion-button> <ion-slide class='slideCss' *ngFor="let segment of ITGSegment">
</ion-item> <span [ngClass]="segment.style? 'text-span-active': 'text-span'" (click)="setActive(segment.code)">
<ion-item class="menuListItem" lines="none"> {{segment.name}}
<ion-button class="menuListBtn" (click)="ITGNotification()"> </span>
<img *ngIf="!isITG" src="../assets/imgs/menuTabs/ITG1.png" /> </ion-slide>
<img *ngIf="isITG" src="../assets/imgs/menuTabs/ITG2.png" /> </ion-slides>
</ion-button>
</ion-item>
</ion-list>
</ion-col> </ion-col>
<ion-col size='9' class="notifincationList"> </ion-row>
<ion-list class="notification-list" *ngIf="!noData">
<div class="timelineMain">
<ion-item class="itemListNotification" *ngFor="let notificationList of filteredNotificationList"
lines='none'>
<div class="item-date"> {{notificationList.BEGIN_DATE | dateString }} </div>
<div class="timelineMain-item" slot="start">
<!-- <div class="item-date"> {{notificationList.BEGIN_DATE }} </div> -->
<div class="timelineMain-thumb bg-color-dot timelineMain-icon">
</div>
</div>
<ion-label (click)="openNotificationDetail(notificationList)"> {{notificationList.SUBJECT}}
</ion-label>
</ion-item>
</div>
</ion-list>
<ion-list class="emptyItem" *ngIf="noData">
<ion-item class="itemListNotification" lines='none'>
<ion-label> There is no Notification
</ion-label>
</ion-item>
</ion-list>
<!-- <ion-list class="notification-list " *ngIf="isPR">
<div class="timeline">
<p>PR</p>
</div>
</ion-list>
<ion-list class="notification-list " *ngIf="isPO">
<div class="timeline">
<p>PO</p>
</div>
</ion-list>
<ion-list class="notification-list " *ngIf="isMR"> <div [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *ngIf='selectedFilter != "ITG"'>
<div class="timeline"> <div *ngFor="let data of showFormattedData | keyvalue; let i = index">
<p>MR</p> <span class="date-span">{{data.key}}</span>
<div (click)="openNotificationDetail(data.value)" class="date-data" *ngFor="let workList of data.value; let j = index">
<p>{{workList.SUBJECT}}</p>
</div> </div>
</ion-list> </div>
</div>
<ion-list class="notification-list " *ngIf="isHR">
<div class="timeline">
<p>HR</p>
</div>
</ion-list>
<ion-list class="notification-list " *ngIf="isITG"> <div [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div class="timeline"> <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'>
<p>ITG</p> <span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
<div class="date-data">
<p>{{segmentInfo.Title}}</p>
</div> </div>
</ion-list> --> </div>
</div>
</ion-col>
</ion-row>
</ion-grid> <div class="no-data-available" *ngIf="!isEmptyObject()">
<span>No Data Available</span>
</div>
<!-- *ngIf="rowsNo <= noOfrows" --> </div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</ion-content> </ion-content>
<ion-footer class="footerSearchBtn" *ngIf="!isSearch">
<ion-button color="customnavy" expand="full" fill="outline" (click)="searchBtn()">{{ts.trPK('worklist','search')}}
</ion-button>
</ion-footer>
<ion-footer class="footerSearchBtn" *ngIf="isSearch">
<ion-grid>
<ion-row>
<!-- <ion-col size='3'> </ion-col> -->
<ion-col>
<div class="viewAndSearch">
<ion-item lines="none">
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="notificationType" (ionChange)=onChangeView($event)>
<ion-select-option value="1" selected="true">{{ts.trPK('worklist','openNot')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
</ion-select>
</ion-item>
</div>
<div class="viewAndSearch">
<ion-item>
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="searchBy" (ionChange)="getValueSelected($event)">
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
</ion-select>
</ion-item>
<div>
<div *ngIf="HideDateInput==true">
<ion-item lines='none'>
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY"
pickerFormat="DD-MMM-YYYY" [(ngModel)]="InputDate"></ion-datetime>
</ion-item>
</div>
<div *ngIf="HideTextInput==true">
<ion-item>
<ion-input placeholder="{{ts.trPK('worklist','enter')}}" [(ngModel)]="inputSearch">
</ion-input>
</ion-item>
</div>
</div>
<div>
<ion-button class="toSearchBtn" color="customnavy" expand="full" fill="outline"
(click)="getAllPushNotificationFun()">
{{ts.trPK('worklist','search')}}</ion-button>
<ion-button class="toSearchBtn" color="customnavy" expand="full" fill="outline" (click)="searchBtn()">
{{ts.trPK('general','close')}}</ion-button>
</div>
<ion-button color="customnavy" (click)="Details()">Call details ITG</ion-button>
<ion-button color="customnavy" (click)="Count()">Call count ITG</ion-button>
<!--
<ion-button color="customnavy" (click)="getAllPushNotificationFun()">{{ts.trPK('worklist','search')}}</ion-button> -->
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-footer>

@ -216,4 +216,205 @@ ion-input ,ion-datetime{
.emptyItem{ .emptyItem{
white-space: normal; white-space: normal;
padding-left: 10%; padding-left: 10%;
} }
///////////////////////////////////////////NEW DESIGN/////////////////////////////////////
.profile-image-container{
position: relative;
z-index: 999;
img {
width: 32px;
float: right;
border-radius: 20px;
height: 32px;
margin-right: 10px;
}
}
ion-title{
color: white;
position: absolute;
top: 0;
text-align: center;
left: 15%;
right: 15%;
font-size: 0.42cm;
font-weight: bold;
height: 100%;
}
.contentBg:before {
position: absolute;
content: "";
background: #22c6b3;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
ion-content {
--ion-background-color: whitesmoke;
}
.request-heading {
span {
text-align: center;
display: block;
padding-top: 8px;
font-family: workSans-Regular;
}
}
.result-graph {
position: relative;
background: white;
margin-right: 20px;
margin-left: 20px;
margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
}
.result-text-container {
padding: 0;
margin: 0;
position: absolute;
left: 50%;
top: 50%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 38px;
font-family: WorkSans-Bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
}
}
.today-graph {
width: 100%;
max-height: 4cm;
}
.swiper-container {
margin: 0 !important;
width: 100% !important;
}
.filters-row {
margin-top: 10px;
margin-left: 20px;
}
.work-list-container {
position: relative;
padding-left: 60px;
clear: both;
min-height: 200px;
margin-bottom: 80px;
padding-top: 15px;
}
.work-list-container:before{
content: "";
position: absolute;
height: 100%;
width: 4px;
left: 30px;
top: 15px;
background-color: #dddddd;
}
.search-container{
margin-top: 15px;
display: block;
padding: 0 20px;
ion-col{
background: white;
border-radius: 12px;
padding-right: 10px;
flex: none;
ion-icon{
margin-right: 3px;
font-size: 14px;
margin-left: 3px;
vertical-align: middle;
}
span{
font-size: 12px;
vertical-align: middle;
}
}
}
.date-span {
position: relative;
display: block;
margin-bottom: 10px;
}
.date-span:before{
content: "";
position: absolute;
left: -35px;
border-radius: 50%;
width: 15px;
height: 15px;
background-color: #38c9b3;
top: 1px;
}
.date-data{
background-color: white;
padding: 1px;
border-radius: 20px;
font-family: WorkSans-Regular;
padding-left: 15px;
margin-right: 20px;
margin-bottom: 15px;
p{
font-size: 14px;
}
}
.no-data-available {
background: white;
font-family: WorkSans-Regular;
padding: 30px;
position: absolute;
left: 50%;
margin-left: -100px;
margin-top: 100px;
}
.disable-filter {
pointer-events: none;
opacity: .3;
}
.total-result {
margin-top: 55px;
padding-left: 20px;
color: #888;
font-size: 15px;
}
.text-span{
font-size: 14px;
color: #888;
background-color: white;
width: 93%;
height: 30px;
border: 1px solid;
border-radius: 15px;
}
.text-span-active{
font-size: 14px;
color: #888;
background-color:#22c6b3;
width: 93%;
height: 30px;
border: 1px solid;
border-radius: 15px;
}
.slideCss{
width: 200px !important;
}

@ -1,336 +1,458 @@
import { Component, OnInit, ViewChild } from "@angular/core"; import { Component, OnInit, ViewChild } from '@angular/core';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { ModalController } from '@ionic/angular';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { WorkListRequest } from "../models/workListRequest"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import * as moment from "moment"; import { WorkListRequest } from '../models/workListRequest';
import { WorKListResponse } from "../models/workListResponse"; import * as moment from 'moment';
import { WorklistService } from "../service/worklist.service"; import { WorklistService } from '../service/worklist.service';
import { IonInfiniteScroll } from '@ionic/angular'; import { IonInfiniteScroll } from '@ionic/angular';
import { WorklistMainService } from '../service/work-list.main.service'; import { WorklistMainService } from '../service/work-list.main.service';
import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component';
import { DatePipe } from '@angular/common';
@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 {
// @ViewChild(Navbar) navBar: Navbar; public static REQUSET_NAME = 'requst_name';
public static REQUSET_INFO = 'requset_info';
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';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
private WorkListObj: WorkListRequest; private WorkListObj: WorkListRequest;
WorkListResObj: any; //WorKListResponse; WorkListResObj: any;
notificationType: string = "1"; notificationType = '1';
pageNum: number = 1; pageNum = 1;
rowsNo: number; rowsNo: number;
noOfrows: number; noOfrows: number;
selectedValue: string = ""; selectedValue = '';
FromUserName: string = ""; FromUserName = '';
ItemKeyDisplayName: string = ""; ItemKeyDisplayName = '';
SentDate: string = ""; SentDate = '';
Subject: string = ""; Subject = '';
inputSearch: string = ""; inputSearch = '';
HideDateInput: boolean = false; inputDate: string;
HideTextInput: boolean = false;
InputDate: string;
filteredNotificationList: any; filteredNotificationList: any;
IsReachEnd: boolean = false; isReachEnd = false;
public noData: boolean = false; public isAll = true;
public isAll: boolean = true; public isPR = false;
public isPR: boolean = false; public isPO = false;
public isPO: boolean = false; public isMR = false;
public isMR: boolean = false; public isHR = false;
public isHR: boolean = false; public noData = false;
public isITG: boolean = false; public isITG = false;
public isSearch: boolean = false; public isSearch = false;
public direction = 'ltr'; public direction = 'ltr';
public ITGCount = 0;
public ITGSegment: {name: string, code: any, data: any, style: boolean} [] = [];
public ITGAllItem: any = [];
public selectedITGToActive = false;
public ITGItem: any = [];
public activeSegment: any;
public currentActiveIndex = 0;
public previousActiveIndex = 0;
public worklistNotifications: any;
public totalRequestCount = 0;
public newWorkListResponse = [];
public showFormattedData = {};
public selectedFilter = 'ALL';
public showSearchButton = false;
public itemType = '';
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [0, 0, 0, 0, 0],
backgroundColor: [
'#18a169',
'#38c9b3',
'#114475',
'#3cb9d5',
'#cc3232'
],
borderWidth: 5
}]
};
public filters = [
{
value: 0,
name: 'All',
active: true,
color: '#124375',
key: 'ALL',
disable: false
},
{
value: 0,
name: 'HR',
active: false,
color: '#18a169',
key: 'HRSSA',
disable: false
},
{
value: 0,
name: 'PO',
active: false,
color: '#38c9b3',
key: 'POAPPRV',
disable: false
},
{
value: 0,
name: 'PR',
active: false,
color: '#114475',
key: 'REQAPPRV',
disable: false
},
{
value: 0,
name: 'MR',
active: false,
color: '#3cb9d5',
key: 'INVMOA',
disable: false
},
{
value: 0,
name: 'ITG',
active: false,
color: '#cc3232',
key: 'ITG',
disable: false
}
];
public slideOptsOne = {
slidesPerView: 4.3,
spaceBetween: 10
};
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public WorklistService: WorklistService, public WorklistService: WorklistService,
public workListService: WorklistMainService, public workListService: WorklistMainService,
) { public modalController: ModalController
this.WorkListObj = new WorkListRequest(); ) {
this.WorkListObj.P_NOTIFICATION_TYPE = "1"; this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_SEARCH_FROM_USER = ""; this.WorkListObj.P_NOTIFICATION_TYPE = '1';
this.WorkListObj.P_SEARCH_SUBJECT = ""; this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_SENT_DATE = ""; this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_PAGE_NUM = 0; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_LIMIT = 50; //number this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50;
} }
ngOnInit() { ngOnInit() {
this.direction = TranslatorService.getCurrentDirection(); // this.direction = TranslatorService.getCurrentDirection();
} this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
ionViewDidLoad() { this.Details();
// this.navBar.backButtonClick = () => { this.Count();
// // you can set a full custom history here if you want this.assignDataToFilters();
// let pages = [
// {
// page: "HomePage"
// }
// ];
// this.navCtrl.setPages(pages);
// };
}
ionViewWillEnter() {
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
} }
getValueSelected(Value) {
this.selectedValue = Value.detail.value; assignDataToFilters() {
if (this.selectedValue == "1") { this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.HideDateInput = false; const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
this.HideTextInput = true; for (const notification of openNotificationsArray) {
} else if (this.selectedValue == "2") { if (notification.ITEM_TYPE === 'HRSSA') {
this.HideDateInput = false; this.filters[1].value = notification.OPEN_NTF_NUMBER;
this.HideTextInput = true; this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (this.selectedValue == "3") { } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.HideDateInput = true; this.filters[2].value = notification.OPEN_NTF_NUMBER;
this.HideTextInput = false; this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (this.selectedValue == "4") { } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.HideDateInput = false; this.filters[3].value = notification.OPEN_NTF_NUMBER;
this.HideTextInput = true; this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (this.selectedValue == "5") { } else if (notification.ITEM_TYPE === 'INVMOA') {
this.HideDateInput = false; this.filters[4].value = notification.OPEN_NTF_NUMBER;
this.HideTextInput = false; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'ITG') {
this.filters[5].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER;
}
} }
} }
getAllPushNotificationFun() {
this.WorkListObj.P_PAGE_NUM = 1;
this.IsReachEnd = false;
if (this.selectedValue == "1") {
this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch;
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "2") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch;
} else if (this.selectedValue == "3") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
if (this.InputDate)
this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format(
"DD-MMM-YYYY"
);
else this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "4") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch;
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "5") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
}
this.WorklistService.getWorkList(this.WorkListObj).subscribe( activeFilter(index: number) {
(result: WorKListResponse) => { if (this.currentActiveIndex !== index) {
this.handleWorkListResult(result); this.showFormattedData = {};
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false;
this.filters[this.currentActiveIndex].active = true;
if (this.filters[this.currentActiveIndex].value !== 0) {
const selectedKey = this.filters[this.currentActiveIndex].key;
this.resetData();
this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : '';
this.getAllPushNotificationFun();
} }
); this.selectedFilter = this.filters[this.currentActiveIndex].key;
} //End getNotifications }
}
private handleWorkListResult(result) { openProfilePage() {
if (this.common.validResponse(result)) { this.common.openProfile();
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); }
if (this.common.hasData(result.GetWorkList)) {
this.WorkListObj.P_PAGE_NUM++; disableFilters() {
this.WorkListResObj = result.GetWorkList; for (const filter of this.filters) {
this.filteredNotificationList = this.WorkListResObj; if (filter.key === this.itemType) {
this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR); filter.disable = false;
let lastItemIndex = this.WorkListResObj.length - 1; filter.active = true;
if (result.GetWorkList[lastItemIndex]) { this.selectedFilter = filter.name;
let lastitem = result.GetWorkList[lastItemIndex]; } else if (this.itemType === '') {
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { filter.disable = false;
this.IsReachEnd = true; filter.active = false;
} else {
this.IsReachEnd = false;
}
// this.navCtrl.push('SmsAuthenticatePage');
}
} else { } else {
this.WorkListResObj = []; filter.disable = true;
filter.active = false;
} }
} }
if (this.itemType === '') {
this.filters[0].active = true;
}
} }
openNotificationDetail(obj) { async openSearchModal() {
console.log(obj); const modal = await this.modalController.create({
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); component: WorklistAdvancedSearchComponent,
//this.common.openWorklistMainPage(); cssClass: 'advanced-search-modal',
if(obj.REQUEST_TYPE == "PR"){ backdropDismiss: false,
this.common.openWorklistMainPRPage(); componentProps: {}
} });
else if(obj.REQUEST_TYPE == "PO"){ modal.onDidDismiss().then(result => {
this.common.openWorklistMainPOPage(); if (result.data) {
} if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
else if(obj.REQUEST_TYPE == "MO"){ this.showSearchButton = true;
this.common.openWorklistMainMRPage(); this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
this.selectedValue = result.data.selectedValue;
this.inputDate = result.data.inputDate;
this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = [];
this.showFormattedData = {};
this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true;
if (this.itemType !== '') {
this.disableFilters();
}
this.getAllPushNotificationFun();
}
} }
});
else{ return await modal.present();
this.common.openWorklistMainPage();
}
//this.navCtrl.push("WorkListMainPage", { passNotificationList: obj });
}
onChangeView(selectedValue: any) {
this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value;
} }
doInfinite(infiniteScroll) { getAllPushNotificationFun() {
//this.pageNum= this.pageNum + 1; this.WorkListObj.P_PAGE_NUM = 1;
this.isReachEnd = false;
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; ;
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') {
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
if (!this.IsReachEnd) { this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
this.WorklistService.getWorkList(this.WorkListObj).subscribe( if (this.common.validResponse(result)) {
(result: any) => { this.handleWorkListResult(result.GetWorkList);
if (this.common.validResponse(result)) { }
this.WorkListObj.P_PAGE_NUM++;
if (this.common.hasData(result.GetWorkList)) {
result.GetWorkList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.WorkListResObj.push(element);
});
} // if list length >0
else {
this.IsReachEnd = true;
}
} // if response == 1
//this.pageNum++;
this.infiniteScroll.complete();
} }
); );
} else {
if (this.infiniteScroll) this.infiniteScroll.complete();
}
} //end infiniteScroll
Count() {
this.workListService.getITGCount()
.subscribe((result: any) => {
console.log("ENAD ITG COUNT:")
console.log(result);
});
} }
filterNotificationByRequestType(reqType) { categorizeData(arrayToCategorize: any) {
let filterdType = []; const datePipe = new DatePipe('en-US');
if (reqType == "All") { const formattedData = {};
this.filteredNotificationList = this.WorkListResObj; for (const workList of arrayToCategorize) {
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
this.noData = true; if (!(workList.FORMATTED_DATE in formattedData)) {
return false; formattedData[workList.FORMATTED_DATE] = new Array();
} else { formattedData[workList.FORMATTED_DATE].push(workList);
this.noData = false; } else {
return false; formattedData[workList.FORMATTED_DATE].push(workList);
}
} }
} return formattedData;
for (let i = 0; i < this.WorkListResObj.length; i++) { }
if(reqType=="HR"){
if ("EIT" == this.WorkListResObj[i].REQUEST_TYPE || "ABSENCE" == this.WorkListResObj[i].REQUEST_TYPE) { sortArray(arrayToSort: any) {
filterdType.push(this.WorkListResObj[i]); return arrayToSort.sort((a: any, b: any) =>
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
);
}
private handleWorkListResult(result: any) {
const lastItemIndex = result.length - 1;
const lastitem = result[lastItemIndex];
if (lastitem) {
if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) {
this.isReachEnd = true;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
} }
}else{ } else {
if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { this.isReachEnd = false;
filterdType.push(this.WorkListResObj[i]); if (this.infiniteScroll) {
this.infiniteScroll.complete();
} }
} }
} }
if (this.common.hasData(result)) {
this.filteredNotificationList = filterdType; this.WorkListObj.P_PAGE_NUM++;
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { if (this.newWorkListResponse.length === 0) {
this.noData = true; this.newWorkListResponse = result;
return false; } else {
this.newWorkListResponse = this.newWorkListResponse.concat(result);
}
this.newWorkListResponse = this.sortArray(this.newWorkListResponse);
console.log(this.newWorkListResponse);
this.showFormattedData = this.categorizeData(this.newWorkListResponse);
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
} else { } else {
this.noData = false; this.newWorkListResponse = [];
return false;
} }
} }
Details() { openNotificationDetail(obj) {
this.workListService.getITGDetails() this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA);
.subscribe((result: any) => { if (obj.REQUEST_TYPE === 'PR') {
console.log("ENAD ITG Details:") this.common.openWorklistMainPRPage();
console.log(result); } else if (obj[0].REQUEST_TYPE === 'PO') {
}); this.common.openWorklistMainPOPage();
} else if (obj[0].REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
} else {
this.common.openWorklistMainPage();
}
} }
isEmptyObject() {
return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0) || this.ITGItem.length > 0);
}
AllNotification() { resetData() {
this.filterNotificationByRequestType("All"); if (this.infiniteScroll) {
this.isAll = true; this.infiniteScroll.complete();
this.isPR = false; }
this.isPO = false; this.showSearchButton = false;
this.isMR = false; this.notificationType = '1';
this.isHR = false; this.selectedValue = '';
this.isITG = false; this.inputDate = '';
this.inputSearch = '';
this.newWorkListResponse = [];
this.showFormattedData = {};
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
} }
PRNotification() {
this.filterNotificationByRequestType("PR"); clearSearch() {
this.isAll = false; this.itemType = '';
this.isPR = true; this.selectedFilter = 'ALL';
this.isPO = false; this.disableFilters();
this.isMR = false; this.resetData();
this.isHR = false; this.getAllPushNotificationFun();
this.isITG = false;
} }
PONotification() {
this.filterNotificationByRequestType("PO");
this.isAll = false;
this.isPR = false;
this.isPO = true;
this.isMR = false;
this.isHR = false;
this.isITG = false;
doInfinite(infiniteScroll) {
if (!this.isReachEnd && this.selectedFilter !== 'ITG') {
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
}
});
} else {
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
}
} }
MRNotification() {
this.filterNotificationByRequestType("MO"); Count() {
this.isAll = false; this.workListService.getITGCount()
this.isPR = false; .subscribe((result: any) => {
this.isPO = false; for (let i = 0; i < result.RequestType.length; i++) {
this.isMR = true; this.ITGSegment[i] = {
this.isHR = false; name: result.RequestType[i].RequestTypeName,
this.isITG = false; code: result.RequestType[i].RequestTypeCode,
data: result.RequestType[i].RequestDetails,
style: false
};
}
this.setActive(this.ITGSegment[0].code);
});
} }
HRNotification() {
this.filterNotificationByRequestType("HR"); Details() {
this.isAll = false; this.workListService.getITGDetails()
this.isPR = false; .subscribe((result: any) => {
this.isPO = false; this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.isMR = false; this.filters[5].value = result.TotalCount;
this.isHR = true; });
this.isITG = false;
} }
ITGNotification() { ITGNotification() {
// this.Details(); // this.Details();
this.isAll = false; this.isAll = false;
this.isPR = false; this.isPR = false;
this.isPO = false; this.isPO = false;
this.isMR = false; this.isMR = false;
this.isHR = false; this.isHR = false;
this.isITG = true; this.isITG = true;
} }
searchBtn() { searchBtn() {
this.isSearch = !this.isSearch; this.isSearch = !this.isSearch;
} }
setActive(selectedSegment) {
this.ITGItem = [];
let count = 0;
this.activeSegment = selectedSegment;
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.ITGSegment.length; i++) {
if (this.ITGSegment[i].code === selectedSegment) {
this.ITGSegment[i].style = true;
this.ITGItem[count] = this.ITGSegment[i].data;
count++;
} else {
this.ITGSegment[i].style = false;
}
}
}
openITG(segmentInfo) {
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.openWorklistITGPage();
}
} }

@ -21,8 +21,8 @@
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div> <div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> --> </ion-card-header> -->
<!-- <ion-card-content> --> <!-- <ion-card-content> -->
<div [hidden]="itemHistoryRes && itemHistoryRes.length > 0"> <div class="noDataDiv" [hidden]="itemHistoryRes && itemHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p> <p>{{ 'general, empty' | translate}}</p>
</div> </div>
<ion-list class="itemeHistoryist" *ngIf="itemHistoryRes && itemHistoryRes.length > 0 "> <ion-list class="itemeHistoryist" *ngIf="itemHistoryRes && itemHistoryRes.length > 0 ">

@ -0,0 +1,12 @@
import { Request } from 'src/app/hmg-common/services/models/request';
export class itgRequest extends Request {
public RequestType: string;
public ItemID: number;
public TaskID: number;
public EmployeeNumber: string;
public Comments: string;
public IsSubTask: boolean;
public NewUserEMPId: string;
public AdditionalFields?: [{}];
}

@ -1,18 +1,13 @@
// import { Request } from './request';
import { Request } from 'src/app/hmg-common/services/models/request'; import { Request } from 'src/app/hmg-common/services/models/request';
export class WorkListRequest extends Request{ export class WorkListRequest extends Request{
public static SHARED_DATA = 'login-request'; public static SHARED_DATA = 'login-request';
// Channel: Channel, //channel public P_NOTIFICATION_TYPE: string;
// LanguageID: LanguageID,//langlist public P_SEARCH_FROM_USER: string;
// P_USER_NAME:userName,//string public P_SEARCH_SUBJECT: string;
// P_SESSION_ID:sessionID,//number public P_SEARCH_SENT_DATE: string;
public P_NOTIFICATION_TYPE: string;//string public P_SEARCH_ITEM_TYPE_DSP_NAME: string;
public P_SEARCH_FROM_USER:string;//string public P_PAGE_NUM: number;
public P_SEARCH_SUBJECT:string;//string public P_PAGE_LIMIT: number;
public P_SEARCH_SENT_DATE:string;//string public P_ITEM_TYPE : string;
public P_SEARCH_ITEM_TYPE_DSP_NAME:string;//string
public P_PAGE_NUM:number;//number
public P_PAGE_LIMIT:number;//number
} }

@ -0,0 +1,44 @@
<ion-content padding>
<!--
<ion-col col-1
style="margin-right: -22px;margin-top: -10px;">
<ion-button class="closeIcon" (click)="closeModal()">
<img src="../assets/imgs/close.png">
</ion-button>
</ion-col> -->
<ion-list>
<ion-radio-group>
<ion-list-header style="margin-bottom: 22px !important;">
<p class="Header">More Action</p>
</ion-list-header>
<div *ngFor="let button of actionBtns ">
<ion-item *ngIf="button.BUTTON_ACTION !='APPROVED' && button.BUTTON_ACTION !='REJECTED' && button.BUTTON_ACTION !='REQUEST_INFO' " >
<ion-label class="labelRadio"> {{button.BUTTON_LABEL}}</ion-label>
<ion-radio color="secondary" mode="md" value="{{button.BUTTON_ACTION}}" (ionSelect)="radioSelect(button)"></ion-radio>
<!-- </div> -->
</ion-item>
</div>
</ion-radio-group>
</ion-list>
<ion-footer>
<ion-row class="rowBtn">
<ion-button style="width:200px !important" class="confirmBtn" (click)="OkBtnModal()"> {{ts.trPK('general','ok')}}
</ion-button>
</ion-row>
<ion-row class="rowBtn">
<ion-button style="width:200px !important" class="cancelBtn" (click)="closeModal()"> {{ts.trPK('general','cancel')}}
</ion-button>
</ion-row>
</ion-footer>
</ion-content>

@ -0,0 +1,22 @@
.rowBtn{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.Header{
color: black !important;
font-size: 16px !important;
font-weight: bold !important;;
margin: 0;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-58px, 2px);
}
.labelRadio{
color: black !important;
font-weight: bold !important;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MoreActionModalComponent } from './more-action-modal.component';
describe('MoreActionModalComponent', () => {
let component: MoreActionModalComponent;
let fixture: ComponentFixture<MoreActionModalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MoreActionModalComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MoreActionModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,44 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { ModalController } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-more-action-modal',
templateUrl: './more-action-modal.component.html',
styleUrls: ['./more-action-modal.component.scss'],
})
export class MoreActionModalComponent implements OnInit {
actionBtns :any =[];
radioButtonValue: any;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){}
ngOnInit() {
console.log("modal");
this.actionBtns = this.cs.sharedService.getSharedData("passActionMore" , false);
console.log("modal");
}
closeModal() {
this.modalCtrl.dismiss();
}
radioSelect(v) {
this.radioButtonValue = v;
console.log("radio selected"+v);
}
OkBtnModal() {
if (!this.radioButtonValue) {
let msg: string = this.ts.trPK("replacementRoll", "msg");
this.cs.presentAlert(msg);
return;
} else {
let data = this.radioButtonValue;
this.modalCtrl.dismiss(data);
}
}
}

@ -25,8 +25,12 @@ import { WorklistMainPoComponent } from './worklist-main-po/worklist-main-po.com
import { ItemHistoryComponent } from './item-history/item-history.component'; import { ItemHistoryComponent } from './item-history/item-history.component';
import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis.component'; import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis.component';
import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component'; import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component';
// import { WorklistMainComponent } from './worklist-main/worklist-main.component'; import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component';
import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component';
// import { WorklistMainComponent } from './worklist-main/worklist-main.component';
import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component'
import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component';
const routes: Routes = [ const routes: Routes = [
@ -43,8 +47,8 @@ const routes: Routes = [
component: WorkListAttachViewComponent component: WorkListAttachViewComponent
}, },
{ {
path:'worklist-main', path: 'worklist-main',
component:WorklistMainComponent component: WorklistMainComponent
}, },
{ {
path: 'work-list-replacement-roll', path: 'work-list-replacement-roll',
@ -76,28 +80,40 @@ const routes: Routes = [
}, },
{ {
path:'worklist-main-PR', path: 'worklist-main-PR',
component:WorklistMainPRComponent component: WorklistMainPRComponent
}, },
{ {
path:'apply-action-modal', path: 'apply-action-modal',
component:ApplyActionModalComponent component: ApplyActionModalComponent
}, },
{ {
path:'worklist-main-PO', path: 'worklist-main-PO',
component:WorklistMainPoComponent component: WorklistMainPoComponent
}, },
{ {
path:'item-history-PO', path: 'item-history-PO',
component:ItemHistoryComponent component: ItemHistoryComponent
}, },
{ {
path:'qutation-analysis-PO', path: 'qutation-analysis-PO',
component:QutationAnalysisComponent component: QutationAnalysisComponent
}, },
{ {
path:'worklist-main-MR', path: 'worklist-main-MR',
component:WorklistMainMRComponent component: WorklistMainMRComponent
},
{
path: 'worklist-main-ITG',
component: WorkListMainItgComponent
},
{
path: 'more-action-modal',
component: MoreActionModalComponent
},
{
path: 'worklist-replacement-itg',
component: WorkListReplacementItgComponent
} }
] ]
} }
@ -119,6 +135,7 @@ const routes: Routes = [
WorkListReplacementRollComponent, WorkListReplacementRollComponent,
WorkListRfcComponent, WorkListRfcComponent,
ViewNoteModalComponent, ViewNoteModalComponent,
MoreActionModalComponent,
ApplyActionModalComponent, ApplyActionModalComponent,
ViewReplacementModalComponent, ViewReplacementModalComponent,
WorkListActionHistoryComponent, WorkListActionHistoryComponent,
@ -128,9 +145,15 @@ const routes: Routes = [
WorklistMainPoComponent, WorklistMainPoComponent,
ItemHistoryComponent, ItemHistoryComponent,
QutationAnalysisComponent, QutationAnalysisComponent,
WorklistMainMRComponent WorklistMainMRComponent,
WorklistAdvancedSearchComponent,
WorkListMainItgComponent,
WorkListReplacementItgComponent
// WorklistMainComponent // WorklistMainComponent
], ],
providers:[WorklistService,WorklistMainService, WorklistAttachService] entryComponents: [
WorklistAdvancedSearchComponent
],
providers: [WorklistService, WorklistMainService, WorklistAttachService]
}) })
export class NotificationPageModule {} export class NotificationPageModule {}

@ -22,7 +22,7 @@
</ion-card-header> --> </ion-card-header> -->
<!-- <ion-card-content> --> <!-- <ion-card-content> -->
<div [hidden]="getQutationAnalysis && getQutationAnalysis.length > 0"> <div class="noDataDiv" [hidden]="getQutationAnalysis && getQutationAnalysis.length > 0">
<p>{{ 'general, empty' | translate}}</p> <p>{{ 'general, empty' | translate}}</p>
</div> </div>
<ion-list class="itemeHistoryist" *ngIf="getQutationAnalysis && getQutationAnalysis.length > 0 "> <ion-list class="itemeHistoryist" *ngIf="getQutationAnalysis && getQutationAnalysis.length > 0 ">

@ -19,6 +19,7 @@ import { MOItemHistoryRes } from "../models/MOItemHistoryRes";
import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes';
import { Request } from 'src/app/hmg-common/services/models/request'; import { Request } from 'src/app/hmg-common/services/models/request';
import { LoginModel } from '../../authentication/models/LoginModel'; import { LoginModel } from '../../authentication/models/LoginModel';
import { itgRequest } from '../models/itgFormDetailsRequest';
@Injectable() @Injectable()
export class WorklistMainService { export class WorklistMainService {
@ -44,9 +45,11 @@ export class WorklistMainService {
public static getQutationAnalysisUrl = public static getQutationAnalysisUrl =
"Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS";
public static getITGFormTaskCount = public static getITGFormTaskCount =
'http://10.80.100.124:7086/Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType';
public static getITGFormTaskDetails = public static getITGFormTaskDetails =
'http://10.80.100.124:7086/Services/COCWS.svc/REST/ITGFormsPendingTasks'; 'Services/COCWS.svc/REST/ITGFormsPendingTasks';
public static getITGFormDetails =
'Services/COCWS.svc/REST/ITGGetFormDetials';
@ -241,7 +244,7 @@ export class WorklistMainService {
const request = new Request; const request = new Request;
console.log(request) console.log(request)
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.api.postToken( return this.api.post(
WorklistMainService.getITGFormTaskCount, WorklistMainService.getITGFormTaskCount,
request, request,
onError, onError,
@ -249,12 +252,25 @@ export class WorklistMainService {
); );
} }
public getITGFormDetails(request:itgRequest, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME;
console.log(request);
return this.api.post(
WorklistMainService.getITGFormDetails,
request,
onError,
errorLabel
);
}
public getITGDetails( onError?: any, errorLabel?: string): Observable<any> { public getITGDetails( onError?: any, errorLabel?: string): Observable<any> {
const request = new Request; const request = new Request;
console.log(request) console.log(request)
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.api.postToken( return this.api.post(
WorklistMainService.getITGFormTaskDetails, WorklistMainService.getITGFormTaskDetails,
request, request,
onError, onError,
@ -262,4 +278,19 @@ export class WorklistMainService {
); );
} }
public getITGActionRequest(itgrequest:itgRequest,actionURL:string, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(itgrequest);
itgrequest.EmployeeNumber = itgrequest.P_USER_NAME;
console.log(itgrequest);
console.log(actionURL);
return this.api.post(
actionURL,
itgrequest,
onError,
errorLabel
);
}
} }

@ -9,3 +9,7 @@ ion-content {
padding-top: 30px !important; padding-top: 30px !important;
border: solid 1px #dedede; border: solid 1px #dedede;
} }
:host(.activated) .item-native {
background: var(--red) !important;
color: var(--grey) !important;
}

@ -0,0 +1,151 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content class="colorBG">
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChangedClick($event)"
[value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="{{segmentVal.name}}"
[ngClass]="activeSegment == segmentVal.name ? 'active-Segment' : 'normal-Segment'"
*ngFor="let segmentVal of segmentsArray">
{{segmentVal.name}}
</ion-segment-button>
</ion-segment>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentData'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label>{{dataContant.Value}}</label>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<!-- if there is additional screen like in VIDA -->
<!-- <ng-container>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentDataTable'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row *ngFor="let headerData of dataContant.Header">
<ion-col>
<label class="colItemReq"> {{headerData}}</label>
<br />
<label>{{headerData}}</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ng-container> -->
<!-- END -->
<ion-card class="cardContent" *ngIf='activeSegment === "Approval Level"'>
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-list class="notification-list" style="margin-left: -30px;" *ngFor="let approvalInfo of workList">
<div class="timeline">
<ion-item>
<div class="timeline-item" slot="start">
<div>
<button ion-button style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png">
</button>
<div
[ngClass]="{'bg-blue-dot' : approvalInfo.Action === 'Submit', 'bg-green-dot':approvalInfo.Action === 'Approved', 'bg-red-dot':approvalInfo.Action === 'Rejected', 'bg-gray-dot':approvalInfo.Action === 'Pending', 'bg-gray-dot':approvalInfo.Action === ''}"
class="timeline-thumb timeline-icon">
</div>
<p style="margin-left: -20%; font-size: 12px !important;">{{approvalInfo.Action}}</p>
</div>
</div>
<p style="margin-left: 10%;">{{approvalInfo.Name}}</p>
</ion-item>
</div>
</ion-list>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<ion-card class="cardContent">
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-label>
<h2 class="boldTxtNav">Comment</h2>
</ion-label>
<ion-input type='text' [(ngModel)]='commentText'></ion-input>
<ion-item *ngFor="let object of grantInfo">
<ion-label>{{object.Label}}</ion-label>
<ion-select *ngIf="!object.ConditionalFieldName" [(ngModel)]='ExchangeServerSelected'
(ionChange)="filterGrantDB(ExchangeServerSelected,object, object.FieldName)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of object.Value">
{{value}}</ion-select-option>
</ion-select>
<ion-select *ngIf="object.ConditionalFieldName" [(ngModel)]='ExchangeServerDBSelected'
(ionChange)="filterGrantDB(ExchangeServerDBSelected,object)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of filteredGrantFieldsConditionalValue">
{{value}}</ion-select-option>
</ion-select>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer class="footerSearchBtn">
<ion-tabs>
<ion-tab-bar class="tabBar" slot="bottom">
<!-- <ion-tab-button *ngFor='let action of actionBTN' [hidden]="action.isAvailable" > -->
<ion-tab-button *ngFor='let action of actionBTN' [hidden]='!action.isAvailable'
(click)="selectAtion(action.name)">
<img [src]="action.image">
<ion-label style="font-size: 12px;">{{action.name}}</ion-label>
</ion-tab-button>
<ion-tab-button (click)="skip()">
<img src="../assets/imgs/action-skip.png">
<ion-label style="font-size: 12px;">Skip</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-footer>

@ -0,0 +1,13 @@
.timeline-thumb {
height: 30px !important;
left: 54px !important;
}
.timeline-icon{
width: 30px !important;
}
.timeline:before{
position: fixed !important;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkListMainItgComponent } from './work-list-main-itg.component';
describe('WorkListMainItgComponent', () => {
let component: WorkListMainItgComponent;
let fixture: ComponentFixture<WorkListMainItgComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WorkListMainItgComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WorkListMainItgComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,342 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { HomeComponent } from '../home/home.component';
import { WorklistMainService } from '../service/work-list.main.service';
import { itgRequest } from '../models/itgFormDetailsRequest';
import { ModalController } from '@ionic/angular';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component';
@Component({
selector: 'app-work-list-main-itg',
templateUrl: './work-list-main-itg.component.html',
styleUrls: ['./work-list-main-itg.component.scss'],
})
export class WorkListMainItgComponent implements OnInit {
public static APPROVAL = "Services/COCWS.svc/REST/ITGApproveRequest"
public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest'
public static DELEGATE = 'Services/COCWS.svc/REST/ITGDelegateRequest';
public static REQUEST_INFORMATION = 'Services/COCWS.svc/REST/ITGRequestInformation';
public static ANSWER = 'Services/COCWS.svc/REST/ITGAnswer';
public static GRANT = 'Services/COCWS.svc/REST/ITGGrantAccess';
public request_info: any;
public request_name: any;
public all_request: any;
public request = new itgRequest();
public activeSegment: any = "info";
public request_details: any;
public segmentsArray: { name: string, number: number }[] = [];
public segmentData: { name: string, data: any }[] = [];
public header: any = [];
public rows: any = [];
public workList: any;
public commentText: string;
public replcamentID: string;
public actionSelected: any;
public options: any;
public index: number = 0;
public grantDATA: any;
public grantInfo: any;
public grantFieldsConditionalValue: any = [];
public filteredGrantFieldsConditionalValue: any = [];
public grantFieldsLabel: any = [];
public grantFieldsValue: any = [];
public grantRequest: any = [];
public ExchangeServerSelected: any;
public ExchangeServerDBSelected: any;
public actionBTN: { name: string, image: string, isAvailable: boolean }[] = [];
constructor(
public common: CommonService,
public ts: TranslatorService,
public workListService: WorklistMainService,
public modalCtrl: ModalController) { }
ngOnInit() {
this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO);
this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME);
this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST);
this.all_request = this.all_request[0];
this.changeITGForm(this.request_info, this.request_name);
}
changeITGForm(data, requestName) {
this.request_info = data;
this.request_name = requestName;
this.request.RequestType = this.request_name;
this.request.ItemID = this.request_info.ItemID;
this.request.TaskID = this.request_info.ID;
this.request.Comments = this.request_info.Comments;
this.request.NewUserEMPId = this.request_info.NewUserEMPId;
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields;
let count = 0;
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i };
this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields}
}
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length }
this.workList = this.request_details.WFHistory;
this.options = this.request_details.AllowedActions;
this.activeSegment = this.segmentsArray[0].name;
for (let i = 0; i < this.options.length; i++) {
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 }
}
if (this.grantInfo) {
let count = 0;
this.grantFieldsConditionalValue = [];
for (let i = 0; i < this.grantInfo.length; i++) {
if (this.grantInfo[i].Value) {
for (let j = 0; j < this.grantInfo[i].Value.length; j++) {
this.grantFieldsValue[j] = this.grantInfo[i].Value[j];
}
}
if (this.grantInfo[i].ConditionalValue) {
for (let j = 0; j < this.grantInfo[i].ConditionalValue.length; j++) {
this.grantFieldsConditionalValue[count] = this.grantInfo[i].ConditionalValue[j];
count++;
}
}
}
}
//result.ITGRequest.FieldGoups.Fields
});
}
imageURL(actionName) {
if (actionName == "Approve") {
return "../assets/imgs/action-approve.png"
}
if (actionName == "Reject") {
return "../assets/imgs/action-reject.png"
}
if (actionName == "RequestInformation") {
return "../assets/imgs/action-info.png"
}
if (actionName == "Grant") {
return "../assets/imgs/action-info.png"
}
if (actionName == "Delegate") {
return "../assets/imgs/action-info.png"
}
}
public segmentChangedClick(event: any) {
this.activeSegment = event.detail.value;
}
skip() {
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 {
this.common.openNotificationPage();
break;
}
}
}
clearDataArray() {
this.commentText = '';
this.actionSelected = '';
this.segmentsArray = [];
this.segmentData = [];
this.workList = [];
this.actionBTN = [];
}
actionService(action, comments?, grantRequests?) {
let url: string;
let request = new itgRequest();
request.RequestType = this.request_name;
request.ItemID = this.request_info.ItemID;
request.TaskID = this.request_info.ID;
request.Comments = this.commentText;
request.Comments = this.request_info.Comments;
request.EmployeeNumber = this.request_info.EmployeeNumber;
request.NewUserEMPId = this.replcamentID;
this.common.confirmAlertDialogAction(
() => {
if (action == 1) { //approved
url = WorkListMainItgComponent.APPROVAL;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
} else if (action == 2) {//reject
url = WorkListMainItgComponent.REJECT;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
} else if (action == 3) {//request more info
request.NewUserEMPId = this.replcamentID;
url = WorkListMainItgComponent.REQUEST_INFORMATION;
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
} else {
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
}
} else if (action == 4) {//delegate
request.NewUserEMPId = this.replcamentID;
url = WorkListMainItgComponent.DELEGATE;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
} else if (action == 5) { //answer
url = WorkListMainItgComponent.ANSWER;
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
} else {
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
}
} else if (action == 6) { //grant
url = WorkListMainItgComponent.GRANT;
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
}
else {
if (this.grantRequest) {
request.AdditionalFields = this.grantRequest;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
// this.common.openNotificationPage();
this.skip();
});
} else {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
}
}
}
}, this.ts.trPK('general', 'ok'),
() => { this.actionSelected = '' }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg(action));
}
confirmMsg(action) {
if (action === 1) {
return this.ts.trPK('worklist', 'approveMsg');
}
if (action === 2) {
return this.ts.trPK('worklist', 'rejectMsg');
}
if (action === 3) {
return this.ts.trPK('worklist', 'requestInformationMsg');
}
if (action === 4) {
return this.ts.trPK('worklist', 'delegateMsg');
}
if (action === 5) {
return this.ts.trPK('worklist', 'answerMsg');
}
if (action === 6) {
return this.ts.trPK('worklist', 'grantMsg');
}
}
selectAtion(actionSelected) {
this.actionSelected = actionSelected;
if (this.actionSelected == "Answer") {
this.actionService(5, this.commentText)
}
if (this.actionSelected == "Approve") {
this.actionService(1, this.commentText);
}
if (this.actionSelected == "Delegate") {
// this.actionService(4, this.commentText)
// this.common.openWorklistRollReplacement();
this.presentModal(4);
}
if (this.actionSelected === 'Doable') {
}
if (this.actionSelected === 'Grant') {
this.actionService(6, this.commentText, this.grantRequest);
}
if (this.actionSelected === 'NotDoable') {
}
if (this.actionSelected === 'Question') {
}
if (this.actionSelected === 'Reject') {
this.actionService(2, this.commentText);
}
if (this.actionSelected === 'RequestInformation') {
this.presentModal(3);
}
}
async presentModal(actionNumber) {
const modal = await this.modalCtrl.create({
component: WorkListReplacementItgComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
this.replcamentID = data.data.empData.USER_NAME;
if (actionNumber == 3) {
this.actionService(3, this.commentText);
} else if (actionNumber == 4) {
this.actionService(4);
}
});
return await modal.present();
}
filterGrantDB(valueSelected, object, selectedOption?) {
let count = 0;
this.filteredGrantFieldsConditionalValue = [];
this.grantRequest.push({ Key: object.FieldName, Value: valueSelected });
for (let i = 0; i < this.grantInfo.length; i++) {
if (selectedOption === this.grantInfo[i].ConditionalFieldName) {
for (let j = 0; j < this.grantFieldsConditionalValue.length; j++) {
if (valueSelected === this.grantFieldsConditionalValue[j].Key) {
this.filteredGrantFieldsConditionalValue[count] = this.grantInfo[i].ConditionalValue[j].Value[0];
count++;
}
}
}
}
}
}

@ -0,0 +1,60 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<!-- <nav-buttons></nav-buttons> -->
<ion-title color="light">{{ 'vacation-rule, search-employee' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closePage()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div>
<ion-item lines="none">
<ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchKeySelect">
<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="3">{{'vacation-rule, search-by-email' | translate}}</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines='none'>
<ion-input [(ngModel)]="searchKey" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input>
<ion-button style="width: 19%;" button-type="clear" (click)="SearchReplacementList()">
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-item>
<!-- <ion-item>
<ion-list [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}</ion-label>
<ion-radio value="{{i}}"></ion-radio>
</ion-item>
</ion-list>
</ion-item> -->
<ion-list>
<ion-radio-group mode="md" [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}</ion-label>
<ion-radio value="{{i}}"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button>
</div>
</ion-footer>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkListReplacementItgComponent } from './work-list-replacement-itg.component';
describe('WorkListReplacementItgComponent', () => {
let component: WorkListReplacementItgComponent;
let fixture: ComponentFixture<WorkListReplacementItgComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WorkListReplacementItgComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WorkListReplacementItgComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,131 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ReplacementServiceRequest } from 'src/app/vacation-rule/model/replacement-Service.request';
import { VacationRuleServiceService } from 'src/app/vacation-rule/service/vacation-rule-service.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
@Component({
selector: 'app-work-list-replacement-itg',
templateUrl: './work-list-replacement-itg.component.html',
styleUrls: ['./work-list-replacement-itg.component.scss'],
})
export class WorkListReplacementItgComponent implements OnInit {
P_SEARCH_USER_NAME: string = "";
P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = "";
P_SEARCH_EMAIL_ADDRESS: string = "";
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 50;
ReplacementList: any = [];
IsReachEnd: boolean = false;
selEmp: string = null;
callback: any;
searchKey: any = "";
searchKeySelect: string = "";
replacmentRequest: any = "";
isAbs: boolean = false;
isSave: boolean = false;
constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService,
public cs: CommonService,
public modalController: ModalController) { }
ngOnInit() {}
SearchReplacementList() {
this.ReplacementList = [];
this.IsReachEnd = false;
this.P_PAGE_NUM = 1;
if (this.searchKey) {
switch (this.searchKeySelect) {
case '1': {
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.searchKey;
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
case '2': {
this.P_SEARCH_USER_NAME = this.searchKey;
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
case '3': {
this.P_SEARCH_EMAIL_ADDRESS = this.searchKey;
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
break;
}
default: {
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
}
} else {
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.P_SEARCH_EMAIL_ADDRESS = "";
}
const request = new ReplacementServiceRequest();
request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME;
request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME;
request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS;
request.P_PAGE_NUM = this.P_PAGE_NUM;
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
this.vacationRuleService.getReplacementList(request).
subscribe((result: any) => {
this.handleReplacment(result);
});
}
handleReplacment(result) {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.ReplacementList)) {
this.ReplacementList = result.ReplacementList;
this.P_PAGE_NUM++;
let lastItemIndex = this.ReplacementList.length - 1;
if (result.ReplacementList[lastItemIndex]) {
let lastitem = result.ReplacementList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
}
}
}
}
doInfinite(infiniteScroll) {
}
closePage() {
this.isSave = true;
let data: any = null;
if (this.isSave == true) {
if (this.selEmp) {
data = this.ReplacementList[this.selEmp];
} else {
data = null;
}
if (typeof this.callback == 'function') {
this.callback(data);
}
this.modalController.dismiss({
'dismissed': true,
empData: data
});
}
}
}

@ -1,13 +1,13 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar>
<nav-buttons></nav-buttons> <!-- class="header-toolbar" <nav-buttons></nav-buttons> -->
<ion-title color="light">{{ 'replacementRoll, title' | translate}}</ion-title> <ion-title color="dark">{{ 'replacementRoll, title' | translate}}</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content padding> <ion-content >
<ion-list [hidden]="isAnswer==true"> <ion-list style="margin-bottom:2px !important" [hidden]="isAnswer==true">
<ion-item> <ion-item>
<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 }}'
@ -18,17 +18,18 @@
</ion-select> </ion-select>
</ion-item> </ion-item>
<ion-item> <ion-item lines="none">
<ion-input [(ngModel)]="inputSearch" placeholder='{{"general, search" | translate}}'></ion-input> <ion-button class="filterBtn" button-type="clear" (click)="getreplacmentemployee()" item-end>
<ion-icon slot="icon-only" color="white" name="search"></ion-icon>
</ion-button>
<ion-input 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>
</button> --> </button> -->
<ion-button style="width: 19%;" button-type="clear" (click)="getreplacmentemployee()" item-end>
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-item> </ion-item>
<!-- <ion-item> <!-- <ion-item>
@ -41,7 +42,7 @@
</div> --> </div> -->
</ion-list> </ion-list>
<div> <div class="noteInput">
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} : <ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label> {{pQuestion}} ?</ion-label>
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}} <ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}}
@ -55,26 +56,77 @@
<ion-item [hidden]="isAnswer==true"> <ion-item [hidden]="isAnswer==true">
<!-- <ion-list *ngIf="ReplacementList"> --> <!-- <ion-list *ngIf="ReplacementList"> -->
<ion-list *ngIf="ReplacementList"> <!-- <ion-list *ngIf="ReplacementList">
<ion-radio-group mode="md" [(ngModel)]="selEmp"> -->
<ion-item *ngFor="let employee of ReplacementList;let i=index;"> <!-- <ion-radio-group mode="md" [(ngModel)]="selEmp"> -->
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br> <!-- <ion-grid fixed>
<ion-row justify-content-end>
<ion-col [ngClass]="{'activated': (active == i),'deactivated': (active != i)}" (click)="select(employee,i)"
*ngFor="let employee of demoeAttach;let i=index;"
size-xs="6" size-sm="6" size-md="6" size-lg="6" align-self-stretch>
<div class="profileImageDiv"> <img class="profileImage" src="../assets/imgs/profile.png"></div>
<div *ngIf="active == i" class="selIEmpDiv"> <img class="selIEmpImage" src="../assets/imgs/green.png"></div>
<br/>
<div class="repContentDiv">
<ion-label style="color:var(--dark) !important">
<span style="font-weight: bold !important">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}</ion-label> {{employee.EMAIL_ADDRESS}}</ion-label>
<ion-radio value="{{i}}"></ion-radio> </div>
</ion-item>
</ion-radio-group> </ion-col>
</ion-list> </ion-row>
</ion-grid> -->
<!-- </ion-radio-group> -->
<!--
</ion-list> -->
<div class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <div *ngIf="active == i" class="selIEmpDiv">
<img class="selIEmpImage" src="../assets/imgs/green.png">
</div>
<div [ngClass]="{'activated': (active == i),'deactivated': (active != i)}"
class="content">
<ion-label>
<span style="font-weight: bold !important">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}
</ion-label>
</div>
</div>
</div>
</ion-item>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</ion-item>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="submitAction()"> <ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'general, submit' | translate}}</ion-button>
<ion-button class="footer-button" style="background: var(--darkblue)!important;border-radius: 10px; --background: transparent; " ion-button (click)="closeModal()">
{{'general, cancel' | translate}}</ion-button>
</div> </div>
</ion-footer> </ion-footer>

@ -9,8 +9,119 @@ button.item-button.button.button-md.button-clear.button-clear-md {
min-width: 200px; min-width: 200px;
} }
ion-item { // ion-item {
margin-top: 5%; // margin-top: 5%;
margin-right: 7%; // margin-right: 7%;
width: 100%; // width: 100%;
// }
.ionItem{
border: #e4e4e4 solid;
/* margin: 6px; */
/* padding: 11px; */
height: 85px;
width: 164px;
border-radius: 5px;
text-align: center;
} }
.profileImageDiv{
text-align: center;
margin-bottom: -27px;
z-index: 3;
position: relative;
top: 0;
}
.profileImage{
width:60px !important;
// margin-left: -25px;
// margin-right: 22px;
}
.activated{
border: #209a83 0.02cm solid ;
}
.deactivated{ border: #e4e4e4 0.02cm solid;
}
.repContentDiv{
text-align: center;
width: 85%;
font-size: 14px;
border: #e4e4e4 solid;
border-radius: 5px;
padding: 20px 8px 8px 8px;
margin-top: -9px;
margin-right: -35px
}
.selIEmpDiv{
text-align: right;
margin-bottom: -26px;
margin-right: 0px;
z-index: 3;
position: relative;
top: 0;
}
.selIEmpImage{
width:22px !important
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
}
*{
box-sizing: border-box;
}
.square-container{
// padding: 8px;
width:100%;
}
.square{
// width:calc(100% / 2);
width:50%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
}
.square .content{
width: calc(100% - 16px) !important;
height: calc(100% - 16px) !important;
margin: 8px;
padding: 16px;
// position: absolute;
color: white;
border-radius: 9px;
text-align: center;
// background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}

@ -36,6 +36,8 @@ export class WorkListReplacementRollComponent implements OnInit {
private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest();
private WorkListActionObj: WorkListActionRequest; private WorkListActionObj: WorkListActionRequest;
getpassResAttr: any = []; getpassResAttr: any = [];
active: any;
demoeAttach:any=[];
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) {
this.P_PAGE_NUM = 1; this.P_PAGE_NUM = 1;
@ -51,15 +53,45 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.WorkListActionObj = new WorkListActionRequest(); this.WorkListActionObj = new WorkListActionRequest();
this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;//26919060;
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.RespondAttributeList = this.getpassResAttr; this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr;
this.WorkListActionObj.P_APPROVER_INDEX = null; this.WorkListActionObj.P_APPROVER_INDEX = null;
} }
ngOnInit() { } ngOnInit() {
this.demoeAttach = [{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj",
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
}
];
}
getreplacmentemployee() { getreplacmentemployee() {
this.ReplacementList = []; this.ReplacementList = [];
@ -163,6 +195,13 @@ export class WorkListReplacementRollComponent implements OnInit {
this.selectedValue = Value; this.selectedValue = Value;
} }
select(selectEmp,index){
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp=selectEmp
this.active=index;
}
clear() { clear() {
this.selEmpName = ""; this.selEmpName = "";
this.selectedUserInf = null; this.selectedUserInf = null;
@ -188,10 +227,15 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
submitAction() { submitAction() {
this.selEmp
if (this.selEmp && this.isAnswer == false) { if (this.selEmp && this.isAnswer == false) {
this.selectedUserInf = this.ReplacementList[this.selEmp]; // this.selectedUserInf = this.ReplacementList[this.selEmp];
this.selectedUserInf = this.selEmp;
console.log("selEmp "+ this.selEmp.USER_NAME);
if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
console.log("userInfo "+this.selectedUserInf.USER_NAME);
if (this.userNote) { if (this.userNote) {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
@ -290,4 +334,12 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
} }
public col(){
alert("test");
}
closeModal() {
this.modalCtrl.dismiss();
}
} }

@ -1,7 +1,6 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar >
<nav-buttons></nav-buttons> <ion-title color="dark">{{ 'workListMain, rfc' | translate}}</ion-title>
<ion-title color="light">{{ 'workListMain, rfc' | translate}}</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
@ -10,30 +9,62 @@
<div class="tipsPadding boldTxtNav"> <div class="tipsPadding boldTxtNav">
{{"replacementRoll.msgRFC" | translate}} {{"replacementRoll.msgRFC" | translate}}
</div> </div>
<ion-list (ionChange)="radioChecked($event)" radio-group> <!-- <ion-list (ionChange)="radioChecked($event)" radio-group>
<ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;"> <ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;">
<ion-label>{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</ion-label> <ion-label>{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</ion-label>
<ion-label>{{rfcEmployeeList.ACTION}}</ion-label> <ion-label>{{rfcEmployeeList.ACTION}}</ion-label>
<ion-radio value="{{i}}"></ion-radio> <ion-radio value="{{i}}"></ion-radio>
</ion-item> </ion-item>
</ion-list> </ion-list> -->
<div class="noteInput">
<label class="boldTxtNav" padding>{{"replacementRoll.enterNote" | translate}}</label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<ion-item>
<div class="square-container">
<div (click)="select(rfcEmployeeList,i)" *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;"
class="square">
<div class="profileImageDiv">
<img *ngIf="rfcEmployeeList.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+rfcEmployeeList.EMPLOYEE_IMAGE">
<img *ngIf="rfcEmployeeList.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
</div>
<div *ngIf="active == i" class="selIEmpDiv">
<img class="selIEmpImage" src="../assets/imgs/green.png">
</div>
<div [ngClass]="{'activated': (active == i),'deactivated': (active != i)}" class="content">
<ion-label>
<span style="font-weight: bold !important">{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{rfcEmployeeList.ACTION}}
</ion-label>
</div>
</div>
</div>
</ion-item>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
<div>
<label class="boldTxtNav">{{"replacementRoll.enterNote" | translate}}</label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</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)="submitAction()"> <ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'general, submit' | translate}}</ion-button>
</div>
<ion-button class="footer-button" style="background: var(--darkblue)!important;border-radius: 10px; --background: transparent; " ion-button (click)="closeModal()">
{{'general, cancel' | translate}}</ion-button>
</div>
</ion-footer> </ion-footer>

@ -4,4 +4,131 @@
min-height: 45px; min-height: 45px;
min-width: 200px; min-width: 200px;
} }
button.item-button.button.button-md.button-clear.button-clear-md {
background-color: transparent;
}
.footer-button {
border-radius: 3px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
// ion-item {
// margin-top: 5%;
// margin-right: 7%;
// width: 100%;
// }
.ionItem{
border: #e4e4e4 solid;
/* margin: 6px; */
/* padding: 11px; */
height: 85px;
width: 164px;
border-radius: 5px;
text-align: center;
}
.profileImageDiv{
text-align: center;
margin-bottom: -27px;
z-index: 3;
position: relative;
top: 0;
}
.profileImage{
width:60px !important;
// margin-left: -25px;
// margin-right: 22px;
}
.activated{
border: #209a83 0.02cm solid ;
}
.deactivated{ border: #e4e4e4 0.02cm solid;
}
.repContentDiv{
text-align: center;
width: 85%;
font-size: 14px;
border: #e4e4e4 solid;
border-radius: 5px;
padding: 20px 8px 8px 8px;
margin-top: -9px;
margin-right: -35px
}
.selIEmpDiv{
text-align: right;
margin-bottom: -26px;
margin-right: 0px;
z-index: 3;
position: relative;
top: 0;
}
.selIEmpImage{
width:22px !important
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
}
*{
box-sizing: border-box;
}
.square-container{
// padding: 8px;
width:100%;
}
.square{
// width:calc(100% / 2);
width:50%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
}
.square .content{
width: calc(100% - 16px) !important;
height: calc(100% - 16px) !important;
margin: 8px;
padding: 16px;
// position: absolute;
color: white;
border-radius: 9px;
text-align: center;
// background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}

@ -6,6 +6,7 @@ import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes';
import { WorklistService } from '../service/worklist.service'; import { WorklistService } from '../service/worklist.service';
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';
@Component({ @Component({
selector: 'app-work-list-rfc', selector: 'app-work-list-rfc',
@ -29,8 +30,15 @@ export class WorkListRfcComponent implements OnInit {
getpassResAttr: any = []; getpassResAttr: any = [];
P_PAGE_NUM: number = 1; P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 100;
active: any;
constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService) {
constructor(
public worklistService: WorklistService,
private cs: CommonService,
private ts: TranslatorService,
public workListMainService: WorklistMainService,
public modalCtrl: ModalController
) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo');
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr');
@ -153,5 +161,22 @@ export class WorkListRfcComponent implements OnInit {
infiniteScroll.target.complete(); infiniteScroll.target.complete();
} }
}//end infiniteScroll }//end infiniteScroll
closeModal() {
this.modalCtrl.dismiss();
}
select(selectEmp,index){
console.log(selectEmp.USER_NAME);
console.log(selectEmp.SEQ);
this.radioButtonValue=selectEmp.USER_NAME
this.seqNo = selectEmp.SEQ;
//////////////////////////////////////////////////////////////
// let emp: any = this.RFCEmployeeListListRes[v];
// this.seqNo = emp.SEQ;
// this.radioButtonValue = emp.USER_NAME;
this.active=index;
}
} }

@ -0,0 +1,66 @@
<ion-content>
<div class="search-header" (click)="dismissModal()">
<h2>Advanced Search</h2>
<ion-icon slot="icon-only" name="md-close"></ion-icon>
</div>
<div class="search-container">
<ion-item lines="none">
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
(ionChange)=onChangeView($event)>
<ion-select-option value="1">{{ts.trPK('worklist','openNot')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none" [ngStyle]="(hideDateInput === true || hideTextInput === true) ? {'margin-bottom': '0px'} : {}">
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
(ionChange)="getValueSelected($event)">
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
</ion-select>
</ion-item>
<div>
<div *ngIf="hideDateInput">
<ion-item lines='none' style="border-radius: 10px;margin-right: 10px;margin-left: 10px;margin-top: 5px;">
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY"
pickerFormat="DD-MMM-YYYY" [(ngModel)]="inputDate"></ion-datetime>
</ion-item>
</div>
<div *ngIf="hideTextInput">
<ion-item lines='none' style="border-radius: 10px;margin-right: 10px;margin-left: 10px;margin-top: 5px;">
<ion-input placeholder="{{ts.trPK('worklist','enter')}}" [(ngModel)]="inputSearch">
</ion-input>
</ion-item>
</div>
</div>
<ion-item lines="none">
<ion-label>Item Type</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="itemType">
<ion-select-option value="HRSSA">HR</ion-select-option>
<ion-select-option value="POAPPRV">PO</ion-select-option>
<ion-select-option value="REQAPPRV">PR</ion-select-option>
<ion-select-option value="INVMOA">MR</ion-select-option>
</ion-select>
</ion-item>
<div class="search-button" (click)="search()">
<span>SEARCH</span>
</div>
</div>
</ion-content>

@ -0,0 +1,40 @@
.search-header{
display: inline-block;
h2 {
display: inline-block;
margin-left: 20px;
font-family: WorkSans-Regular;
font-size: 18px;
margin-top: 12px;
}
ion-icon {
display: inline-block;
font-size: 23px;
position: absolute;
right: 15px;
top: 8px;
}
}
.search-container {
margin-right: 15px;
margin-left: 15px;
padding-bottom: 100px;
margin-top: 5px;
ion-item{
border: 2px solid #eaeaea;
border-radius: 25px;
margin-bottom: 20px;
}
}
.search-button{
background: #3dcab3;
height: 50px;
text-align: center;
font-family: WorkSans-Regular;
border-radius: 22px;
margin-top: 20px;
line-height: 50px;
span{
color: white;
}
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorklistAdvancedSearchComponent } from './worklist-advanced-search.component';
describe('WorklistAdvancedSearchComponent', () => {
let component: WorklistAdvancedSearchComponent;
let fixture: ComponentFixture<WorklistAdvancedSearchComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WorklistAdvancedSearchComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WorklistAdvancedSearchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,65 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-worklist-advanced-search',
templateUrl: './worklist-advanced-search.component.html',
styleUrls: ['./worklist-advanced-search.component.scss'],
})
export class WorklistAdvancedSearchComponent implements OnInit {
public hideDateInput = false;
public hideTextInput = false;
public inputDate = '';
public inputSearch = '';
public selectedValue = '';
public notificationType = '';
public itemType = '';
constructor(
public modalController: ModalController,
public ts: TranslatorService
) { }
ngOnInit() {}
public dismissModal() {
this.modalController.dismiss();
}
public search() {
console.log(this.itemType);
this.modalController.dismiss({
notificationType: this.notificationType,
selectedValue: this.selectedValue,
inputDate: this.inputDate,
inputSearch: this.inputSearch,
itemType: this.itemType
});
}
onChangeView(selectedValue: any) {
this.notificationType = selectedValue.detail.value;
}
getValueSelected(value) {
this.selectedValue = value.detail.value;
if (this.selectedValue === '1') {
this.hideDateInput = false;
this.hideTextInput = true;
} else if (this.selectedValue === '2') {
this.hideDateInput = false;
this.hideTextInput = true;
} else if (this.selectedValue === '3') {
this.hideDateInput = true;
this.hideTextInput = false;
} else if (this.selectedValue === '4') {
this.hideDateInput = false;
this.hideTextInput = true;
} else if (this.selectedValue === '5') {
this.hideDateInput = false;
this.hideTextInput = false;
}
}
}

@ -1,8 +1,107 @@
.itemHISBtn{ // .itemHISBtn{
padding: 5px; // padding: 5px;
color: var(--light); // color: var(--light);
background: var(--darkgray); // background: var(--darkgray);
border-radius: 3px; // border-radius: 3px;
width: 85%; // width: 85%;
height: 40px; // height: 40px;
} // }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 15px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }

@ -28,6 +28,9 @@ import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.compo
import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes';
import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; import { ApplyActionModalComponent } from '../apply-action-modal/apply-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 { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
@Component({ @Component({
selector: 'app-worklist-main-mr', selector: 'app-worklist-main-mr',
@ -41,7 +44,7 @@ export class WorklistMainMRComponent implements OnInit {
private WorkListActionObj: WorkListActionRequest; private WorkListActionObj: WorkListActionRequest;
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;
@ -65,13 +68,13 @@ export class WorklistMainMRComponent implements OnInit {
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = "";
notificationArray: any; notificationArray: any;
notificationDynamicAttributeArr:any; notificationDynamicAttributeArr: any;
private textInput: TextInput; private textInput: TextInput;
private textArea: TextAreaInput; private textArea: TextAreaInput;
notificationCount: any; notificationCount: any;
attachmentRes:any; attachmentRes: any;
PRHeader:any;//change the tpye later PRHeader: any;//change the tpye later
PRLines:any;//change the tpye later PRLines: any;//change the tpye later
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
P_PAGE_NUM: number = 1; P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 100;
@ -84,6 +87,19 @@ export class WorklistMainMRComponent implements OnInit {
confirmMsg: string; confirmMsg: string;
delMsg: string; delMsg: string;
closeMsg: string; closeMsg: string;
activeSegment: any = "info";
lines_note_limit: any = 15;
orgNote: string;
truncating: boolean;
selectedIndex: any;
showLessBtn: boolean;
showMoreBtn: boolean;
notiActionBtnMore: any = [];
messageSuccess: boolean = false;
approveDis: boolean = false;
rejectDis: boolean = false;
requestDis: boolean = false;
constructor( constructor(
@ -98,55 +114,31 @@ export class WorklistMainMRComponent implements OnInit {
public worklistService: WorklistService public worklistService: WorklistService
) { ) {
//this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo');
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
// this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
} }
ngOnInit() { ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest(); this.WorkListAttachObj = new WorkListButtonRequest();
this.intializeNotificationDetail(); this.intializeNotificationDetail();
let segment = document.querySelector('ion-segment');
let slides = document.querySelector('ion-slides');
segment.addEventListener('ionChange', (ev) => onSegmentChange(ev));
slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev));
// On Segment change slide to the matching slide
function onSegmentChange(ev) {
console.log("ev.detail.value"+ev.detail.value);
slideTo(ev.detail.value);
}
function slideTo(index) {
console.log("index: "+index);
slides.slideTo(index);
}
// On Slide change update segment to the matching value
async function onSlideDidChange(ev) {
var index = await slides.getActiveIndex();
console.log("index: "+index);
clickSegment(index);
}
function clickSegment(index) {
segment.value = index;
}
} }
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value);
}
intializeNotificationDetail() { intializeNotificationDetail() {
document.getElementById("notificationDynamicFields").innerHTML=""; if (this.messageSuccess) {
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,
@ -190,38 +182,38 @@ export class WorklistMainMRComponent implements OnInit {
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);
} }
} }
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");
}); });
} }
getMONotificationDetails(notificationBodyObj){ getMONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.getMONotificationBody(notificationBodyObj) .getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => { .subscribe((result: MONotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "MO"); this.handleWorkListBodyResult(result, "MO");
}); });
} }
getPONotificationDetails(notificationBodyObj){ getPONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.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");
}); });
} }
getEITNotificationDetails(notificationBodyObj) { getEITNotificationDetails(notificationBodyObj) {
@ -246,17 +238,17 @@ export class WorklistMainMRComponent implements OnInit {
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;
}
} }
} }
}
} //End handleWorkListBodyResult } //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) { getNotificationButtons(notificationButtonsObj) {
this.worklistMainService this.worklistMainService
.getNotificationButtons(notificationButtonsObj) .getNotificationButtons(notificationButtonsObj)
@ -270,6 +262,20 @@ 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");
console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true;
} // if result == null
} // valid it
} // if result == null } // if result == null
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
@ -285,14 +291,12 @@ export class WorklistMainMRComponent implements OnInit {
handleApplayActionResult(result) { handleApplayActionResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome(); this.messageSuccess = true;
//this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){ setTimeout(() => {
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { this.messageSuccess = false;
// this.notificationArray.splice(i, 1); }, 5000);
// }
// }
this.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
} }
@ -320,11 +324,14 @@ export class WorklistMainMRComponent implements OnInit {
} }
} }
actionButton() { actionButton(action) {
let ButtonAction: string = this.actionType; console.log("actionButton" + action);
alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = []; this.P_RESPOND_ATTRIBUTES_TBL = [];
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") {
@ -333,8 +340,8 @@ export class WorklistMainMRComponent implements OnInit {
// 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);
} }
@ -358,47 +365,49 @@ export class WorklistMainMRComponent implements OnInit {
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
//sheardData //sheardData
// this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
// this.WorkListActionObj, this.WorkListActionObj,
// WorklistMainMRComponent.PASS_NOTIFICATION_INFO WorklistMainMRComponent.PASS_NOTIFICATION_INFO
// ); );
if (ButtonAction == "APPROVE"){
this.confirmMsg =this.ts.trPK('worklistMain', 'approveMsg') /////////////////////////////////////////////
if (ButtonAction == "APPROVE") {
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')
} }
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);
//////////////////////////////////////////////////////////
// alert.onDidDismiss((data) => { // alert.onDidDismiss((data) => {
// if (data == true) { // if (data == true) {
// this.continueDelete(attach); // this.continueDelete(attach);
// } // }
// }); // });
//this.openApplyModal(this.WorkListActionObj); // this.openApplyModal(this.WorkListActionObj);
////////////this.applyAction(this.WorkListActionObj); ////////////this.applyAction(this.WorkListActionObj);
} }
@ -423,14 +432,10 @@ export class WorklistMainMRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainMRComponent.PASS_RES_ATTR WorklistMainMRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRFCPage(); // this.common.openWorklistRFCPage();
this.openRFCModal();
} else if (ButtonAction == "ANSWER_INFO") { } else if (ButtonAction == "ANSWER_INFO") {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(this.pQuestion, "pQuestion"); this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
@ -444,7 +449,8 @@ export class WorklistMainMRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainMRComponent.PASS_RES_ATTR WorklistMainMRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); //this.common.openWorklistRollReplacement();
this.openReplacementRoll();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" || ButtonAction == "REQUEST_INFO" ||
@ -470,7 +476,8 @@ export class WorklistMainMRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainMRComponent.PASS_RES_ATTR WorklistMainMRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openReplacementRoll();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == "CONTINUE_ACTION"
@ -562,29 +569,29 @@ export class WorklistMainMRComponent implements OnInit {
this.hideForwordEmployee = result.NotificationRespondRolesList[0]; this.hideForwordEmployee = result.NotificationRespondRolesList[0];
} }
this.notificationDynamicFields(result.NotificationGetRespondAttributesList); this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.NotificationGetRespondAttributesList, this.NotificationGetRespondAttributesList,
WorklistMainMRComponent.PASS_RES_ATTR WorklistMainMRComponent.PASS_RES_ATTR
); );
this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList;
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
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") {
} }
} }
} }
@ -633,8 +640,8 @@ export class WorklistMainMRComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) { getAttachmentNotification(WorkListAttachObj) {
this.worklistAttachService.getAttach(WorkListAttachObj). this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => { subscribe((result: NotificationGetAttachResponse) => {
@ -675,21 +682,23 @@ export class WorklistMainMRComponent implements OnInit {
this.IsReachEnd = false; this.IsReachEnd = false;
} }
} }
this.turnCateFun(this.actionHistoryRes);
} }
} }
} }
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')
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ViewNoteModalComponent, component: ViewNoteModalComponent,
backdropDismiss:false, backdropDismiss: false,
}); });
modal.cssClass = 'note-modal'; modal.cssClass = 'note-modal';
@ -731,7 +740,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
}//end infiniteScroll }//end infiniteScroll
//**********Attachment *****************// //**********Attachment *****************//
async OpenAttachFiles(value, Type) { async OpenAttachFiles(value, Type) {
@ -752,7 +761,7 @@ export class WorklistMainMRComponent implements OnInit {
// 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( this.getPassNotificationDetails,WorklistMainMRComponent.PASS_NOTIFICATION_INFO); this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainMRComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage')
// this.common.sharedService.setSharedData( // this.common.sharedService.setSharedData(
// this.WorkListActionObj, // this.WorkListActionObj,
@ -761,23 +770,23 @@ export class WorklistMainMRComponent implements OnInit {
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ApplyActionModalComponent, component: ApplyActionModalComponent,
backdropDismiss:false, backdropDismiss: false,
}); });
modal.cssClass = 'note-modal'; modal.cssClass = 'note-modal';
modal.onDidDismiss() modal.onDidDismiss()
.then((data) => { .then((data) => {
console.log(data); // Here's your selected user! console.log(data); // Here's your selected user!
}); });
// data => { // data => {
// console.log('MODAL DATA', data); // console.log('MODAL DATA', data);
// }); // });
// const { data } = await this.modalCtrl.onWillDismiss(); // const { data } = await this.modalCtrl.onWillDismiss();
// console.log(data); // console.log(data);
return await modal.present(); return await modal.present();
} }
@ -820,7 +829,7 @@ 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) => {
@ -836,9 +845,9 @@ export class WorklistMainMRComponent implements OnInit {
this.IsReachEnd = false; this.IsReachEnd = false;
} }
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 {
@ -846,7 +855,7 @@ export class WorklistMainMRComponent implements OnInit {
} }
}// if response == 1 }// if response == 1
//this.pageNum++; //this.pageNum++;
// infiniteScroll.target.complete(); // infiniteScroll.target.complete();
}); });
} else { } else {
@ -872,25 +881,148 @@ export class WorklistMainMRComponent implements OnInit {
this.IsReachEnd = false; this.IsReachEnd = false;
} }
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;
} }
}// if response == 1 }// if response == 1
//this.pageNum++; //this.pageNum++;
// infiniteScroll.target.complete(); // infiniteScroll.target.complete();
}); });
} else { } else {
//if (infiniteScroll) //if (infiniteScroll)
//infiniteScroll.target.complete(); //infiniteScroll.target.complete();
} }
}//end infiniteScroll }//end infiniteScroll
async openMoreActions() {
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
///call Action button
this.actionButton(this.actionType);
}
});
return await modal.present();
}
///////////////////////////////////////////
public checkLines(note) {
console.log(note.split("\n").length);
console.log(note.length);
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
}
return false;
};
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
}
this.actionHistoryRes = actionHis;
console.log("test");
}
async openReplacementRoll() {
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss().then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
async openRFCModal() {
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
} }

@ -1,4 +1,4 @@
<ion-header> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
@ -6,33 +6,50 @@
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
<ion-toolbar class="slideToolBar">
<ion-segment class="segmentPR" scrollable>
<ion-segment-button value="0" checked> </ion-header>
<ion-label> {{ts.trPK('worklistMain','info')}}</ion-label> <div *ngIf="messageSuccess" class="succssfullMSG">
</ion-segment-button> <ion-icon class="succssfullIcon" name="checkmark"></ion-icon> <!--filled-->
<ion-segment-button value="1"> <br/>
<ion-label> {{ts.trPK('worklistMain','line_details')}}</ion-label> <div> Transaction Successful </div>
</ion-segment-button> </div>
<ion-segment-button value="2"> <ion-content *ngIf="!messageSuccess" class="colorBG">
<ion-label>
{{'worklistMain, actionHis' | translate}} <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<!-- add segemnt part -->
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="line_details"
[ngClass]="activeSegment == 'line_details' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','line_details')}}
</ion-segment-button>
<ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}}
</ion-segment-button>
<ion-segment-button value="attach"
[ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
{{'general, file' | translate}}
</ion-label>
</ion-segment-button>
<ion-segment-button value="3">
<ion-label>{{'general, attachment' | translate}}
</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button checked value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'" >
{{ts.trPK('worklistMain','info')}}
</ion-segment-button>
</ion-segment> </ion-segment>
</ion-toolbar>
</ion-header>
<ion-content class="colorBG">
<ion-slides pager="true" class="slides-gray-bullets">
<ion-slide class="slide-1">
<!-- <ion-slides pager="true" class="slides-gray-bullets">
<ion-slide class="slide-1"> -->
<ng-container *ngIf="activeSegment === 'info'">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div> <div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
@ -40,8 +57,8 @@
<ion-card-content> <ion-card-content>
<ion-grid style="text-align: left"> <ion-grid style="text-align: left">
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','description')}} <label class="colItemReq" for=""> {{ts.trPK('worklistMain','description')}}
</label> </label>
@ -49,8 +66,8 @@
<label for=""> {{ts.trPK('worklistMain','des-PO')}} {{PO_NUMBER}} </label> <label for=""> {{ts.trPK('worklistMain','des-PO')}} {{PO_NUMBER}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}} <label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}}
@ -61,17 +78,17 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}}
</label> </label>
<br /> <br />
<label for=""> {{getPassNotificationDetails.TO_USER}}</label> <label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}}
</label> </label>
@ -81,16 +98,16 @@
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label> <label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}}
</label> </label>
<br /> <br />
<label for="">{{getPassNotificationDetails.END_DATE}}</label> <label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}}
</label> </label>
@ -98,40 +115,40 @@
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label> <label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row >
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> <ion-row class="rowBorder" *ngIf=" getPassNotificationDetails.RESPONDER != '' ">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}}
</label> </label>
<br /> <br />
<label for="">{{getPassNotificationDetails.RESPONDER}} </label> <label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <!-- <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label>
<br /> <br />
<label for="">{{getPassNotificationDetails.SUBJECT}} </label> <label for="">{{getPassNotificationDetails.SUBJECT}} </label>
</ion-col> </ion-col> -->
</ion-row> </ion-row>
<div *ngFor="let header of POHeader"> <div *ngFor="let header of POHeader">
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Supplier')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','Supplier')}} </label>
<br /> <br />
<label for="">{{header.VENDOR_NAME}} </label> <label for="">{{header.VENDOR_NAME}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Site')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','Site')}} </label>
<br /> <br />
@ -139,15 +156,15 @@
<label for="">{{header.VENDOR_SITE_CODE}} </label> <label for="">{{header.VENDOR_SITE_CODE}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Buyer')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','Buyer')}} </label>
<br /> <br />
<label for="">{{header.BUYER}} </label> <label for="">{{header.BUYER}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Preparer')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','Preparer')}} </label>
<br /> <br />
@ -155,15 +172,15 @@
<label for="">{{header.PREPARER}} </label> <label for="">{{header.PREPARER}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','CreationDate')}}</label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','CreationDate')}}</label>
<br /> <br />
<label for="">{{header.CREATION_DATE}} </label> <label for="">{{header.CREATION_DATE}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipToLocation')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipToLocation')}}
</label> </label>
@ -172,16 +189,16 @@
<label for="">{{header.SHIP_TO_LOCATION_NAME}} </label> <label for="">{{header.SHIP_TO_LOCATION_NAME}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','QuotationNumber')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','QuotationNumber')}}
</label> </label>
<br /> <br />
<label for="">{{header.QUOTATION_NUMBER}} </label> <label for="">{{header.QUOTATION_NUMBER}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','QuotationDate')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','QuotationDate')}}
</label> </label>
@ -190,15 +207,15 @@
<label for="">{{header.QUOTATION_DATE}} </label> <label for="">{{header.QUOTATION_DATE}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','PaymentTerms')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','PaymentTerms')}} </label>
<br /> <br />
<label for="">{{header.PAYMENT_TERMS}} </label> <label for="">{{header.PAYMENT_TERMS}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Currency')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','Currency')}} </label>
<br /> <br />
@ -206,15 +223,15 @@
<label for="">{{header.CURRENCY_NAME}} - {{header.LOC_CUR}} </label> <label for="">{{header.CURRENCY_NAME}} - {{header.LOC_CUR}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','GrossAmount')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','GrossAmount')}} </label>
<br /> <br />
<label for="">{{header.GROSS_AMOUNT}} </label> <label for="">{{header.GROSS_AMOUNT}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','DiscountAmount')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','DiscountAmount')}}
</label> </label>
@ -223,16 +240,16 @@
<label for="">{{header.DISCOUNT_AMOUNT}} </label> <label for="">{{header.DISCOUNT_AMOUNT}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" <label class="colItemReq"
for="">{{ts.trPK('worklistMain','TotalPODiscount')}}</label> for="">{{ts.trPK('worklistMain','TotalPODiscount')}}</label>
<br /> <br />
<label for="">{{header.TOTAL_PO_DISCOUNT}} </label> <label for="">{{header.TOTAL_PO_DISCOUNT}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','VATAmount')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','VATAmount')}} </label>
<br /> <br />
@ -241,15 +258,15 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','CustomDuty')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','CustomDuty')}} </label>
<br /> <br />
<label for="">{{header.CUSTOM_DUTY}} </label> <label for="">{{header.CUSTOM_DUTY}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipHandle')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','ShipHandle')}} </label>
<br /> <br />
@ -257,26 +274,17 @@
<label for="">{{header.SHIP_HANDLE}} </label> <label for="">{{header.SHIP_HANDLE}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col> <ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','OtherCharges')}}</label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','OtherCharges')}}</label>
<br /> <br />
<label for="">{{header.OTHER_CHARGES}} </label> <label for="">{{header.OTHER_CHARGES}} </label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<!-- <ion-row>
<ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','Currency')}} </label>
<br />
<label for="">{{header.LOC_CUR}} </label>
</ion-col>
</ion-row>
<ion-row> -->
<ion-row> -->
<ion-row>
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}}
</label> </label>
@ -286,14 +294,17 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row >
<ion-col> <ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','TotalPOAmountInWords')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','TotalPOAmountInWords')}}
</label> </label>
<br /> <br />
<label for="">{{header.TOT_PO_AMT_WORD}} </label> <label for="">{{header.TOT_PO_AMT_WORD}} </label>
</ion-col> </ion-col>
<!-- <ion-col>
</ion-col> -->
</ion-row> </ion-row>
<!-- <ion-row> <!-- <ion-row>
<ion-col> <ion-col>
@ -348,39 +359,39 @@
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ng-container>
</ion-slide> <ng-container *ngIf="activeSegment === 'line_details'">
<ion-slide>
<!-- <ion-card class="cardContent">
<!-- <ion-card class="cardContent">
<ion-card-content> --> <ion-card-content> -->
<div [hidden]="POLines && POLines.length > 0"> <div [hidden]="POLines && POLines.length > 0">
<p>{{ 'general, empty' | translate}}</p> <p>{{ 'general, empty' | translate}}</p>
</div> </div>
<ion-list class="itemReqList" *ngIf="POLines && POLines.length > 0 "> <!-- <ion-list class="itemReqList" *ngIf="POLines && POLines.length > 0 "> -->
<div> <!-- <div> -->
<ion-grid class="gridItemReq">
<!-- <ion-grid class="gridItemReq"> -->
<ion-item class="itemReqContent" *ngFor="let Lines of POLines; let i=index;">
<accordin-custom >
<accordin-tab-custom *ngFor="let Lines of POLines; let i=index;" [header]="Lines.ITEM_DESCRIPTION" >
<div class="itemReqDiv"> <div class="itemReqDiv">
<!-- <ion-item class="itemReqContent" > -->
<ion-row>
<ion-col class="colItemReqHeader"> <ion-row class="rowBorder">
<ion-col class="colItems colBorder ">
<label for="">{{i+1}}. {{Lines.ITEM_DESCRIPTION}} </label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','code')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','code')}} </label>
<br /> <br />
<ion-label class="labelValue" for="">{{Lines.ITEM_CODE}} </ion-label> <ion-label class="labelValue" for="">{{Lines.ITEM_CODE}} </ion-label>
</ion-col> </ion-col>
<ion-col class="colItems"> <ion-col class="colItems ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','MFG')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','MFG')}}
</label> </label>
<br /> <br />
@ -390,8 +401,8 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','LINE_TYPE')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','LINE_TYPE')}}
</label> </label>
<br /> <br />
@ -410,9 +421,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','price')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','price')}} </label>
<br /> <br />
@ -431,9 +442,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label>
<br /> <br />
@ -452,9 +463,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','NEED_TO')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','NEED_TO')}} </label>
<br /> <br />
@ -474,9 +485,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','DELIVER_TO')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','DELIVER_TO')}}
</label> </label>
<br /> <br />
@ -496,9 +507,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','REQUEST')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','REQUEST')}} </label>
<br /> <br />
@ -506,12 +517,8 @@
<ion-label class="labelValue" for="">{{Lines.REQUESTOR}} </ion-label> <ion-label class="labelValue" for="">{{Lines.REQUESTOR}} </ion-label>
</ion-col> </ion-col>
<!-- <ion-col>
<label class="colItemReq" for="">{{ts.trPK('payslip','amount')}} </label>
<br />
Quotation Analysis
<label for="">{{Item History}} </label>
</ion-col> -->
@ -519,7 +526,7 @@
</ion-row> </ion-row>
<ion-row> <ion-row >
<ion-col> <ion-col>
@ -528,18 +535,11 @@
<button ion-button class="itemHISBtn" <button ion-button class="itemHISBtn"
(click)="getItemHistory(Lines.ITEM_ID)"> (click)="getItemHistory(Lines.ITEM_ID)">
{{ts.trPK('worklistMain','ITEM_HIS')}} {{ts.trPK('worklistMain','ITEM_HIS')}}
<!-- (click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)"
[hidden]="actionHistory.NOTE == '' || actionHistory.NOTE == null"
style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png"> -->
</button> </button>
</div> </div>
<!-- <label class="colItemReq" for="">{{ts.trPK('worklistMain','ITEM_HIS')}} </label> -->
<!-- <br /> -->
<!-- <label for="">{{Lines.REQUESTOR}} </label> -->
</ion-col> </ion-col>
<ion-col> <ion-col>
@ -549,10 +549,7 @@
<button ion-button class="itemHISBtn" <button ion-button class="itemHISBtn"
(click)="getQutationAnalysis(Lines.PO_HEADER_ID ,Lines.ITEM_ID)"> (click)="getQutationAnalysis(Lines.PO_HEADER_ID ,Lines.ITEM_ID)">
{{ts.trPK('worklistMain','QUOTATION_ANALYSIS')}} {{ts.trPK('worklistMain','QUOTATION_ANALYSIS')}}
<!-- (click)="getQutationAnalysis(Lines.PO_HEADER_ID ,Lines.ITEM_CODE)"
[hidden]="actionHistory.NOTE == '' || actionHistory.NOTE == null"
style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png"> -->
</button> </button>
</div> </div>
@ -560,32 +557,36 @@
</ion-row> </ion-row>
</div> </div>
</ion-item> <!-- </ion-item> -->
</accordin-tab-custom>
</accordin-custom>
</ion-grid> <!-- </ion-grid>
</div> </div> -->
</ion-list>
<!-- </ion-list> -->
<!-- </ion-card-content> <!-- </ion-card-content>
</ion-card> --> </ion-card> -->
</ion-slide>
</ng-container>
<ion-slide> <ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent"> <ion-card class="cardContent">
<ion-card-content> <ion-card-content>
<div [hidden]="actionHistoryRes && actionHistoryRes.length > 0"> <div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p> <p>{{ 'general, empty' | translate}}</p>
</div> </div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 "> <div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list "> <ion-list class="notification-list ">
<div class="timeline"> <div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes"> <ion-item *ngFor="let actionHistory of actionHistoryRes; let index=index">
<div class="timeline-item" slot="start"> <div class="timeline-item" slot="start">
<div> <!-- <div>
<button ion-button <button ion-button
(click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)" (click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)"
@ -595,20 +596,47 @@
<img src="../assets/imgs/noteSmall.png"> <img src="../assets/imgs/noteSmall.png">
</button> </button>
</div> </div> -->
<div [ngClass]="{'bg-blue-dot' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-dot' : actionHistory.ACTION === 'Pending' ,'bg-red-dot' : actionHistory.ACTION === 'Rejected','bg-green-dot' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}" <div class="timeline-thumb timeline-icon">
class="timeline-thumb timeline-icon"> <img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge" [src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
</div> <img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge" src="../assets/imgs/profile.png"> </div>
</div> </div>
<ion-col> <ion-col>
<ion-label style="color:black !important ;font-weight: bold;"> {{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE">
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote" >
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' " >
Note: {{actionHistory.NOTE}} {{actionHistory.NOTE}}
</div>
<button class="showMore" (click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
</div>
</div>
<!-- [ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Rejected','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}" -->
<ion-label <ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Rejected','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}"
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submite' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Reject','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Reject' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}"
class=""> {{actionHistory.ACTION}}</ion-label> class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label> {{actionHistory.NAME}}
</ion-label>
<ion-label> {{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label> <ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''" class="dateActionHistory"> {{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col> </ion-col>
</ion-item> </ion-item>
</div> </div>
@ -619,72 +647,110 @@
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ion-slide> </ng-container>
<ng-container *ngIf="activeSegment === 'attach'">
<ion-slide>
<ion-card class="cardContent"> <div class="noDataDiv" [hidden]="attachmentRes && attachmentRes.length > 0">
<ion-card-content> <p>{{ 'general, notAttch' | translate}}</p>
<div [hidden]="attachmentRes && attachmentRes.length > 0"> </div>
<p>{{ 'general, notAttch' | translate}}</p>
</div>
<div *ngIf="attachmentRes && attachmentRes.length > 0 "> <div *ngIf="attachmentRes && attachmentRes.length > 0 ">
<ion-grid> <ion-grid>
<div *ngFor="let attachList of attachmentRes"> <ion-item class="itemAttch" *ngFor="let attachList of attachmentRes" >
<ion-row (click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)"> <div
<ion-col col-12> *ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'">
<div <img float-start class="attachImg" src="../assets/imgs/pdf.png">
*ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'"> </div>
<img float-start class="attachImg" src="../assets/imgs/pdf.png"> <div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start
</div> class="attachImg" src="../assets/imgs/doc.png">
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start </div>
class="attachImg" src="../assets/imgs/doc.png"> <div
</div> *ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'">
<div <img float-start class="attachImg" src="../assets/imgs/nonfile.png">
*ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'"> </div>
<img float-start class="attachImg" src="../assets/imgs/nonfile.png"> <div
</div> *ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'">
<div <img float-start class="attachImg" src="../assets/imgs/img.png">
*ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'"> </div>
<img float-start class="attachImg" src="../assets/imgs/img.png"> <ion-label>
</div> {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} </ion-label>
<ion-label>
{{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} </ion-label> <button float-end class="attachImgBtn"
</ion-col> (click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-item>
</ion-grid>
</div>
</ng-container>
<!-- </ion-slides> -->
</ion-row>
</div>
</ion-grid> <ion-row>
<ion-col col-12>
<div id="notificationDynamicFields">
</div>
</ion-col>
</ion-row>
</ion-content>
</div> <div *ngIf="messageSuccess" class="succssfullMSG">
</ion-card-content> <ion-icon class="succssfullIcon" name="checkmark"></ion-icon> <!--filled-->
</ion-card> <br/>
</ion-slide> <div> Transaction Successful </div>
</div>
</ion-slides>
<ion-footer *ngIf="!messageSuccess" class="footerSearchBtn">
</ion-content>
<ion-footer class="footerSearchBtn">
<ion-row> <!-- <ion-row>
<ion-col col-12> <ion-col col-12>
<div id="notificationDynamicFields"> <div id="notificationDynamicFields">
</div> </div>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<ion-row> <!-- <ion-row class="rowBtn" *ngIf="notificationButtonRes?.length >0">
<ion-col col-2>
<ion-button class="actionBtn" (click)="actionButton(notificationButtons.BUTTON_ACTION)"
*ngFor="let notificationButtons of notificationButtonRes | slice:0:3; let i=index;" >
{{notificationButtons.BUTTON_LABEL}}
</ion-button>
<ion-button style="--background:orange"class="actionBtn" (click)="nextNotfification()">
{{'worklistMain, skip' | translate}}
</ion-button>
<ion-button style="--background:#cccccc;" *ngIf="notiActionBtnMore != '' && notiActionBtnMore == undefined" class="actionBtn" (click)="openMoreActions()">
more
</ion-button>
</ion-row> -->
<!-- <ion-row >
<ion-col col-2>
</ion-col> </ion-col>
<ion-col col-8> <ion-col col-8>
<ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem actionList"> <ion-item *ngIf="notificationButtonRes?.length >0 " class="requiredItem actionList">
<ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label> <ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label>
<ion-select (ionChange)="actionButton()" okText="{{ts.trPK('general','ok')}}" <ion-select (ionChange)="actionButton()" okText="{{ts.trPK('general','ok')}}"
cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="actionType" required> cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="actionType" required>
@ -703,11 +769,39 @@
</ion-button> </ion-button>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<ion-tabs>
<ion-tab-bar class="tabBar" slot="bottom">
<ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVED')">
<img src="../assets/imgs/action-approve.png">
<ion-label>Approve</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECTED')">
<img src="../assets/imgs/action-reject.png">
<ion-label>Reject</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="requestDis" (click)="actionButton('REQUEST_INFO')">
<img src="../assets/imgs/action-info.png">
<ion-label>Request</ion-label>
</ion-tab-button>
<ion-tab-button (click)="nextNotfification()">
<img src="../assets/imgs/action-skip.png">
<ion-label>Skip</ion-label>
</ion-tab-button>
<ion-tab-button (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-footer> </ion-footer>

@ -1,8 +1,110 @@
.itemHISBtn{ // .itemHISBtn{
padding: 5px; // padding: 5px;
color: var(--light); // color: var(--light);
background: var(--darkgray); // background: var(--darkgray);
border-radius: 3px; // border-radius: 3px;
width: 85%; // width: 85%;
height: 40px; // height: 40px;
} // }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 16px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }

@ -32,6 +32,9 @@ import { POItemHistoryRes } from '../models/POItemHistoryRes';
import { POItemHistoryRequest } from '../models/POItemHistoryReq'; import { POItemHistoryRequest } from '../models/POItemHistoryReq';
import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes';
import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq'; import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq';
import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
@Component({ @Component({
selector: 'app-worklist-main-po', selector: 'app-worklist-main-po',
@ -44,12 +47,14 @@ export class WorklistMainPoComponent implements OnInit {
private WorkListActionObj: WorkListActionRequest; private WorkListActionObj: WorkListActionRequest;
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_PO_INFO = "passPOInfo"; public static PASS_PO_INFO = "passPOInfo";
public static PASS_PO_HEADER_ID = "passPOHeader"; public static PASS_PO_HEADER_ID = "passPOHeader";
public static PASS_ACTION_MODE = "passActionMode"; public static PASS_ACTION_MODE = "passActionMode";
public static PASS_ACTION_MORE = "passActioMore";
getPassNotificationDetails: any; getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr"; public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999; TransactionID: number = -999;
@ -71,13 +76,13 @@ export class WorklistMainPoComponent implements OnInit {
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = "";
notificationArray: any; notificationArray: any;
notificationDynamicAttributeArr:any; notificationDynamicAttributeArr: any;
private textInput: TextInput; private textInput: TextInput;
private textArea: TextAreaInput; private textArea: TextAreaInput;
notificationCount: any; notificationCount: any;
attachmentRes:any; attachmentRes: any;
PRHeader:any;//change the tpye later PRHeader: any;//change the tpye later
PRLines:any;//change the tpye later PRLines: any;//change the tpye later
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
P_PAGE_NUM: number = 1; P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 100;
@ -95,6 +100,22 @@ export class WorklistMainPoComponent implements OnInit {
PO_NUMBER: any; PO_NUMBER: any;
itemHistoryRes: any; itemHistoryRes: any;
QutationAnalysisRes: any; QutationAnalysisRes: any;
activeSegment: any = "info";
lines_note_limit: number = 15;
notiActionBtnMore: any = [];
demoeAttach: any = [];
orgNote: any;
truncating: boolean = true;
hidden: boolean = true;
selectedIndex = -1;
showLessBtn: boolean;
showMoreBtn: boolean = true;
selectedAction: any = [];
messageSuccess: boolean = false;
approveDis: boolean = false;
rejectDis: boolean = false;
requestDis: boolean = false;
constructor( constructor(
public common: CommonService, public common: CommonService,
@ -106,7 +127,7 @@ export class WorklistMainPoComponent implements OnInit {
public worklistAttachService: WorklistAttachService, public worklistAttachService: WorklistAttachService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
public worklistService: WorklistService, public worklistService: WorklistService,
) { ) {
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
@ -118,43 +139,13 @@ export class WorklistMainPoComponent implements OnInit {
this.intializeNotificationDetail(); this.intializeNotificationDetail();
let segment = document.querySelector('ion-segment');
let slides = document.querySelector('ion-slides');
segment.addEventListener('ionChange', (ev) => onSegmentChange(ev));
slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev));
// On Segment change slide to the matching slide
function onSegmentChange(ev) {
console.log("ev.detail.value"+ev.detail.value);
slideTo(ev.detail.value);
}
function slideTo(index) {
console.log("index: "+index);
slides.slideTo(index);
}
// On Slide change update segment to the matching value
async function onSlideDidChange(ev) {
var index = await slides.getActiveIndex();
console.log("index: "+index);
clickSegment(index);
}
function clickSegment(index) {
segment.value = index;
}
}//ngOn }//ngOn
intializeNotificationDetail() { intializeNotificationDetail() {
document.getElementById("notificationDynamicFields").innerHTML=""; if (this.messageSuccess) {
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,
@ -194,18 +185,24 @@ export class WorklistMainPoComponent implements OnInit {
this.getActionHistory(this.WorkListActionHistoryObj); this.getActionHistory(this.WorkListActionHistoryObj);
this.getAttachmentNotification(this.WorkListAttachObj); this.getAttachmentNotification(this.WorkListAttachObj);
if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") {
this.getPONotificationDetails(this.WorkListBodyObj); this.getPONotificationDetails(this.WorkListBodyObj);
} }
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value);
} }
getPONotificationDetails(notificationBodyObj){
getPONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.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");
}); });
} }
handleWorkListBodyResult(result, Type) { handleWorkListBodyResult(result, Type) {
@ -224,64 +221,64 @@ export class WorklistMainPoComponent implements OnInit {
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;
for( var i = 0; i < this.PRHeader.length; i++){ for (var i = 0; i < this.PRHeader.length; i++) {
if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total'){ if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') {
this.totalH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; this.totalH = this.PRHeader[i].HDR_ATTRIBUTE_NAME;
this.valueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; this.valueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE;
//this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"
} }
if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax'){ if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') {
this.taxH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; this.taxH = this.PRHeader[i].HDR_ATTRIBUTE_NAME;
this.taxvalueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; this.taxvalueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE;
}
// HDR_ATTRIBUTE_VALUE
} }
// HDR_ATTRIBUTE_VALUE
}
this.notificationBodyRes = this.notificationBodyRes =
result.GetPrNotificationBodyList; result.GetPrNotificationBodyList;
} }
}else if (Type == "PO") {
if (result.GetPoNotificationBodyList) {
console.log("PO");
this.POHeader=result.GetPoNotificationBodyList.POHeader; } else if (Type == "PO") {
this.POLines=result.GetPoNotificationBodyList.POLines; if (result.GetPoNotificationBodyList) {
for( var i = 0; i < this.POHeader.length; i++){ console.log("PO");
this.PO_NUMBER=this.POHeader[i].PO_NUMBER;
if(this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total'){ this.POHeader = result.GetPoNotificationBodyList.POHeader;
this.totalH=this.POHeader[i].HDR_ATTRIBUTE_NAME; this.POLines = result.GetPoNotificationBodyList.POLines;
this.valueH=this.POHeader[i].HDR_ATTRIBUTE_VALUE; for (var i = 0; i < this.POHeader.length; i++) {
this.PO_NUMBER = this.POHeader[i].PO_NUMBER;
//this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') {
} this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
if(this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax'){ this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
this.taxH=this.POHeader[i].HDR_ATTRIBUTE_NAME;
this.taxvalueH=this.POHeader[i].HDR_ATTRIBUTE_VALUE; //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"
}
if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') {
this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
}
// HDR_ATTRIBUTE_VALUE
}
this.notificationBodyRes =
result.GetPoNotificationBodyList;
} }
}//
// HDR_ATTRIBUTE_VALUE }
}
this.notificationBodyRes =
result.GetPoNotificationBodyList;
}
}//
}
} //End handleWorkListBodyResult } //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) { getNotificationButtons(notificationButtonsObj) {
this.worklistMainService this.worklistMainService
.getNotificationButtons(notificationButtonsObj) .getNotificationButtons(notificationButtonsObj)
@ -292,14 +289,31 @@ export class WorklistMainPoComponent implements OnInit {
handleWorkListButtonsResult(result) { handleWorkListButtonsResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.notiActionBtnMore = []
// 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;
} // if result == null this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
} // valid it console.log("test" + this.notificationButtonRes.length);
} // End handleWorkListButtonsResult for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true;
} // if result == null
} // valid it
} // valid it
} // End handleWorkListButtonsResult
}
applyAction(WorkListActionObj) { applyAction(WorkListActionObj) {
console.log("applyactio");
this.worklistMainService this.worklistMainService
.actionButton(WorkListActionObj) .actionButton(WorkListActionObj)
.subscribe((result: any) => { .subscribe((result: any) => {
@ -310,14 +324,14 @@ export class WorklistMainPoComponent implements OnInit {
handleApplayActionResult(result) { handleApplayActionResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome();
//this.common.openNotificationPage(); this.messageSuccess = true;
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { setTimeout(() => {
// this.notificationArray.splice(i, 1); this.messageSuccess = false;
// } }, 5000);
// }
this.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
} }
@ -345,11 +359,16 @@ export class WorklistMainPoComponent implements OnInit {
} }
} }
actionButton() { actionButton(action) {
let ButtonAction: string = this.actionType;
console.log("actionButton" + action);
alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = []; this.P_RESPOND_ATTRIBUTES_TBL = [];
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") {
@ -358,8 +377,8 @@ export class WorklistMainPoComponent implements OnInit {
// 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);
} }
@ -387,43 +406,43 @@ export class WorklistMainPoComponent 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')
} }
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);
// alert.onDidDismiss((data) => { // alert.onDidDismiss((data) => {
// if (data == true) { // if (data == true) {
// this.continueDelete(attach); // this.continueDelete(attach);
// } // }
// }); // });
//this.openApplyModal(this.WorkListActionObj); //this.openApplyModal(this.WorkListActionObj);
////////////this.applyAction(this.WorkListActionObj); ////////////this.applyAction(this.WorkListActionObj);
} }
@ -448,7 +467,8 @@ export class WorklistMainPoComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPoComponent.PASS_RES_ATTR WorklistMainPoComponent.PASS_RES_ATTR
); );
this.common.openWorklistRFCPage(); //this.common.openWorklistRFCPage();
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,
@ -469,7 +489,8 @@ export class WorklistMainPoComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPoComponent.PASS_RES_ATTR WorklistMainPoComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" || ButtonAction == "REQUEST_INFO" ||
@ -495,7 +516,8 @@ export class WorklistMainPoComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPoComponent.PASS_RES_ATTR WorklistMainPoComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == "CONTINUE_ACTION"
@ -587,29 +609,29 @@ export class WorklistMainPoComponent implements OnInit {
this.hideForwordEmployee = result.NotificationRespondRolesList[0]; this.hideForwordEmployee = result.NotificationRespondRolesList[0];
} }
this.notificationDynamicFields(result.NotificationGetRespondAttributesList); this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.NotificationGetRespondAttributesList, this.NotificationGetRespondAttributesList,
WorklistMainPoComponent.PASS_RES_ATTR WorklistMainPoComponent.PASS_RES_ATTR
); );
this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList;
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
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") {
} }
} }
} }
@ -658,8 +680,8 @@ export class WorklistMainPoComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) { getAttachmentNotification(WorkListAttachObj) {
this.worklistAttachService.getAttach(WorkListAttachObj). this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => { subscribe((result: NotificationGetAttachResponse) => {
@ -689,6 +711,7 @@ export class WorklistMainPoComponent implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetActionHistoryList)) { if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList; this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++; this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1; let lastItemIndex = this.actionHistoryRes.length - 1;
@ -701,20 +724,22 @@ export class WorklistMainPoComponent implements OnInit {
} }
} }
} }
this.turnCateFun(this.actionHistoryRes);
} }
} }
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')
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ViewNoteModalComponent, component: ViewNoteModalComponent,
backdropDismiss:false, backdropDismiss: false,
}); });
modal.cssClass = 'note-modal'; modal.cssClass = 'note-modal';
@ -755,7 +780,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
}//end infiniteScroll }//end infiniteScroll
//**********Attachment *****************// //**********Attachment *****************//
async OpenAttachFiles(value, Type) { async OpenAttachFiles(value, Type) {
@ -774,9 +799,9 @@ export class WorklistMainPoComponent implements OnInit {
console.log(itemID); console.log(itemID);
this.IsReachEnd = false; this.IsReachEnd = false;
const request = new POItemHistoryRequest(); const request = new POItemHistoryRequest();
request.P_ITEM_ID=parseInt(itemID); request.P_ITEM_ID = parseInt(itemID);
request.P_PAGE_LIMIT=100; request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM=1; request.P_PAGE_NUM = 1;
this.worklistMainService.getPOItemHistory(request). this.worklistMainService.getPOItemHistory(request).
subscribe((result: POItemHistoryRes) => { subscribe((result: POItemHistoryRes) => {
// this.common.sharedService.setSharedData( // this.common.sharedService.setSharedData(
@ -788,7 +813,7 @@ export class WorklistMainPoComponent implements OnInit {
WorklistMainPoComponent.PASS_PO_INFO WorklistMainPoComponent.PASS_PO_INFO
); );
//open page //open page
// this.common.openItemHistoryPage(); // this.common.openItemHistoryPage();
this.handleItemHistoryResult(result); this.handleItemHistoryResult(result);
}); });
} }
@ -801,21 +826,22 @@ export class WorklistMainPoComponent implements OnInit {
} }
} }
else{ else {
this.common.presentAlert( this.common.presentAlert(
this.ts.trPK("general", "empty") this.ts.trPK("general", "empty")
); } );
}
} }
getQutationAnalysis(headerID,itemID) { getQutationAnalysis(headerID, itemID) {
console.log(itemID+headerID); console.log(itemID + headerID);
this.IsReachEnd = false; this.IsReachEnd = false;
const request = new QuotationAnalysisRequest(); const request = new QuotationAnalysisRequest();
request.P_ITEM_ID=parseInt(itemID); request.P_ITEM_ID = parseInt(itemID);
request.P_PO_HEADER_ID=headerID; request.P_PO_HEADER_ID = headerID;
request.P_PAGE_LIMIT=100; request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM=1; request.P_PAGE_NUM = 1;
this.worklistMainService.getQutationAnalysis(request). this.worklistMainService.getQutationAnalysis(request).
subscribe((result: QuotationAnalysisResponse) => { subscribe((result: QuotationAnalysisResponse) => {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
@ -827,7 +853,7 @@ export class WorklistMainPoComponent implements OnInit {
WorklistMainPoComponent.PASS_PO_HEADER_ID WorklistMainPoComponent.PASS_PO_HEADER_ID
); );
//open page //open page
this.handleQutationAnalysisResult(result); this.handleQutationAnalysisResult(result);
}); });
@ -840,10 +866,10 @@ export class WorklistMainPoComponent implements OnInit {
//open page //open page
//set sheard data //set sheard data
// //
this.common.openQutationAnalysisPage();
this.common.openQutationAnalysisPage();
// this.QutationAnalysisRes = result.GetQutationAnalysisList; // this.QutationAnalysisRes = result.GetQutationAnalysisList;
// this.P_PAGE_NUM++; // this.P_PAGE_NUM++;
// let lastItemIndex = this.QutationAnalysisRes.length - 1; // let lastItemIndex = this.QutationAnalysisRes.length - 1;
@ -856,18 +882,19 @@ export class WorklistMainPoComponent implements OnInit {
// } // }
// } // }
}//hasData }//hasData
else{ else {
this.common.presentAlert( this.common.presentAlert(
this.ts.trPK("general", "empty") this.ts.trPK("general", "empty")
); } );
}
} }
} }
loadMoreNotificationBody() { loadMoreNotificationBody() {
console.log("loadMoreNotificationBody PO"); console.log("loadMoreNotificationBody PO");
if (!this.IsReachEnd) { if (!this.IsReachEnd) {
console.log("this.IsReachEnd"+ this.IsReachEnd); console.log("this.IsReachEnd" + this.IsReachEnd);
this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -882,9 +909,9 @@ export class WorklistMainPoComponent implements OnInit {
this.IsReachEnd = false; this.IsReachEnd = false;
} }
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 {
@ -892,7 +919,7 @@ export class WorklistMainPoComponent implements OnInit {
} }
}// if response == 1 }// if response == 1
//this.pageNum++; //this.pageNum++;
// infiniteScroll.target.complete(); // infiniteScroll.target.complete();
}); });
} else { } else {
@ -918,25 +945,155 @@ export class WorklistMainPoComponent implements OnInit {
this.IsReachEnd = false; this.IsReachEnd = false;
} }
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;
} }
}// if response == 1 }// if response == 1
//this.pageNum++; //this.pageNum++;
// infiniteScroll.target.complete(); // infiniteScroll.target.complete();
}); });
} else { } else {
//if (infiniteScroll) //if (infiniteScroll)
//infiniteScroll.target.complete(); //infiniteScroll.target.complete();
} }
}//end infiniteScroll }//end infiniteScroll
async openMoreActions() {
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
///call Action button
this.actionButton(this.actionType);
}
});
return await modal.present();
}
///////////////////////////////////////////
public checkLines(note) {
console.log(note.split("\n").length);
console.log(note.length);
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
}
return false;
};
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
}
// actionHis.map((obj) => {
// obj.visible = false;
// // or via brackets
// // obj['total'] = 2;
// return obj;
// })
this.actionHistoryRes = actionHis;
console.log("test");
}
async openRepRolModal() {
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
async openRFCModal() {
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
} }

@ -1,186 +1,184 @@
<ion-header> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
<ion-toolbar class="slideToolBar">
<ion-segment class="segmentPR" scrollable>
<ion-segment-button value="0" checked>
<!-- <ion-icon name="call">arrowRight</ion-icon> -->
<ion-label> {{ts.trPK('worklistMain','info')}}</ion-label>
</ion-segment-button>
<ion-segment-button value="1">
<!-- <ion-icon name="cloud-upload"></ion-icon> -->
<ion-label> {{ts.trPK('worklistMain','itemReq')}}</ion-label>
</ion-segment-button>
<ion-segment-button value="2">
<!-- <ion-icon name="paper"></ion-icon> -->
<ion-label>
{{'worklistMain, actionHis' | translate}}
</ion-label>
</ion-segment-button>
<ion-segment-button value="3">
<!-- <ion-icon name="code-working"></ion-icon> -->
<ion-label>{{'general, attachment' | translate}}
</ion-label>
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</ion-header> </ion-header>
<ion-content class="colorBG"> <ion-content *ngIf="!messageSuccess" class="colorBG">
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<!-- add segemnt part -->
<ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all">
<ion-segment-button value="item-req"
[ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','itemReq')}}
</ion-segment-button>
<ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}}
</ion-segment-button>
<ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
{{'general, file' | translate}}
<ion-slides pager="true" class="slides-gray-bullets"> </ion-segment-button>
<ion-slide class="slide-1">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div> <ion-segment-button checked value="info"
[ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','info')}}
</ion-segment-button>
</ion-segment>
<ion-card class="cardContent"> <ng-container *ngIf="activeSegment === 'info'">
<!-- <ion-card-header class="boxHdr">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<ion-card class="cardContent">
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div> <div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> --> </ion-card-header> -->
<ion-card-content> <ion-card-content>
<ion-grid style="text-align: left"> <ion-grid style="text-align: left">
<ion-row> <ion-row>
<ion-col> <ion-col>
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}} <label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for="">{{getPassNotificationDetails.FROM_USER}}</label> <label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col> </ion-col>
</ion-row>
<ion-row> <ion-col>
<ion-col> <label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}}
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}} </label>
</label> <br />
<br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for=""> {{getPassNotificationDetails.TO_USER}}</label> <label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label> <label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row>
<ion-row> <ion-row> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for="">{{getPassNotificationDetails.END_DATE}}</label> <label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label> <label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col> </ion-col>
</ion-row> <!-- </ion-row> -->
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> <!-- <ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> -->
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<label for="">{{getPassNotificationDetails.RESPONDER}} </label> <label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <!-- <ion-row>
<ion-col> <ion-col>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label>
<br /> <br />
</ion-col>
<!-- </ion-col> <ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.SUBJECT}} </label> <label for="">{{getPassNotificationDetails.SUBJECT}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<!-- notificationBodyRes -->
<div *ngFor="let header of PRHeader"> <!-- notificationBodyRes -->
<ion-row <div *ngFor="let header of PRHeader">
*ngIf="header.HDR_ATTRIBUTE_NAME != 'Requisition Total' && header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'">
<!-- *ngIf="header.HDR_ATTRIBUTE_NAME != 'Requisition Total' && header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"> -->
<ion-col> <ion-row
<label class="colItemReq" for="">{{header.HDR_ATTRIBUTE_NAME}} </label> *ngIf="header.HDR_ATTRIBUTE_NAME != 'Requisition Total' && header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'">
<br /> <!-- *ngIf="header.HDR_ATTRIBUTE_NAME != 'Requisition Total' && header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"> -->
<label for="">{{header.HDR_ATTRIBUTE_VALUE}} </label> <ion-col>
</ion-col> <label class="colItemReq" for="">{{header.HDR_ATTRIBUTE_NAME}} </label>
</ion-row> <br />
</div> <label for="">{{header.HDR_ATTRIBUTE_VALUE}} </label>
<br /> </ion-col>
</ion-row>
</div>
<br />
<ion-grid>
<div>
<ion-row style="text-align: center !important">
<ion-col *ngIf="totalH">
<div class="colItemReq" style="text-align: center !important">{{totalH}}</div>
<div class="labelTotal">{{valueH}}</div>
</ion-col> <ion-grid>
<ion-col *ngIf="taxH "> <div>
<div class="colItemReq" style="text-align: center !important">{{taxH}}</div> <ion-row style="text-align: center !important">
<div class="labelTotal">{{taxvalueH}}</div> <ion-col *ngIf="totalH">
<div class="colItemReq" style="text-align: center !important">{{totalH}}</div>
<div class="labelTotal">{{valueH}}</div>
</ion-col> </ion-col>
</ion-row> <ion-col *ngIf="taxH ">
<div class="colItemReq" style="text-align: center !important">{{taxH}}</div>
<div class="labelTotal">{{taxvalueH}}</div>
</div> </ion-col>
</ion-grid> </ion-row>
</div>
</ion-grid>
</ion-grid>
<button [hidden]="IsReachEnd" ion-button class="itemHISBtn" (click)="loadMoreNotificationBody()">Load More</button>
</ion-card-content> </ion-grid>
<button [hidden]="IsReachEnd" ion-button class="itemHISBtn" (click)="loadMoreNotificationBody()">Load
More</button>
</ion-card-content>
<ion-card-content>
<div>
<div id="notificationDynamicFields1"> <ion-card-content>
</div> <div>
<div id="notificationDynamicFields1">
</div> </div>
<!-- <ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem">
</div>
<!-- <ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem">
<ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label> <ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" <ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="actionType" required> [(ngModel)]="actionType" required>
@ -189,129 +187,115 @@
{{notificationButtons.BUTTON_LABEL}}</ion-select-option> {{notificationButtons.BUTTON_LABEL}}</ion-select-option>
</ion-select> </ion-select>
</ion-item> --> </ion-item> -->
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ion-slide> </ng-container>
<ion-slide> <ng-container *ngIf="activeSegment === 'item-req'">
<!-- <ion-card class="cardContent"> --> <!-- <ion-card class="cardContent"> -->
<!-- <ion-card-header class="boxHdr"> <!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div> <div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> --> </ion-card-header> -->
<!-- <ion-card-content> --> <!-- <ion-card-content> -->
<div [hidden]="PRLines && PRLines.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div [hidden]="PRLines && PRLines.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<ion-list class="itemReqList" *ngIf="PRLines && PRLines.length > 0 ">
<div>
<ion-grid class="gridItemReq">
<ion-item class="itemReqContent" *ngFor="let Lines of PRLines; let i=index; ">
<div class="itemReqDiv">
<ion-row>
<accordin-custom>
<accordin-tab-custom *ngFor="let Lines of PRLines; let i=index;" [header]="Lines.DESCRIPTION">
<div class="itemReqDiv">
<!-- <ion-row>
<ion-col class="colItemReqHeader"> <ion-col class="colItemReqHeader">
<!-- <label for="">{{ts.trPK('worklistMain','description')}}
</label> -->
<!-- </ion-col>
<ion-col> -->
<label for="">{{i+1}}. {{Lines.DESCRIPTION}} </label> <label for="">{{i+1}}. {{Lines.DESCRIPTION}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems"> <ion-col class="colItems colBorder ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','cost-center')}} <label class="colItemReq" for="">{{ts.trPK('worklistMain','cost-center')}}
</label> </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<ion-label class="labelValue" for="">{{Lines.COST_CENTER}} </ion-label> <ion-label class="labelValue" for="">{{Lines.COST_CENTER}} </ion-label>
</ion-col> </ion-col>
<!-- </ion-row> <!-- </ion-row>
<ion-row> --> <ion-row> -->
<ion-col class="colItems"> <ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','code')}} </label> <label class="colItemReq" for="">{{ts.trPK('worklistMain','code')}} </label>
<br /> <br />
<!-- </ion-col> <!-- </ion-col>
<ion-col> --> <ion-col> -->
<ion-label class="labelValue" for="">{{Lines.ITEM_CODE}} </ion-label> <ion-label class="labelValue" for="">{{Lines.ITEM_CODE}} </ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row class="rowBorder">
<ion-col class="colItems colBorder ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','unit')}} </label>
<br />
<ion-col class="colItems"> <ion-label class="labelValue" for="">{{Lines.UOM}} </ion-label>
<label class="colItemReq" for="">{{ts.trPK('worklistMain','unit')}} </label> </ion-col>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{Lines.UOM}} </ion-label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','price')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{Lines.UNIT_PRICE}} </ion-label>
</ion-col> <ion-col class="colItems">
</ion-row> <label class="colItemReq" for="">{{ts.trPK('worklistMain','price')}} </label>
<ion-row> <br />
<ion-label class="labelValue" for="">{{Lines.UNIT_PRICE}} </ion-label>
<ion-col class="colItems"> </ion-col>
<label class="colItemReq" for="">{{ts.trPK('payslip','amount')}} </label> </ion-row>
<br /> <ion-row>
<!-- </ion-col> <ion-col class="colItems colBorder ">
<ion-col> --> <label class="colItemReq" for="">{{ts.trPK('payslip','amount')}} </label>
<ion-label class="labelValue" for="">{{Lines.LINE_AMOUNT}} </ion-label> <br />
</ion-col>
<!-- </ion-row> <ion-label class="labelValue" for="">{{Lines.LINE_AMOUNT}} </ion-label>
<ion-row> --> </ion-col>
<ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label>
<br />
<!-- </ion-col>
<ion-col> -->
<ion-label class="labelValue" for="">{{Lines.QUANTITY}} </ion-label>
</ion-col>
</ion-row>
</div>
</ion-item> <ion-col class="colItems">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','quantity')}} </label>
<br />
</ion-grid> <ion-label class="labelValue" for="">{{Lines.QUANTITY}} </ion-label>
</ion-col>
</ion-row>
</div> </div>
</ion-list> </accordin-tab-custom>
<!-- </ion-card-content> --> </accordin-custom>
<!-- </ion-card> -->
</ion-slide>
<ion-slide>
<ion-card class="cardContent">
<ion-card-content>
<div [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start"> </ng-container>
<!-- <div class="item-date"> {{notificationList.BEGIN_DATE }} </div> --> <ng-container *ngIf="activeSegment === 'action-history'">
<!-- [hidden]="actionHistory.NOTE == '' || actionHistory.NOTE == null"> --> <ion-card class="cardContent">
<ion-card-content>
<div> <div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes; let index=index">
<div class="timeline-item" slot="start">
<!-- <div>
<button ion-button <button ion-button
(click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)" (click)="openNoteDetail(actionHistory.NOTE ,actionHistory.NAME)"
@ -320,97 +304,112 @@
<img src="../assets/imgs/noteSmall.png"> <img src="../assets/imgs/noteSmall.png">
<!-- <ion-icon name="bookmark"></ion-icon> -->
</button> </button>
</div> </div> -->
<!-- [ngClass]="{'bg-blue-dot' : actionHistory.ACTION === 'Submitted' ,'statusGreanColor' :appointmentsArrive.Status != 1 && appointmentsArrive.Status != 2, 'statusRedColor' :appointmentsArrive.Status === 2}" -->
<div class="timeline-thumb timeline-icon">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png">
<div [ngClass]="{'bg-blue-dot' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-dot' : actionHistory.ACTION === 'Pending' ,'bg-red-dot' : actionHistory.ACTION === 'Rejected','bg-green-dot' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}"
class="timeline-thumb timeline-icon">
</div>
</div> </div>
<ion-col> </div>
<ion-label <ion-col>
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Rejected','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}" <ion-label style="color:black !important ;font-weight: bold;">
class=""> {{actionHistory.ACTION}}</ion-label> {{actionHistory.NAME}}
<ion-label> {{actionHistory.NAME}} </ion-label>
</ion-label>
<ion-label> {{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load More</button> <div *ngIf="actionHistory.NOTE">
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
</ion-card-content>
</ion-card>
</ion-slide> <div *ngIf="checkLines(actionHistory.NOTE)">
<ion-slide>
<ion-card class="cardContent"> <div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' ">
<ion-card-content> Note: {{actionHistory.NOTE}}
<div [hidden]="attachmentRes && attachmentRes.length > 0">
<p>{{ 'general, notAttch' | translate}}</p>
</div> </div>
<div *ngIf="attachmentRes && attachmentRes.length > 0 "> <button class="showMore"
<!-- <ion-card> (click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
<ion-card-header class="boxHdr"> </div>
<div class="hrTitle">{{'worklistMain, suppDoc' | translate}}</div>
</ion-card-header>
<ion-card-content>
-->
<ion-grid>
<div *ngFor="let attachList of attachmentRes">
<ion-row (click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<ion-col col-12>
<div
*ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'">
<img float-start class="attachImg" src="../assets/imgs/pdf.png">
</div>
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start
class="attachImg" src="../assets/imgs/doc.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/nonfile.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/img.png">
</div> </div>
<ion-label>
{{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} </ion-label>
</ion-col>
<!-- <ion-col col-2>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-col> -->
</ion-row>
</div>
</ion-grid>
<!-- </ion-card-content>
</ion-card> -->
<!-- *ngIf="!checkLines(actionHistory.NOTE)" -->
</div>
<!-- [ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submitted' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Rejected','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Rejected' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}" -->
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submite' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Reject','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Reject' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''" class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load
More</button>
</ion-card-content>
</ion-card>
</ng-container>
<ng-container *ngIf="activeSegment === 'attach'">
<!-- <ion-card class="cardContent">
<ion-card-content> -->
<div class="noDataDiv" [hidden]="attachmentRes && attachmentRes.length > 0">
<p>{{ 'general, notAttch' | translate}}</p>
</div>
<div *ngIf="attachmentRes && attachmentRes.length > 0 ">
<ion-grid>
<ion-item class="itemAttch" *ngFor="let attachList of attachmentRes">
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'">
<img float-start class="attachImg" src="../assets/imgs/pdf.png">
</div>
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start class="attachImg"
src="../assets/imgs/doc.png">
</div> </div>
</ion-card-content> <div
</ion-card> *ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'">
</ion-slide> <img float-start class="attachImg" src="../assets/imgs/nonfile.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/img.png">
</div>
<ion-label>
{{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} </ion-label>
</ion-slides> <button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-item>
</ion-grid>
<!-- <div id="notificationDynamicFields">
</div> -->
</ion-content>
<ion-footer class="footerSearchBtn">
</div>
<!-- </ion-card-content>
</ion-card> -->
</ng-container>
<ion-row> <ion-row>
<ion-col col-12> <ion-col col-12>
<div id="notificationDynamicFields"> <div id="notificationDynamicFields">
@ -418,14 +417,28 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> </ion-content>
<!-- <div class="centerDiv"> --> <div *ngIf="messageSuccess" class="succssfullMSG">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
<!--filled-->
<br />
<div> Transaction Successful </div>
</div>
<ion-footer *ngIf="!messageSuccess" class="footerSearchBtn">
<!-- <ion-row>
<ion-col col-12>
<div id="notificationDynamicFields">
</div>
</ion-col>
</ion-row> -->
<!-- <ion-row class="rowBtn">
<ion-col col-2> <ion-col col-2>
</ion-col> </ion-col>
<ion-col col-8> <ion-col col-8>
<!-- <ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}
</ion-button> -->
<ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem actionList"> <ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem actionList">
<ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label> <ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label>
@ -438,7 +451,6 @@
</ion-item> </ion-item>
</ion-col> </ion-col>
<!-- </div> -->
<ion-col col-2 style="bottom: -8px"> <ion-col col-2 style="bottom: -8px">
<ion-button class="skipbutton" (click)="nextNotfification()"> <ion-button class="skipbutton" (click)="nextNotfification()">
@ -447,10 +459,59 @@
</ion-button> </ion-button>
</ion-col> </ion-col>
</ion-row>
</ion-row> -->
<!-- <ion-row class="rowBtn" *ngIf="notificationButtonRes?.length >0">
<ion-button class="actionBtn" (click)="actionButton(notificationButtons.BUTTON_ACTION)"
*ngFor="let notificationButtons of notificationButtonRes | slice:0:3; let i=index;" >
{{notificationButtons.BUTTON_LABEL}}
</ion-button>
<ion-button style="--background:orange;" class="actionBtn" (click)="nextNotfification()">
{{'worklistMain, skip' | translate}}
</ion-button>
<ion-button style="--background:#cccccc;" *ngIf="notiActionBtnMore != '' && notiActionBtnMore == undefined" class="actionBtn" (click)="openMoreActions()">
more
</ion-button>
</ion-row> -->
<ion-tabs>
<ion-tab-bar class="tabBar" slot="bottom">
<ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVED')">
<img src="../assets/imgs/action-approve.png">
<ion-label>Approve</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECTED')">
<img src="../assets/imgs/action-reject.png">
<ion-label>Reject</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="requestDis" (click)="actionButton('REQUEST_INFO')">
<img src="../assets/imgs/action-info.png">
<ion-label>Request</ion-label>
</ion-tab-button>
<ion-tab-button (click)="nextNotfification()">
<img src="../assets/imgs/action-skip.png">
<ion-label>Skip</ion-label>
</ion-tab-button>
<ion-tab-button (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

@ -1,8 +1,106 @@
.itemHISBtn{ // .itemHISBtn{
padding: 5px; // padding: 5px;
color: var(--light); // color: var(--light);
background: var(--darkgray); // background: var(--darkgray);
border-radius: 3px; // border-radius: 3px;
width: 85%; // width: 85%;
height: 40px; // height: 40px;
} // }
// .rowBtn{
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: center;
// background: white;
// }
// .rowBorder{
// border-bottom: solid 0.03cm var(--grayBG);
// }
// .colBorder{
// border-right: solid 0.03cm var(--grayBG);
// }
// .dateActionHistory{
// text-align: end;
// // margin-top: -25px;
// }
// .actionBtn{
// --border-radius: 50% !important;
// height: 55px;
// width: 55px;
// --background: var(--newgreen); // will be dynamic
// background: transparent;
// margin:10px;
// }
// .itemAttch{
// border-radius: 11px;
// margin: 8px;
// --min-height: 60px;
// --max-height: 60px;
// }
// .less {
// max-height: 54px;
// }
// .noDataDiv{
// background: #ffffff;
// height: 11%;
// text-align: center;
// padding-top: 1px;
// border-radius: 10px;
// margin: 10px;
// }
// .container {
// font-size: 14px;
// line-height: 14px;
// height: 16px;
// overflow: hidden;
// text-align: justify;
// }
// .show {
// overflow: visible;
// height: auto;
// }
// .showMore{
// padding: 0px;
// background: transparent;
// color: blue;
// text-decoration: underline;
// font-size: 14px;
// }
// .succssfullMSG{
// height: 100%;
// width: 100%;
// background: var(--newgreen);
// color: white;
// font-weight: bold;
// font-size: 20px;
// text-align: center;
// vertical-align: middle;
// padding-top: 30px;
// }
// .succssfullIcon{
// width: 60%;
// text-align: center;
// height: 60%;
// }
// .subjectNotification{
// text-align: center;
// padding-top: 10px;
// font-weight: bold;
// }

@ -28,6 +28,10 @@ import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.compo
import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes';
import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; import { ApplyActionModalComponent } from '../apply-action-modal/apply-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 { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
@Component({ @Component({
selector: 'app-worklist-main-pr', selector: 'app-worklist-main-pr',
templateUrl: './worklist-main-pr.component.html', templateUrl: './worklist-main-pr.component.html',
@ -83,6 +87,19 @@ export class WorklistMainPRComponent implements OnInit {
confirmMsg: string; confirmMsg: string;
delMsg: string; delMsg: string;
closeMsg: string; closeMsg: string;
truncating: boolean;
orgNote: any;
lines_note_limit: any = 15;
selectedIndex: any;
showLessBtn: boolean;
showMoreBtn: boolean;
demoeAttach: any = [];
notiActionBtnMore: any = [];
messageSuccess: boolean = false;
activeSegment: any = "info";
approveDis: boolean;
rejectDis: boolean;
requestDis: boolean;
constructor( constructor(
@ -109,43 +126,19 @@ export class WorklistMainPRComponent implements OnInit {
this.intializeNotificationDetail(); this.intializeNotificationDetail();
let segment = document.querySelector('ion-segment');
let slides = document.querySelector('ion-slides');
segment.addEventListener('ionChange', (ev) => onSegmentChange(ev));
slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev));
// On Segment change slide to the matching slide
function onSegmentChange(ev) {
console.log("ev.detail.value" + ev.detail.value);
slideTo(ev.detail.value);
}
function slideTo(index) { }
console.log("index: " + index);
slides.slideTo(index);
}
// On Slide change update segment to the matching value
async function onSlideDidChange(ev) {
var index = await slides.getActiveIndex();
console.log("index: " + index);
clickSegment(index);
}
function clickSegment(index) {
segment.value = index; intializeNotificationDetail() {
if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = "";
} }
}
intializeNotificationDetail() {
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,
@ -197,6 +190,10 @@ export class WorklistMainPRComponent implements OnInit {
this.getPRNotificationDetails(this.WorkListBodyObj); this.getPRNotificationDetails(this.WorkListBodyObj);
} }
} }
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value);
}
getPRNotificationDetails(notificationBodyObj) { getPRNotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
@ -298,7 +295,20 @@ 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;
} // if result == null this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true;
} // if result == null
} // valid it
}
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
@ -313,14 +323,14 @@ export class WorklistMainPRComponent implements OnInit {
handleApplayActionResult(result) { handleApplayActionResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome(); // show succsfull popup
//this.common.openNotificationPage(); this.messageSuccess = true;
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { setTimeout(() => {
// this.notificationArray.splice(i, 1); this.messageSuccess = false;
// } }, 5000);
// }
this.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
} }
@ -348,8 +358,14 @@ export class WorklistMainPRComponent implements OnInit {
} }
} }
actionButton() { actionButton(action) {
let ButtonAction: string = this.actionType;
console.log("actionButton" + action);
alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = []; this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) { for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) {
@ -451,7 +467,8 @@ export class WorklistMainPRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPRComponent.PASS_RES_ATTR WorklistMainPRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRFCPage(); // this.common.openWorklistRFCPage();
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,
@ -472,7 +489,8 @@ export class WorklistMainPRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPRComponent.PASS_RES_ATTR WorklistMainPRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" || ButtonAction == "REQUEST_INFO" ||
@ -498,7 +516,8 @@ export class WorklistMainPRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainPRComponent.PASS_RES_ATTR WorklistMainPRComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == "CONTINUE_ACTION"
@ -703,6 +722,8 @@ export class WorklistMainPRComponent implements OnInit {
} }
} }
} }
this.turnCateFun(this.actionHistoryRes);
} }
} }
@ -876,9 +897,136 @@ export class WorklistMainPRComponent implements OnInit {
//infiniteScroll.target.complete(); //infiniteScroll.target.complete();
} }
}//end infiniteScroll }//end infiniteScroll
////////////////////////////////////////////////////////
public checkLines(note) {
console.log(note.split("\n").length);
console.log(note.length);
if (note && note != null) {
} return (note.length > this.lines_note_limit) ? true : false;
}
return false;
};
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
}
// actionHis.map((obj) => {
// obj.visible = false;
// // or via brackets
// // obj['total'] = 2;
// return obj;
// })
this.actionHistoryRes = actionHis;
console.log("test");
}
async openMoreActions() {
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
this.actionButton(this.actionType);
///call Action button
}
});
return await modal.present();
}
async openRepRolModal() {
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
async openRFCModal() {
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
}

@ -1,136 +1,529 @@
<ion-header > <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content> <ion-content *ngIf="!messageSuccess" class="colorBG">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<!-- add segemnt part -->
<ion-card> <div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<ion-card-header class="boxHdr"> <ion-segment [dir]="directionLTR" mode="md" color="secondary" (ionChange)="segmentChanged($event)"
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div> [value]="defaultSegment" class="ion-segment-all">
</ion-card-header>
<ion-card-content>
<div> <ion-segment-button value="item-req"
<ion-grid> [ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
<ion-row> {{ts.trPK('worklistMain','title')}}
<ion-col class="colBold">
<label for=""> {{ts.trPK('worklistMain','from')}} </ion-segment-button>
<ion-segment-button value="action-history"
</label> [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
</ion-col> {{'worklistMain, action' | translate}}
<ion-col> </ion-segment-button>
<label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col> <ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
</ion-row> {{'general, file' | translate}}
<ion-row> </ion-segment-button>
<ion-col class="colBold"> <ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
<label for="">{{ts.trPK('worklistMain','to')}} {{ts.trPK('worklistMain','info')}}
</label> </ion-segment-button>
</ion-col> </ion-segment>
<ion-col>
<label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col>
</ion-row>
<ion-row> <div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<ion-col class="colBold"> <ng-container *ngIf="activeSegment === 'info'">
<label for="">{{ts.trPK('worklistMain','sent')}}
</label> <div *ngIf="notificationBodyRes?.length > 0 ">
</ion-col> <ion-card *ngFor="let item of notificationBodyRes; let i=index ">
<ion-col>
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label> <!-- <ion-card-header class="boxHdr">
</ion-col> <div class="hrTitle"> {{'worklistMain, notfDetails' | translate}}</div>
</ion-row> </ion-card-header> -->
<ion-row>
<ion-col class="colBold"> <ion-card-content>
<label for="">{{ts.trPK('worklistMain','closed')}} <div>
</label>
</ion-col> <ion-row class="" *ngIf=" item.Collection_Notification.DISPLAY_FLAG != 'N' ">
<ion-col> <ion-col class="rowBorder" *ngFor="let notificationBody of item.Collection_Notification;"
<label for="">{{getPassNotificationDetails.END_DATE}}</label> size="6">
</ion-col> <label class="colItemReq" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
</ion-row> <!-- </ion-col>
<ion-row> <ion-col col-7> -->
<ion-col class="colBold"> <br />
<label for="">{{ts.trPK('worklistMain','id')}} <label for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
</label> </ion-col>
</ion-col> </ion-row>
<ion-col> </div>
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label> </ion-card-content>
</ion-col>
</ion-row> </ion-card>
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> </div>
<ion-col class="colBold">
<label for="">{{ts.trPK('worklistMain','responder')}}
</label> <div style="margin: 10px; " *ngIf="subordinatesleaveList != undefined">Employee will also on leave </div>
</ion-col> <ion-item class="subOrdinateList" *ngFor="let List of subordinatesleaveList;">
<ion-col>
<label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col>
</ion-row> <ion-grid class="gridSubordinates">
<div class="subOrdinateDiv">
<ion-row>
<ion-col class="colBold"> <img class="subOrdinateImg" src="../assets/imgs/profile.png"></div>
<label for="">{{ts.trPK('worklistMain','subject')}} </label>
</ion-col> <ion-row class="rowHeader subOrdinateRow">
<ion-col>
<label for="">{{getPassNotificationDetails.SUBJECT}} </label> <ion-col size="9">
</ion-col> <label style="font-weight: bold; " class="label" for="">{{List.EMPLOYEE_NAME}} </label>
</ion-row> <br />
<ion-row> <label class="label" for="">JOB TITLE DEMO </label><br />
<ion-col class="greenTxt" col-4> </ion-col>
<button ion-button block class="notColBtn" (click)="openNotificationBody()">
<p>{{ts.trPK('worklistMain','notfDetails')}} </p> <ion-col class="status" size="3">
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img> <label class="label" for="label">{{List.STATUS}}</label>
</button> </ion-col>
</ion-col> </ion-row>
<ion-col class="greenTxt" col-4> <br />
<button ion-button block class="notColBtn" (click)="openActionHistory()"> <ion-row class="subOrdinateRow">
<p>{{ts.trPK('worklistMain','actionHis')}}</p> <ion-col>
<ion-img class="serviceItemImg" src="../assets/imgs/actionHistory.png"></ion-img>
</button> <label class="label" for="">From</label><br />
</ion-col> <label class="label" for="">{{List.DATE_START |date}}</label>
<ion-col class="greenTxt" col-4> </ion-col>
<button ion-button block class="notColBtn" (click)="openSupportDocuments()"> <ion-col>
<p>{{ts.trPK('worklistMain','suppDoc')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/documents.png"></ion-img> <label class="label" for="">To</label><br />
</button> <label class="label" for="">{{List.DATE_END | date}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<!-- </ion-col> -->
</div> </ion-item>
</ion-card-content> <!-- </ion-card-content>
</ion-card> </ion-card> -->
<div> </ng-container>
<ng-container *ngIf="activeSegment === 'item-req'">
<ion-card class="cardContent">
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> -->
<ion-card-content>
<div>
<ion-grid style="text-align: left">
<ion-row class="rowBorder">
<ion-col class="colBorder">
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder">
<ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col>
</ion-row>
<ion-row class="">
<ion-col class="colBorder">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col>
<!-- </ion-row>
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col>
</ion-row>
<!-- <ion-row class="">
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label>
</ion-col>
<ion-col>
<br/>
<label for="">{{getPassNotificationDetails.SUBJECT}} </label>
</ion-col>
</ion-row> -->
<!-- <ion-row>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openNotificationBody()">
<p>{{ts.trPK('worklistMain','notfDetails')}} </p>
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openActionHistory()">
<p>{{ts.trPK('worklistMain','actionHis')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/actionHistory.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openSupportDocuments()">
<p>{{ts.trPK('worklistMain','suppDoc')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/documents.png"></ion-img>
</button>
</ion-col>
</ion-row> -->
</ion-grid>
</div>
</ion-card-content>
</ion-card>
<div *ngIf="submitterInfoRes?.length > 0 ">
<ion-card>
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{'general, info' | translate}}</div>
</ion-card-header> -->
<ion-card-content>
<div style="font-weight: bold;" class="hrTitle">Employee Detail</div>
<div *ngFor="let submitterInfo of submitterInfoRes">
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, empNo' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NUMBER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, name' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, position' | translate}}</label>
<br />
<label for="">{{submitterInfo.POSITION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, grade' | translate}}</label>
<br />
<label for="">{{submitterInfo.GRADE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, job' | translate}}</label>
<br />
<label for="">{{submitterInfo.JOB_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, category' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYMENT_CATEGORY_MEANING}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, orgEmail' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_EMAIL_ADDRESS}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, orgName' | translate}}</label>
<br />
<label for="">{{submitterInfo.ORGANIZATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, busG' | translate}}</label>
<br />
<label for="">{{submitterInfo.BUSINESS_GROUP_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, locName' | translate}}</label>
<br />
<label for="">{{submitterInfo.LOCATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<label class="colItemReq" for="">{{'userProfile, payrol' | translate}}</label>
<br />
<label for="">{{submitterInfo.PAYROLL_NAME}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
</ng-container>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div class="timeline-thumb timeline-icon">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;">
{{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION === 'Submite' || actionHistory.ACTION === 'Submit' ,'bg-orange-txt' : actionHistory.ACTION === 'Pending' ,'bg-red-txt' : actionHistory.ACTION === 'Reject','bg-green-txt' : actionHistory.ACTION != 'Pending' && actionHistory.ACTION != 'Reject' && actionHistory.ACTION != 'Submitted' && actionHistory.ACTION != 'Submit'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''" class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load
More</button>
</ion-card-content>
</ion-card>
</ng-container>
<ng-container *ngIf="activeSegment === 'attach'">
<div class="noDataDiv" [hidden]="attachmentRes && attachmentRes.length > 0">
<p>{{ 'general, notAttch' | translate}}</p>
</div>
<div *ngIf="attachmentRes && attachmentRes.length > 0 ">
<ion-grid>
<ion-item class="itemAttch" *ngFor="let attachList of attachmentRes">
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'">
<img float-start class="attachImg" src="../assets/imgs/pdf.png">
</div>
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start class="attachImg"
src="../assets/imgs/doc.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/nonfile.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/img.png">
</div>
<ion-label>
{{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} </ion-label>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-item>
</ion-grid>
</div>
</ng-container>
<div>
<!-- ATTRIBUTE_DISPLAY_NAME: "Note" <!-- ATTRIBUTE_DISPLAY_NAME: "Note"
ATTRIBUTE_FORMAT: "4000" ATTRIBUTE_FORMAT: "4000"
ATTRIBUTE_NAME: "WF_NOTE" ATTRIBUTE_NAME: "WF_NOTE"
ATTRIBUTE_TYPE: "VARCHAR2" --> ATTRIBUTE_TYPE: "VARCHAR2" -->
<div id="notificationDynamicFields"> <div id="notificationDynamicFields1">
</div> </div>
<!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject"> <!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form> --> </json-schema-form> -->
</div> </div>
<ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem"> <!-- <ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem">
<ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label> <ion-label class="boldTxtNav">{{'actionHis, action' | translate}} </ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="actionType" required > <ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
<ion-select-option value= "{{notificationButtons.BUTTON_ACTION}}" *ngFor="let notificationButtons of notificationButtonRes; let i=index;">{{notificationButtons.BUTTON_LABEL}}</ion-select-option> [(ngModel)]="actionType" required>
</ion-select> <ion-select-option value="{{notificationButtons.BUTTON_ACTION}}"
</ion-item> *ngFor="let notificationButtons of notificationButtonRes; let i=index;">
{{notificationButtons.BUTTON_LABEL}}</ion-select-option>
</ion-select>
</ion-item> -->
<ion-row>
<ion-col col-12>
<div id="notificationDynamicFields">
</div>
</ion-col>
</ion-row>
</ion-content> </ion-content>
<ion-footer> <div *ngIf="messageSuccess" class="succssfullMSG">
<div class="centerDiv" > <ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
<ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</ion-button> <!--filled-->
</div> <br />
<div class="centerDiv" > <div> Transaction Successful </div>
<ion-button color="customnavy" class="gridBtn" (click)="nextNotfification()">{{'worklistMain, skip' | translate}}</ion-button> </div>
</div>
</ion-footer> <ion-footer class="footerSearchBtn" *ngIf="!messageSuccess">
<!-- <ion-row class="rowBtn" *ngIf="notificationButtonRes?.length >0">
*ngFor="let notificationButtons of notificationButtonRes; let i=index;">
<ion-button class="actionBtn" (click)="actionButton(notificationButtons.BUTTON_ACTION)"
*ngFor="let notificationButtons of notificationButtonRes | slice:0:3; let i=index;" >
{{notificationButtons.BUTTON_LABEL}}
</ion-button>
<ion-button style="--background:orange" class="actionBtn" (click)="nextNotfification()">
{{'worklistMain, skip' | translate}}
</ion-button>
<ion-button style="--background:#cccccc;" class="actionBtn" (click)="openMoreActions()">
more
</ion-button>
</ion-row> -->
<!-- <div class="centerDiv">
<ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}
</ion-button>
</div>
<div class="centerDiv">
<ion-button color="customnavy" class="gridBtn" (click)="nextNotfification()">
{{'worklistMain, skip' | translate}}</ion-button>
</div> -->
<ion-row class="rowBtn" *ngIf="notificationButtonRes?.length >0">
<ion-tabs>
<ion-tab-bar class="tabBar" slot="bottom">
<ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVED')">
<img src="../assets/imgs/action-approve.png">
<ion-label>Approve</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECTED')">
<img src="../assets/imgs/action-reject.png">
<ion-label>Reject</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="requestDis" (click)="actionButton('REQUEST_INFO')">
<img src="../assets/imgs/action-info.png">
<ion-label>Request</ion-label>
</ion-tab-button>
<ion-tab-button (click)="nextNotfification()">
<img src="../assets/imgs/action-skip.png">
<ion-label>Skip</ion-label>
</ion-tab-button>
<ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-row>
</ion-footer>

@ -69,4 +69,202 @@
color: var(--secondary); color: var(--secondary);
border: 2px solid var(--gray); border: 2px solid var(--gray);
min-width: auto; min-width: auto;
} }
////////////////////////
.itemHISBtn{
padding: 5px;
color: var(--light);
background: var(--darkgray);
border-radius: 3px;
width: 85%;
height: 40px;
}
.rowBtn{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background: white;
}
.rowBorder{
border-bottom: solid 0.03cm var(--grayBG);
}
.colBorder{
border-right: solid 0.03cm var(--grayBG);
}
.dateActionHistory{
text-align: end;
// margin-top: -25px;
margin-top: -3px;
}
.actionBtn{
--border-radius: 50% !important;
height: 55px;
width: 55px;
--background: var(--newgreen); // will be dynamic
background: transparent;
margin:10px;
}
.itemAttch{
border-radius: 11px;
margin: 8px;
--min-height: 60px;
--max-height: 60px;
}
.less {
max-height: 54px;
}
.noDataDiv{
background: #ffffff;
height: 11%;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
}
.container {
font-size: 14px;
line-height: 14px;
height: 15px;
overflow: hidden;
text-align: justify;
}
.show {
overflow: visible;
height: auto;
}
.showMore{
padding: 0px;
background: transparent;
color: blue;
text-decoration: underline;
font-size: 14px;
}
.succssfullMSG{
height: 100%;
width: 100%;
background: var(--newgreen);
color: white;
font-weight: bold;
font-size: 20px;
text-align: center;
vertical-align: middle;
padding-top: 30px;
}
.succssfullIcon{
width: 60%;
text-align: center;
height: 60%;
}
////////////////////////////////
.subOrdinateList{
// margin: 10px;
// border-top-left-radius: 45px;
// border-bottom-left-radius: 45px;
// border: var(--cusgray) 1px solid !important;
--background: transparent;
margin-left: -15px;
margin-right: 7px;
}
.status{
text-align: center;
background: green;
border-radius: 10px;
font-size: 12px;
height: 40px;
color: white;
}
.rowHeader{
border-bottom: 1px solid var(--cusgray);
padding-bottom: 10px;
margin-bottom: -17px;
}
.container{
position:relative;
}
.overflow-hid-div{
overflow:hidden;
margin-left:50px;
width:200px;
height: 200px;
background-color:red;
}
.inner{
width:50px;
height: 50px;
background-color:green;
position: absolute;
left:25px;
top:25px;
}
.gridSubordinates{
margin-left: 38px;
border-top-left-radius: 28px;
border-bottom-left-radius: 40px;
// padding-left: 8px;
background:var(--light);
border-top-right-radius: 16px;
border-bottom-right-radius: 16px;
}
.subOrdinateDiv{
z-index: 4;
margin-left: -44px;
position: absolute;
top: -2px;
}
.subOrdinateImg{
width: 85px;
border: #e4e4e4 solid 2px;
-moz-border-radius: 50%;
border-radius: 50%;
border: 3px solid #f0efef;
}
.subOrdinateRow{
margin-left: 40px;
}
.label{
font-size: 14px;
}
.subjectNotification{
text-align: center;
padding-top: 10px;
font-weight: bold;
}
.submitterInfo{
padding-top: 10px;
padding-bottom: 10px;
}
ion-card{
color: black !important;
}
////
.tabBar{
height:70px
}

@ -15,10 +15,29 @@ 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';
import { Events } from '@ionic/angular'; import { Events, ModalController } from '@ionic/angular';
import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes'; import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes';
import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes'; import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes';
import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes'; import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes';
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
import { WorklistAttachService } from 'src/app/absence/service/work-list-attach.service';
import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq';
import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes';
import { WorklistService } from '../service/worklist.service';
import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component';
import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component';
import { GetSubordinatesLeavesRequest } from '../../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest';
import { DashboredService } from '../../hmg-common/services/dashbored/dashbored.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 { WorklistsubmitterInfoResponse } from '../models/WorklistsubmitterInfoRes';
import { WorkListSubmitterInfoRequest } from '../models/WorklistsubmitterInfoReq';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
@Component({ @Component({
selector: "app-worklist-main", selector: "app-worklist-main",
templateUrl: "./worklist-main.component.html", templateUrl: "./worklist-main.component.html",
@ -51,29 +70,85 @@ export class WorklistMainComponent implements OnInit {
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = "";
notificationArray: any; notificationArray: any;
notificationDynamicAttributeArr:any; notificationDynamicAttributeArr: any;
private textInput: TextInput; private textInput: TextInput;
private textArea: TextAreaInput; private textArea: TextAreaInput;
private WorkListAttachObj: WorkListButtonRequest;
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100;
notificationCount: any; notificationCount: any;
activeSegment: any = "info";
lines_note_limit: any = 15;
attachmentRes: any;
private WorkListActionHistoryObj: WorkListActionHistoryRequest;
IsReachEnd: boolean = false;
notiActionBtnMore: any = [];
messageSuccess: boolean = false;
confirmMsg: string;
newArr: any = [];
selEmp: any;
subordinatesleaveList: any;
private WorkListSubmitterInfoObj: WorkListSubmitterInfoRequest;
submitterInfoRes: any;
approveDis: boolean = false;
rejectDis: boolean = false;
requestDis: boolean = false;
moreDisabled: boolean = true;
constructor( constructor(
public worklistService: WorklistService,
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public worklistMainService: WorklistMainService, public worklistMainService: WorklistMainService,
public elementRef: ElementRef, public elementRef: ElementRef,
public menuService: MenuService, public menuService: MenuService,
public events: Events, public events: Events,
) { } public worklistAttachService: WorklistAttachService,
private modalCtrl: ModalController,
public dashboredService: DashboredService,
public authService: AuthenticationService
) {
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
}
ngOnInit() { ngOnInit() {
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
false
);
if (this.selEmp) { } else {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.selEmp = user.ASSIGNMENT_NUMBER;
}
});
}
console.log(" this.selEmp" + this.selEmp);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
console.log(" event.detail.value: " + event.detail.value);
} }
intializeNotificationDetail() { intializeNotificationDetail() {
document.getElementById("notificationDynamicFields").innerHTML=""; if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = "";
}
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
); );
console.log(this.getPassNotificationDetails.ROW_NUM); console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData( this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR, HomeComponent.NOTIFICATION_ARR,
@ -81,6 +156,8 @@ export class WorklistMainComponent implements OnInit {
); );
this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest(); this.WorkListButtonsObj = new WorkListButtonRequest();
this.WorkListAttachObj = new WorkListButtonRequest();
this.WorkListSubmitterInfoObj = new WorkListSubmitterInfoRequest();
this.WorkListActionObj = new WorkListActionRequest(); this.WorkListActionObj = new WorkListActionRequest();
@ -96,45 +173,65 @@ export class WorklistMainComponent implements OnInit {
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_LIMIT = this.P_PAGE_LIMIT;
this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListAttachObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListSubmitterInfoObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.WorkListSubmitterInfoObj.P_PAGE_NUM = 1;
this.WorkListSubmitterInfoObj.P_SELECTED_EMPLOYEE_NUMBER = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.WorkListSubmitterInfoObj.P_SELECTED_RESP_ID = -999;
this.WorkListSubmitterInfoObj.P_SEARCH_EMAIL_ADDRESS = "";
this.WorkListSubmitterInfoObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.WorkListSubmitterInfoObj.P_SEARCH_USER_NAME = "";
this.getsubmitterInfo(this.WorkListSubmitterInfoObj);
this.getNotificationButtons(this.WorkListButtonsObj); this.getNotificationButtons(this.WorkListButtonsObj);
this.getNotificationResAttr(this.WorkListButtonsObj); this.getNotificationResAttr(this.WorkListButtonsObj);
this.getAttachmentNotification(this.WorkListAttachObj);
this.getActionHistory(this.WorkListActionHistoryObj);
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);
} }
} }
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");
}); });
} }
getMONotificationDetails(notificationBodyObj){ getMONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.getMONotificationBody(notificationBodyObj) .getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => { .subscribe((result: MONotificatonBodyResponse) => {
//this.handleWorkListBodyResult(result, "MO"); //this.handleWorkListBodyResult(result, "MO");
}); });
} }
getPONotificationDetails(notificationBodyObj){ getPONotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.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");
}); });
} }
getEITNotificationDetails(notificationBodyObj) { getEITNotificationDetails(notificationBodyObj) {
@ -167,8 +264,17 @@ export class WorklistMainComponent implements OnInit {
if (result.GetAbsenceCollectionNotificationBodyList) { if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
// getDimensions(this.notificationBodyRes) {
let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) {
return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE";
});
// return obj;
// }
this.getSubordinatesleave(obj)
} }
}else if (Type == "PR") { } else if (Type == "PR") {
if (result.GetAbsenceCollectionNotificationBodyList) { if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
@ -178,7 +284,7 @@ export class WorklistMainComponent implements OnInit {
} //End handleWorkListBodyResult } //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) { getNotificationButtons(notificationButtonsObj) {
this.worklistMainService this.worklistMainService
.getNotificationButtons(notificationButtonsObj) .getNotificationButtons(notificationButtonsObj)
@ -192,8 +298,27 @@ export class WorklistMainComponent 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;
} // if result == null this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
} // valid it console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true;
} // if result == null
else (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it
}
}
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
applyAction(WorkListActionObj) { applyAction(WorkListActionObj) {
@ -215,6 +340,13 @@ export class WorklistMainComponent implements OnInit {
// this.notificationArray.splice(i, 1); // this.notificationArray.splice(i, 1);
// } // }
// } // }
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
}, 5000);
this.getNotificationCountAfterSubmit(); this.getNotificationCountAfterSubmit();
this.nextNotfification(); this.nextNotfification();
} }
@ -242,11 +374,12 @@ export class WorklistMainComponent implements OnInit {
} }
} }
actionButton() { actionButton(action) {
let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = []; this.P_RESPOND_ATTRIBUTES_TBL = [];
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") {
@ -255,8 +388,8 @@ export class WorklistMainComponent implements OnInit {
// 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);
} }
@ -278,17 +411,54 @@ export class WorklistMainComponent implements OnInit {
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;
this.applyAction(this.WorkListActionObj);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.sharedService.setSharedData(
ButtonAction,
WorklistMainComponent.PASS_ACTION_MODE
);
this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
// this.applyAction(this.WorkListActionObj);
if (ButtonAction === "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
}
else if (ButtonAction === "REJECTED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
}
else if (ButtonAction === "DEL") {
this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg')
}
else if (ButtonAction === "CLOSE") {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
}
this.common.confirmAlertDialogAction(
() => {
this.applyAction(this.WorkListActionObj);
}, this.ts.trPK('general', 'ok'),
() => { }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg)
// this.openApplyModal(this.WorkListActionObj);
} }
if (ButtonAction == "RFC") { if (ButtonAction == "RFC") {
// alert("Return For Correction"); // alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
// this.navCtrl.push("WorkListRfcPage", {
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -301,7 +471,8 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
this.common.openWorklistRFCPage(); //this.common.openWorklistRFCPage();
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,
@ -322,7 +493,8 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); //this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "DELEGATE" || ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" || ButtonAction == "REQUEST_INFO" ||
@ -348,7 +520,8 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
this.common.openWorklistRollReplacement(); // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if ( } else if (
ButtonAction == "UPDATE_ACTION" || ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION" ButtonAction == "CONTINUE_ACTION"
@ -440,22 +613,22 @@ export class WorklistMainComponent implements OnInit {
this.hideForwordEmployee = result.NotificationRespondRolesList[0]; this.hideForwordEmployee = result.NotificationRespondRolesList[0];
} }
this.notificationDynamicFields(result.NotificationGetRespondAttributesList); this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList;
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
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") {
} }
} }
} }
@ -483,7 +656,6 @@ export class WorklistMainComponent implements OnInit {
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.common.openNotificationDetailsPage(); this.common.openNotificationDetailsPage();
} }
} }
@ -501,4 +673,277 @@ export class WorklistMainComponent implements OnInit {
} }
}); });
} }
getAttachmentNotification(WorkListAttachObj) {
this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
});
}
handleWorkListAttachResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
getActionHistory(WorkListActionHistoryObj) {
this.IsReachEnd = false;
this.worklistService.getActionHistory(WorkListActionHistoryObj).
subscribe((result: WorkListActionHistoryResponse) => {
this.handleWorkListActionHistoryResult(result);
});
}
handleWorkListActionHistoryResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList;
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
let lastItemIndex = this.actionHistoryRes.length - 1;
if (result.GetActionHistoryList[lastItemIndex]) {
let lastitem = result.GetActionHistoryList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
}
this.turnCateFun(this.actionHistoryRes);
}
}
}
public checkLines(note) {
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
}
return false;
};
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
}
this.actionHistoryRes = actionHis;
console.log("test");
}
async openMoreActions() {
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
///call Action button
this.actionButton(this.actionType);
}
});
return await modal.present();
}
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage')
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
return await modal.present();
}
///calling getSubleave
getSubordinatesleave(list) {
console.log(list);
let to;
let from;
for (let i = 0; i < list.length; i++) {
if (list[i].SEGMENT_NAME == "END_DATE")
to = list[i].DATE_VALUE;
else if (list[i].SEGMENT_NAME == "START_DATE") {
from = list[i].DATE_VALUE;
}
}
console.log(new Date(to));
console.log(new Date(from));
const request = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = "/Date(" + Date.parse(from) + ")/";//new Date(from);
request.P_DATE_TO = "/Date(" + Date.parse(to) + ")/" //new Date(to);
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
// ="'/Date(" + Date.parse(from) + ")'"
this.dashboredService.getSubordinatesLeaves(request).
subscribe((result: any) => {
this.handleSubordinatesLeavesResult(result);
});
}
public handleSubordinatesLeavesResult(result) {
if (this.common.validResponse(result)) {
// GetSubordinatesLeavesList it used in dashbored
// if (this.common.hasData(result.GetSubordinatesLeavesList)) {
if (this.common.hasData(result.SubordinatesOnLeavesList)) {
this.subordinatesleaveList = result.SubordinatesOnLeavesList;
}
}
}
getsubmitterInfo(notificationSubmitterInfoObj) {
this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj).
subscribe((result: WorklistsubmitterInfoResponse) => {
this.handleSubmitterInfoResult(result);
});
}
handleSubmitterInfoResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (this.common.hasData(result.MemberInformationList)) {
//if (result.MemberInformationList != null) {
this.submitterInfoRes = result.MemberInformationList;
} // if result == null
} // valid it
}// End handleWorkListButtonsResult
async openRepRolModal() {
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
async openRFCModal() {
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
}
});
return await modal.present();
}
async openApplyModal(WorkListActionObj) {
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage')
// this.common.sharedService.setSharedData(
// this.WorkListActionObj,
// WorklistMainPRComponent.PASS_NOTIFICATION_INFO
// );
const modal = await this.modalCtrl.create({
component: ApplyActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data); // Here's your selected user!
});
return await modal.present();
}
} }

@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from '@angular/core';
/**
* Generated class for the JsonDatePipe pipe.
*
* See https://angular.io/api/core/Pipe for more info on Angular Pipes.
*/
@Pipe({
name: 'jsonDate',
})
export class JsonDatePipe implements PipeTransform {
/**
* Takes a value and makes it lowercase.
*/
transform(value: string): any {
if(value)
return new Date(parseInt(value.substr(6)));
else
return value;
}
}

@ -1,11 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { DateStringPipe } from './date-string/date-string'; import { DateStringPipe } from './date-string/date-string';
import { FilterLangPipe } from './filter-lang/filter-lang'; import { FilterLangPipe } from './filter-lang/filter-lang';
import { TurncatePipe } from './turncate/turncate.pipe';
@NgModule({ @NgModule({
declarations: [DateStringPipe, declarations: [DateStringPipe,
FilterLangPipe], FilterLangPipe,
TurncatePipe],
imports: [], imports: [],
exports: [DateStringPipe, exports: [DateStringPipe,
FilterLangPipe] FilterLangPipe,TurncatePipe]
}) })
export class PipesModule {} export class PipesModule {}

@ -0,0 +1,8 @@
import { TurncatePipe } from './turncate.pipe';
describe('TurncatePipe', () => {
it('create an instance', () => {
const pipe = new TurncatePipe();
expect(pipe).toBeTruthy();
});
});

@ -0,0 +1,27 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'turncate'
})
export class TurncatePipe implements PipeTransform {
transform(value: any, args?: any): any {
console.log("args" + args);
let limit = args.length > 0 ? parseInt(args[0], 10) : 10;
let trail = args.length > 1 ? args[1] : '...';
console.log("limit" + limit);
console.log("parseInt(args[0], 10)" + parseInt(args[0], 10));
console.log("trail" + trail);
console.log("limit" + limit);
console.log("parseInt(args[0], 10)" + parseInt(args[0], 10));
return value.length > limit ? value.substring(0, limit) + trail : value; }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

@ -466,6 +466,10 @@
"en": "Attachment", "en": "Attachment",
"ar": "مرفق" "ar": "مرفق"
}, },
"file": {
"en": "file",
"ar": "ملف"
},
"select-attachment": { "select-attachment": {
"en": "Select Attachment", "en": "Select Attachment",
"ar": "إختر مرفق" "ar": "إختر مرفق"
@ -1210,6 +1214,22 @@
"en": "Accrual Balances", "en": "Accrual Balances",
"ar": "رصيد حساب المستحقات" "ar": "رصيد حساب المستحقات"
}, },
"accrualNet": {
"en": "Accrual Net",
"ar": "صافي الاستحقاق"
},
"accrualUsed": {
"en": "Accrual Used",
"ar": "الاستحقاق المستخدم"
},
"accrualYearly": {
"en": "Accrual Yearly",
"ar": "الاستحقاق السنوي"
},
"totalNumber": {
"en": "TOTAL NUMBERS",
"ar": "المجموع"
},
"createAbsence": { "createAbsence": {
"en": "Create Absence", "en": "Create Absence",
"ar": "إنشاء إجازة" "ar": "إنشاء إجازة"
@ -1261,6 +1281,26 @@
"attachList": { "attachList": {
"en": "Attachment List", "en": "Attachment List",
"ar": "قائمة المرفقات" "ar": "قائمة المرفقات"
},
"adult": {
"en": "Adult",
"ar": "بالغ"
},
"child": {
"en": "Child",
"ar": "طفل"
},
"infants": {
"en": "Infants",
"ar": "رضيع"
},
"tickets": {
"en": "Tickets",
"ar": "تذاكر"
},
"tickets-balance": {
"en": "Ticket Balance",
"ar": "رصيد التذاكر"
} }
}, },
"accrualBalances": { "accrualBalances": {
@ -1674,6 +1714,34 @@
"note": { "note": {
"en":"Note", "en":"Note",
"ar":"مذكرة" "ar":"مذكرة"
},
"approveMsg":{
"en":"are you sure that you want to approve this request?",
"ar":"هل انت متاكد من قبول هذا الطلب؟"
},
"rejectMsg":{
"en":"are you sure that you want to reject this request?",
"ar":"هل انت متاكد من رفض هذا الطلب؟"
},
"delegateMsg":{
"en":"are you sure that you want to delegate this request?",
"ar":"هل انت متاكد من تحويل هذا الطلب؟"
},
"requestInformationMsg":{
"en":"are you sure that you want to more information for this request?",
"ar":"هل انت متاكد من طلب مزيد من المعلومات لهذا الطلب؟"
},
"grantMsg":{
"en":"are you sure that you want to grant access for this request?",
"ar":"هل انت متاكد من انشاء صلاحيه لهذا الطلب؟"
},
"answerMsg":{
"en":"press on ok to continue",
"ar":"اضغط على موافق للاستمرار"
},
"empty-comment":{
"en":"you shoud add comment",
"ar":"يجب عليك اضافة تعليق"
} }
}, },
"worklistMain": { "worklistMain": {
@ -1698,7 +1766,7 @@
"ar": "معلومات الموظف" "ar": "معلومات الموظف"
}, },
"info":{ "info":{
"en": "Information", "en": "Info",
"ar":"تفاصيل" "ar":"تفاصيل"
}, },
"notfDetails":{ "notfDetails":{
@ -1778,19 +1846,19 @@
"ar":"العناصر المطلوبة" "ar":"العناصر المطلوبة"
}, },
"approveMsg":{ "approveMsg":{
"en": "Are you sure to approve this purchase requisition ?", "en": "Are you sure to approve this request ?",
"ar":"العناصر المطلوبة" "ar":"العناصر المطلوبة"
}, },
"rejectMsg":{ "rejectMsg":{
"en": "Are you sure to reject this purchase requisition ?", "en": "Are you sure to reject this request?",
"ar":"العناصر المطلوبة" "ar":"العناصر المطلوبة"
}, },
"delMsg":{ "delMsg":{
"en": "Are you sure to delete this purchase requisition ?", "en": "Are you sure to delete this request?",
"ar":"العناصر المطلوبة" "ar":"العناصر المطلوبة"
}, },
"closeMsg":{ "closeMsg":{
"en": "Are you sure to close this purchase requisition ?", "en": "Are you sure to close this request?",
"ar":"العناصر المطلوبة" "ar":"العناصر المطلوبة"
}, },
"Supplier":{ "Supplier":{
@ -2058,7 +2126,6 @@
"en": "Line Details", "en": "Line Details",
"ar":"Line Details" "ar":"Line Details"
} }
}, },
"payslip": { "payslip": {
@ -2174,24 +2241,24 @@
"ar":"Mark Attendance " "ar":"Mark Attendance "
}, },
"check-in":{ "check-in":{
"en": "Check In", "en": "CHECK IN",
"ar":"Check In" "ar":"CHECK IN"
}, },
"check-out":{ "check-out":{
"en": "Check Out", "en": "CHECK OUT",
"ar":"Check Out" "ar":"CHECK OUT"
}, },
"regular":{ "regular":{
"en": "Regular", "en": "REGULAR",
"ar":"Regular" "ar":"REGULAR"
}, },
"late-in":{ "late-in":{
"en": "Late In", "en": "LATE IN",
"ar":"Late In" "ar":"LATE IN"
}, },
"today-time-left":{ "today-time-left":{
"en": "TODAY TIME LEFT", "en": "TODAY'S TIME LEFT",
"ar":"TODAY TIME LEFT" "ar":"TODAY'S TIME LEFT"
}, },

@ -927,7 +927,19 @@ color: var(--dark);
// right: 5%; // right: 5%;
// bottom: 5%; // bottom: 5%;
background: rgba(0, 0, 0, 0.5) !important; background: rgba(0, 0, 0, 0.5) !important;
padding: 60% 10% !important; padding: 30% 10% !important;
--height: 12cm !important;
// --width: 80% !important;
--border-radius: 0.4cm;
}
.replaceRoll-modal {
padding: 30% 1% !important;
--height: 15cm !important;
--width: 100% !important;
--border-radius: 0.4cm;
} }
@ -978,7 +990,7 @@ color: var(--dark);
} }
.cancelBtn { .cancelBtn {
background:var(--red) !important; background:var(--darkblue) !important;
white-space: normal !important; white-space: normal !important;
color:var(--light) !important; color:var(--light) !important;
text-transform: capitalize !important; text-transform: capitalize !important;
@ -989,9 +1001,11 @@ color: var(--dark);
min-width: 5px !important; min-width: 5px !important;
width: 10px !important; width: 10px !important;
margin: 8px !important; margin: 8px !important;
--background:transparent;
} }
.confirmBtn { .confirmBtn {
background:var(--green) !important; background:var(--newgreen) !important;
white-space: normal !important; white-space: normal !important;
color:var(--light) !important; color:var(--light) !important;
text-transform: capitalize !important; text-transform: capitalize !important;
@ -1002,6 +1016,7 @@ color: var(--dark);
min-width: 5px !important; min-width: 5px !important;
width: 10px !important; width: 10px !important;
margin: 8px !important; margin: 8px !important;
--background:transparent;
} }
.checkOutOkBtn{ .checkOutOkBtn{
@ -1111,6 +1126,83 @@ border:0px
width: 315px; width: 315px;
} }
.active-Segment {
border-radius: 25px !important;
// font-size: 0.3cm !important;
background: var(--newgreen) !important;
color: var(--light) !important;
font-weight: bold !important;
text-transform: none;
border: none;
}
.normal-Segment {
border-radius: 10px !important;
// font-size: 0.3cm !important;
background: rgba(255, 255, 255, 0) !important;
color: var(--dark) !important;
font-weight: bold !important;
text-transform: none;
border: none;
}
.active-Segment,
.normal-Segment {
flex: 1 100%;
}
.ion-segment-all {
height: 50px !important;
background: white !important;
border-radius: 25px !important;
border: 1px solid #cccccc;
margin-top: 10px;
}
.checkOutOkBtn{
margin-left: 55px !important;
margin-right: 55px !important;
margin-top: 10px !important;
margin-bottom: 10px !important;
border-radius: 5px !important;
height: 32px !important;
min-height: 30px !important;
background: var(--lightblue) !important;
-webkit-box-flex: 1;
flex: 1 1 auto;
border-top: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);
border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);
color: white !important;
border: none !important;
}
.checkOutCancelBtn{
margin-left: 55px !important;
margin-right: 55px !important;
margin-top: 10px !important;
margin-bottom: 10px !important;
border-radius: 5px !important;
height: 32px !important;
min-height: 30px !important;
background: var(--darkblue) !important;
-webkit-box-flex: 1;
flex: 1 1 auto;
border-top: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);
border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);
color: white !important;
border: none !important;
}
.more-modal {
background: rgba(0, 0, 0, 0.5) !important;
padding: 30% 10% !important;
--height: 12cm !important;
--border-radius: 0.4cm;
}
// .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction { // .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction {
// /* bottom: 10px; */ // /* bottom: 10px; */
// left: 0; // left: 0;
@ -1123,6 +1215,11 @@ border:0px
// max-width: 40% !important; // max-width: 40% !important;
// } // }
.advanced-search-modal {
--height: 9cm !important;
--width: 88% !important;
--border-radius: 0.6cm;
}
.slideFullWidth { .slideFullWidth {
margin-left:-15px; margin-left:-15px;
margin-right:-15px; margin-right:-15px;
@ -1147,10 +1244,16 @@ border:0px
} }
.alert-button-inner.sc-ion-alert-md { .alert-button-inner.sc-ion-alert-md {
justify-content: center !important; justify-content: center !important;
} }
.header-md:after {
height: 0px !important;
display: none !important;
}
.header-toolbar-new{
--background: #22c6b3;
}
.modal-wrapper{ .modal-wrapper{
border-radius: 20px !important; border-radius: 20px !important;
} }
@ -1162,4 +1265,4 @@ border:0px
--width: 100% !important; --width: 100% !important;
--border-radius: 0.4cm; --border-radius: 0.4cm;
} }

@ -2,7 +2,7 @@
--background: #f0efef; --background: #f0efef;
} }
.footerSearchBtn{ .footerSearchBtn{
padding: 0px !important; padding: 50px !important;
background: #f0efef !important; background: #f0efef !important;
} }
@ -15,6 +15,7 @@
background: #f0efef; background: #f0efef;
margin-top: 20px; margin-top: 20px;
width: 95%; width: 95%;
margin-left:9px
} }
.gridItemReq{ .gridItemReq{
@ -29,8 +30,9 @@
text-align: left; text-align: left;
} }
.itemReqDiv{ .itemReqDiv{
padding-bottom: 10px; padding:10px;
padding-top: 10px; // padding-bottom: 10px;
// padding-top: 10px;
} }
.arrowIcon{ .arrowIcon{
width: 18px !important; width: 18px !important;
@ -47,13 +49,13 @@ margin-left: 10px !important;
border-top-right-radius: 7px border-top-right-radius: 7px
} }
.cardContent{ .cardContent{
width:100%; // width:100%;
margin-top: 33px // margin-top: 33px
} }
.colItemReq{ .colItemReq{
color: var(--dark); color: var(--darkblue);
font-weight: bold; font-weight: bold !important;;
font-size: 16px; font-size: 16px ;
text-align: left; text-align: left;
display: contents; display: contents;
font-family: var(--ion-font-family,inherit); font-family: var(--ion-font-family,inherit);
@ -62,10 +64,6 @@ margin-left: 10px !important;
white-space: normal; white-space: normal;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
} }
.colItemReqHeader{ .colItemReqHeader{
@ -169,6 +167,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
.timeline { .timeline {
position: relative; position: relative;
margin: 15px 0 0 0; margin: 15px 0 0 0;
// border-bottom: solid 1px var(--cusgray);
} }
.timeline:before { .timeline:before {
@ -178,9 +177,9 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
top: 0; top: 0;
bottom: 0; bottom: 0;
width: 4px; width: 4px;
background: #e4e4e4; // background: #e4e4e4;
z-index: 1; z-index: 1;
left: 66px; left: 35px;
/* margin-left: -10px; */ /* margin-left: -10px; */
/* z-index: 1; */ /* z-index: 1; */
} }
@ -188,10 +187,10 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
.timeline .timeline-thumb { .timeline .timeline-thumb {
border-radius: 500px; border-radius: 500px;
width: 40px !important; width: 70px !important;
z-index: 2; z-index: 2;
position: absolute; position: absolute;
left: 48px; left: 0px;
// :root[dir="ltr"]{ // :root[dir="ltr"]{
// left: 37px; // left: 37px;
// } // }
@ -203,7 +202,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
} }
.timeline .timeline-thumb.timeline-icon { .timeline .timeline-thumb.timeline-icon {
height: 40px; height: 70px;
// text-align: center; // text-align: center;
// color: white; // color: white;
// border: 5px solid #CBD0D3; // border: 5px solid #CBD0D3;
@ -213,7 +212,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
.timeline .timeline-item { .timeline .timeline-item {
width: 50px; width: 40px;
} }
@ -253,49 +252,101 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated
.bg-blue-dot { .bg-blue-dot {
border: var(--blue) solid 1px; border: var(--blue) solid 1px;
background: var(--gray);
background-repeat: no-repeat;
background-image: url("/assets/imgs/profile.png");
background-size: 100% 100%;
} }
.bg-orange-dot { .bg-orange-dot {
border: var(--orange) solid 1px; border: var(--orange) solid 1px;
background: var(--gray); // background: var(--gray);
background-repeat: no-repeat;
background-image: url("/assets/imgs/profile.png");
background-size: 100% 100%;
} }
.bg-red-dot { .bg-red-dot {
border: var(--red) solid 1px; border: var(--red) solid 1px;
background: var(--gray); // background: var(--gray);
background-repeat: no-repeat;
background-image: url("/assets/imgs/profile.png");
background-size: 100% 100%;
} }
.bg-green-dot { .bg-green-dot {
border: var(--green) solid 1px; border: var(--green) solid 1px;
background: var(--gray); // background: var(--gray);
background-repeat: no-repeat;
background-image: url("/assets/imgs/profile.png");
background-size: 100% 100%;
} }
.bg-blue-txt { .bg-blue-txt {
color: var(--blue) !important; color: var(--light) !important;
font-weight:bold; font-weight:bold;
background: var( --blue);
border-radius: 9px;
text-align: center;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 7px 0px 7px;
} }
.bg-orange-txt { .bg-orange-txt {
font-weight:bold; font-weight:bold;
color: var(--orange) !important; color: var(--light) !important;
background: var( --orange);
border-radius: 9px;
text-align: center;
width: 30%;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 7px 0px 7px;
} }
.bg-red-txt { .bg-red-txt {
font-weight:bold; font-weight:bold;
color: var(--light) !important;
background: var( --red);
border-radius: 9px;
text-align: center;
width: 30%;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 7px 0px 7px;
color: var(--red) !important;
} }
.bg-green-txt { .bg-green-txt {
font-weight:bold; font-weight:bold;
color: var(--light) !important;
background: var( --green);
border-radius: 9px;
text-align: center;
width: 30%;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 7px 0px 7px;
color: var(--green) !important;
} }
@ -310,7 +361,7 @@ ion-item{
background-color: transparent; background-color: transparent;
.item-date{ .item-date{
width: 55px; width: 55px;
font-size: 14px; font-size: 14px !important;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
@ -324,7 +375,7 @@ ion-item{
ion-label , [item-end]{ ion-label , [item-end]{
white-space: normal; white-space: normal;
font-size: 14px; font-size: 14px !important;
// :root[dir="ltr"]{ // :root[dir="ltr"]{
// margin-left: 10px; // margin-left: 10px;
// } // }
@ -366,8 +417,138 @@ left: 66px;
} }
.approvalTitle{ .itemHISBtn{
font-weight: bold; padding: 5px;
font-size: 16px; color: var(--light);
text-align: left; background: var(--darkgray);
} border-radius: 3px;
width: 85%;
height: 40px;
}
.rowBtn{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background: white;
}
.rowBorder{
border-bottom: solid 0.03cm var(--grayBG);
}
.colBorder{
border-right: solid 0.03cm var(--grayBG);
}
.dateActionHistory{
text-align: end;
// margin-top: -25px;
}
.actionBtn{
--border-radius: 50% !important;
height: 55px;
width: 55px;
--background: var(--newgreen); // will be dynamic
background: transparent;
margin:10px;
}
.itemAttch{
border-radius: 11px;
margin: 8px;
--min-height: 60px;
--max-height: 60px;
}
.less {
max-height: 54px;
}
.noDataDiv{
background: #ffffff;
height: 11%;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
}
.containerNote {
font-size: 14px;
line-height: 14px;
height: 15px;
overflow: hidden;
text-align: justify;
}
.show {
overflow: visible;
height: auto;
}
.showMore{
padding: 0px;
background: transparent;
color: blue;
text-decoration: underline;
font-size: 14px;
}
.succssfullMSG{
height: 100%;
width: 100%;
background: var(--newgreen);
color: white;
font-weight: bold;
font-size: 20px;
text-align: center;
vertical-align: middle;
padding-top: 30px;
}
.succssfullIcon{
width: 60%;
text-align: center;
height: 60%;
}
.subjectNotification{
text-align: center;
padding-top: 10px;
font-weight: bold;
}
.tabBar{
height:70px
}
.empImge{
border-radius: 50%;
width:100%;
height: 100%;
border: #dedede solid 1px;
}
.empImgeRep {
border-radius: 50% !important;
width: 80px;
height: 80px;
border: #dedede solid 1px;
}
ion-card{
color:black !important;
}
.line{
padding-bottom:87px;
}
.approvalTitle{
font-weight: bold;
font-size: 16px;
text-align: left;
}

Loading…
Cancel
Save