fixed business card issues

MOHEMM-HUAWEI-RELEASE
umasoodch 4 years ago
parent f2232c544a
commit bc9c5e9deb

@ -5,19 +5,19 @@
<ion-content padding> <ion-content padding>
<div [ngClass]=" direction === 'en' ? 'custom-text-area-element Field-en' : 'custom-text-area-element Field-ar'" > <!-- <div [ngClass]=" direction === 'en' ? 'custom-text-area-element Field-en' : 'custom-text-area-element Field-ar'" >
<label class="label" position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </label> <label class="label" position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </label>
<select class="label-Select" [(ngModel)]="absenceType" (change)="onTypeAbsenceChange()" required> <select class="label-Select" [(ngModel)]="absenceType" (change)="onTypeAbsenceChange()" required>
<option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </option> <option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </option>
</select> </select>
</div> </div> -->
<!-- <ion-item class='dynamicField'> <ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </ion-label> <ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </ion-label>
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required> --> <ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required>
<!-- let item of AbsenceType; let i=index; --> <!-- let item of AbsenceType; let i=index; -->
<!-- <ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option> <ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
</ion-select> </ion-select>
</ion-item> --> </ion-item>
<ion-item class='dynamicField'> <ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','startDate')}} </ion-label> <ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','startDate')}} </ion-label>

@ -1,6 +1,6 @@
<ion-app [dir]="direction"> <ion-app [dir]="direction">
<ion-split-pane> <ion-split-pane>
<ion-menu side='start' *ngIf="direction ==='ltr'"> <ion-menu [swipeGesture]="false" side='start' *ngIf="direction ==='ltr'">
<ion-content class="sidebar-menu"> <ion-content class="sidebar-menu">
<div class="header-div"> <div class="header-div">
<div> <div>
@ -99,7 +99,7 @@
</ion-content> </ion-content>
</ion-menu> </ion-menu>
<ion-menu side='end' *ngIf="direction ==='rtl'"> <ion-menu [swipeGesture]="false" side='end' *ngIf="direction ==='rtl'">
<ion-content class="sidebar-menu"> <ion-content class="sidebar-menu">
<div class="header-div"> <div class="header-div">
<div> <div>

