Merge branch 'MOHEMM-Q3-DEV-LATEST' into MOHEMM-PHASE-2-SFH
# Conflicts: # Mohem/resources/android/icon/drawable-hdpi-icon.png # Mohem/resources/android/icon/drawable-ldpi-icon.png # Mohem/resources/android/icon/drawable-mdpi-icon.png # Mohem/resources/android/icon/drawable-xhdpi-icon.png # Mohem/resources/android/icon/drawable-xxhdpi-icon.png # Mohem/resources/android/icon/drawable-xxxhdpi-icon.png # Mohem/resources/android/splash/drawable-land-hdpi-screen.png # Mohem/resources/android/splash/drawable-land-ldpi-screen.png # Mohem/resources/android/splash/drawable-land-mdpi-screen.png # Mohem/resources/android/splash/drawable-land-xhdpi-screen.png # Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png # Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png # Mohem/resources/android/splash/drawable-port-hdpi-screen.png # Mohem/resources/android/splash/drawable-port-ldpi-screen.png # Mohem/resources/android/splash/drawable-port-mdpi-screen.png # Mohem/resources/android/splash/drawable-port-xhdpi-screen.png # Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png # Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png # Mohem/src/app/app-routing.module.ts # Mohem/src/app/app.component.html # Mohem/src/app/app.component.ts # Mohem/src/app/hmg-common/services/authentication/authentication.service.ts # Mohem/src/app/hmg-common/services/common/common.service.ts # Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss # Mohem/src/app/home/home.page.ts # Mohem/src/app/my-team/details/details.component.ts # Mohem/src/app/notification/home/home.component.html # Mohem/src/app/notification/home/home.component.ts # Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss # Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss # Mohem/src/app/notification/worklist-main/worklist-main.component.html # Mohem/src/app/notification/worklist-main/worklist-main.component.ts # Mohem/src/app/profile/home/home.component.ts # Mohem/src/app/time-card/time-card-details/time-card-details.component.tsNEW-SFH-2022
commit
42ec226d45
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "com.huawei.cordovahmsgmscheckplugin",
|
||||
"version": "1.0.0",
|
||||
"description": "Account Check Kit 4.0",
|
||||
"cordova": {
|
||||
"id": "com.huawei.cordovahmsgmscheckplugin",
|
||||
"platforms": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"ecosystem:cordova",
|
||||
"cordova-android"
|
||||
],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "com.huawei.cordovahmslocationplugin",
|
||||
"version": "1.0.0",
|
||||
"description": "Location Service",
|
||||
"cordova": {
|
||||
"id": "com.huawei.cordovahmslocationplugin",
|
||||
"platforms": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"ecosystem:cordova",
|
||||
"cordova-android"
|
||||
],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "cordovahmspushplugin",
|
||||
"version": "1.0.0",
|
||||
"description": "For Hms Push",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "test",
|
||||
"license": "ISC",
|
||||
"cordova": {
|
||||
"id": "com.huawei.cordovahmspushplugin",
|
||||
"platforms": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"ecosystem:cordova",
|
||||
"cordova-android"
|
||||
]
|
||||
}
|
||||
@ -1,43 +1,42 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
|
||||
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
|
||||
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
|
||||
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
|
||||
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
|
||||
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
|
||||
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
|
||||
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
|
||||
{ path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
|
||||
{ path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
|
||||
{ path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' },
|
||||
{ path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' },
|
||||
{ path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' },
|
||||
{ path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' },
{ path: 'sit', loadChildren: './sit/sit.module#SitPageModule' }
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
|
||||
RouterModule.forRoot(routes),
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
|
||||
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
|
||||
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
|
||||
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
|
||||
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
|
||||
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
|
||||
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
|
||||
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
|
||||
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
|
||||
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
|
||||
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
|
||||
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
|
||||
{ path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
|
||||
{ path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
|
||||
{ path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' },
|
||||
{ path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' },
|
||||
{ path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' },
|
||||
{ path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' },
|
||||
{ path: 'sit', loadChildren: './sit/sit.module#SitPageModule' },
|
||||
{ path: 'reports', loadChildren: './reports/reports.module#ReportsPageModule' },
|
||||
{ path: 'termination', loadChildren: './termination/termination.module#TerminationPageModule' },
|
||||
{ path: 'pending-transaction', loadChildren: './pending-transaction/pending-transaction.module#PendingTransactionPageModule' }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
|
||||
RouterModule.forRoot(routes),
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
@ -1,64 +1,106 @@
|
||||
<app-generic-header
|
||||
showBack="true"
|
||||
[headerText]="'changePassword,changePassword' | translate">
|
||||
<app-generic-header showBack="true" [headerText]="'changePassword,changePassword' | translate">
|
||||
</app-generic-header>
|
||||
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<ion-grid>
|
||||
|
||||
<ion-row >
|
||||
<ion-col [size]="4">
|
||||
<img [src]="logo" class="logoHeader" />
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<p class="headerTxt" color="light" > {{'changePassword,changePassword' | translate}}</p>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col [size]="4">
|
||||
<img [src]="logo" class="logoHeader" />
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-item class="item-input-login" >
|
||||
<p class="headerTxt" color="light"> {{'changePassword,changePassword' | translate}}</p>
|
||||
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
|
||||
<ion-input class="login-input" required type="password"
|
||||
placeholder="{{ts.trPK('changePassword','currentPassword')}}"
|
||||
[(ngModel)]="P_OLD_PASSWORD"
|
||||
minLength="8" min="8"
|
||||
(ionChange)="onChangeOP()"
|
||||
></ion-input>
|
||||
</ion-item>
|
||||
<p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p>
|
||||
<ion-item class="item-input-login">
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
|
||||
<ion-input class="login-input" required [type]="currentPasswordIcon"
|
||||
placeholder="{{ts.trPK('changePassword','currentPassword')}}" [(ngModel)]="P_OLD_PASSWORD" minLength="8"
|
||||
min="8" (ionChange)="onChangeOP()"></ion-input>
|
||||
<ion-icon *ngIf='currentPasswordIcon === "text"' name="ios-eye" (click)="showPassword(3)"></ion-icon>
|
||||
<ion-icon *ngIf='currentPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(3)"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<ion-item class="item-input-login" >
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
|
||||
<ion-input (ionChange)="onChangeNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
|
||||
[(ngModel)]="P_NEW_PASSWORD" minLength="8" min="8" >
|
||||
</ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item class="item-input-login" >
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
|
||||
<ion-input (ionChange)="onChangeCNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
|
||||
[(ngModel)]="P_Confirm_NEW_PASSWORD" minLength="8" min="8">
|
||||
</ion-input>
|
||||
</ion-item>
|
||||
<p class="headerTxt" color="light"> {{'changePassword,newPassword' | translate}}</p>
|
||||
|
||||
<ion-item class="item-input-login">
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
|
||||
<ion-input (ionChange)="onChangeNP()" class="login-input" required [type]="newPasswordIcon"
|
||||
placeholder="{{ts.trPK('changePassword','newPassword')}}" [(ngModel)]="P_NEW_PASSWORD" minLength="8"
|
||||
min="8">
|
||||
</ion-input>
|
||||
<ion-icon *ngIf='newPasswordIcon === "text"' name="ios-eye" (click)="showPassword(1)"></ion-icon>
|
||||
<ion-icon *ngIf='newPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(1)"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<ion-item class="item-input-login">
|
||||
<img class="item-icon" src="assets/imgs/password.png" item-start />
|
||||
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
|
||||
<ion-input (ionChange)="onChangeCNP()" class="login-input" required [type]="confirmPasswordIcon"
|
||||
placeholder="{{ts.trPK('changePassword','confirmPassword')}}" [(ngModel)]="P_Confirm_NEW_PASSWORD"
|
||||
minLength="8" min="8">
|
||||
</ion-input>
|
||||
<ion-icon *ngIf='confirmPasswordIcon === "text"' name="ios-eye" (click)="showPassword(2)"></ion-icon>
|
||||
<ion-icon *ngIf='confirmPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(2)"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon " src="../assets/imgs/req info.svg" item-start />
|
||||
<ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<!-- <ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
|
||||
<ion-label><p>{{isLowerCase.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(2)" item-start />
|
||||
<ion-label><p>{{isUpperCase.text}}</p></ion-label>
|
||||
</ion-item> -->
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{isLetterCase.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(3)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{isHasDigit.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(4)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{isMinLength.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(5)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{isRepeatedLetter.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(6)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{isContainSpecialChar.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(7)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{confirmMatchNew.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
<ion-item lines='none'>
|
||||
<img class="item-icon" [src]="checkerFuncation(8)" item-start />
|
||||
<ion-label><p style="white-space: pre-wrap;">{{userNameMatchNew.text}}</p></ion-label>
|
||||
</ion-item>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
<page-trailer [small]="true"></page-trailer>
|
||||
|
||||
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
|
||||
|
||||
</ion-grid>
|
||||
<page-trailer [small]="true"></page-trailer>
|
||||
|
||||
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
|
||||
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
|
||||
<button [disabled]="!(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD)" [ngClass]=" !(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD) ? 'disabledButton' : '' " class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
|
||||
<button [disabled]="disabledSubmitBtn()"
|
||||
[ngClass]=" disabledSubmitBtn() ? 'disabledButton' : '' "
|
||||
class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -1,2 +1,8 @@
|
||||
.disabledButton{
|
||||
opacity:.5;
|
||||
|
||||
|
||||
}
|
||||
.info{
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -1,325 +1,682 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { ElementRef } from '@angular/core';
|
||||
|
||||
import { NavController, Platform } 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 { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
|
||||
|
||||
import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request';
|
||||
|
||||
import { LoginModel } from '../models/LoginModel';
|
||||
|
||||
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
||||
|
||||
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
|
||||
|
||||
import { Password } from '../models/password';
|
||||
|
||||
import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request';
|
||||
|
||||
import * as moment from 'moment';
|
||||
|
||||
import { NFC } from "@ionic-native/nfc/ngx";
|
||||
|
||||
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
|
||||
|
||||
@Component({
|
||||
|
||||
selector: 'app-sms-page',
|
||||
|
||||
templateUrl: './sms-page.page.html',
|
||||
|
||||
styleUrls: ['./sms-page.page.scss']
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
export class SmsPageComponent implements OnInit {
|
||||
|
||||
public static LOGIN_DATA = 'LOGIN_DATA';
|
||||
|
||||
Channel = 0;
|
||||
|
||||
activationCode: string;
|
||||
|
||||
P_SESSION_ID: number;
|
||||
|
||||
P_USER_NAME: string;
|
||||
|
||||
timeInSeconds: any;
|
||||
|
||||
time: any;
|
||||
|
||||
runTimer: any;
|
||||
|
||||
hasStarted: any;
|
||||
|
||||
hasFinished: any;
|
||||
|
||||
remainingTime: any;
|
||||
|
||||
displayTime: any;
|
||||
|
||||
loginTokenID: string;
|
||||
|
||||
public isForgetPwd = false;
|
||||
|
||||
public isExpiredPwd = false;
|
||||
|
||||
public count = 0;
|
||||
|
||||
private loginData = new LoginModel();
|
||||
|
||||
public deviceToken: any;
|
||||
|
||||
public loginTypeData: any;
|
||||
|
||||
public logo = 'assets/icon/login/password.png';
|
||||
|
||||
// tslint:disable-next-line: variable-name
|
||||
|
||||
public smc_code: any = [];
|
||||
|
||||
code: any;
|
||||
|
||||
// tslint:disable-next-line: variable-name
|
||||
|
||||
user_name: string;
|
||||
|
||||
public isPostNoLoad = true;
|
||||
|
||||
loginType: any;
|
||||
|
||||
activeType: any;
|
||||
|
||||
public isNFCAvailable = false;
|
||||
|
||||
public showErrorMessage = false;
|
||||
|
||||
public messageValue: string;
|
||||
|
||||
public businessInfo: object;
|
||||
|
||||
public isAutoRead: boolean = false;
|
||||
|
||||
constructor(
|
||||
|
||||
public navCtrl: NavController,
|
||||
|
||||
public translate: TranslatorService,
|
||||
|
||||
public common: CommonService,
|
||||
|
||||
private elementRef: ElementRef,
|
||||
|
||||
public authService: AuthenticationService,
|
||||
|
||||
public sharedData: SharedDataService,
|
||||
|
||||
public platform: Platform,
|
||||
private nfc: NFC
|
||||
) {}
|
||||
|
||||
private nfc: NFC,
|
||||
|
||||
private smsRetriever: SmsRetriever
|
||||
|
||||
) { }
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.checkNFCStatus();
|
||||
this.activeType=this.common.getActiveTypeLogin();
|
||||
console.log("active "+ this.common.sharedService.getSharedData('active-type',true));
|
||||
|
||||
console.log("activeType :"+this.activeType);
|
||||
this.activeType = this.common.getActiveTypeLogin();
|
||||
|
||||
console.log("active " + this.common.sharedService.getSharedData('active-type', true));
|
||||
|
||||
|
||||
|
||||
console.log("activeType :" + this.activeType);
|
||||
|
||||
this.count = 0;
|
||||
|
||||
this.initTimer();
|
||||
|
||||
this.startTimer();
|
||||
|
||||
this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
|
||||
|
||||
this.isExpiredPwd = this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
|
||||
|
||||
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||
|
||||
this.deviceToken = this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
|
||||
|
||||
// tslint:disable-next-line: triple-equals
|
||||
|
||||
if (this.deviceToken == undefined) {
|
||||
|
||||
this.deviceToken = localStorage.getItem('deviceToken');
|
||||
|
||||
}
|
||||
|
||||
console.log('deviceToken :' + this.deviceToken);
|
||||
|
||||
this.loginTypeData = this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false);
|
||||
if( this.loginTypeData){
|
||||
this.loginType=this.loginTypeData.loginType;
|
||||
|
||||
console.log("loginType :"+this.loginTypeData.loginType);
|
||||
}else{
|
||||
this.loginType=1;
|
||||
}
|
||||
if (this.loginTypeData) {
|
||||
|
||||
this.loginType = this.loginTypeData.loginType;
|
||||
|
||||
|
||||
|
||||
console.log("loginType :" + this.loginTypeData.loginType);
|
||||
|
||||
} else {
|
||||
|
||||
this.loginType = 1;
|
||||
|
||||
}
|
||||
|
||||
this.smsRetriever.startWatching()
|
||||
|
||||
.then((res: any) => this.checkActivation(res, true))
|
||||
|
||||
.catch((error: any) => console.error(error));
|
||||
|
||||
}
|
||||
|
||||
checkActivation(res, isAndroid) {
|
||||
|
||||
this.isAutoRead = true;
|
||||
|
||||
var pattern = /\d+/g;
|
||||
|
||||
if (isAndroid)
|
||||
|
||||
var code = res.Message.match(pattern)[0];
|
||||
|
||||
else
|
||||
|
||||
var code = res;
|
||||
|
||||
|
||||
this.activationCode = code
|
||||
|
||||
this.smc_code = code.split('');
|
||||
|
||||
this.checkVerificationCode();
|
||||
|
||||
}
|
||||
|
||||
initTimer() {
|
||||
|
||||
if (!this.timeInSeconds) {
|
||||
this.timeInSeconds = 600;
|
||||
|
||||
this.timeInSeconds = 120;
|
||||
|
||||
}
|
||||
|
||||
this.time = this.timeInSeconds;
|
||||
|
||||
this.runTimer = false;
|
||||
|
||||
this.hasStarted = false;
|
||||
|
||||
this.hasFinished = false;
|
||||
|
||||
this.remainingTime = this.timeInSeconds;
|
||||
|
||||
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
startTimer() {
|
||||
|
||||
this.runTimer = true;
|
||||
|
||||
this.hasStarted = true;
|
||||
|
||||
this.timerTick();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pauseTimer() {
|
||||
|
||||
this.runTimer = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
resumeTimer() {
|
||||
|
||||
this.startTimer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
timerTick() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
if (!this.runTimer) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
this.remainingTime--;
|
||||
|
||||
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
|
||||
|
||||
if (this.remainingTime > 0) {
|
||||
|
||||
this.timerTick();
|
||||
|
||||
} else {
|
||||
|
||||
this.hasFinished = true;
|
||||
|
||||
this.pauseTimer();
|
||||
|
||||
this.navCtrl.pop();
|
||||
|
||||
}
|
||||
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ionViewWillLeave() {
|
||||
|
||||
this.pauseTimer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
checkOTPLength() {
|
||||
|
||||
// tslint:disable-next-line: triple-equals
|
||||
|
||||
if (this.activationCode.length == 4) {
|
||||
|
||||
this.checkVerificationCode();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
checkVerificationCode() {
|
||||
|
||||
this.code = this.smc_code.join('');
|
||||
|
||||
if (this.count < 3) {
|
||||
|
||||
// tslint:disable-next-line: triple-equals
|
||||
|
||||
if (this.code == undefined || this.code == null || this.code == '') {
|
||||
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
|
||||
|
||||
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
|
||||
|
||||
} else {
|
||||
|
||||
this.count = this.count + 1;
|
||||
|
||||
if (this.isForgetPwd || this.isExpiredPwd) {
|
||||
|
||||
this.checkForgetPwdSMS();
|
||||
|
||||
} else {
|
||||
|
||||
this.checkSMS();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
const msg: string = this.translate.trPK('general', 'noOfTriesLogin');
|
||||
|
||||
this.common.JustAlertDialog(this.translate.trPK('general', 'ok'), msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async checkNFCStatus() {
|
||||
|
||||
try {
|
||||
|
||||
let nfcStatus = await this.nfc.enabled();
|
||||
|
||||
console.log("nfc status >>>>>>>>>>" + nfcStatus);
|
||||
|
||||
this.isNFCAvailable = true;
|
||||
|
||||
} catch (err) {
|
||||
|
||||
console.log("Error reading tag", err);
|
||||
|
||||
if (err === "NO_NFC") {
|
||||
|
||||
this.isNFCAvailable = false;
|
||||
|
||||
} else if (err === "NFC_DISABLED") {
|
||||
this.isNFCAvailable = true;
|
||||
|
||||
this.isNFCAvailable = true;
|
||||
|
||||
} else {
|
||||
|
||||
this.isNFCAvailable = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public checkSMS() {
|
||||
this.showErrorMessage = false;
|
||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||
const request = new SMSCheckRequest();
|
||||
request.LogInTokenID = data.LogInTokenID;
|
||||
request.activationCode = this.code; // code;this.activationCode;
|
||||
request.P_USER_NAME = data.P_USER_NAME;
|
||||
request.MobileNumber = data.MobileNumber;
|
||||
request.IsDeviceNFC = this.isNFCAvailable;
|
||||
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
|
||||
//save business card info
|
||||
this.businessInfo = {
|
||||
show_business: result.BusinessCardPrivilege,
|
||||
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
|
||||
job_en: result.MemberInformationList[0].JOB_NAME_En,
|
||||
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
|
||||
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
|
||||
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
|
||||
qr: result.MemberInformationList[0].BusinessCardQR,
|
||||
company_logo: result.BC_Logo ? result.BC_Logo: result.CompanyImageURL,
|
||||
company_url: result.BC_Domain,
|
||||
company_type: result.CompanyMainCompany,
|
||||
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
|
||||
}
|
||||
|
||||
// Wifi Credientials
|
||||
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
|
||||
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
|
||||
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
|
||||
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
|
||||
|
||||
AuthenticationService.servicePrivilage = result.Privilege_List;
|
||||
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
||||
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
|
||||
this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME;
|
||||
const currDateTime = moment().format('MMM DD , YYYY HH:mm');
|
||||
localStorage.setItem('login-at', currDateTime);
|
||||
if (this.platform.is('cordova')) {
|
||||
this.insertMobileLogin();
|
||||
}
|
||||
this.common.sharedService.setSharedData(result.MemberInformationList[0].PAYROLL_CODE, "projcet-code");
|
||||
this.activeType =this.common.setActiveTypeLogin(0);
|
||||
this.common.openHome();
|
||||
});
|
||||
} else {
|
||||
let errorResult: any;
|
||||
errorResult = result;
|
||||
this.showErrorMessage = true;
|
||||
this.messageValue = errorResult.ErrorEndUserMessage;
|
||||
this.smc_code = [];
|
||||
(document.activeElement as HTMLElement).blur();
|
||||
setTimeout(() => {
|
||||
this.showErrorMessage = false;
|
||||
}, 5000);
|
||||
this.showErrorMessage = false;
|
||||
|
||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||
|
||||
const request = new SMSCheckRequest();
|
||||
|
||||
request.LogInTokenID = data.LogInTokenID;
|
||||
|
||||
request.activationCode = this.code; // code;this.activationCode;
|
||||
|
||||
request.P_USER_NAME = data.P_USER_NAME;
|
||||
|
||||
request.MobileNumber = data.MobileNumber;
|
||||
|
||||
request.IsDeviceNFC = this.isNFCAvailable;
|
||||
|
||||
this.authService.checkSMS(request, () => { }, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
|
||||
|
||||
if (this.common.validResponse(result)) {
|
||||
|
||||
|
||||
|
||||
//save business card info
|
||||
|
||||
this.businessInfo = {
|
||||
|
||||
show_business: result.BusinessCardPrivilege,
|
||||
|
||||
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
|
||||
|
||||
job_en: result.MemberInformationList[0].JOB_NAME_En,
|
||||
|
||||
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
|
||||
|
||||
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
|
||||
|
||||
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
|
||||
|
||||
qr: result.MemberInformationList[0].BusinessCardQR,
|
||||
|
||||
company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL,
|
||||
|
||||
company_url: result.BC_Domain,
|
||||
|
||||
company_type: result.CompanyMainCompany,
|
||||
|
||||
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Wifi Credientials
|
||||
|
||||
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
|
||||
|
||||
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
|
||||
|
||||
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
|
||||
|
||||
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
|
||||
|
||||
|
||||
|
||||
AuthenticationService.servicePrivilage = result.Privilege_List;
|
||||
|
||||
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
||||
|
||||
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
|
||||
|
||||
this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME;
|
||||
|
||||
const currDateTime = moment().format('MMM DD , YYYY HH:mm');
|
||||
|
||||
localStorage.setItem('login-at', currDateTime);
|
||||
|
||||
if (this.platform.is('cordova')) {
|
||||
|
||||
this.insertMobileLogin();
|
||||
|
||||
}
|
||||
|
||||
this.common.sharedService.setSharedData(result.MemberInformationList[0].PAYROLL_CODE, "projcet-code");
|
||||
|
||||
this.activeType = this.common.setActiveTypeLogin(0);
|
||||
|
||||
this.common.openHome();
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
let errorResult: any;
|
||||
|
||||
errorResult = result;
|
||||
|
||||
this.showErrorMessage = true;
|
||||
|
||||
this.messageValue = errorResult.ErrorEndUserMessage;
|
||||
|
||||
this.smc_code = [];
|
||||
|
||||
(document.activeElement as HTMLElement).blur();
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
this.showErrorMessage = false;
|
||||
|
||||
}, 5000);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public insertMobileLogin() {
|
||||
const request = new GetLoginInfoRequest();
|
||||
this.authService.setPublicFields(request);
|
||||
request.MobileNumber = this.loginData.MobileNumber;
|
||||
request.P_USER_NAME = this.loginData.P_USER_NAME;
|
||||
request.UserName = this.loginData.P_USER_NAME;
|
||||
request.LogInTokenID = this.loginData.LogInTokenID;
|
||||
request.CompanyID = 1; // CompanyID
|
||||
request.DeviceType = this.common.getDeviceType();
|
||||
request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
|
||||
request.LoginType = this.loginTypeData.loginType;
|
||||
request.EmployeeName = this.user_name;
|
||||
this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad)
|
||||
.subscribe((result: any) => {
|
||||
console.log('successful insertMobileLogin' );
|
||||
});
|
||||
|
||||
const request = new GetLoginInfoRequest();
|
||||
|
||||
this.authService.setPublicFields(request);
|
||||
|
||||
request.MobileNumber = this.loginData.MobileNumber;
|
||||
|
||||
request.P_USER_NAME = this.loginData.P_USER_NAME;
|
||||
|
||||
request.UserName = this.loginData.P_USER_NAME;
|
||||
|
||||
request.LogInTokenID = this.loginData.LogInTokenID;
|
||||
|
||||
request.CompanyID = 1; // CompanyID
|
||||
|
||||
request.DeviceType = this.common.getDeviceType();
|
||||
|
||||
request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
|
||||
|
||||
request.LoginType = this.loginTypeData.loginType;
|
||||
|
||||
request.EmployeeName = this.user_name;
|
||||
|
||||
this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad)
|
||||
|
||||
.subscribe((result: any) => {
|
||||
|
||||
console.log('successful insertMobileLogin');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public checkForgetPwdSMS() {
|
||||
|
||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||
|
||||
const request = new SMSCheckRequest();
|
||||
|
||||
request.LogInTokenID = data.LogInTokenID;
|
||||
|
||||
request.activationCode = this.code; // this.activationCode;
|
||||
|
||||
request.P_USER_NAME = data.P_USER_NAME;
|
||||
this.authService.checkForgetSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
this.sharedData.setSharedData(result, 'checkSMSResponse');
|
||||
if (this.isForgetPwd) {
|
||||
this.common.openForgotPassword();
|
||||
}
|
||||
if (this.isExpiredPwd) {
|
||||
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
|
||||
this.common.openChangePassword();
|
||||
}
|
||||
|
||||
this.authService.checkForgetSMS(request, () => { }, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
|
||||
|
||||
if (this.common.validResponse(result)) {
|
||||
|
||||
this.sharedData.setSharedData(result, 'checkSMSResponse');
|
||||
|
||||
if (this.isForgetPwd) {
|
||||
|
||||
this.common.openForgotPassword();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (this.isExpiredPwd) {
|
||||
|
||||
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
|
||||
|
||||
this.common.openChangePassword();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
onChange() {
|
||||
|
||||
// tslint:disable-next-line: only-arrow-functions
|
||||
const filtered = this.smc_code.filter(function(el) {
|
||||
|
||||
const filtered = this.smc_code.filter(function (el) {
|
||||
|
||||
if (el) {
|
||||
|
||||
return el;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
if (filtered.length === 4) {
|
||||
|
||||
if (filtered.length === 4 && !this.isAutoRead) {
|
||||
|
||||
this.checkVerificationCode();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
goToNextInput(e) {
|
||||
|
||||
const key = e.which;
|
||||
|
||||
const t = e.target;
|
||||
|
||||
const sib = t.nextElementSibling;
|
||||
|
||||
const sibPre = t.previousElementSibling;
|
||||
|
||||
|
||||
|
||||
if (key === undefined && (this.platform.is('ios') && !this.platform.is('mobileweb'))) {
|
||||
|
||||
|
||||
this.checkActivation(e.target.value, false);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (key !== 9 && (key < 48 || key > 57)) {
|
||||
|
||||
if (key === 8 || key === 46) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (key === 9) {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (sib) {
|
||||
|
||||
if (e.target.value === '') {
|
||||
|
||||
sibPre.setFocus();
|
||||
|
||||
} else {
|
||||
|
||||
sib.setFocus();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
<app-generic-header
|
||||
showBack="!getPassdirfromNotifiPage"
|
||||
[updateDirection]="getPassdirfromNotifiPage"
|
||||
[headerText]="headerTitle"
|
||||
(trigger)="closeModal()"
|
||||
>
|
||||
</app-generic-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
<ion-item class="country dynamicField" lines="none" *ngIf="showEffectiveDate">
|
||||
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
|
||||
<ion-label>{{showEffectiveDate}}</ion-label>
|
||||
</ion-item>
|
||||
<div #containerDiv id="containerDiv">
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="submitChildEducationTransaction()">
|
||||
{{'vacation-rule, next-label' | translate}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,45 @@
|
||||
.footer-button {
|
||||
border-radius: 2px;
|
||||
padding: 0 1.1em;
|
||||
min-height: 45px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
ion-label {
|
||||
color: var(--customnavy) !important;
|
||||
}
|
||||
|
||||
.daynamicForm-Label {
|
||||
font-size: 16px;
|
||||
color: #a2a5a6 !important;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
-webkit-flex: 1;
|
||||
flex: 1;
|
||||
font-size: inherit;
|
||||
white-space: normal;
|
||||
padding: 5px 0px;
|
||||
margin: 10px auto;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
.header-toolbar-new{
|
||||
--background: #269DB8;
|
||||
}
|
||||
.addEitOkButton{
|
||||
white-space: normal !important;
|
||||
text-transform: capitalize !important;
|
||||
min-height: 45px !important;
|
||||
min-width: 5px !important;
|
||||
margin: 8px !important;
|
||||
background-color: #269DB8;
|
||||
width: 80% !important;
|
||||
color: white!important;
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
.country{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AddCeiComponent } from './add-cei.component';
|
||||
|
||||
describe('AddCeiComponent', () => {
|
||||
let component: AddCeiComponent;
|
||||
let fixture: ComponentFixture<AddCeiComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddCeiComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AddCeiComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,69 @@
|
||||
<app-generic-header
|
||||
showImage="false"
|
||||
showBack="true"
|
||||
[headerText]="'eit,cei' | translate">
|
||||
</app-generic-header>
|
||||
|
||||
<ion-content style="--background: #f5f5f5;">
|
||||
<!-- <div class="head-title">
|
||||
|
||||
</div> -->
|
||||
|
||||
<div padding>
|
||||
<ion-radio-group [(ngModel)]="selectedServiceType">
|
||||
<ion-item *ngFor="let user of familyMemberData" lines='none'
|
||||
style="padding-bottom: 10px; border-radius: 10px 10px 25px 25px;">
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size='6'>
|
||||
<h2 style="font-weight: bold; font-size: 15px;">{{user.CONTACT_NAME}}</h2>
|
||||
</ion-col>
|
||||
<ion-col size='6'>
|
||||
<div class='family-member-button'>
|
||||
<ion-label>
|
||||
<p style="white-space: pre-line; font-size: 11px;">{{ts.trPK('eit','relationship-start-date')}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p style="color: black;">12/31/2022</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col size='6'>
|
||||
<ion-label>
|
||||
<p style="font-weight: bold; font-size: 14px; white-space:pre-wrap">{{user.RELATIONSHIP}}</p>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size='6'>
|
||||
<div class='family-member-button'>
|
||||
<ion-label>
|
||||
<p style="white-space: pre-line; font-size: 11px;">{{ts.trPK('eit','relationship-end-date')}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p style="color: black;">12/31/2022</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<ion-radio mode="md" slot="start" [value]="user" [color]="myColor" (click)='selectedUser(user)'></ion-radio>
|
||||
</ion-item>
|
||||
</ion-radio-group>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
<ion-footer class="footer">
|
||||
<div class="Btn">
|
||||
<ion-button class="CreateBtn" (click)="gotoTransactionsPage()" >{{'vacation-rule, next-label' | translate}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
|
||||
<!-- <ion-footer style="background: #f5f5f5 !important;">
|
||||
<div class="centerDiv" (click)="gotoTransactionsPage()">
|
||||
<ion-button ion-button style="background: #269db8 !important; --background: #269db8">
|
||||
{{'vacation-rule, next-label' | translate}}</ion-button>
|
||||
</div>
|
||||
</ion-footer> -->
|
||||
@ -0,0 +1,40 @@
|
||||
@media screen and (min-width: 300px){
|
||||
.CreateBtn{
|
||||
--background: var(--newgreen) !important;
|
||||
background: var(--newgreen) !important;
|
||||
white-space: normal;
|
||||
color: var(--light);
|
||||
text-transform: capitalize;
|
||||
min-height: 1.0cm;
|
||||
--border-radius: 7px !important;
|
||||
border-radius: 7px !important;
|
||||
--min-height: 1.6cm !important;
|
||||
width: 315px;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
}}
|
||||
|
||||
@media screen and (min-width: 1px) and (max-width:290px) {
|
||||
.CreateBtn{
|
||||
--background: var(--newgreen) !important;
|
||||
background: var(--newgreen) !important;
|
||||
white-space: normal;
|
||||
color: var(--light);
|
||||
text-transform: capitalize;
|
||||
min-height: 1.0cm;
|
||||
--border-radius: 7px !important;
|
||||
border-radius: 7px !important;
|
||||
--min-height: 1.6cm !important;
|
||||
width: 257px;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
}}
|
||||
|
||||
.footer{
|
||||
padding: 15px 0px;
|
||||
background-color: var(--light) !important;
|
||||
border: 0px !important;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none;
|
||||
}
|
||||
.Btn{
|
||||
margin: auto; text-align: center; display: block;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CeiHomepageComponent } from './cei-homepage.component';
|
||||
|
||||
describe('CeiHomepageComponent', () => {
|
||||
let component: CeiHomepageComponent;
|
||||
let fixture: ComponentFixture<CeiHomepageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CeiHomepageComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CeiHomepageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,51 @@
|
||||
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 { EitService } from '../services/eit.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cei-homepage',
|
||||
templateUrl: './cei-homepage.component.html',
|
||||
styleUrls: ['./cei-homepage.component.scss'],
|
||||
})
|
||||
export class CeiHomepageComponent implements OnInit {
|
||||
|
||||
public familyMemberData;
|
||||
public selectedServiceType;
|
||||
public direction: string;
|
||||
myColor: string = 'secondary';
|
||||
constructor(
|
||||
private eitService: EitService,
|
||||
public ts: TranslatorService,
|
||||
public cs: CommonService
|
||||
) {}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.getContactInfo();
|
||||
}
|
||||
|
||||
public getContactInfo () {
|
||||
this.eitService.getContactInfo({
|
||||
P_MENU_TYPE: 'E',
|
||||
P_SELECTED_RESP_ID: -999
|
||||
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
|
||||
if (this.cs.validResponse(response)) {
|
||||
this.familyMemberData = response['GetEmployeeContactsList'];
|
||||
this.selectedServiceType = this.familyMemberData[0];
|
||||
console.log(this.familyMemberData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public gotoTransactionsPage() {
|
||||
console.log(this.selectedServiceType);
|
||||
this.cs.sharedService.setSharedData(this.selectedServiceType, 'selectedContactFORChildEducation');
|
||||
this.cs.openCEIListPage();
|
||||
}
|
||||
|
||||
public selectedUser(user){
|
||||
this.selectedServiceType = user;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<app-generic-header
|
||||
showBack="true"
|
||||
[headerText]="headerTitle">
|
||||
</app-generic-header>
|
||||
|
||||
<ion-content>
|
||||
<div>
|
||||
<div class="no-dataDiv"
|
||||
*ngIf="!getResCEITransactionList || getResCEITransactionList[0]?.Collection_Transaction.length <= 0">
|
||||
<ion-row>
|
||||
<img class="empty-data" src="../assets/imgs/box.png" />
|
||||
</ion-row>
|
||||
<h4> {{'general, noData' | translate}}</h4>
|
||||
</div>
|
||||
|
||||
<div *ngIf="getResCEITransactionList && getResCEITransactionList[0]?.Collection_Transaction.length > 0 ">
|
||||
<div *ngFor="let EITTransactionList of getResCEITransactionList; let i=index ">
|
||||
<ion-grid>
|
||||
<div>
|
||||
</div>
|
||||
<ion-grid class="grids">
|
||||
<div *ngFor="let item of EITTransactionList.Collection_Transaction">
|
||||
<ion-row *ngIf="item.DISPLAY_FLAG != 'N' " class="">
|
||||
<ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''">
|
||||
<label style="color:#269DB8;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label>
|
||||
<br>
|
||||
<label class="label" style="color:black;" for="">{{item.SEGMENT_VALUE_DSP}} </label>
|
||||
<br>
|
||||
<hr style="background-color: grey;height: 1px">
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
</ion-grid>
|
||||
</ion-grid>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-icon class="addClass" name="add" (click)="addCEIRrq()"></ion-icon>
|
||||
@ -0,0 +1,330 @@
|
||||
.footer-button {
|
||||
border-radius: 2px;
|
||||
padding: 0 1.1em;
|
||||
min-height: 45px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.datetime{
|
||||
text-align: center;
|
||||
font-family: WorkSans-Bold;
|
||||
margin-left: 47px;
|
||||
margin-top: -19px;
|
||||
|
||||
}
|
||||
.iconCalendar{
|
||||
margin-left: 30px !important;
|
||||
width: 22% !important;
|
||||
height: 26px !important;
|
||||
margin-top: -69px !important;
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
h4 {
|
||||
font-size: 2.2rem;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
}
|
||||
.grids{
|
||||
border-radius: 20px !important;
|
||||
background: white;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
margin: 13px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 13px;
|
||||
padding-right: 13px;
|
||||
border: 1px solid #cac8c8;
|
||||
}
|
||||
|
||||
.bgcolor {
|
||||
|
||||
color: white;
|
||||
border-top-right-radius: 19px;
|
||||
border-top-left-radius: 15px;
|
||||
padding-top: 1;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
/* border-radius: 12px !important; */
|
||||
background: #269DB8;
|
||||
border-bottom: 1px solid #a7a4a4;
|
||||
border-top: 1px solid #cac8c8;
|
||||
margin-left: -13px;
|
||||
margin-right: -13px;
|
||||
}
|
||||
.colEit{
|
||||
border-right: 1px solid #cac8c8;
|
||||
border-bottom-left-radius: -10px !important;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
margin-left: 18px;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.header-div {
|
||||
|
||||
background-color: #269DB8;
|
||||
text-transform: capitalize;
|
||||
height: 160px;
|
||||
// position: relative;
|
||||
display: block;
|
||||
margin-bottom: -28px;
|
||||
}
|
||||
|
||||
.header-toolbar-new{
|
||||
--background: #269DB8;
|
||||
}
|
||||
|
||||
.addClass{
|
||||
background-color: #269DB8;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
right: 8%;
|
||||
position: fixed;
|
||||
color: white;
|
||||
bottom: 5%;
|
||||
border-radius: 50%;
|
||||
z-index: 999;
|
||||
-webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||
-moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||
box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||
}
|
||||
|
||||
.contentEit:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
// background: #269DB8;
|
||||
height: 140px;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.hrClass{
|
||||
border-width: 0;
|
||||
box-sizing: content-box;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
background: #fff !important;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
.content:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
background: #269DB8;
|
||||
height: 140px;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
.colorBG{
|
||||
--background: #f0efef;
|
||||
}
|
||||
|
||||
.Title{
|
||||
text-align: center;
|
||||
color: white;
|
||||
margin-top: -33px;
|
||||
font-size: 17px;
|
||||
}
|
||||
.title{
|
||||
text-align: center;
|
||||
color: black;
|
||||
margin-top: 5px;
|
||||
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;
|
||||
padding-bottom: 53px;
|
||||
padding-top: -30px;
|
||||
margin-left: 13px;
|
||||
margin-right: 13px;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
border-radius: 20px;
|
||||
margin-top: 17px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.green-label-ar{
|
||||
font-size: 15px !important;
|
||||
margin-left: 7px !important;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.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-label-ar{
|
||||
font-size: 15px !important;
|
||||
margin-right: 7px !important;
|
||||
margin-left: -26px;
|
||||
}
|
||||
|
||||
.light-dote{
|
||||
background-color: #3CB9D5;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50% !important;
|
||||
display: inline-block;
|
||||
}
|
||||
.blue-dote{
|
||||
|
||||
background-color: #269DB8;
|
||||
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;
|
||||
}
|
||||
|
||||
.adult-dote-ar{
|
||||
background-color: #3CB9D5;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50% !important;
|
||||
display: inline-block;
|
||||
margin-right: 0px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.child-dote{
|
||||
|
||||
background-color: #269DB8;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50% !important;
|
||||
display: inline-block;
|
||||
margin-left: -17px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.child-dote-ar{
|
||||
background-color: #269DB8;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50% !important;
|
||||
display: inline-block;
|
||||
margin-right: 1px;
|
||||
margin-left: 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;
|
||||
}
|
||||
|
||||
.infants-dote-ar{
|
||||
background-color: #1FA269;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50% !important;
|
||||
display: inline-block;
|
||||
margin-right: 1px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.addEitOkButton{
|
||||
white-space: normal !important;
|
||||
text-transform: capitalize !important;
|
||||
min-height: 45px !important;
|
||||
min-width: 5px !important;
|
||||
margin: 8px !important;
|
||||
background-color: #269DB8;
|
||||
width: 80% !important;
|
||||
color: white!important;
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CeiListComponent } from './cei-list.component';
|
||||
|
||||
describe('CeiListComponent', () => {
|
||||
let component: CeiListComponent;
|
||||
let fixture: ComponentFixture<CeiListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CeiListComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CeiListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,127 @@
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { EITTransactionsRequest } from './../models/EITTransactionsReq';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EitService } from '../services/eit.service';
|
||||
import { EIT_ACTION } from '../models/submit.eit.action';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cei-list',
|
||||
templateUrl: './cei-list.component.html',
|
||||
styleUrls: ['./cei-list.component.scss'],
|
||||
})
|
||||
export class CeiListComponent implements OnInit {
|
||||
Sdate: any;
|
||||
emp_no: any;
|
||||
balance:any;
|
||||
P_PAGE_NUM: number;
|
||||
P_PAGE_LIMIT: number;
|
||||
IsReachEnd = false;
|
||||
userName: any;
|
||||
isDelete = false;
|
||||
getResCEITransactionList: any = [];
|
||||
eitAddedList: any = [];
|
||||
getPassMnuEntryObj: any;
|
||||
selMenu: MenuResponse = new MenuResponse();
|
||||
CEITransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest();
|
||||
selEmp: string;
|
||||
respID: number;
|
||||
transactionNo = 0;
|
||||
menuType = '';
|
||||
public functionName = '';
|
||||
private pAction = 0;
|
||||
public headerTitle = '';
|
||||
data: any;
|
||||
accrualNetInfants: any;
|
||||
accrualUNetChild: any;
|
||||
accrualNetAdult: any;
|
||||
|
||||
public options = {
|
||||
cutoutPercentage: 80,
|
||||
tooltips: { enabled: false },
|
||||
legend: { display: false }};
|
||||
gaugeType = 'full';
|
||||
accrualBalancesList: any;
|
||||
common: any;
|
||||
direction: string;
|
||||
|
||||
constructor(
|
||||
private cs: CommonService,
|
||||
private EITService: EitService,
|
||||
public ts: TranslatorService,
|
||||
public authService:AuthenticationService,) {
|
||||
this.direction = TranslatorService.getCurrentLanguageName();
|
||||
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
||||
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
||||
this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList;
|
||||
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
||||
this.transactionNo = 0;
|
||||
this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
|
||||
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
|
||||
this.P_PAGE_NUM = 1;
|
||||
this.P_PAGE_LIMIT = 100;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getCEITransactions();
|
||||
}
|
||||
|
||||
|
||||
public getCEITransactions() {
|
||||
this.IsReachEnd = false;
|
||||
this.CEITransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
|
||||
this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
this.CEITransactionsListObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
||||
this.CEITransactionsListObj.P_SELECTED_RESP_ID = this.respID;
|
||||
this.CEITransactionsListObj.P_MENU_TYPE = this.selMenu.List_Menu.MENU_TYPE;
|
||||
this.CEITransactionsListObj.P_FUNCTION_NAME = this.getPassMnuEntryObj.FUNCTION_NAME;
|
||||
this.EITService.getCEITransactionsList(this.CEITransactionsListObj).
|
||||
subscribe((result: any) => {
|
||||
this.handleCEITransactionsResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
public handleCEITransactionsResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (this.cs.hasData(result.GetEITTransactionList)) {
|
||||
this.getResCEITransactionList = result.GetEITTransactionList;
|
||||
this.P_PAGE_NUM++;
|
||||
this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||
const lastItemIndex = this.getResCEITransactionList.length - 1;
|
||||
if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) {
|
||||
const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
|
||||
// tslint:disable-next-line: triple-equals
|
||||
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||
this.IsReachEnd = true;
|
||||
} else {
|
||||
this.IsReachEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public addCEIRrq(i?) {
|
||||
this.pAction = EIT_ACTION.ADD;
|
||||
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
|
||||
this.openCEINew(i);
|
||||
}
|
||||
|
||||
openCEINew(index) {
|
||||
let item: any = [];
|
||||
if (this.pAction == EIT_ACTION.UPDATE) {
|
||||
item = this.getResCEITransactionList[index].Collection_Transaction;
|
||||
}
|
||||
this.transactionNo++;
|
||||
// tslint:disable-next-line: max-line-length
|
||||
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
|
||||
this.cs.openAddCEIPage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,127 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar-new">
|
||||
<nav-buttons></nav-buttons>
|
||||
<ion-title [ngClass]=" direction === 'en' ? 'title' : 'title-ar'" color="light">{{headerTitle}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content>
|
||||
<!-------------------------------Start New design ---------------------------------------->
|
||||
<ion-grid>
|
||||
<ion-row style="margin-top: 20px;margin-left: 12px;">
|
||||
<ion-col>
|
||||
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'" >{{'general, addAttach' | translate}}</div>
|
||||
</ion-col>
|
||||
<ion-col style="padding-left: 7%;" size="2">
|
||||
<div class="fileDiv">
|
||||
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
|
||||
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
|
||||
<label end for="file" class="attachLable">
|
||||
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
|
||||
</label></div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
|
||||
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
|
||||
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
|
||||
<div *ngFor="let attachList of attachListOver ; let i = index">
|
||||
<ion-row>
|
||||
<ion-col size="1">
|
||||
<ion-label style="color: black !important;">
|
||||
{{attachList.AttachmentID +1 }} .
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col style="text-align: left;" size="10">
|
||||
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
|
||||
{{attachList.P_FILE_NAME }}
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size="1">
|
||||
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
|
||||
(click)="removeFile(attachList)">
|
||||
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
|
||||
</button>
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
<ion-grid *ngIf="attachmentRes?.length > 0">
|
||||
<div *ngFor="let attachRes of attachmentRes">
|
||||
<ion-row>
|
||||
<ion-col col-8>
|
||||
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
|
||||
</div>
|
||||
<ion-label>
|
||||
{{attachRes.FILE_NAME }} </ion-label>
|
||||
|
||||
</ion-col>
|
||||
<ion-col col-4>
|
||||
<button float-end class="attachImgBtn"
|
||||
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
|
||||
<img class="attachImg" src="../assets/imgs/view.png">
|
||||
</button>
|
||||
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
|
||||
class="attachImg" src="../assets/imgs/deletegray.png"></button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
<ion-grid class="">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
|
||||
<ion-item class="submitNote" lines="none">
|
||||
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="approvalList">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
|
||||
<div class="noDataDiv" *ngIf="approversList?.length == 0">
|
||||
<p>{{ 'general, empty' | translate}}</p>
|
||||
</div>
|
||||
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
|
||||
<ion-list class="notification-list ">
|
||||
<div class="timeline">
|
||||
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
|
||||
|
||||
<div class="timeline-item" slot="start">
|
||||
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
|
||||
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
|
||||
src="../assets/imgs/profile.png"> </div>
|
||||
</div>
|
||||
<ion-col>
|
||||
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
|
||||
{{employee.APPROVER}}
|
||||
</ion-label>
|
||||
<ion-label style="color:black !important ;padding-top: 4%;">
|
||||
{{employee.POSITION_TITLE}}
|
||||
</ion-label>
|
||||
|
||||
</ion-col>
|
||||
<div class="line"></div>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="confirmEitOkButton" color="customnavy" ion-button (click)="openSubmitModal()">
|
||||
{{ (isDelete ? 'general, delete' : 'general, submit') | translate }}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,263 @@
|
||||
.footer-button {
|
||||
border-radius: 2px;
|
||||
padding: 0 1.1em;
|
||||
min-height: 45px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.imgSize {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.Header {
|
||||
font-weight: bold;
|
||||
color: #1a586d !important;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.tbData {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.btnBack {
|
||||
background: transparent;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.attachmentDiv{
|
||||
background: #ffffff;
|
||||
height: auto;
|
||||
text-align: center;
|
||||
padding-top: 1px;
|
||||
margin: 10px;
|
||||
border-radius: 15px;
|
||||
border: 1px solid grey;
|
||||
}
|
||||
|
||||
.noDataDiv{
|
||||
background: #ffffff;
|
||||
height: 11%;
|
||||
text-align: center;
|
||||
padding-top: 1px;
|
||||
border-radius: 10px;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.submitNote{
|
||||
background: #ffffff;
|
||||
height: 80px;
|
||||
padding-top: 1px;
|
||||
margin: 10px;
|
||||
border-radius: 15px;
|
||||
border: 1px solid grey;
|
||||
}
|
||||
|
||||
.approvalList{
|
||||
--background: #f0efef;
|
||||
height: auto;
|
||||
text-align: center;
|
||||
padding-top: 1px;
|
||||
border-radius: 10px;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/************************New Design**********************************/
|
||||
.notification-list{
|
||||
background: none;
|
||||
background: none;
|
||||
border-radius: 32px;
|
||||
ion-item{
|
||||
// margin-top: 5px;
|
||||
// margin-bottom: 5px;
|
||||
|
||||
background-color: transparent;
|
||||
.item-date{
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
|
||||
text-align: start;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12%;
|
||||
}
|
||||
ion-label , [item-end]{
|
||||
|
||||
white-space: normal;
|
||||
font-size: 14px;
|
||||
padding-top: 15%;
|
||||
// :root[dir="ltr"]{
|
||||
// margin-left: 10px;
|
||||
// }
|
||||
// :root[dir="rtl"]{
|
||||
// margin-right: 10px;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.timeline {
|
||||
position: relative;
|
||||
margin: 15px 0 0 0;
|
||||
// border-bottom: solid 1px var(--cusgray);
|
||||
}
|
||||
|
||||
.timeline:before {
|
||||
|
||||
content: '';
|
||||
position: inherit !important;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
// background: #e4e4e4;
|
||||
z-index: 1;
|
||||
left: 35px;
|
||||
/* margin-left: -10px; */
|
||||
/* z-index: 1; */
|
||||
}
|
||||
|
||||
.timeline .timeline-thumb {
|
||||
|
||||
border-radius: 500px;
|
||||
width: 70px !important;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
// :root[dir="ltr"]{
|
||||
// left: 37px;
|
||||
// }
|
||||
// :root[dir="rtl"]{
|
||||
// right: 37px;
|
||||
// }
|
||||
float: right;
|
||||
top: 9px;
|
||||
}
|
||||
|
||||
.timeline .timeline-thumb.timeline-icon {
|
||||
height: 70px;
|
||||
// text-align: center;
|
||||
// color: white;
|
||||
// border: 5px solid #CBD0D3;
|
||||
// transform: scale(0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.timeline .timeline-item {
|
||||
width: 40px;
|
||||
|
||||
}
|
||||
|
||||
.timeline .timeline-stats {
|
||||
position: relative;
|
||||
font-size: 12px;
|
||||
color: var(--darkgray);
|
||||
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.line{
|
||||
padding-bottom:87px;
|
||||
}
|
||||
|
||||
.attachLable{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
z-index: 0;
|
||||
background: #30b8c6;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
border: 0px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
text-align: center;
|
||||
font-size: 5px;
|
||||
}
|
||||
|
||||
.removeLable{
|
||||
top: 0px;
|
||||
z-index: 0;
|
||||
background: #d8252d;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
border: 0px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
font-size: 5px;
|
||||
}
|
||||
|
||||
.note-modal {
|
||||
// width: 90%;
|
||||
// height: 50%;
|
||||
// top: 20%;
|
||||
// left: 5%;
|
||||
// right: 5%;
|
||||
// bottom: 5%;
|
||||
background: rgba(0, 0, 0, 0.5) !important;
|
||||
padding: 30% 10% !important;
|
||||
--height: 12cm !important;
|
||||
// --width: 80% !important;
|
||||
--border-radius:20px;
|
||||
|
||||
}
|
||||
.header-toolbar-new{
|
||||
--background: #269DB8;
|
||||
}
|
||||
.title{
|
||||
margin-top: -37px;
|
||||
margin-left: 85px;
|
||||
}
|
||||
.title-ar{
|
||||
margin-top: -37px;
|
||||
margin-right: 101px;
|
||||
}
|
||||
.confirmEitOkButton{
|
||||
white-space: normal !important;
|
||||
text-transform: capitalize !important;
|
||||
min-height: 45px !important;
|
||||
min-width: 5px !important;
|
||||
margin: 8px !important;
|
||||
background-color: #269DB8;
|
||||
width: 80% !important;
|
||||
color: white!important;
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
.approvalTitle-ar{
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
.approvalTitle{
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConfirmAddCeiComponent } from './confirm-add-cei.component';
|
||||
|
||||
describe('ConfirmAddCeiComponent', () => {
|
||||
let component: ConfirmAddCeiComponent;
|
||||
let fixture: ComponentFixture<ConfirmAddCeiComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ConfirmAddCeiComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfirmAddCeiComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,444 @@
|
||||
import { WorkListAttachViewComponent } from './../../notification/work-list-attach-view/work-list-attach-view.component';
|
||||
import { AddAttachComponent } from './../add-attach/add-attach.component';
|
||||
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
|
||||
import { EITNotificatonBodyResponse } from './../models/EITNotificationBodyRes';
|
||||
import { WorkListButtonRequest } from './../models/NotificationButtonReq';
|
||||
import { ApproversList } from './../../absence/models/approvers';
|
||||
import { CeiRequest } from './../models/cei.request';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { EitService } from '../services/eit.service';
|
||||
import { AddCeiResponse } from '../models/add.cei.response';
|
||||
import { FileUploader } from 'ng2-file-upload';
|
||||
import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-add-cei',
|
||||
templateUrl: './confirm-add-cei.component.html',
|
||||
styleUrls: ['./confirm-add-cei.component.scss'],
|
||||
})
|
||||
export class ConfirmAddCeiComponent implements OnInit {
|
||||
|
||||
private P_TransactionID: number;
|
||||
private ceiRequest: CeiRequest;
|
||||
approversList = [];
|
||||
addrespList: any;
|
||||
eitComments: string = "";
|
||||
menuType: string = "";
|
||||
selEmp: string = "";
|
||||
respID: number;
|
||||
selMenu: MenuResponse;
|
||||
getAttachList: any;
|
||||
attachListDisplay: any = [];
|
||||
headerTitle: string = "";
|
||||
isTrue: any = 0;
|
||||
attachItems: any;
|
||||
public isResubmitEIT: boolean = false;
|
||||
private itemKey: string = "";
|
||||
private pActionMode: string = "SUBMIT";
|
||||
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
|
||||
attachmentRes: any;
|
||||
objIndex1: any;
|
||||
attachListOver: any = [];
|
||||
index: any = 0;
|
||||
getPassNotificationDetails: any;
|
||||
isSubmitBtnClicked: boolean;
|
||||
isDelete: boolean = false;
|
||||
|
||||
isUpload: boolean = false;
|
||||
inQueue: boolean = false;
|
||||
addAttachmentListReq: any;
|
||||
attachmentID: number = 0;
|
||||
addAttachRequest: any = [];
|
||||
fileData: any;
|
||||
fileType: any;
|
||||
dirPage: any;
|
||||
TransactionID: any;
|
||||
indexLastObj: any = 0;
|
||||
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
|
||||
direction: string;
|
||||
|
||||
|
||||
constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) {
|
||||
this.direction = TranslatorService.getCurrentLanguageName()
|
||||
this.isSubmitBtnClicked = false;
|
||||
this.ceiRequest = new CeiRequest();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
||||
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
||||
this.ceiRequest = this.cs.sharedService.getSharedData(CeiRequest.SHARED_DATA, false);
|
||||
// this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
|
||||
if (this.isResubmitEIT) {
|
||||
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING **
|
||||
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
|
||||
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
|
||||
this.pActionMode = "RESUBMIT";
|
||||
this.menuType = "E";
|
||||
this.respID = -999;
|
||||
this.selEmp = this.ceiRequest.P_SELECTED_EMPLOYEE_NUMBER;
|
||||
this.getApproversList();
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "update-title");
|
||||
this.headerTitle = msg;
|
||||
} else {
|
||||
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
||||
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
|
||||
this.addrespList = this.cs.sharedService.getSharedData(AddCeiResponse.SHARED_DATA);
|
||||
this.itemKey = this.addrespList.SubmitCEITransactionList.P_ITEM_KEY;
|
||||
this.P_TransactionID = this.addrespList.SubmitCEITransactionList.P_TRANSACTION_ID;
|
||||
// this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
|
||||
this.getApproversList();
|
||||
}
|
||||
}
|
||||
|
||||
getApproversList() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID,
|
||||
P_AME_TRANSACTION_TYPE: "SSHRMS",
|
||||
P_PAGE_NUM: 1,
|
||||
P_PAGE_LIMIT: 1000
|
||||
}
|
||||
this.eitService.getApproversList(
|
||||
body).
|
||||
subscribe((result: any) => {
|
||||
this.handleApproversResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleApproversResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.approversList = result.GetApprovesList;
|
||||
}
|
||||
}
|
||||
|
||||
startCeiApproval() {
|
||||
if (this.attachListOver) {
|
||||
let request = {
|
||||
AddAttachmentList: this.attachListOver
|
||||
}
|
||||
this.eitService.addAttachment(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleAddAttachmentResults(result);
|
||||
});
|
||||
} else {
|
||||
this.startCeiApprovalProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
handleAddAttachmentResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
//this.isUpload=true;
|
||||
this.isTrue = 0;
|
||||
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
|
||||
if (!result.AddAttSuccessList[i].AddSuccess) {
|
||||
this.attachListOver[i].isSuccess = false;
|
||||
// if false display cancel button with waring icon or design
|
||||
}// end if
|
||||
else {
|
||||
// if true remove cancel and set isSuccess = true
|
||||
this.attachListOver[i].isSuccess = true;
|
||||
this.isTrue = this.isTrue + 1; //count flag of attach status
|
||||
} // end else
|
||||
} // end for
|
||||
|
||||
if (this.isTrue == result.AddAttSuccessList.length) {
|
||||
this.startCeiApprovalProcess();
|
||||
}
|
||||
else {
|
||||
//stope
|
||||
let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
|
||||
this.attachListOver = filtered;
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "attach-errorMsg");
|
||||
this.cs.presentAlert(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startCeiApprovalProcess() {
|
||||
let request: any = {};
|
||||
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
||||
request.P_MENU_TYPE = this.menuType;
|
||||
request.P_SELECTED_RESP_ID = this.respID;
|
||||
request.P_TRANSACTION_ID = this.P_TransactionID;
|
||||
request.P_ITEM_KEY = this.itemKey;
|
||||
request.P_ACTION_MODE = this.pActionMode;
|
||||
request.P_COMMENTS = this.eitComments;
|
||||
this.eitService.startCeiApprovalProcess(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleResults(result);
|
||||
});
|
||||
}
|
||||
cancelEitProcess() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID
|
||||
}
|
||||
this.eitService.cancelHRTransaction(
|
||||
body).
|
||||
subscribe((result: any) => {
|
||||
this.handleCancelResults(result);
|
||||
});
|
||||
|
||||
}
|
||||
handleCancelResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = false;
|
||||
}
|
||||
}
|
||||
handleResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = true;
|
||||
let msg: string = this.ts.trPK("eit", "approval-message-success");
|
||||
this.cs.presentAlert(msg);
|
||||
this.cs.openNotificationPage();
|
||||
}
|
||||
}
|
||||
|
||||
async addAttachment(str: boolean, attachItems: any) {
|
||||
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
|
||||
|
||||
this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID');
|
||||
this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj');
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: AddAttachComponent
|
||||
});
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then((data) => {
|
||||
if (data == "cancel" || data == "undefined") {
|
||||
return;
|
||||
} else {
|
||||
if (!str) {
|
||||
this.updateFile(data, attachDocID);
|
||||
} else {
|
||||
console.log(data);
|
||||
this.attachListDisplay = data.data;
|
||||
this.attachItems = this.attachListDisplay.map(function (el) {
|
||||
var o = Object.assign({}, el);
|
||||
o.isSuccess = false;
|
||||
return o;
|
||||
});
|
||||
|
||||
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
/*****submit modal********/
|
||||
async openSubmitModal() {
|
||||
this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList');
|
||||
this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
|
||||
const modal = await this.modalController.create({
|
||||
component: SubmitEitModalComponent,
|
||||
backdropDismiss: false,
|
||||
|
||||
});
|
||||
modal.cssClass = 'note-modal';
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then((data) => {
|
||||
console.log(data.data);
|
||||
|
||||
if (data.data == "cancel" || data.data == undefined) {
|
||||
return;
|
||||
} else {
|
||||
this.startCeiApproval();
|
||||
}
|
||||
});
|
||||
|
||||
return await modal.present();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
removeFile(objectitem) {
|
||||
if (this.attachListOver) {
|
||||
let index2 = this.attachListOver.findIndex(item => item == objectitem);
|
||||
if (index2 > -1) {
|
||||
this.attachListOver.splice(index2, 1);
|
||||
}
|
||||
}
|
||||
if (this.attachmentRes) {
|
||||
|
||||
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
|
||||
if (index3 > -1) {
|
||||
|
||||
this.attachmentRes.splice(index3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getAttachment(NotificationID) {
|
||||
|
||||
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
|
||||
|
||||
this.eitService.getAttach(this.attachReqObj).
|
||||
subscribe((result: NotificationGetAttachResponse) => {
|
||||
this.handleWorkListAttachResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleWorkListAttachResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
|
||||
if (result.GetAttachementList != null) {
|
||||
this.attachmentRes = result.GetAttachementList;
|
||||
} // if result == null
|
||||
} // valid it
|
||||
|
||||
}
|
||||
|
||||
async OpenAttachFiles(value, Type) {
|
||||
|
||||
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
|
||||
const modal = await this.modalController.create({
|
||||
component: WorkListAttachViewComponent
|
||||
});
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then((data) => {
|
||||
});
|
||||
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
|
||||
delelteFile(attach) {
|
||||
this.cs.confirmAlertDialog((data) => {
|
||||
if (data == true) {
|
||||
this.continueDelete(attach);
|
||||
}
|
||||
}, this.ts.trPK('general', 'ok'), () => {
|
||||
|
||||
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
|
||||
}
|
||||
continueDelete(attach) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
|
||||
}
|
||||
this.eitService.deleteAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "deleteAttach");
|
||||
this.cs.presentAlert(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateFile(attachList, attachDocID) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attachDocID,
|
||||
P_FILE_DATA: attachList[0].P_FILE_DATA,
|
||||
P_FILE_NAME: attachList[0].P_FILE_NAME,
|
||||
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
|
||||
}
|
||||
this.eitService.updateAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.MessageStatus == 1) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "attachUpdate");
|
||||
this.cs.presentAlert(msg);
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
}
|
||||
} // val
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
ionViewWillLeave() {
|
||||
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
|
||||
this.cancelEitProcess();
|
||||
}
|
||||
|
||||
public uploader: FileUploader = new FileUploader({
|
||||
allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
||||
maxFileSize: 10 * 1024 * 1024,
|
||||
formatDataFunctionIsAsync: true,
|
||||
formatDataFunction: async (item) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve({
|
||||
name: item._file.name,
|
||||
length: item._file.size,
|
||||
contentType: item._file.type,
|
||||
date: new Date()
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
onFileSelectedclick(event){
|
||||
event.target.value = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
onFileSelected(input) {
|
||||
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("general", "notSupport");
|
||||
this.cs.presentAlert(msg);
|
||||
return
|
||||
} // todo: show alert that you tried uploading wrong files
|
||||
|
||||
else {
|
||||
const file = input.target.files[0];
|
||||
this.getBase64(file).then(
|
||||
data => this.pushObject(data, file.name, file.type)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
pushObject(fileData, name, type) {
|
||||
try {
|
||||
let array = name.split('.');
|
||||
let attachType: string = array[array.length - 1];
|
||||
|
||||
this.attachListOver.push(
|
||||
{
|
||||
AttachmentID: this.attachListOver.length,
|
||||
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
|
||||
P_FILE_DATA: fileData.split(',')[1],
|
||||
P_FILE_NAME: name,//.split('.')[0],
|
||||
P_TRANSACTION_ID: this.P_TransactionID
|
||||
})
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
import { Response } from '../../hmg-common/services/models/response';
|
||||
import { EitRespModel } from './eit.response.model'
|
||||
|
||||
export class AddCeiResponse extends Response {
|
||||
public static SHARED_DATA = 'add-cei-response';
|
||||
SubmitCEITransactionList: EitRespModel;
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
import { EitTransactionModel } from './eit.transaction.model';
|
||||
|
||||
export class CeiRequest {
|
||||
public static SHARED_DATA = 'cei-request';
|
||||
public P_MENU_TYPE: string;
|
||||
public P_SELECTED_EMPLOYEE_NUMBER: string;
|
||||
public P_FUNCTION_NAME: string;
|
||||
public P_SELECTED_RESP_ID: Number;
|
||||
P_CONTACT_RELATIONSHIP_ID: Number;
|
||||
P_DESC_FLEX_CONTEXT_CODE: string;
|
||||
EITTransactionTBL: EitTransactionModel[];
|
||||
}
|
||||
@ -1,13 +1,40 @@
|
||||
<input [id]="attachmentname" type="file" name="attachment" style="display:none" (change)='loadAttachment($event)'
|
||||
accept="image/*,video/*,audio/*">
|
||||
<ion-button (click)="openFile()" slot="end" expand="block" fill="outline">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
{{'general,select-attachment' | translate}}
|
||||
</ion-button>
|
||||
<!-- <two-option-select (selected)="switchOptions($event)" [option1]="ts.trPK('settings','file')" [option2]="ts.trPK('settings','camera')"
|
||||
[isOption1]="true"></two-option-select> -->
|
||||
|
||||
<div *ngIf="inputFiles.length>0" class="uploader-icons">
|
||||
<ion-item *ngFor="let file of inputFiles; let i = index" lines="none">
|
||||
<p slot="start"> <img [src]="attachmentImg" /> {{file.name}}</p>
|
||||
<p slot="end"><img [src]="deleteImg" (click)="deleteFiles(i)"></p>
|
||||
</ion-item>
|
||||
</div>
|
||||
<!-- <input [id]="attachmentname" type="file" name="attachment" style="display:none" (change)='loadAttachment($event)'
|
||||
accept="jpg, jpeg, png, gif, pdf, doc, docx"> -->
|
||||
<ion-button (click)="openFile()" slot="end" expand="block" fill="outline" class="uploader">
|
||||
<ion-icon name="attach" slot="start" ></ion-icon>
|
||||
{{'general,select-attachment' | translate}}
|
||||
</ion-button>
|
||||
|
||||
<!-- <div class="uploader-icons">
|
||||
<ion-item lines="none">
|
||||
<p slot="start" class="file-name"> <img [src]="attachmentImg" /> {{file.name}}</p>
|
||||
<p slot="end" class="delete-cont"><img [src]="deleteImg" (click)="deleteFiles(i)"></p>
|
||||
</ion-item>
|
||||
</div> -->
|
||||
|
||||
<ion-slides>
|
||||
<ion-slide>
|
||||
<ion-grid class=" gridAH" *ngIf="inputFiles.length>0">
|
||||
|
||||
<ion-row>
|
||||
<ion-col lines="none" size="3" *ngFor="let file of inputFiles; let i = index">
|
||||
<div class="image-container">
|
||||
<div class="uploaded">
|
||||
<div class="closed" (click)="deleteFiles(i)">X</div>
|
||||
<img [src]="getImgContent(file.data) " />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
|
||||
<div *ngIf="errorMsg" class="error">
|
||||
{{errorMsg}}
|
||||
</div>
|
||||
@ -1,100 +1,288 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } 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 { AlertController } from '@ionic/angular';
|
||||
import { Component, OnInit, Input, Output, EventEmitter, NgZone } 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 { AlertController, ActionSheetController, Platform } from "@ionic/angular";
|
||||
import {
|
||||
Camera,
|
||||
CameraOptions,
|
||||
PictureSourceType
|
||||
} from "@ionic-native/Camera/ngx";
|
||||
import { FileChooser } from "@ionic-native/file-chooser/ngx";
|
||||
import { File } from "@ionic-native/file/ngx";
|
||||
import { FilePath } from "@ionic-native/file-path/ngx";
|
||||
import { Base64 } from "@ionic-native/base64/ngx";
|
||||
import { IOSFilePicker } from '@ionic-native/file-picker/ngx';
|
||||
import { Location } from '@angular/common';
|
||||
import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
|
||||
|
||||
|
||||
export interface CustomWindow extends Window {
|
||||
File: any;
|
||||
FileReader: any;
|
||||
}
|
||||
declare let window: CustomWindow;
|
||||
|
||||
@Component({
|
||||
selector: 'file-uploader',
|
||||
templateUrl: './file-uploader.component.html',
|
||||
styleUrls: ['./file-uploader.component.scss']
|
||||
selector: "file-uploader",
|
||||
templateUrl: "./file-uploader.component.html",
|
||||
styleUrls: ["./file-uploader.component.scss"]
|
||||
})
|
||||
export class FileUploaderComponent implements OnInit {
|
||||
@Input() multiupload = false;
|
||||
@Input() attachmentname = 'attachment-loader';
|
||||
@Input() attachmentname = "attachment-loader";
|
||||
public attachmentData: string;
|
||||
@Input() maxFileSize = 10 * 1024 * 1024;
|
||||
public errorMsg: string;
|
||||
public selectedOpn: number = 1;
|
||||
public allowdType: any = ["jpg", "jpeg", "png", "gif", "pdf", "doc", "docx"];
|
||||
@Input() maxFileSize = 5 * 1024 * 1024;
|
||||
@Output() fileSelected = new EventEmitter();
|
||||
public inputFiles: any = [];
|
||||
public attachmentImg = 'assets/icon/attachment.png';
|
||||
public deleteImg = 'assets/icon/delete.png';
|
||||
public attachmentImg = "assets/icon/attachment.png";
|
||||
public deleteImg = "assets/icon/delete.png";
|
||||
public nativePath: any;
|
||||
public actionSheet: any;
|
||||
public isActionSheetShown: boolean = false;
|
||||
@Input() selectedAttachment = [];
|
||||
constructor(
|
||||
public cs: CommonService,
|
||||
public ts: TranslatorService,
|
||||
public alertController: AlertController
|
||||
) {
|
||||
}
|
||||
public alertController: AlertController,
|
||||
private cameraController: Camera,
|
||||
private actionSheetController: ActionSheetController,
|
||||
private fileChooser: FileChooser,
|
||||
private file: File,
|
||||
private filePath: FilePath,
|
||||
public base64: Base64,
|
||||
public platform: Platform,
|
||||
private iOSfilePicker: IOSFilePicker,
|
||||
public ngzone: NgZone,
|
||||
public loc: Location,
|
||||
public sanitizer: DomSanitizer
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.platform.backButton.subscribeWithPriority(9999, () => {
|
||||
// You decide what happens
|
||||
if (this.isActionSheetShown)
|
||||
this.actionSheet.dismiss();
|
||||
else
|
||||
this.loc.back();
|
||||
});
|
||||
this.inputFiles = this.selectedAttachment;
|
||||
}
|
||||
|
||||
|
||||
public loadAttachment(changeEvent) {
|
||||
const fileInput = this.getFileElement();
|
||||
if (this.isFileSupported()) {
|
||||
if (fileInput.files != null && fileInput.files.length > 0) {
|
||||
const file = fileInput.files[0];
|
||||
const reader = new FileReader();
|
||||
if (file.size <= this.maxFileSize) {
|
||||
reader.onload = (data) => {
|
||||
if (this.multiupload) {
|
||||
this.inputFiles.push({name: file.name, data: data.target['result']});
|
||||
} else {
|
||||
this.inputFiles = [{name: file.name, data: data.target['result']}];
|
||||
}
|
||||
this.fileSelected.emit( {
|
||||
name: file.name ,
|
||||
data: data.target['result'],
|
||||
inputFiles: this.inputFiles
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
} else {
|
||||
this.attachmentData = null;
|
||||
changeEvent.target.value = ''; // remove current selection
|
||||
this.showFileExceededMaxSize();
|
||||
}
|
||||
} else {
|
||||
this.attachmentData = null;
|
||||
}
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
}
|
||||
async openFile() {
|
||||
if (this.platform.is('ios'))
|
||||
this.openiOSActionSheet();
|
||||
else
|
||||
this.openAndroidActionSheet();
|
||||
//this.openiOSActionSheet();
|
||||
|
||||
private isFileSupported() {
|
||||
return (window.FileReader && window.File);
|
||||
}
|
||||
async openAndroidActionSheet() {
|
||||
this.actionSheet = await this.actionSheetController.create({
|
||||
header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file",
|
||||
|
||||
private showFileExceededMaxSize() {
|
||||
this.cs.presentConfirmDialog(
|
||||
this.ts.trPK('general', 'large-file'),
|
||||
() => {
|
||||
this.openFile();
|
||||
},
|
||||
() => {
|
||||
}
|
||||
);
|
||||
buttons: [
|
||||
{
|
||||
text: this.ts.trPK("itemforsale", "from-library"),
|
||||
handler: () => {
|
||||
this.takePictureiOS();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: this.ts.trPK("itemforsale", "from-camera"),
|
||||
handler: () => {
|
||||
this.takePicture(this.cameraController.PictureSourceType.CAMERA);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: this.ts.trPK("general", "cancel"),
|
||||
role: "cancel"
|
||||
}
|
||||
]
|
||||
});
|
||||
this.isActionSheetShown = true;
|
||||
await this.actionSheet.present();
|
||||
}
|
||||
|
||||
private getFileElement(): HTMLInputElement {
|
||||
return document.getElementById(this.attachmentname) as HTMLInputElement;
|
||||
async openiOSActionSheet() {
|
||||
this.actionSheet = await this.actionSheetController.create({
|
||||
header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file",
|
||||
buttons: [
|
||||
{
|
||||
text: this.ts.trPK("itemforsale", "from-library"),
|
||||
handler: () => {
|
||||
this.takePictureiOS();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: this.ts.trPK("itemforsale", "from-camera"),
|
||||
handler: () => {
|
||||
this.takePicture(this.cameraController.PictureSourceType.CAMERA);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
text: this.ts.trPK("itemforsale", "from-icloud"),
|
||||
handler: () => {
|
||||
this.takePicture(this.cameraController.PictureSourceType.PHOTOLIBRARY);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: this.ts.trPK("general", "cancel"),
|
||||
role: "cancel"
|
||||
}
|
||||
]
|
||||
});
|
||||
this.isActionSheetShown = true;
|
||||
await this.actionSheet.present();
|
||||
}
|
||||
|
||||
public openFile() {
|
||||
const fileInput = this.getFileElement();
|
||||
fileInput.click();
|
||||
public takePictureiOS() {
|
||||
const options: CameraOptions = {
|
||||
quality: 60,
|
||||
sourceType: this.cameraController.PictureSourceType.PHOTOLIBRARY,
|
||||
destinationType: this.cameraController.DestinationType.DATA_URL,
|
||||
encodingType: this.cameraController.EncodingType.JPEG,
|
||||
mediaType: this.cameraController.MediaType.PICTURE,
|
||||
correctOrientation: true,
|
||||
}
|
||||
this.cameraController.getPicture(options).then((imageData) => {
|
||||
const data = "data:image/jpeg;base64," + imageData;
|
||||
this.pushFiles(this.getFileName(), data);
|
||||
}, (err) => {
|
||||
});
|
||||
}
|
||||
|
||||
public deleteFiles(index: number) {
|
||||
this.inputFiles.splice(index, 1);
|
||||
this.fileSelected.emit( {
|
||||
this.fileSelected.emit({
|
||||
name: null,
|
||||
data: '',
|
||||
data: "",
|
||||
inputFiles: this.inputFiles
|
||||
});
|
||||
this.errorMsg = null;
|
||||
}
|
||||
public switchOptions($event) {
|
||||
this.selectedOpn = $event;
|
||||
}
|
||||
public takePicture(sourceType: PictureSourceType) {
|
||||
const options: CameraOptions = {
|
||||
quality: 50,
|
||||
destinationType: this.cameraController.DestinationType.DATA_URL,
|
||||
encodingType: this.cameraController.EncodingType.JPEG,
|
||||
sourceType: sourceType,
|
||||
mediaType: this.cameraController.MediaType.PICTURE,
|
||||
correctOrientation: true
|
||||
};
|
||||
if (sourceType === this.cameraController.PictureSourceType.PHOTOLIBRARY) {
|
||||
if (this.platform.is('android')) {
|
||||
this.fileChooser
|
||||
.open()
|
||||
.then(uri => {
|
||||
this.readFile(uri);
|
||||
})
|
||||
.catch(e => { });
|
||||
} else {
|
||||
this.iOSfilePicker.pickFile(['public.content']).then(uri => {
|
||||
|
||||
let correctPath = uri.substr(0, uri.lastIndexOf('/') + 1);
|
||||
let currentName = uri.substring(uri.lastIndexOf('/') + 1);
|
||||
this.nativePath = uri;
|
||||
|
||||
this.file.readAsDataURL("file:///" + correctPath, currentName).then(result => {
|
||||
this.pushFiles(currentName, result);
|
||||
}).catch(e => { });
|
||||
}).catch(e => { });
|
||||
}
|
||||
} else {
|
||||
this.cameraController.getPicture(options).then(imageData => {
|
||||
const data = "data:image/jpeg;base64," + imageData;
|
||||
this.pushFiles(this.getFileName(), data);
|
||||
});
|
||||
}
|
||||
}
|
||||
pushFiles(name, files) {
|
||||
this.ngzone.run(() => {
|
||||
if (this.multiupload) {
|
||||
this.inputFiles.push({ name: name, data: files });
|
||||
} else {
|
||||
this.inputFiles = [{ name: name, data: files }];
|
||||
}
|
||||
this.fileSelected.emit({
|
||||
name: name,
|
||||
data: files,
|
||||
inputFiles: this.inputFiles
|
||||
});
|
||||
});
|
||||
}
|
||||
readFile(fileUrl: any) {
|
||||
this.filePath.resolveNativePath(fileUrl).then(filePathResult => {
|
||||
this.nativePath = filePathResult;
|
||||
this.file.resolveLocalFilesystemUrl(this.nativePath).then(entry => {
|
||||
entry.getMetadata(metadata => {
|
||||
if (metadata.size <= this.maxFileSize) {
|
||||
this.errorMsg = null;
|
||||
this.encodeFiles(entry);
|
||||
} else {
|
||||
this.errorMsg = this.ts.trPK("general", "large-file");
|
||||
}
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
getImgContent(imgFile): SafeUrl {
|
||||
console.log(imgFile);
|
||||
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
|
||||
}
|
||||
|
||||
checkDuplicate(name: string) {
|
||||
return this.inputFiles.filter(a => {
|
||||
return a.name === name;
|
||||
});
|
||||
}
|
||||
encodeFiles(entry) {
|
||||
let fileName = entry.nativeURL.split('/').pop();
|
||||
let path = entry.nativeURL.substring(0, entry.nativeURL.lastIndexOf("/") + 1);
|
||||
|
||||
this.file.readAsDataURL(path, fileName)
|
||||
.then(base64File => {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('Error reading file', err);
|
||||
})
|
||||
this.base64.encodeFile(this.nativePath).then(
|
||||
(base64File: string) => {
|
||||
const type = this.nativePath.substr(
|
||||
this.nativePath.lastIndexOf(".") + 1
|
||||
);
|
||||
if (this.allowdType.includes(type.toLowerCase())) {
|
||||
if (this.checkDuplicate(entry.name).length === 0) {
|
||||
this.pushFiles(entry.name, base64File);
|
||||
this.errorMsg = null;
|
||||
} else {
|
||||
this.errorMsg = this.ts.trPK("general", "file-name-exist");
|
||||
}
|
||||
} else {
|
||||
this.attachmentData = null;
|
||||
this.errorMsg = this.ts.trPK("general", "not-supported");
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
getFileName() {
|
||||
const date = new Date().valueOf();
|
||||
let text = "";
|
||||
const possibleText =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
for (let i = 0; i < 5; i++) {
|
||||
text += possibleText.charAt(
|
||||
Math.floor(Math.random() * possibleText.length)
|
||||
);
|
||||
}
|
||||
const imageName = date + "." + text + ".jpeg";
|
||||
return imageName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
<app-generic-header
|
||||
showImage="false"
|
||||
showBack="false"
|
||||
navigate="false"
|
||||
backlink="false"
|
||||
[headerText]="'general,filter-offers' | translate">
|
||||
</app-generic-header>
|
||||
|
||||
|
||||
<ion-content>
|
||||
<div class="container-icon" *ngIf="categories.length>0">
|
||||
|
||||
<ion-item lines="none" *ngFor="let key of categories" (click)="filterOffers(key)" [ngClass]="{'active':activeClass==key.title }">
|
||||
<ion-label *ngIf="direction =='ltr'">
|
||||
{{key.title}}
|
||||
</ion-label>
|
||||
<ion-label *ngIf="direction =='rtl'">
|
||||
{{key.title_ar}}
|
||||
</ion-label>
|
||||
<ion-thumbnail slot="start">
|
||||
<div class="top-filter" [innerHTML]="key.content | sanitizeHTMLPipe"></div>
|
||||
</ion-thumbnail>
|
||||
</ion-item>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<ion-footer >
|
||||
<div class="centerDiv">
|
||||
<ion-button class="footer-button" ion-button (click)="applyFilters()">
|
||||
{{ts.trPK('general','apply-filters')}} </ion-button>
|
||||
|
||||
</div>
|
||||
</ion-footer>
|
||||
</ion-content>
|
||||
@ -0,0 +1,38 @@
|
||||
ion-label{
|
||||
font-size: 14px !important;
|
||||
}
|
||||
ion-thumbnail img{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 10px;
|
||||
}
|
||||
.active::before{
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 15px;
|
||||
padding: 0px;
|
||||
background: #3cc353;
|
||||
padding: 3px 2px 1px 3px;
|
||||
border-radius: 60%;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
content: '✓';
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
z-index: 2;
|
||||
}
|
||||
ion-item{
|
||||
border-bottom: 1px solid #ccc;
|
||||
--padding-start: 0px;
|
||||
margin: 0 20px 4px 20px;
|
||||
}
|
||||
|
||||
.footer-button{
|
||||
background: var(--newgreen)!important;border-radius: 10px; --background: transparent;
|
||||
width: 80%;
|
||||
}
|
||||
ion-footer{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FilterComponent } from './filter.component';
|
||||
|
||||
describe('FilterComponent', () => {
|
||||
let component: FilterComponent;
|
||||
let fixture: ComponentFixture<FilterComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FilterComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FilterComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,56 @@
|
||||
import { AfterViewInit, 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 { ModalController } from '@ionic/angular';
|
||||
import { OfferDiscountService } from 'src/app/offersdiscount/services/service';
|
||||
import { ItemForSaleService } from '../services/service.service';
|
||||
@Component({
|
||||
selector: 'app-filter',
|
||||
templateUrl: './filter.component.html',
|
||||
styleUrls: ['./filter.component.scss'],
|
||||
})
|
||||
export class FilterComponent implements AfterViewInit {
|
||||
|
||||
segment: any = '1';
|
||||
categoriesObj: any;
|
||||
categories: any = [];
|
||||
offersData: any = [];
|
||||
activeClass: any;
|
||||
tempSearch: any = [];
|
||||
searchText: String;
|
||||
public activeKey = {}
|
||||
direction: any;
|
||||
|
||||
constructor(public ts: TranslatorService, public modalController: ModalController, public cs: CommonService, public offersService: OfferDiscountService) { }
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.direction = TranslatorService.getCurrentDirection();
|
||||
this.categories = this.cs.sharedService.getSharedData(OfferDiscountService.categories, false);
|
||||
|
||||
|
||||
// this.getOfferDiscount();
|
||||
}
|
||||
|
||||
|
||||
openDetails(offer) {
|
||||
// this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers);
|
||||
|
||||
// var related = this.offersData.filter((res) => res.rowID != offer.rowID);
|
||||
// this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers);
|
||||
|
||||
// this.cs.navigateForward('/offersdiscount/offer-details');
|
||||
}
|
||||
|
||||
|
||||
filterOffers(key) {
|
||||
this.activeKey = key
|
||||
this.activeClass = key.title;
|
||||
|
||||
}
|
||||
|
||||
|
||||
applyFilters() {
|
||||
this.cs.sharedService.setSharedData(this.activeKey, ItemForSaleService.selected_filters);
|
||||
this.cs.back();
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,41 @@
|
||||
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 { ItemForSaleService } from '../services/service.service';
|
||||
import * as moment from 'moment';
|
||||
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@Component({
|
||||
selector: 'app-item-details',
|
||||
templateUrl: './item-details.component.html',
|
||||
styleUrls: ['./item-details.component.scss'],
|
||||
})
|
||||
export class ItemDetailsComponent implements OnInit {
|
||||
constructor(public ts: TranslatorService, public cs: CommonService,) { }
|
||||
itemDetails: any;
|
||||
direction: any;
|
||||
|
||||
constructor(public ts: TranslatorService, public itemService: ItemForSaleService, public route: ActivatedRoute, public cs: CommonService, private sanitizer: DomSanitizer,) {
|
||||
this.route
|
||||
.params.subscribe(val => {
|
||||
setTimeout(() => {
|
||||
this.ionEnter();
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
ionEnter() {
|
||||
this.direction = TranslatorService.getCurrentDirection();
|
||||
this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false);
|
||||
|
||||
ngOnInit() { }
|
||||
}
|
||||
getDate(date) {
|
||||
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
|
||||
}
|
||||
getImgContent(imgFile): SafeUrl {
|
||||
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
import { Pipe, PipeTransform } from "@angular/core";
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({
|
||||
name: 'sanitizeHTMLPipe'
|
||||
})
|
||||
export class SanitizeHtmlPipe implements PipeTransform {
|
||||
|
||||
constructor(private _sanitizer: DomSanitizer) {
|
||||
}
|
||||
|
||||
transform(v: string): SafeHtml {
|
||||
return this._sanitizer.bypassSecurityTrustHtml(v);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ItemForSaleService } from './service.service';
|
||||
|
||||
describe('ServiceService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: ItemForSaleService = TestBed.get(ItemForSaleService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,87 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
||||
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
|
||||
import { MowadhafiService } from 'src/app/mowadhafi/mowadhafi.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ItemForSaleService {
|
||||
public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
|
||||
public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
|
||||
public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
|
||||
public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSaleMobile';
|
||||
public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale';
|
||||
public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion';
|
||||
public static ITEMS_SELECTED = 'item-selected';
|
||||
public static CATEGORIES = 'categories';
|
||||
public static EDIT_ITEMS = 'edit-items';
|
||||
public static selected_filters = 'selected_filter';
|
||||
constructor(
|
||||
public con: ConnectorService,
|
||||
private authService: AuthenticationService,
|
||||
private http: HttpClient
|
||||
) { }
|
||||
public getItems(request: any, onError?: any, errorLabel?: string) {
|
||||
this.authService.authenticateRequest(request);
|
||||
request.EmployeeNumber = request.UserName;
|
||||
request.ItgPageNo = request.pageNo;
|
||||
request.ItgPageSize = 10;
|
||||
request.ItgStatus = "Approved";
|
||||
return this.con.postNoLoad(ItemForSaleService.getItemForSale, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
public getCategories(request: any, onError?: any, errorLabel?: string) {
|
||||
this.authService.authenticateRequest(request);
|
||||
request.EmployeeNumber = request.UserName;
|
||||
|
||||
return this.con.postNoLoad(ItemForSaleService.getCategories, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
parser(response: any) {
|
||||
try {
|
||||
var result = JSON.parse(response.Mohemm_ITG_ResponseItem);
|
||||
if (result.result)
|
||||
return result.result.data
|
||||
else
|
||||
return {}
|
||||
} catch (res) {
|
||||
console.log(res);
|
||||
}
|
||||
}
|
||||
|
||||
getItemsByEmployee(request: any, onError?: any, errorLabel?: string) {
|
||||
this.authService.authenticateRequest(request);
|
||||
request.EmployeeNumber = request.UserName;
|
||||
request.ItgEmployeeNumber = request.UserName; //request.UserName;
|
||||
return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel);
|
||||
}
|
||||
getRegion(request: any, onError?: any, errorLabel?: string) {
|
||||
this.authService.authenticateRequest(request);
|
||||
request.EmployeeNumber = request.UserName;
|
||||
request.ItgEmployeeNumber = request.UserName; //request.UserName;
|
||||
return this.con.post(ItemForSaleService.getRegion, request, onError, errorLabel);
|
||||
}
|
||||
|
||||
createItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
|
||||
const request = itemRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
request.employeeNumber = request.P_USER_NAME;
|
||||
//return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
|
||||
return this.con.post(ItemForSaleService.createItemForSale, request, onError, errorLabel);
|
||||
//}
|
||||
//)
|
||||
}
|
||||
updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
|
||||
const request = itemRequest;
|
||||
this.authService.authenticateRequest(request);
|
||||
request.employeeNumber = request.P_USER_NAME;
|
||||
return this.http.post(ConnectorService.host + ItemForSaleService.updateItemForSale, itemRequest, {
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
<app-generic-header
|
||||
showBack="true"
|
||||
[headerText]="'myTeam, subordinate-leave' | translate">
|
||||
</app-generic-header>
|
||||
|
||||
|
||||
<ion-content padding style="--background: #f5f5f5">
|
||||
<div class="team-member-container">
|
||||
<ion-label>
|
||||
<ion-item lines='none'>
|
||||
<p style="font-size: 18px; font-weight: bold;">{{ts.trPK('myTeam','select-duration')}}</p>
|
||||
</ion-item>
|
||||
</ion-label>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size='6'>
|
||||
<ion-label position='floating' style="margin-left: 15px;" class="colBold">{{ts.trPK('general','from')}} </ion-label>
|
||||
|
||||
<ion-item class='dynamicField' lines='none'>
|
||||
<ion-datetime style="padding: 0px" [(ngModel)]="startDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required
|
||||
cancelText="{{ts.trPK('general','cancel')}}" doneText="{{ts.trPK('general','done')}}"></ion-datetime>
|
||||
|
||||
<ion-icon style="width: 20px;" name="calendar"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-col>
|
||||
<ion-col size='6'>
|
||||
<ion-label position='floating' style="margin-left: 15px;" class="colBold">{{ts.trPK('general','to')}} </ion-label>
|
||||
<ion-item class='dynamicField' lines='none'>
|
||||
<ion-datetime style="padding: 0px" [(ngModel)]="endDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required
|
||||
cancelText="{{ts.trPK('general','cancel')}}"
|
||||
doneText="{{ts.trPK('general','done')}}"></ion-datetime>
|
||||
|
||||
<ion-icon style="width: 20px;" name="calendar"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
|
||||
<div *ngIf='noData'></div>
|
||||
|
||||
<div *ngIf='!noData'>
|
||||
<div *ngIf='list.length === 0'>
|
||||
<div class="team-member-container" style="text-align: center;">
|
||||
<h2 style="margin-top: 5px !important; font-size: 20px;" class="name">
|
||||
{{ts.trPK('general','empty')}}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf='list.length > 0'>
|
||||
<div class="team-member-container" *ngFor='let user of list'>
|
||||
<ion-row>
|
||||
<ion-col [size]="3">
|
||||
<div class="user-image-container">
|
||||
<div class="user-image">
|
||||
<img *ngIf='user.image' [src]="user.image"/>
|
||||
<img *ngIf='!user.image' src="../assets/imgs/profile.png"/>
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col [size]="9">
|
||||
<div>
|
||||
<span>
|
||||
<h2 style="margin-top: 0px !important; font-size: 20px;" class="name">{{user.EMPLOYEE_NAME}}</h2>
|
||||
<span class="title"><ion-label>{{ts.trPK('general','from')}}: </ion-label><b style="font-size: 12px;">{{getDate(user.DATE_START)}} </b></span>
|
||||
<span class="title"><ion-label>{{ts.trPK('general','to')}}: </ion-label><b style="font-size: 12px;">{{getDate(user.DATE_END)}}</b></span>
|
||||
<br>
|
||||
<span class="title"><ion-label>{{ts.trPK('myTeam','no-of-days')}}: </ion-label><b style="font-size: 12px;">{{diffDays(user)}}</b></span>
|
||||
</span>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="confirmEitOkButton" [disabled]='checkDate()' (click)="subordinateLeaveList()">{{ts.trPK('general','submit')}}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,199 @@
|
||||
.confirmEitOkButton{
|
||||
white-space: normal !important;
|
||||
text-transform: capitalize !important;
|
||||
min-height: 45px !important;
|
||||
min-width: 5px !important;
|
||||
margin: 8px !important;
|
||||
--background: #269DB8;
|
||||
width: 80% !important;
|
||||
color: white!important;
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
.team-member-container{
|
||||
// background: white;
|
||||
// border-radius: 100px 20px 20px 100px;
|
||||
// margin-top: 15px;
|
||||
// font-family: WorkSans-Regular;
|
||||
// border: 1px solid #ccc;
|
||||
// border-radius: 15px;
|
||||
// padding-bottom: 8px;
|
||||
background: white;
|
||||
/* margin-top: 2px; */
|
||||
font-family: WorkSans-Regular;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 15px;
|
||||
padding-bottom: 8px;
|
||||
padding-top: 9px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
// .user-image-container{
|
||||
// position: relative;
|
||||
// width: 70px;
|
||||
// height: 70px;
|
||||
// display: block;
|
||||
// margin: 0 auto;
|
||||
// &:before{
|
||||
// position: absolute;
|
||||
// content: "";
|
||||
// width: 20px;
|
||||
// height: 20px;
|
||||
// border-radius: 20px;
|
||||
// border: 1px solid white;
|
||||
// top: 0;
|
||||
// right: 0;
|
||||
// background-color: red;
|
||||
// z-index: 9;
|
||||
// }
|
||||
// &.present:before{
|
||||
// background-color: green !important;
|
||||
// }
|
||||
// }
|
||||
.user-image{
|
||||
// overflow: hidden;
|
||||
// position: relative;
|
||||
// display: block;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// border-radius: 80px;
|
||||
// border: 1px solid #ccc;
|
||||
// margin: 0px auto 6px;
|
||||
|
||||
img {
|
||||
// width: 100%;
|
||||
// max-height: 100%;
|
||||
width: 74%;
|
||||
max-height: 74%;
|
||||
margin-top: 7px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.employee-name{
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
.name{
|
||||
// font-size: 16px;
|
||||
// color: black;
|
||||
// // margin: 0;
|
||||
// width: 100%;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// overflow: hidden;
|
||||
// margin-left: -10px;
|
||||
// margin-top: -5px;
|
||||
// font-family: 'WorkSans-Bold';
|
||||
font-size: 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-left: -10px;
|
||||
margin-top: -5px;
|
||||
text-align: left;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
line-height: 25px;
|
||||
letter-spacing: -0.64px;
|
||||
color: #2B353E;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.title{
|
||||
// font-size: 13px;
|
||||
// color: #888;
|
||||
// width: 100%;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// overflow: hidden;
|
||||
// display: block;
|
||||
// margin-left: -10px;
|
||||
// margin-top: -6px;
|
||||
// color: black;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
line-height: 12px;
|
||||
letter-spacing: -0.56px;
|
||||
color: #575757;
|
||||
opacity: 1;
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
margin-left: -10px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
}
|
||||
|
||||
.employee-name-ar{
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
.name{
|
||||
// font-size: 16px;
|
||||
// color: black;
|
||||
// // margin: 0;
|
||||
// width: 100%;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// overflow: hidden;
|
||||
// margin-left: -10px;
|
||||
// margin-top: -5px;
|
||||
// font-family: 'WorkSans-Bold';
|
||||
font-size: 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-left: -10px;
|
||||
margin-top: -5px;
|
||||
text-align: right;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
line-height: 25px;
|
||||
letter-spacing: -0.64px;
|
||||
color: #2B353E;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.title{
|
||||
// font-size: 13px;
|
||||
// color: #888;
|
||||
// width: 100%;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// overflow: hidden;
|
||||
// display: block;
|
||||
// margin-left: -10px;
|
||||
// margin-top: -6px;
|
||||
// color: black;
|
||||
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
|
||||
line-height: 12px;
|
||||
letter-spacing: -0.56px;
|
||||
color: #575757;
|
||||
opacity: 1;
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
margin-left: -10px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
}
|
||||
.image-container{
|
||||
width: 20%;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.swipe-information{
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
border-top: 1px solid #ccc;
|
||||
padding-top: 6px;
|
||||
margin-top: 6px;
|
||||
.check-in {
|
||||
font-size: 12px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SubordinateLeaveComponent } from './subordinate-leave.component';
|
||||
|
||||
describe('SubordinateLeaveComponent', () => {
|
||||
let component: SubordinateLeaveComponent;
|
||||
let fixture: ComponentFixture<SubordinateLeaveComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SubordinateLeaveComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SubordinateLeaveComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,57 @@
|
||||
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 { MyTeamService } from '../service/my-team.service';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-subordinate-leave',
|
||||
templateUrl: './subordinate-leave.component.html',
|
||||
styleUrls: ['./subordinate-leave.component.scss'],
|
||||
})
|
||||
export class SubordinateLeaveComponent implements OnInit {
|
||||
public startDate: any;
|
||||
public endDate: any;
|
||||
public list = [];
|
||||
public noData = true;
|
||||
|
||||
constructor(
|
||||
public ts: TranslatorService,
|
||||
public common: CommonService,
|
||||
public myTeamService: MyTeamService,
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
subordinateLeaveList() {
|
||||
const Sdata = this.common.convertDateToJsonDateUpdated(this.startDate);
|
||||
const Edata = this.common.convertDateToJsonDateUpdated(this.endDate);
|
||||
this.myTeamService.getEmployeeSubordinatesLeave({
|
||||
P_DATE_FROM: Sdata,
|
||||
P_DATE_TO: Edata
|
||||
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
||||
if (this.common.validResponse(result)) {
|
||||
this.list = result.GetSubordinatesLeavesTotalVacationsList;
|
||||
this.noData = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getDate(date) {
|
||||
const newDate = this.common.localizeDate(new Date(this.common.getDateTimeISOFromStringUpdated(date).split(' ')[0]));
|
||||
return newDate;
|
||||
}
|
||||
diffDays(date) {
|
||||
const date1 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_START).split(' ')[0]);
|
||||
const date2 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_END).split(' ')[0]);
|
||||
const diff = Math.abs(date1.getTime() - date2.getTime());
|
||||
const diffDays = Math.ceil(diff / (1000 * 3600 * 24));
|
||||
return diffDays;
|
||||
}
|
||||
|
||||
checkDate() {
|
||||
if (this.startDate && this.endDate) {
|
||||
return false;
|
||||
} else { return true; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
export class UserItemTypes extends Request {
|
||||
public P_ITEM_TYPE: string;
|
||||
public P_FYA_ENABLED_FALG: string;
|
||||
public P_FYI_ENABLED_FLAG: string;
|
||||
public ItemID: number;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue