|
|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
|