@ -150,7 +150,9 @@ export class AppComponent implements OnInit {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
console.log(user); console.log(user);
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('ENAD TEST')
console.log(this.userInfo)
localStorage.setItem("digitalIDUser", JSON.stringify(user)); localStorage.setItem("digitalIDUser", JSON.stringify(user));
this.digitalIDUser = user//JSON.stringify(user); this.digitalIDUser = user//JSON.stringify(user);
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png'; this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
@ -287,7 +289,7 @@ export class AppComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
async openBusinessCard() { async openBusinessCard() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info')); // this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo); console.log(this.userInfo);
//this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false); //this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false);
const modal = await this.modalController.create({ const modal = await this.modalController.create({

@ -11,7 +11,7 @@
<ion-row> <ion-row>
<ion-col size='6'> <ion-col size='6'>
<ion-label> <ion-label>
<h1 class='font-text-style' style="font-size: 25px !important; width: 400px;">{{userInfo.name_en}}</h1> <h1 class='font-text-style' style="font-size: 20px !important; width: 200%;">{{userInfo.name_en}}</h1>
</ion-label> </ion-label>
</ion-col> </ion-col>
<ion-col size='6'> <ion-col size='6'>

@ -38,14 +38,17 @@
// CS // CS
.card-size{ .card-size{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
padding: 10px !important; // padding: 5% !important;
// padding-right: 0px !important;
padding-right: 0px !important; padding-right: 0px !important;
padding-left: 15% !important;
} }
.qr-style{ .qr-style{
left: 410px !important; left: 260% !important;
} }
.name-ar-style{ .name-ar-style{
left: 320px !important; left: 175% !important;
padding: 0%;
} }
// HMG // HMG
.logo-img-hmg-style{ .logo-img-hmg-style{
@ -60,14 +63,15 @@
// CS // CS
.card-size{ .card-size{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
padding: 10px !important; padding: 6% !important;
padding-right: 0px !important; padding-right: 2% !important;
} }
.qr-style{ .qr-style{
left: 324px !important; width: 80%;
left: 220% !important;
} }
.name-ar-style{ .name-ar-style{
left: 230px !important; left: 140% !important;
} }
// HMG // HMG
@ -83,14 +87,14 @@
// CS // CS
.card-size{ .card-size{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
padding: 5px !important; padding: 6% !important;
padding-right: 0px !important; padding-right: 0px !important;
} }
.qr-style{ .qr-style{
left: 400px !important; left: 280% !important;
} }
.name-ar-style{ .name-ar-style{
left: 310px !important; left: 205%!important;
} }
// HMG // HMG
.logo-img-hmg-style{ .logo-img-hmg-style{
@ -125,14 +129,14 @@
@media screen and (min-width: 325px) and (max-width:399px) and (max-height: 699px){ @media screen and (min-width: 325px) and (max-width:399px) and (max-height: 699px){
.card-size{ .card-size{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
padding: 5px !important; padding: 6% !important;
padding-right: 0px !important; padding-right: 0% !important;
} }
.qr-style{ .qr-style{
left: 280px !important; left: 200% !important;
} }
.name-ar-style{ .name-ar-style{
left: 190px !important; left: 116% !important;
} }
// HMG // HMG
.logo-img-hmg-style{ .logo-img-hmg-style{
@ -146,26 +150,26 @@
.card-size{ .card-size{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
position: relative; position: relative;
bottom: 30px; bottom: 3%;
left: 26px; left: 8%;
} }
.qr-style{ .qr-style{
width: 80px !important; width: 70% !important;
margin-top: 50px !important; margin-top: 30% !important;
position: relative !important; position: relative !important;
left: 265px !important; left: 200% !important;
} }
.name-ar-style{ .name-ar-style{
font-size: 15px !important; font-size: 15px !important;
position: relative !important; position: relative !important;
left: 130px !important; left: 115% !important;
text-align: end !important; text-align: end !important;
padding: 10px !important; padding: 1% !important;
width: 225px !important; width: 170% !important;
} }
.logo-img-style{ .logo-img-style{
width: 80px !important; width: 60% !important;
margin-top: 50px !important; margin-top: 35% !important;
} }
// HMG // HMG
@ -193,23 +197,24 @@
.card-size{ .card-size{
transform: rotate(90deg); transform: rotate(90deg);
padding: 6%;
} }
.qr-style{ .qr-style{
width: 130px; width: 70%;
margin-top: 0px; margin-top: 0px;
position: relative; position: relative;
left: 410px; left: 200%;
} }
.name-ar-style{ .name-ar-style{
font-size: 25px; font-size: 20px;
position: relative; position: relative;
left: 314px; left: 120%;
text-align: end; text-align: end;
padding: 10px; padding: 1%;
width: 225px; width: 145%;
} }
.logo-img-style{ .logo-img-style{
width: 120px; width: 70%;
} }
.logo-img-hmg-style{ .logo-img-hmg-style{

@ -10,7 +10,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
}) })
export class BusinessCardComponent implements OnInit { export class BusinessCardComponent implements OnInit {
@Input() userInfo: any; public userInfo: any;
public userJobName: any; public userJobName: any;
constructor( constructor(
public modalCtrl: ModalController, public modalCtrl: ModalController,
@ -19,6 +19,7 @@ export class BusinessCardComponent implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo); console.log(this.userInfo);
} }

@ -475,11 +475,12 @@ export class ConfirmLoginComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
checkAccess(el: any, isDigitalID = false, buttonType?) { checkAccess(el: any, isDigitalID = false, buttonType?, isBusinessID = false,) {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
if (isDigitalID) { if (isDigitalID || isBusinessID) {
const sourceType = isDigitalID === true ? 'digitalID' : 'businessID';
this.button(); this.button();
this.checkButtonType(buttonType); this.checkButtonType(buttonType, sourceType);
} }
else { else {
console.log(data); console.log(data);
@ -497,7 +498,7 @@ export class ConfirmLoginComponent implements OnInit {
} }
} }
checkButtonType(typeNumber) { checkButtonType(typeNumber, sourceType) {
let buttonSelected; let buttonSelected;
this.buttons.forEach(element => { this.buttons.forEach(element => {
element.forEach(elementValue => { element.forEach(elementValue => {
@ -508,7 +509,11 @@ export class ConfirmLoginComponent implements OnInit {
} }
}); });
}); });
this.sharedData.setSharedData(true, "loginWithDigitalIDButton"); if (sourceType === 'digitalID') {
this.sharedData.setSharedData(true, "loginWithDigitalIDButton");
} else {
this.sharedData.setSharedData(true, "loginWithBusinessIDButton");
}
this.loginType = buttonSelected; this.loginType = buttonSelected;
this.checkAppUpdated(); this.checkAppUpdated();
} }

@ -215,8 +215,6 @@ export class SmsPageComponent implements OnInit {
// Wifi Credientials // Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
console.log('ENAD');
console.log(JSON.stringify(this.businessInfo));
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo)); localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info'); // this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');

@ -34,7 +34,7 @@ export class AttendScanService {
userData: any = {}; userData: any = {};
public isFakeLocationUsed = false; public isFakeLocationUsed = false;
public isGpsRequired = false; public isGpsRequired = false;
public collection = 'HMG'; public collection = 'CS';
constructor(private device: Device, constructor(private device: Device,
private zbar: ZBar, private zbar: ZBar,

@ -142,8 +142,8 @@ export class AuthenticationService {
} else { } else {
mobileType = 'android'; mobileType = 'android';
} }
request.VersionID = 3.1; request.VersionID = 3.2;
request.Channel = 33; request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType; request.MobileType = mobileType;
@ -218,7 +218,7 @@ export class AuthenticationService {
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> { public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request); this.setPublicFields(request);
request.P_APP_VERSION = "HMG"; request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel); return this.con.post(AuthenticationService.login, request, onError, errorLabel);
} }
@ -475,7 +475,7 @@ export class AuthenticationService {
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> { : Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request); this.setPublicFields(request);
request.P_APP_VERSION = "HMG"; request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
} }

@ -1,4 +1,4 @@
<ion-content has-bouncing="false" forceOverscroll="false" class="ion-no-padding"> <ion-content has-bouncing="false" class="ion-no-padding" >
<ion-grid padding> <ion-grid padding>
<!-- <ion-row> <!-- <ion-row>
<ion-col [size]="12"> <ion-col [size]="12">
@ -58,8 +58,8 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col style="padding-bottom: 100px !important;">
<ion-button *ngIf="userBusiness?.show_business" class="button-digital-id" (click)="openBusinessCard()"> <ion-button *ngIf="showBusinessCard" class="button-digital-id" (click)="loginWithBusinessCard()" >
<p style="color: black;">{{ts.trPK('general','business-card')}}</p> <p style="color: black;">{{ts.trPK('general','business-card')}}</p>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png"> <img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button> </ion-button>

@ -17,7 +17,6 @@ import { ButtonSettings } from '../button/models/button-settingsl';
import { Events, ModalController } from '@ionic/angular'; import { Events, ModalController } from '@ionic/angular';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component"; import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component";
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({ @Component({
selector: "welcome-login", selector: "welcome-login",
@ -76,6 +75,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
user_name: string; user_name: string;
userInfo: any; userInfo: any;
userBusiness: any; userBusiness: any;
showBusinessCard = false;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -94,7 +94,13 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
false false
); );
console.log( "this.user in welcome login"+ this.user); console.log( "this.user in welcome login"+ JSON.stringify(this.user));
if (this.user && this.user.BusinessCardPrivilege) {
this.showBusinessCard = true
} else {
this.showBusinessCard = false;
}
this.userName = localStorage.getItem("user"); this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password");
@ -104,6 +110,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.lastLoginDate= localStorage.getItem("login-at"); this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info')); this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('userBusiness' + this.userBusiness);
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false); // this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -229,7 +236,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
} }
loginWithDigitalID(){ loginWithDigitalID(){
this.confimLogin.checkAccess(this.logintype, true, this.logintype); this.confimLogin.checkAccess(this.logintype, true, this.logintype, false);
}
loginWithBusinessCard() {
this.confimLogin.checkAccess(this.logintype, false, this.logintype, true);
} }
@ -254,16 +265,4 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
return await modal.present(); return await modal.present();
} }
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.userBusiness
}
});
return await modal.present();
}
} }

@ -40,6 +40,7 @@ import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'
import { NFC, Ndef } from "@ionic-native/nfc/ngx" import { NFC, Ndef } from "@ionic-native/nfc/ngx"
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component'; import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -167,6 +168,7 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true); let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
let openBusinessCard = this.sharedData.getSharedData("loginWithBusinessIDButton", true);
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header'); this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule'); this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');
@ -175,9 +177,11 @@ export class HomePage implements OnInit {
this.events.subscribe('getNotCount', badge => { this.events.subscribe('getNotCount', badge => {
this.notBadge = badge; this.notBadge = badge;
}); });
if (openDigitalIDCard === true) { if (openDigitalIDCard) {
console.log("DONE"); console.log("DONE");
this.openDigitalId(); this.openDigitalId();
} else if (openBusinessCard) {
this.openBusinessCard();
} }
} }
@ -787,6 +791,16 @@ export class HomePage implements OnInit {
}); });
return await modal.present(); return await modal.present();
} }
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css'
});
return await modal.present();
}
itemForSale() { itemForSale() {
this.common.navigateForward('/itemforsale/items'); this.common.navigateForward('/itemforsale/items');
} }

