worklist main page added

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 6 years ago
parent fe054b8ab6
commit faad878c87

@ -1,28 +1,29 @@
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',
data: { preload: true, delay: 1000 }
},
{ 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' },
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',
data: { preload: true, delay: 1000 }
},
{ 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' }
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule { }
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),
],
exports: [RouterModule]
})
export class AppRoutingModule { }

@ -6,7 +6,6 @@ import { AuthenticationService } from "./hmg-common/services/authentication/auth
import { AuthenticatedUser } from "./hmg-common/services/authentication/models/authenticated-user";
import { TabsBarComponent } from "./hmg-common/ui/tabs-bar/tabs-bar.component";
import { KeyboardService } from "./hmg-common/services/keyboard/keyboard.service";
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
@ -36,7 +35,7 @@ export class AppComponent implements OnInit, AfterViewInit {
private events: Events,
private keyboardService: KeyboardService,
private menu: MenuController,
private authService: AuthenticationService
private authService: AuthenticationService,
) {}
ngOnInit() {
this.initializeApp();

@ -12,6 +12,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from '@ionic-native/geolocation/ngx';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
@ -19,7 +20,7 @@ import { Geolocation } from '@ionic-native/geolocation/ngx';
BrowserModule,
BrowserAnimationsModule,
IonicModule.forRoot({
hardwareBackButton: true
hardwareBackButton: true,
}),
AppRoutingModule,
HmgCommonModule

@ -9,8 +9,8 @@ import { IonicModule } from '@ionic/angular';
import { NotificationPage } from './notification.page';
import { PipesModule } from '../pipes/pipes.module';
import { WorklistService } from './service/worklist.service';
// import { WorklistMainComponent } from './worklist-main/worklist-main.component';
import { WorklistMainComponent } from './worklist-main/worklist-main.component';
import { WorklistMainService } from './service/work-list.main.service';
const routes: Routes = [
{
@ -25,10 +25,10 @@ const routes: Routes = [
path: 'work-list-attach-view',
component: WorkListAttachViewComponent
},
// {
// path:'worklist-main',
// component:WorklistMainComponent
// }
{
path:'worklist-main',
component:WorklistMainComponent
}
]
}
];
@ -45,8 +45,8 @@ const routes: Routes = [
declarations: [
NotificationPage,
HomeComponent,
// WorklistMainComponent
WorklistMainComponent
],
providers:[WorklistService]
providers:[WorklistService,WorklistMainService]
})
export class NotificationPageModule {}

@ -110,19 +110,19 @@
<div>
<json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form>
<!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form> -->
</div>
<ion-item *ngIf="notificationButtonRes?.length >0" class="requiredItem">
<ion-label class="boldTxtNav">{{'worklistMain.action' | translate}} </ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="actionType" required >
<ion-option value= "{{notificationButtons.BUTTON_ACTION}}" *ngFor="let notificationButtons of notificationButtonRes; let i=index;">{{notificationButtons.BUTTON_LABEL}}</ion-option>
<ion-select-option value= "{{notificationButtons.BUTTON_ACTION}}" *ngFor="let notificationButtons of notificationButtonRes; let i=index;">{{notificationButtons.BUTTON_LABEL}}</ion-select-option>
</ion-select>
</ion-item>
</ion-content>
<ion-footer>
<div class="centerDiv" >
<button ion-button class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</button>
<ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</ion-button>
</div>
</ion-footer>

