notification added

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 6 years ago
parent 31af06d2c9
commit 3327ad4d29

@ -19,7 +19,7 @@
<ion-label>
{{ts.trPK('home','worklist')}}
<ion-badge item-end>{{notBadge}}</ion-badge>
<ion-badge slot="end" color="danger" class="main-badge">{{notBadge}}</ion-badge>
</ion-label>
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >

@ -14,3 +14,14 @@
.alert-tappable.sc-ion-alert-ios {
height: 50px;
}
.main-badge{
position: absolute;
right: 16px;
border-radius: 50% !important;
line-height: 2;
margin: auto;
top: 0;
bottom: 0;
height: 32px;
}

@ -96,7 +96,7 @@ export class CommonService {
public diagnostic: Diagnostic,
public callNumber: CallNumber,
public iab: InAppBrowser
) { }
) {}
public back() {
// this.nav.pop();
@ -171,7 +171,7 @@ export class CommonService {
public mobileNumber(number: string) {
return number.substr(1, number.length - 1);
}
public testFunction() { }
public testFunction() {}
public stopLoading() {
this.progressLoadingService.dismiss();
@ -223,7 +223,7 @@ export class CommonService {
public confirmNotAllowedDialog() {
this.openHome();
this.alertDialog(
() => { },
() => {},
this.ts.trPK("general", "ok"),
this.ts.trPK("general", "info"),
this.ts.trPK("general", "not-allowed")
@ -461,7 +461,7 @@ export class CommonService {
private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) {
const browser = window.open(url, "_blank", "location=no");
browser.addEventListener("loadstart", () => { });
browser.addEventListener("loadstart", () => {});
browser.addEventListener("loaderror", () => {
if (onFaild) {
@ -537,7 +537,7 @@ export class CommonService {
public openLocation(lat: number, lng: number) {
this.platform.ready().then(() => {
this.launchNavigation.navigate([lat, lng]).then(
() => { },
() => {},
err => {
// this.failedToOpenMap();
window.open("https://maps.google.com/?q=" + lat + "," + lng);
@ -737,7 +737,7 @@ export class CommonService {
return targetCode >= minDigit && targetCode <= maxDigit;
}
public enterPage() { }
public enterPage() {}
private smsAlertDialog = null;
public presentSMSPasswordDialog(
@ -769,7 +769,7 @@ export class CommonService {
text: this.ts.trPK("general", "cancel"),
role: "cancel",
cssClass: "cancel-button",
handler: () => { }
handler: () => {}
},
{
text: this.ts.trPK("general", "ok"),
@ -955,34 +955,40 @@ export class CommonService {
public openSubmitAbsencePage() {
this.nav.navigateForward(["/absence/submit-absence"]);
}
public openConfirmAbsece(){
public openConfirmAbsece() {
this.nav.navigateForward(["/absence/confirm-absence"]);
}
public openWorkListAttachViewPage() {
this.nav.navigateForward(["/notification/work-list-attach-view"]);
}
public openviewAbsenceAttachment(){
this.nav.navigateForward(["/absence/view-attachements"]);
}
public openNotificationPage() {
this.nav.navigateForward(["/notification/homepage"]);
}
public openWorklistMainPage() {
this.nav.navigateForward(["/notification/worklist-main"]);
}
public openWorklistReplacementRollPage() {
this.nav.navigateForward(["/notification/work-list-replacement-roll"]);
}
public openNotificationDetailsPage(){
this.nav.navigateForward(["/notification/work-list-details"]);
}
public openWorklistHistoryPage(){
this.nav.navigateForward(["/notification/work-list-action-history"]);
}
public openWorklistAttachPage(){
this.nav.navigateForward(["/notification/work-list-attach"]);
}
public openviewAbsenceAttachment() {
this.nav.navigateForward(["/absence/view-attachements"]);
}
public openNotificationPage() {
this.nav.navigateForward(["/notification/homepage"]);
}
public openWorklistMainPage() {
this.nav.navigateForward(["/notification/worklist-main"]);
}
public openWorklistReplacementRollPage() {
this.nav.navigateForward(["/notification/work-list-replacement-roll"]);
}
public openNotificationDetailsPage() {
this.nav.navigateForward(["/notification/work-list-details"]);
}
public openWorklistHistoryPage() {
this.nav.navigateForward(["/notification/work-list-action-history"]);
}
public openWorklistAttachPage() {
this.nav.navigateForward(["/notification/work-list-attach"]);
}
public openWorklistRFCPage() {
this.nav.navigateForward(["/notification/work-list-rfc"]);
}
public openWorklistRollReplacement() {
this.nav.navigateForward(["/notification/work-list-replacement-roll"]);
}
public reload(url: string, from: string) {
console.log("force reload called from:" + from);
// window.location.reload();
@ -1079,8 +1085,8 @@ public openWorklistAttachPage(){
if (this.isCordova()) {
this.callNumber
.callNumber(phoneNumber, true)
.then(res => { })
.catch(err => { });
.then(res => {})
.catch(err => {});
} else {
window.open("tel:" + phoneNumber);
// this.presentAlert(this.ts.trPK('error', 'call'));
@ -1161,5 +1167,4 @@ public openWorklistAttachPage(){
}
return FormatedDate;
}
}

@ -9,7 +9,7 @@
<div class="header-div">
<button ion-button icon-only menuToggle class="menubutton" (click)="openMenu()">
<ion-icon name="menu"></ion-icon>
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
<ion-badge id="homeBadgeBtn" slot="end" color="danger">{{notBadge}}</ion-badge>
</button>
<div class="centerDiv" (click)="openPersonalInfo()">
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{userData.EMPLOYEE_DISPLAY_NAME}}</p>

@ -1,4 +1,4 @@
import { EitService } from './../eit/services/eit.service';
import { EitService } from "./../eit/services/eit.service";
import { Component, OnInit } from "@angular/core";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController, Events } from "@ionic/angular";
@ -13,7 +13,7 @@ import { Device } from "@ionic-native/device/ngx";
import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request";
import { Response } from "src/app/hmg-common/services/models/response";
import { AttendanceService } from "./services/attendance.services";
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
import { LoginRequest } from "../hmg-common/services/authentication/models/login.request";
@Component({
selector: "app-home",
@ -26,6 +26,7 @@ export class HomePage implements OnInit {
menuList: any = [];
zbarOptions: any;
scannedResult: any;
notBadge: any;
lat: any;
longt: any;
deviceID: string;
@ -43,7 +44,6 @@ export class HomePage implements OnInit {
private eitService: EitService
) {}
ngOnInit() {
this.getUserDetails();
this.getMenu();
@ -58,8 +58,21 @@ export class HomePage implements OnInit {
.catch(error => {
console.log("Error getting location", error);
});
this.getCount();
}
getCount() {
const req: any = {};
this.menuService.getNotificationCount(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
this.notBadge =
result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
if (this.notBadge <= 0) {
this.notBadge = null;
}
this.events.publish("getNotCount", this.notBadge);
}
});
}
// ionViewDidLoad() {
// this.geolocation
// .getCurrentPosition()
@ -83,14 +96,17 @@ export class HomePage implements OnInit {
// }
ionViewDidLoad() {
this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude
// resp.coords.longitude
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
}).catch((error) => {
console.log('Error getting location', error);
});
this.geolocation
.getCurrentPosition()
.then(resp => {
// resp.coords.latitude
// resp.coords.longitude
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
})
.catch(error => {
console.log("Error getting location", error);
});
}
private openMenu() {
this.menu.toggle();
@ -150,29 +166,41 @@ export class HomePage implements OnInit {
let selEmpNo: string = null;
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999;
if (item.MENU_TYPE == 'S') {
if (item.MENU_TYPE == "S") {
request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(LoginRequest.SHARED_DATA, false);
selEmpNo = this.common.sharedService.getSharedData(
LoginRequest.SHARED_DATA,
false
);
}
nationality = this.common.sharedService.getSharedData(LoginRequest.NATIONALITY_CODE, false);
nationality = this.common.sharedService.getSharedData(
LoginRequest.NATIONALITY_CODE,
false
);
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
//set emp and resp id
this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP);
this.common.sharedService.setSharedData(request.P_SELECTED_RESP_ID, MenuResponse.SHARED_SEL_RESP_ID);
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
);
this.common.sharedService.setSharedData(
request.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
this.eitService.getMenuEntries(
request).
subscribe((result: MenuResponse) => {
this.eitService
.getMenuEntries(request)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
}
sortMenuEntires(list) {
let tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.sharedService.setSharedData(tree, "menuEntries");
// this.common.navigateForward("/eit/homepage");
this.common.openEITPage();
}
@ -199,7 +227,8 @@ export class HomePage implements OnInit {
}
scanCode() {
this.zbar.scan(this.zbarOptions)
this.zbar
.scan(this.zbarOptions)
.then(result => {
console.log(result); // Scanned code
let strResult = JSON.parse(result);
@ -222,8 +251,8 @@ export class HomePage implements OnInit {
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request");
console.log(JSON.stringify(request));
this.attendance_service.attendanceSwipeScanner(
request, () => {
this.attendance_service
.attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance");
})
.subscribe((result: Response) => {

@ -39,7 +39,7 @@
</ion-avatar>
<p class="boldTxt">{{subordinate.EMPLOYEE_NAME}}</p>
<p>{{subordinate.POSITION_NAME}}</p>
<ion-badge item-end class="badge">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge>
<ion-badge slot="end" class="badge">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge>
</ion-item>
</ion-list>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">

@ -18,16 +18,16 @@
<ion-grid class=" gridAH">
<ion-row class="rowAH titleH">
<ion-col col-4>
<ion-col size="4">
<label class="Header" for="">{{'actionHis, name' | translate}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label class="Header" for="">{{'actionHis, action' | translate}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label class="Header" for="">{{'actionHis, date' | translate}}</label>
</ion-col>
<ion-col col-2>
<ion-col size="2">
<label class="Header" for="">{{'actionHis, note' | translate}}</label>
</ion-col>
@ -36,16 +36,16 @@
<!-- <ion-col col-1>
<label for="">{{actionHistory.SEQUENCE}}</label>
</ion-col> -->
<ion-col col-4>
<ion-col size="4">
<label for="">{{actionHistory.NAME}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label for="">{{actionHistory.ACTION}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label for="">{{actionHistory.NOTIFICATION_DATE}}</label>
</ion-col>
<ion-col col-2 style="text-align: center">
<ion-col size="2" style="text-align: center">
<button (click)="openNoteDetail(actionHistory.NOTE)" style=" background: none;"
[hidden]="actionHistory.NOTE == '' || actionHistory.NOTE == null">
<img src="../assets/imgs/more.png">

@ -53,3 +53,10 @@ ion-label.label.label-md,
ion-label.label.label-ios {
margin: 0px;
}
.rowAH .col{
border: 1px solid #d9d9d9;
padding: 2px !important;
text-align: center;
font-size: 15px;
}
.ion-card-content{padding:0;}

@ -40,10 +40,10 @@ export class WorkListReplacementRollComponent implements OnInit {
constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode');
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo');
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr');
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion');
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
if (this.getPassActionMode == "ANSWER_INFO") {
this.isAnswer = true;
}

@ -1,4 +1,4 @@
import { Component, OnInit } from "@angular/core";
import { Component, OnInit, ElementRef } 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 { WorkListBodyRequest } from "../models/NotificationBodyReq";
@ -21,8 +21,10 @@ export class WorklistMainComponent implements OnInit {
private WorkListBodyObj: WorkListBodyRequest;
private WorkListButtonsObj: WorkListButtonRequest;
private WorkListActionObj: WorkListActionRequest;
public static PASS_NOTIFICATION_INFO="passNotificationInfo";
public static PASS_NOTIFICATION_INFO = "passNotificationInfo";
public static PASS_ACTION_MODE = "passActionMode";
getPassNotificationDetails: any;
public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999;
notificationBodyRes: any;
actionHistoryRes: any;
@ -44,7 +46,8 @@ export class WorklistMainComponent implements OnInit {
constructor(
public common: CommonService,
public ts: TranslatorService,
public worklistMainService: WorklistMainService
public worklistMainService: WorklistMainService,
public elementRef: ElementRef
) {}
ngOnInit() {
@ -150,16 +153,18 @@ export class WorklistMainComponent implements OnInit {
var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let key in responseAttrDic) {
// let obj: any = {};
// obj.ATTRIBUTE_NAME = key;
// if (typeof responseAttrDic[key] === "number") {
// obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key];
// } else if (isDate(responseAttrDic[key])) {
let obj: any = {};
obj.ATTRIBUTE_NAME = key;
if (typeof responseAttrDic[key] === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key];
}
// else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// } else {
// obj.ATTRIBUTE_TEXT_VALUE = responseAttrDic[key];
// }
// this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
else {
obj.ATTRIBUTE_TEXT_VALUE = responseAttrDic[key];
}
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
let repUserName = this.selEmployeeID;
if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
@ -190,6 +195,19 @@ export class WorklistMainComponent implements OnInit {
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.sharedService.setSharedData(
ButtonAction,
WorklistMainComponent.PASS_ACTION_MODE
);
this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
this.common.openWorklistRFCPage();
} else if (ButtonAction == "ANSWER_INFO") {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
@ -197,6 +215,20 @@ export class WorklistMainComponent implements OnInit {
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.sharedService.setSharedData(
ButtonAction,
WorklistMainComponent.PASS_ACTION_MODE
);
this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
this.common.openWorklistRollReplacement();
} else if (
ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" ||
@ -210,6 +242,19 @@ export class WorklistMainComponent implements OnInit {
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.sharedService.setSharedData(
ButtonAction,
WorklistMainComponent.PASS_ACTION_MODE
);
this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
this.common.openWorklistRollReplacement();
} else if (
ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION"
@ -237,30 +282,32 @@ export class WorklistMainComponent implements OnInit {
// dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// });
this.common.openConfirmAbsece();
}
}
// else if (this.notificationButtonRes.length > 0 && !ButtonAction) {
// (this.elementRef.nativeElement.querySelectorAll(
// "ion-item"
// ) as HTMLElement[]).forEach(x => {
// if (x.classList.contains("requiredItem")) {
// x.classList.add("ng-touched");
// x.classList.remove("ng-untouched");
// }
// });
// this.common.showAlert(
// this.translate.translate("worklistMain.actionRequird")
// );
// } else {
// this.navCtrl.pop();
// }
else if (this.notificationButtonRes.length > 0 && !ButtonAction) {
(this.elementRef.nativeElement.querySelectorAll(
"ion-item"
) as HTMLElement[]).forEach(x => {
if (x.classList.contains("requiredItem")) {
x.classList.add("ng-touched");
x.classList.remove("ng-untouched");
}
});
this.common.presentAlert(
this.ts.trPK("worklistMain","actionRequird")
);
}
}
openActionHistory() {
// this.navCtrl.push("WorkListActionHistoryPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.openWorklistHistoryPage();
}
@ -268,7 +315,10 @@ export class WorklistMainComponent implements OnInit {
// this.navCtrl.push("WorkListAttachPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
);
this.common.openWorklistAttachPage();
}
@ -309,7 +359,7 @@ export class WorklistMainComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" });
this.common.sharedService.setSharedData("EIT","NotBodyType");
this.common.sharedService.setSharedData("EIT", "NotBodyType");
this.common.openNotificationDetailsPage();
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData(
@ -320,7 +370,7 @@ export class WorklistMainComponent implements OnInit {
this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST
);
this.common.sharedService.setSharedData("ABSENCE","NotBodyType");
this.common.sharedService.setSharedData("ABSENCE", "NotBodyType");
//this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
this.common.openNotificationDetailsPage();
}

Loading…
Cancel
Save