@ -91,9 +91,9 @@ export class HomeComponent implements OnInit {
data: [0, 0, 0, 0, 0, 0], data: [0, 0, 0, 0, 0, 0],
backgroundColor: [ backgroundColor: [
'#18a169', '#18a169',
'#38c9b3',
'#114475',
'#3cb9d5', '#3cb9d5',
'#114475',
'#38c9b3',
'#cc3232', '#cc3232',
'#9e7e97' '#9e7e97'
], ],
@ -119,10 +119,10 @@ export class HomeComponent implements OnInit {
}, },
{ {
value: 0, value: 0,
name: 'PO', name: 'MR',
active: false, active: false,
color: '#38c9b3', color: '#3cb9d5',
key: 'POAPPRV', key: 'INVMOA',
disable: false disable: false
}, },
{ {
@ -135,10 +135,10 @@ export class HomeComponent implements OnInit {
}, },
{ {
value: 0, value: 0,
name: 'MR', name: 'PO',
active: false, active: false,
color: '#3cb9d5', color: '#38c9b3',
key: 'INVMOA', key: 'POAPPRV',
disable: false disable: false
}, },
{ {
@ -158,6 +158,7 @@ export class HomeComponent implements OnInit {
disable: false disable: false
} }
]; ];
public slideOptsOne = { public slideOptsOne = {
slidesPerView: 4.3, slidesPerView: 4.3,
spaceBetween: 10 spaceBetween: 10
@ -236,9 +237,9 @@ export class HomeComponent implements OnInit {
this.ngZone.run(() => { this.ngZone.run(() => {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.filters[1].value = this.totalHR; this.filters[1].value = this.totalHR;
this.filters[2].value = this.totalPO; this.filters[2].value = this.totalMR;
this.filters[3].value = this.totalPR; this.filters[3].value = this.totalPR;
this.filters[4].value = this.totalMR; this.filters[4].value = this.totalPO;
this.filters[6].value = this.totalIC; this.filters[6].value = this.totalIC;
}); });
@ -269,14 +270,14 @@ export class HomeComponent implements OnInit {
if (notification.ITEM_TYPE === 'HRSSA') { if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = this.totalHR; this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') { } else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[2].value = this.totalPO; this.filters[2].value = this.totalMR;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') { } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = this.totalPR; this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') { } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[4].value = this.totalMR; this.filters[4].value = this.totalPO;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVITEM') { } else if (notification.ITEM_TYPE === 'INVITEM') {
this.filters[6].value = this.totalIC; this.filters[6].value = this.totalIC;

@ -29,6 +29,8 @@ export class WorklistMainService {
public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY";
public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY"; public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY"; public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY";
public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY";
public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY"; public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY"; public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS"; public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
@ -107,7 +109,7 @@ export class WorklistMainService {
); );
} }
public getICNotificationBody( public getBasicDetailNotificationBody(
WorkListBodyRequest: any, WorkListBodyRequest: any,
onError?: any, onError?: any,
errorLabel?: string errorLabel?: string
@ -115,7 +117,22 @@ export class WorklistMainService {
const request = WorkListBodyRequest; const request = WorkListBodyRequest;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.api.post( return this.api.post(
WorklistMainService.getICNotificationBody, WorklistMainService.getBasicDetailNotificationBody,
request,
onError,
errorLabel
);
}
public getAddressNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getAddressNotificationBody,
request, request,
onError, onError,
errorLabel errorLabel
@ -169,6 +186,21 @@ export class WorklistMainService {
); );
} }
public getICNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getICNotificationBody,
request,
onError,
errorLabel
);
}
public getQutationAnalysis( public getQutationAnalysis(
qutationAnalysis: any, qutationAnalysis: any,
onError?: any, onError?: any,

@ -100,8 +100,30 @@
<ion-item lines="none" class="search-box" *ngIf='!isFilter && !userSelected'> <ion-item lines="none" class="search-box" *ngIf='!isFilter && !userSelected'>
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'ltr'? 'filterInput':'filterInput-ar'" <!-- <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'ltr'? 'filterInput':'filterInput-ar'"
[(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> [(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> -->
<!-- <ion-input class='replacmentSearchBar'
style="height: 45px; border: 1px solid lightgray; border-radius: 50px; width: 350px;"
[(ngModel)]="searchKey"
[placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-button (click)='onChangeInput()' style="--background: transparent; background: transparent; color: black"><ion-icon name="search"></ion-icon></ion-button>
</ion-input> -->
<ion-grid>
<ion-row style="height: 45px; border: 1px solid lightgray; border-radius: 50px;">
<ion-col size='9'>
<ion-input class='replacmentSearchBar' style="height: 35px;"
[(ngModel)]="searchKey" [placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-icon style="width: 50px; height: 21px;" name="search"></ion-icon>
</ion-input>
</ion-col>
<ion-col size='3'>
<button [disabled]='searchKey == undefined || 1 > searchKey.length' (click)='onChangeInput()'
style="--background: white; background: transparent; margin-top: 4px; --background-hover: transparent !important;">
<ion-label><p style="color: #269db8;">{{"general, search" | translate}}</p></ion-label>
</button>
</ion-col>
</ion-row>
</ion-grid>
</ion-item> </ion-item>

@ -100,6 +100,12 @@ export class WorkListReplacementItgComponent implements OnInit {
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
break; break;
} }
case '5': {
this.P_SEARCH_EMAIL_ADDRESS = "";
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.searchKey;
break;
}
default: { default: {
this.P_SEARCH_USER_NAME = ""; this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
@ -211,12 +217,13 @@ export class WorkListReplacementItgComponent implements OnInit {
} }
onChangeInput() { onChangeInput() {
this.ReplacementList = []; this.ReplacementList = [];
clearTimeout(this.typingTimer); this.SearchReplacementList();
this.typingTimer = setTimeout(() => { // clearTimeout(this.typingTimer);
if (this.searchKey.length > 2) { // this.typingTimer = setTimeout(() => {
this.SearchReplacementList(); // if (this.searchKey.length > 2) {
} // this.SearchReplacementList();
}, 3000); // }
// }, 3000);
} }
select(selectEmp, index) { select(selectEmp, index) {
this.selEmp = selectEmp this.selEmp = selectEmp
@ -268,7 +275,7 @@ export class WorkListReplacementItgComponent implements OnInit {
"IsFavorite": selEmp.IsFavorite "IsFavorite": selEmp.IsFavorite
} }
]; ];
this.saveUserFavruiteList(request); this.saveUserFavruiteList(request, selEmp.IsFavorite);
}, () => { }, () => {
}); });
} else { } else {
@ -283,16 +290,21 @@ export class WorkListReplacementItgComponent implements OnInit {
"IsFavorite": false "IsFavorite": false
} }
]; ];
this.saveUserFavruiteList(request); this.saveUserFavruiteList(request, false);
} }
} }
saveUserFavruiteList(request) { saveUserFavruiteList(request, isFav: boolean) {
this.worklistService.saveFavoriteList(request, () => { this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => { }).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.cs.toastPK("replacementRoll", "favorite-saved"); if (isFav) {
this.cs.greenToastPK("replacementRoll", "favorite-saved");
} else {
this.cs.redToastPK("replacementRoll", "favorite-unsaved");
}
this.getFavruite();
} }
}) });
} }
getFavruite() { getFavruite() {
this.cs.startLoading(); this.cs.startLoading();

@ -60,10 +60,21 @@
<div style="padding: 5px;" *ngIf="!isFilter"> <div style="padding: 5px;" *ngIf="!isFilter">
<!-- <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> --> <!-- <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> -->
<ion-input class='replacmentSearchBar' (ionInput)="onChangeInput()" style="height: 45px; --padding-start: 20px;" <ion-grid>
class="searchbar-input sc-ion-searchbar-md" [(ngModel)]="inputSearch" <ion-row style="height: 45px; border: 1px solid lightgray; border-radius: 50px;">
[placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true"></ion-input> <ion-col size='9'>
<ion-input class='replacmentSearchBar' style="height: 35px;"
[(ngModel)]="inputSearch" [placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-icon style="width: 50px; height: 21px;" name="search"></ion-icon>
</ion-input>
</ion-col>
<ion-col size='3'>
<button [disabled]='inputSearch == undefined || inputSearch.length < 1' (click)='onChangeInput()' style="--background: white;background: transparent;--background-hover: transparent !important; margin-top: 4px;">
<ion-label><p style="color: #269db8;">{{"general, search" | translate}}</p></ion-label>
</button>
</ion-col>
</ion-row>
</ion-grid>
</div> </div>
<div *ngIf="isFilter"> <div *ngIf="isFilter">
@ -156,12 +167,12 @@
</p> </p>
</ion-label> </ion-label>
</div> </div>
<div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected" class="uk-margin"> <div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected && searchBy !== '1' && searchBy !== '4'" class="uk-margin">
{{'replacementRoll, search-result' | translate}} {{'replacementRoll, search-result' | translate}}
</div> </div>
<br /> <br />
<ion-item [hidden]="isAnswer==true" lines="none" *ngIf="!userSelected"> <ion-item [hidden]="isAnswer==true" lines="none" *ngIf="ReplacementList.length>0 && !userSelected && searchBy !== '1' && searchBy !== '4'">
<div class="square-container"> <div class="square-container">

@ -340,17 +340,17 @@ export class WorkListReplacementRollComponent implements OnInit {
this.messageSuccess = true; this.messageSuccess = true;
setTimeout(() => { // setTimeout(() => {
this.messageSuccess = false; this.messageSuccess = false;
//this.modalCtrl.dismiss(succ); //this.modalCtrl.dismiss(succ);
this.modalCtrl.dismiss({ this.modalCtrl.dismiss({
'dismissed': true, 'dismissed': true,
data: "Success" data: "Success"
}); });
if (this.selEmp && this.isAnswer == false) { // if (this.selEmp && this.isAnswer == false) {
this.setFavorite(this.selEmp); // this.setFavorite(this.selEmp);
} // }
}, 5000); // }, 5000);
this.cs.openNotificationPage(); this.cs.openNotificationPage();
// this.messageSuccess = true; // this.messageSuccess = true;
@ -433,6 +433,7 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
selectedType; selectedType;
counter=0;
onChangeSelect(select) { onChangeSelect(select) {
let selectValue = select.detail.value; let selectValue = select.detail.value;
@ -441,9 +442,20 @@ export class WorkListReplacementRollComponent implements OnInit {
this.isFilter = true; this.isFilter = true;
this.selectedType = 1; this.selectedType = 1;
this.listOfRealted = this.actionHistory; this.listOfRealted = this.actionHistory;
if(this.counter > 0)
{
this.actionHistory.forEach((obj, i) => {
if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) {
this.actionHistory[i].IsFavorite = true;
}else{
this.actionHistory[i].IsFavorite = false;
}
});
}
this.counter = 1;
} else if (selectValue === '4') { } else if (selectValue === '4') {
// if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) { // if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
this.getFavruite(); this.getFavruite();
// } // }
this.isFilter = true; this.isFilter = true;
this.selectedType = 4; this.selectedType = 4;
@ -461,11 +473,11 @@ export class WorkListReplacementRollComponent implements OnInit {
onChangeInput() { onChangeInput() {
this.ReplacementList = []; this.ReplacementList = [];
clearTimeout(this.typingTimer); clearTimeout(this.typingTimer);
this.typingTimer = setTimeout(() => { // this.typingTimer = setTimeout(() => {
if (this.inputSearch.length > 2) { // if (this.inputSearch.length > 2) {
this.getreplacmentemployee(); this.getreplacmentemployee();
} // }
}, 3000); // }, 3000);
// if (this.inputSearch.length > 0) { // if (this.inputSearch.length > 0) {
@ -509,12 +521,12 @@ export class WorkListReplacementRollComponent implements OnInit {
this.worklistService.saveFavoriteList(request, () => { this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => { }).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if(isFav){ if (isFav) {
this.cs.toastPK("replacementRoll", "favorite-saved"); this.cs.greenToastPK("replacementRoll", "favorite-saved");
} else{ } else {
this.cs.toastPK("replacementRoll", "favorite-unsaved"); this.cs.redToastPK("replacementRoll", "favorite-unsaved");
} }
this.getFavruite();
} }
}) })
} }

@ -542,7 +542,7 @@
for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}} for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}}
</label> </label>
<br /> <br />
<label for="">{{header.TOT_PO_AMT}} </label> <label for="">{{header.LOC_CUR_TOT_PO_AMT}} </label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>