@ -1,28 +1,323 @@
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 {WorkListBodyRequest} from '../models/NotificationBodyReq';
import {EITNotificatonBodyResponse} from '../models/EITNotificationBodyRes';
import {AbsenceNotificatonBodyResponse} from '../models/AbsenceNotificationBodyRes';
import {NotificatonButtonResponse} from '../models/NotificationButtonRes';
import {WorkListActionRequest} from '../models/NotificationActionReq';
import { WorkListButtonRequest } from '../models/NotificationButtonReq';
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 { WorkListBodyRequest } from "../models/NotificationBodyReq";
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes";
import { NotificatonButtonResponse } from "../models/NotificationButtonRes";
import { WorkListActionRequest } from "../models/NotificationActionReq";
import { WorkListButtonRequest } from "../models/NotificationButtonReq";
// import { isDate } from 'angular6-json-schema-form';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request';
import { WorklistMainService } from '../service/work-list.main.service';
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { WorklistMainService } from "../service/work-list.main.service";
import { HomeComponent } from 'src/app/notification/home/home.component';
@Component({
selector: 'app-worklist-main',
templateUrl: './worklist-main.component.html',
styleUrls: ['./worklist-main.component.scss'],
selector: "app-worklist-main",
templateUrl: "./worklist-main.component.html",
styleUrls: ["./worklist-main.component.scss"]
})
export class WorklistMainComponent implements OnInit {
private WorkListBodyObj: WorkListBodyRequest;
private WorkListButtonsObj: WorkListButtonRequest;
private WorkListActionObj: WorkListActionRequest;
getPassNotificationDetails: any;
TransactionID: number = -999;
notificationBodyRes: any;
actionHistoryRes: any;
notificationButtonRes: any;
actionMode: any;
pInformation: string = "";
pQuestion: string = "";
RespondAttributesListRes: any;
schemaNotific: any;
NotRespondAttributeList: any;
Resp2_val: any;
notExampleJsonObject: any;
hideForwordEmployee: any;
exampleJsonObject: any;
dataOfAttr: any;
P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any;
actionType: string = "";
constructor(
public common: CommonService,
public ts: TranslatorService,
) { }
public worklistMainService: WorklistMainService
) {}
ngOnInit() {
this.getPassNotificationDetails = this.common.sharedService.getSharedData(HomeComponent.NOTIFICATION_DATA, false);
this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest();
this.WorkListActionObj = new WorkListActionRequest();
this.WorkListBodyObj.P_TRANSACTION_ID = this.TransactionID;
this.WorkListBodyObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = "";
this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.P_APPROVER_INDEX = null;
this.getNotificationButtons(this.WorkListButtonsObj);
this.getNotificationResAttr(this.WorkListButtonsObj);
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
this.getEITNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.getAbsenceNotificationDetails(this.WorkListBodyObj);
}
}
getEITNotificationDetails(notificationBodyObj) {
this.worklistMainService.getEITNotificationBody(
notificationBodyObj
).subscribe((result: EITNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "EIT");
});
}
getAbsenceNotificationDetails(notificationBodyObj) {
this.worklistMainService.getAbsencesNotificationBody(
notificationBodyObj
).subscribe((result: AbsenceNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "ABSENCE");
});
}
handleWorkListBodyResult(result, Type) {
this.notificationBodyRes = {};
if (this.common.validResponse(result)) {
this.pInformation = result.P_INFORMATION;
this.pQuestion = result.P_QUESTION;
if (Type == "EIT") {
if (result.GetEITCollectionNotificationBodyList) {
this.notificationBodyRes =
result.GetEITCollectionNotificationBodyList;
}
} else if (Type == "ABSENCE") {
if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList;
}
}
}
} //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) {
this.worklistMainService.getNotificationButtons(
notificationButtonsObj
).subscribe((result: NotificatonButtonResponse) => {
this.handleWorkListButtonsResult(result);
});
}
handleWorkListButtonsResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetNotificationButtonsList != null) {
this.notificationButtonRes = result.GetNotificationButtonsList;
} // if result == null
} // valid it
} // End handleWorkListButtonsResult
applyAction(WorkListActionObj) {
this.worklistMainService.actionButton(WorkListActionObj).subscribe(
(result: any) => {
this.handleApplayActionResult(result);
}
);
}
handleApplayActionResult(result) {
if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
}
} // valid it
}
actionButton() {
let ButtonAction: string = this.actionType;
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])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// } 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) {
let obj: any = {};
repUserName = "";
obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME;
obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
if (
ButtonAction == "APPROVED" ||
ButtonAction == "REJECTED" ||
ButtonAction == "DEL" ||
ButtonAction == "CLOSE"
) {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
this.applyAction(this.WorkListActionObj);
}
if (ButtonAction == "RFC") {
// alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
// this.navCtrl.push("WorkListRfcPage", {
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
} else if (ButtonAction == "ANSWER_INFO") {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
} else if (
ButtonAction == "DELEGATE" ||
ButtonAction == "REQUEST_INFO" ||
ButtonAction == "TRANSFER" ||
ButtonAction == "TRANSFER_INFO"
) {
// alert("multi option: "+ ButtonAction);
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
// this.navCtrl.push("WorkListReplacmentRollPage", {
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
} else if (
ButtonAction == "UPDATE_ACTION" ||
ButtonAction == "CONTINUE_ACTION"
) {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
this.common.sharedService.setSharedData(
this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA
);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
EITNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("EitUpdateListPage");
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData(
this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA
);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("SubmitAbsencePage", {
// dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// });
}
}
// 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();
// }
}
openActionHistory() {
// this.navCtrl.push("WorkListActionHistoryPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
}
openSupportDocuments() {
// this.navCtrl.push("WorkListAttachPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
}
getNotificationResAttr(notificationButtonsObj) {
this.worklistMainService.notificationResponseAttr(
notificationButtonsObj
).subscribe((result: NotificatonButtonResponse) => {
this.handleNotificationResAttrResult(result);
});
}
handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
this.NotRespondAttributeList =
result.NotificationGetRespondAttributesList;
if (
result.NotificationRespondRolesList != "" &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null &&
result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined
) {
this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME;
this.hideForwordEmployee = result.NotificationRespondRolesList[0];
}
ngOnInit() {}
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it
} // End handleWorkListButtonsResult
openNotificationBody() {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
this.common.sharedService.setSharedData(
this.notificationBodyRes,
EITNotificatonBodyResponse.SHARED_DATA
);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
EITNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" });
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData(
this.notificationBodyRes,
AbsenceNotificatonBodyResponse.SHARED_DATA
);
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST
);
//this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
}
}
}

