fix update/continue notification + action name

MOHEMM-Q3-DEV-LATEST
ashwaq 6 years ago
parent 021e53da26
commit 18f54941ee

@ -27,6 +27,7 @@ import {ReplacementListComponent} from "../../vacation-rule/replacement-list/rep
import {ReplacmentResponse} from "../models/replacment-response"; import {ReplacmentResponse} from "../models/replacment-response";
import { AbsenceResponse } from '../models/absence.response'; import { AbsenceResponse } from '../models/absence.response';
import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component'; import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component';
import { AbsenceNotificatonBodyResponse } from 'src/app/notification/models/AbsenceNotificationBodyRes';
@Component({ @Component({
selector: "app-submit-absence", selector: "app-submit-absence",
templateUrl: "./submit-absence.component.html", templateUrl: "./submit-absence.component.html",
@ -88,6 +89,8 @@ export class SubmitAbsenceComponent implements OnInit {
) { ) {
////*new add*///// ////*new add*/////
/**********resubmit************ */ /**********resubmit************ */
this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
//this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); //this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
// this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage'); // this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage');
if (this.getPassdirfromNotifiPage) { if (this.getPassdirfromNotifiPage) {
@ -97,7 +100,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID; this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID;
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.respID = -999; this.respID = -999;
//this.submitAbsObjList = this.navParams.get('submitAbsObjList'); this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
} else { } else {
this.action = "CREATE"; this.action = "CREATE";
this.selEmp = this.common.sharedService.getSharedData( this.selEmp = this.common.sharedService.getSharedData(

@ -21,6 +21,8 @@ import { DatePicker } from "@ionic-native/date-picker/ngx";
import { EIT_ACTION } from "../models/submit.eit.action"; import { EIT_ACTION } from "../models/submit.eit.action";
import { AddEitResponse } from "../models/add.eit.response"; import { AddEitResponse } from "../models/add.eit.response";
import { element } from '@angular/core/src/render3'; import { element } from '@angular/core/src/render3';
// import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
@Component({ @Component({
selector: "app-add-eit", selector: "app-add-eit",
@ -87,6 +89,8 @@ export class AddEitComponent implements OnInit {
false false
); );
this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false); this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false);
console.log("addEITData: " + this.addEITData);
console.log("dirfromNotificationPage: " + this.addEITData.dirfromNotificationPage);
this.eitRequest = new EitRequest(); this.eitRequest = new EitRequest();
@ -94,7 +98,7 @@ export class AddEitComponent implements OnInit {
////*new add*///// ////*new add*/////
/**********resubmit************ */ /**********resubmit************ */
// this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING
this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage; this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage;
if (this.getPassdirfromNotifiPage) { if (this.getPassdirfromNotifiPage) {
this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME; this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME;
@ -1551,6 +1555,7 @@ export class AddEitComponent implements OnInit {
validateEITTransaction() { validateEITTransaction() {
// let EITTransactionValues:any= []; // let EITTransactionValues:any= [];
this.arrValues = this.getElementsValues(); this.arrValues = this.getElementsValues();
if (this.arrValues) { if (this.arrValues) {
this.eitRequest = { this.eitRequest = {
@ -1582,7 +1587,8 @@ export class AddEitComponent implements OnInit {
data.eitRequest = this.eitRequest; data.eitRequest = this.eitRequest;
data.updated = this.updatedValues; data.updated = this.updatedValues;
// this.viewCtrl.dismiss(data); // this.viewCtrl.dismiss(data);
this.closemodal(); this.modalController.dismiss(data);
// this.closemodal();
} else { } else {
this.submitEit(); this.submitEit();
// this.navCtrl.push("ConfirmAddEitPage"); // this.navCtrl.push("ConfirmAddEitPage");

@ -76,11 +76,12 @@ export class ConfirmAddEitComponent implements OnInit {
this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false); this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false);
this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) { if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING **
// console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails);
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true); this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); // let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
this.itemKey = notification.ITEM_KEY;
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
this.pActionMode = "RESUBMIT"; this.pActionMode = "RESUBMIT";
this.menuType = "E"; this.menuType = "E";
this.respID = -999; this.respID = -999;

@ -121,7 +121,7 @@
<ion-icon name="create"></ion-icon> <ion-icon name="create"></ion-icon>
</button> --> </button> -->
<button ion-button icon-only (click)="removeAddedItem(i)"> <button ion-button icon-only (click)="removeAddedItem(i)">
<ion-icon name="trash"></ion-icon> <ion-icon class="imgSize" name="trash"></ion-icon>
</button> </button>
</ion-card-header> </ion-card-header>
@ -201,7 +201,7 @@
</ion-col> </ion-col>
</ion-row> --> </ion-row> -->
<ion-row class=""> <ion-row *ngIf="item.DISPLAY_FLAG != 'N' " class="">
<ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''"> <ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''">
<label style="color:#094875;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label> <label style="color:#094875;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label>
<br> <br>

@ -1,5 +1,5 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<nav-buttons></nav-buttons> <nav-buttons></nav-buttons>
<ion-title color="light">{{'eit, update-title' | translate}}</ion-title> <ion-title color="light">{{'eit, update-title' | translate}}</ion-title>
</ion-toolbar> </ion-toolbar>
@ -11,34 +11,51 @@
<ion-card *ngFor="let item of notificationBodyRes; let i=index "> <ion-card *ngFor="let item of notificationBodyRes; let i=index ">
<ion-card-header class="hrTitle"> <ion-card-header class="hrTitle">
<div class="hrTitle">{{'workListMain, notfDetails' | translate}} </div> <div class="hrTitle">{{'worklistMain, notfDetails' | translate}} </div>
<!-- <button ion-button icon-only *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)"> <!-- <button ion-button icon-only *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
<ion-icon name="create"></ion-icon> <ion-icon name="create"></ion-icon>
</button> --> </button> -->
<button ion-button *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)"> <div class="editIconDiv"><button ion-button *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
<img class="imgSize" src="../assets/imgs/edit.png"></button> <img class="imgSize" src="../assets/imgs/edit.png"></button>
</div>
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<div *ngFor="let notificationBody of item.Collection_Notification "> <ion-grid class="grids">
<div *ngFor="let notificationBody of item.Collection_Notification ">
<ion-row *ngIf=" notificationBody.DISPLAY_FLAG != 'N' "> <ion-row *ngIf=" notificationBody.DISPLAY_FLAG != 'N' ">
<ion-col class="colBold"> <ion-col class="colBold">
<label for="">{{notificationBody.SEGMENT_PROMPT}}</label> <label style="color:#094875;font-weight: bold;" class="label" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
</ion-col> <!-- </ion-col>
<ion-col> <ion-col class="colBold"> -->
<label for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label> <br>
<label class="label" style="color:black;" for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
<hr style="background-color: grey;height: 1px">
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
</ion-grid>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</div> </div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="resubmitEit()"> <ion-button class="addEitOkButton" color="customnavy" ion-button (click)="resubmitEit()">
{{ 'general, next' | translate }}</ion-button> {{ 'general, next' | translate }}</ion-button>
</div> </div>
</ion-footer> </ion-footer>

@ -0,0 +1,17 @@
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #22c6b3;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.editIconDiv{
right: 10px;
position: absolute;
top: 10px;
}

@ -25,8 +25,8 @@ export class EitUpdateListComponent implements OnInit {
private descFlex: string; private descFlex: string;
constructor(public cs: CommonService, public eitService: EitService, public modalController: ModalController) { constructor(public cs: CommonService, public eitService: EitService, public modalController: ModalController) {
this.notificationBodyRes = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, true); this.notificationBodyRes = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, false);
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);
this.itemKey = notification.ITEM_KEY; this.itemKey = notification.ITEM_KEY;
this.notificationId = notification.NOTIFICATION_ID; this.notificationId = notification.NOTIFICATION_ID;
this.functionName = notification.FUNCTION_NAME; this.functionName = notification.FUNCTION_NAME;
@ -35,7 +35,7 @@ export class EitUpdateListComponent implements OnInit {
this.fillEitTransactionTable(); this.fillEitTransactionTable();
} }
ngOnInit() { } ngOnInit() { console.log("ngOnInit");}
async updateEitNot(index) { async updateEitNot(index) {
let item = this.notificationBodyRes[index].Collection_Notification; let item = this.notificationBodyRes[index].Collection_Notification;
@ -46,10 +46,15 @@ export class EitUpdateListComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data: any) => { .then((data: any) => {
console.log("data" + data);
console.log("data" + data.data.updated);
console.log("data" + data.data.eitRequest.EITTransactionTBL);
if (data) { if (data) {
this.updatedData = this.updatedData ? this.updatedData.concat(data.updated) : data.updated; this.updatedData = this.updatedData ? this.updatedData.concat(data.data.updated) : data.data.updated;
this.notificationBodyRes[index].Collection_Notification = data.updated; this.notificationBodyRes[index].Collection_Notification = data.data.updated;
this.updateTransactionList(data.eitRequest.EITTransactionTBL); this.updateTransactionList(data.data.eitRequest.EITTransactionTBL);
} }
}); });

@ -1212,7 +1212,9 @@ public getMonthNameAr(value: number): string {
this.nav.navigateForward(["/profile/performanceevaluation"]); this.nav.navigateForward(["/profile/performanceevaluation"]);
} }
public eitUpdate() {
this.nav.navigateForward(["/eit/eit-update-list"]);
}
public navigatePage(path) { public navigatePage(path) {
this.nav.navigateForward([path]); this.nav.navigateForward([path]);
} }

@ -99,6 +99,7 @@ export class WorklistMainMRComponent implements OnInit {
approveDis: boolean = false; approveDis: boolean = false;
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
moreDisabled: boolean = true;
@ -264,15 +265,22 @@ export class WorklistMainMRComponent implements OnInit {
this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
console.log("test" + this.notificationButtonRes.length); console.log("test" + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) { for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") { if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
this.approveDis = true; this.approveDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED" ) {
this.rejectDis = true; this.rejectDis = true;
} else } else
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if(
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} // if result == null } // if result == null
@ -356,8 +364,8 @@ export class WorklistMainMRComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
if ( if (
ButtonAction == "APPROVE" || ButtonAction == "APPROVED" ||
ButtonAction == "REJECT" || ButtonAction == "REJECTED" ||
ButtonAction == "DEL" || ButtonAction == "DEL" ||
ButtonAction == "CLOSE" ButtonAction == "CLOSE"
) { ) {
@ -373,10 +381,10 @@ export class WorklistMainMRComponent implements OnInit {
); );
///////////////////////////////////////////// /////////////////////////////////////////////
if (ButtonAction == "APPROVE") { if (ButtonAction == "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
} }
else if (ButtonAction == "REJECT") { else if (ButtonAction == "REJECTED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
} }

@ -796,7 +796,7 @@
<ion-label>Skip</ion-label> <ion-label>Skip</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button (click)="openMoreActions()"> <ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png"> <img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label> <ion-label>More</ion-label>
</ion-tab-button> </ion-tab-button>

@ -115,6 +115,7 @@ export class WorklistMainPoComponent implements OnInit {
approveDis: boolean = false; approveDis: boolean = false;
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
moreDisabled: boolean = true;
constructor( constructor(
@ -305,6 +306,13 @@ export class WorklistMainPoComponent implements OnInit {
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} // valid it } // valid it

@ -508,7 +508,7 @@
<ion-label>Skip</ion-label> <ion-label>Skip</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button (click)="openMoreActions()"> <ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png"> <img src="../assets/imgs/action-more.png">
<ion-label>More</ion-label> <ion-label>More</ion-label>
</ion-tab-button> </ion-tab-button>

@ -100,6 +100,7 @@ export class WorklistMainPRComponent implements OnInit {
approveDis: boolean; approveDis: boolean;
rejectDis: boolean; rejectDis: boolean;
requestDis: boolean; requestDis: boolean;
moreDisabled: boolean = true;
constructor( constructor(
@ -307,6 +308,12 @@ export class WorklistMainPRComponent implements OnInit {
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else if (
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{
this.moreDisabled = false;
}
} // valid it } // valid it
} }
} // valid it } // valid it

@ -68,7 +68,7 @@
<div style="margin: 10px; " *ngIf="subordinatesleaveList != undefined">Employee will also on leave </div> <div style="margin: 10px; " *ngIf="subordinatesleaveList != undefined">Employee will also on leave </div>
<ion-item class="subOrdinateList" *ngFor="let List of subordinatesleaveList;"> <ion-item lines="none" class="subOrdinateList" *ngFor="let List of subordinatesleaveList;">

@ -185,6 +185,7 @@
--background: transparent; --background: transparent;
margin-left: -15px; margin-left: -15px;
margin-right: 6px; margin-right: 6px;
margin-bottom:8px;
} }
.status{ .status{
text-align: center; text-align: center;

@ -94,6 +94,7 @@ export class WorklistMainComponent implements OnInit {
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
moreDisabled: boolean = true; moreDisabled: boolean = true;
dirfromNotificationPage: boolean = false;
constructor( constructor(
public worklistService: WorklistService, public worklistService: WorklistService,
@ -310,7 +311,7 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
this.requestDis = true; this.requestDis = true;
} // if result == null } // if result == null
else ( else if(
this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO") this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO")
{ {
this.moreDisabled = false; this.moreDisabled = false;
@ -543,6 +544,8 @@ export class WorklistMainComponent implements OnInit {
EITNotificatonBodyResponse.NOT_WORKLIST EITNotificatonBodyResponse.NOT_WORKLIST
); );
// this.navCtrl.push("EitUpdateListPage"); // this.navCtrl.push("EitUpdateListPage");
this.common.eitUpdate();// must be test
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.notificationBodyRes, this.notificationBodyRes,
@ -556,7 +559,18 @@ export class WorklistMainComponent implements OnInit {
// dirfromNotificationPage: true, // dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// }); // });
this.common.openConfirmAbsece(); //this.common.openConfirmAbsece();
this.dirfromNotificationPage=true,
this.common.sharedService.setSharedData(
this.dirfromNotificationPage,
"dirfromNotificationPage"
);
this.common.sharedService.setSharedData(
this.notificationBodyRes[0].Collection_Notification,
"submitAbsObjList"
);
this.common.openSubmitAbsencePage();
} }
} }
else if (this.notificationButtonRes.length > 0 && !ButtonAction) { else if (this.notificationButtonRes.length > 0 && !ButtonAction) {

Loading…
Cancel
Save