@ -46,7 +46,9 @@
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <!-- NOT ADDRESS & BASIC_DETAILS -->
<ion-col
*ngIf="getPassNotificationDetails?.REQUEST_TYPE != 'ADDRESS' && getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' ">
<div *ngIf="notificationBodyRes?.length > 0 "> <div *ngIf="notificationBodyRes?.length > 0 ">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; " <ion-card *ngFor="let item of notificationBodyRes;let i=index; "
style="width: 91%;"> style="width: 91%;">
@ -117,6 +119,45 @@
</ion-grid> </ion-grid>
</ion-item> </ion-item>
</ion-col> </ion-col>
<!-- IF BASIC_DETAILS -->
<ion-col *ngIf="getPassNotificationDetails?.REQUEST_TYPE == 'BASIC_DETAILS' ||
getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS'">
<div *ngIf='notificationBodyRes.length > 0'>
<ion-card style="width: 91%;">
<ion-card-content>
<div>
<ion-row>
<ion-col class="rowBorder" style="background: #269db8;">
<ion-label>
<p style="color: white;">Current</p>
</ion-label>
</ion-col>
<ion-col class="rowBorder" style="background: #269db8;">
<ion-label>
<p style="color: white;">Proposed</p>
</ion-label>
</ion-col>
</ion-row>
<ion-row *ngFor="let item of notificationBodyRes;let i=index;">
<ion-col class="rowBorder" size="6"
[hidden]="item.UPDATED_FLAG == 'N'">
<label class="colItemReq">{{item.SEGMENT_PROMPT}}</label>
<br />
<label>{{item.PREV_SEGMENT_VALUE_DSP}}</label>
</ion-col>
<ion-col class="rowBorder" size="6"
[hidden]="item.UPDATED_FLAG == 'N'">
<label class="colItemReq">{{item.SEGMENT_PROMPT}}</label>
<br />
<label>{{item.SEGMENT_VALUE_DSP}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@ -304,7 +345,7 @@
<ion-slide> <ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'"> <ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent action-history" style="width: 100%;"> <ion-card class="cardContent action-history" style="width: 100%;">
<ion-card-content> <ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0"> <div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
@ -345,7 +386,8 @@
</div> </div>
<button class="showMore" <button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible"> (click)="actionHistory.visible = !actionHistory.visible">
{{actionHistory.visible ? 'Show less': 'Show More' }}</button> {{actionHistory.visible ? 'Show less': 'Show More'
}}</button>
</div> </div>
</div> </div>
<ion-label <ion-label

@ -273,9 +273,28 @@ export class WorklistMainComponent implements OnInit {
this.getMONotificationDetails(this.WorkListBodyObj); this.getMONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") {
this.getPRNotificationDetails(this.WorkListBodyObj); this.getPRNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'ADDRESS') {
this.getAddressNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'BASIC_DETAILS') {
this.getBasicDetailsNotification(this.WorkListBodyObj)
} }
} }
getBasicDetailsNotification(notificationBodyObj) {
this.worklistMainService
.getBasicDetailNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "BASIC_DETAILS");
});
}
getAddressNotification(notificationBodyObj) {
this.worklistMainService
.getAddressNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "ADDRESS");
});
}
getPRNotificationDetails(notificationBodyObj) { getPRNotificationDetails(notificationBodyObj) {
this.worklistMainService this.worklistMainService
.getPRNotificationBody(notificationBodyObj) .getPRNotificationBody(notificationBodyObj)
@ -343,11 +362,23 @@ export class WorklistMainComponent implements OnInit {
this.getSubordinatesleave(obj) this.getSubordinatesleave(obj)
} }
} else if (Type == "PR") { } else if (Type === "PR") {
if (result.GetAbsenceCollectionNotificationBodyList) { if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes = this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList; result.GetAbsenceCollectionNotificationBodyList;
} }
} else if (Type === "ADDRESS"){
if (result.GetAddressNotificationBodyList) {
this.notificationBodyRes =
result.GetAddressNotificationBodyList;
console.log(result);
}
} else if (Type === "BASIC_DETAILS"){
if (result.GetBasicDetNtfBodyList) {
this.notificationBodyRes =
result.GetBasicDetNtfBodyList;
console.log(result);
}
} }
} }
} //End handleWorkListBodyResult } //End handleWorkListBodyResult

@ -2202,11 +2202,11 @@
"ar": "أدخل ملاحظة" "ar": "أدخل ملاحظة"
}, },
"favorite-saved": { "favorite-saved": {
"en": "Your Favorite saved successfully", "en": "Your Favorite has been saved successfully",
"ar": "تم حفظ مفضلتك بنجاح" "ar": "تم حفظ مفضلتك بنجاح"
}, },
"favorite-unsaved": { "favorite-unsaved": {
"en": "Your Favorite had been deleted successfully", "en": "Your Favorite has been deleted successfully",
"ar": "تم حفظ مفضلتك بنجاح" "ar": "تم حفظ مفضلتك بنجاح"
}, },
"msg": { "msg": {

@ -612,3 +612,10 @@ left: 66px;
font-size: 16px; font-size: 16px;
text-align: left; text-align: left;
} }
ion-input .replacmentSearchBar .native-input{
position: absolute !important;
}
ion-input .replacmentSearchBar .input-clear-icon{
display: none !important;
}
Loading…
Cancel
Save