@ -1477,5 +1477,71 @@
"en":"Search",
"ar":"بحث"
}
},
"worklistMain": {
"title":{
"en": "Details",
"ar":"التفاصيل"
},
"from": {
"en":"From:",
"ar":"من:"
},
"to":{
"en": "To:",
"ar":"إلى:"
},
"sent":{
"en":"Sent:",
"ar":"أرسلت:"
},
"empInfo": {
"en":"Employee Information",
"ar": "معلومات الموظف"
},
"info":{
"en": "Information",
"ar":"تفاصيل"
},
"notfDetails":{
"en": "Notification Details",
"ar":"تفاصيل العرض"
},
"actionHis": {
"en":"Action History",
"ar":"تاريخ الإجراء"
},
"suppDoc": {
"en":"Support Documents",
"ar":"المرفقات"
},
"closed":{
"en":"Closed:",
"ar":"أغلقت:"
},
"id":{
"en":"ID:",
"ar":"الرقم:"
},
"responder":{
"en":"Responder:",
"ar":"المرسل:"
},
"subject":{
"en":"Subject:",
"ar":"الموضوع:"
},
"rfc":{
"en":"Return for correction",
"ar":"عودة للتصحيح"
},
"action":{
"en":"Action",
"ar":"الحركة"
},
"actionRequird":{
"en":"Action is required",
"ar":"اختر حركة"
}
}
}

@ -744,6 +744,6 @@ color: var(--dark);
.progress-loading-page .loading-gif {
margin-top: 0.42cm;
width:100%;
margin-left: 0.4cm;
}
.centerDiv .button{width:200px;}
Loading…
Cancel
Save