|
|
|
|
@ -112,9 +112,9 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
public isPostNoLoad = true;
|
|
|
|
|
public worklistNotifications: any;
|
|
|
|
|
public totalRequestCount = 0;
|
|
|
|
|
approve_label: any ="";
|
|
|
|
|
reject_label: any="";
|
|
|
|
|
reqInfo_label: any="";
|
|
|
|
|
approve_label: any = "";
|
|
|
|
|
reject_label: any = "";
|
|
|
|
|
reqInfo_label: any = "";
|
|
|
|
|
close_label: any;
|
|
|
|
|
closeDis: boolean = false;
|
|
|
|
|
selectedFilter: string;
|
|
|
|
|
@ -142,47 +142,39 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.WorkListAttachObj = new WorkListButtonRequest();
|
|
|
|
|
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
|
|
|
|
|
this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
|
|
|
|
|
this.intializeNotificationDetail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public segmentChanged(event: any) {
|
|
|
|
|
this.activeSegment = event.detail.value;
|
|
|
|
|
if(this.activeSegment === 'info')
|
|
|
|
|
{
|
|
|
|
|
this.slides.slideTo(0);
|
|
|
|
|
}
|
|
|
|
|
else if(this.activeSegment === 'item-req')
|
|
|
|
|
{
|
|
|
|
|
this.slides.slideTo(1);
|
|
|
|
|
}
|
|
|
|
|
else if(this.activeSegment === 'action-history')
|
|
|
|
|
{
|
|
|
|
|
this.slides.slideTo(2);
|
|
|
|
|
}
|
|
|
|
|
else if(this.activeSegment === 'attach')
|
|
|
|
|
{
|
|
|
|
|
this.slides.slideTo(3);
|
|
|
|
|
}
|
|
|
|
|
if (this.activeSegment === 'info') {
|
|
|
|
|
this.slides.slideTo(0);
|
|
|
|
|
}
|
|
|
|
|
else if (this.activeSegment === 'item-req') {
|
|
|
|
|
this.slides.slideTo(1);
|
|
|
|
|
}
|
|
|
|
|
else if (this.activeSegment === 'action-history') {
|
|
|
|
|
this.slides.slideTo(2);
|
|
|
|
|
}
|
|
|
|
|
else if (this.activeSegment === 'attach') {
|
|
|
|
|
this.slides.slideTo(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public slideChanged(event: any) {
|
|
|
|
|
this.slides.getActiveIndex().then(index => {
|
|
|
|
|
if(index === 0)
|
|
|
|
|
{
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
this.activeSegment = 'info';
|
|
|
|
|
}
|
|
|
|
|
else if(index === 1)
|
|
|
|
|
{
|
|
|
|
|
else if (index === 1) {
|
|
|
|
|
this.activeSegment = 'item-req';
|
|
|
|
|
}
|
|
|
|
|
else if(index === 2)
|
|
|
|
|
{
|
|
|
|
|
else if (index === 2) {
|
|
|
|
|
this.activeSegment = 'action-history';
|
|
|
|
|
}
|
|
|
|
|
else if(index === 3)
|
|
|
|
|
{
|
|
|
|
|
else if (index === 3) {
|
|
|
|
|
this.activeSegment = 'attach';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -316,7 +308,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getNotificationButtons(notificationButtonsObj) {
|
|
|
|
|
this.notificationButtonRes=[];
|
|
|
|
|
this.notificationButtonRes = [];
|
|
|
|
|
this.worklistMainService
|
|
|
|
|
.getNotificationButtons(notificationButtonsObj)
|
|
|
|
|
.subscribe((result: NotificatonButtonResponse) => {
|
|
|
|
|
@ -332,31 +324,30 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore');
|
|
|
|
|
// console.log('test' + this.notificationButtonRes.length);
|
|
|
|
|
for (let i = 0; i < this.notificationButtonRes.length; i++) {
|
|
|
|
|
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
|
|
|
|
|
this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
|
|
|
|
|
if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
|
|
|
|
|
this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
|
|
|
|
|
this.approveDis = true;
|
|
|
|
|
} else
|
|
|
|
|
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED" ) {
|
|
|
|
|
this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
|
|
|
|
|
this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
this.rejectDis = true;
|
|
|
|
|
} else
|
|
|
|
|
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
|
|
|
|
|
this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
|
|
|
|
|
this.requestDis = true;
|
|
|
|
|
} // if result == null
|
|
|
|
|
else if // if result == null
|
|
|
|
|
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
|
|
|
|
|
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
this.closeDis = true;
|
|
|
|
|
}
|
|
|
|
|
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 != "CLOSE")
|
|
|
|
|
{
|
|
|
|
|
this.moreDisabled = false;
|
|
|
|
|
(this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
|
|
|
|
|
this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
|
|
|
|
|
this.closeDis = true;
|
|
|
|
|
}
|
|
|
|
|
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 != "CLOSE") {
|
|
|
|
|
this.moreDisabled = false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // valid it
|
|
|
|
|
|
|
|
|
|
@ -413,10 +404,10 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
public nextNotfification() {
|
|
|
|
|
//let itemExist = false;
|
|
|
|
|
if( document.getElementById("notificationDynamicFieldsMR") != null){
|
|
|
|
|
if (document.getElementById("notificationDynamicFieldsMR") != null) {
|
|
|
|
|
document.getElementById("notificationDynamicFieldsMR").innerHTML = "";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let itemNo = this.getPassNotificationDetails.ROW_NUM;
|
|
|
|
|
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
|
|
|
|
|
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
|
|
|
|
|
@ -438,23 +429,23 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkRequestType(index){
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
|
|
|
|
|
checkRequestType(index) {
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
|
|
|
|
|
this.common.openWorklistMainPOPage();
|
|
|
|
|
} else
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
|
|
|
|
|
this.common.openWorklistMainPRPage();
|
|
|
|
|
} else
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
|
|
|
|
|
this.intializeNotificationDetail();
|
|
|
|
|
} else {
|
|
|
|
|
this.common.openWorklistMainPage();
|
|
|
|
|
}
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
|
|
|
|
|
this.common.openWorklistMainPRPage();
|
|
|
|
|
} else
|
|
|
|
|
if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
|
|
|
|
|
this.intializeNotificationDetail();
|
|
|
|
|
} else {
|
|
|
|
|
this.common.openWorklistMainPage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
actionButton(action) {
|
|
|
|
|
// console.log('actionButton' + action);
|
|
|
|
|
// alert("don't forget");
|
|
|
|
|
// alert("don't forget");
|
|
|
|
|
//let ButtonAction: string = this.actionType;
|
|
|
|
|
let ButtonAction: string = action;
|
|
|
|
|
var responseAttrDic = this.notExampleJsonObject;
|
|
|
|
|
@ -514,7 +505,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// this.openApplyModal(this.WorkListActionObj);
|
|
|
|
|
// this.openApplyModal(this.WorkListActionObj);
|
|
|
|
|
|
|
|
|
|
this.common.confirmAlertDialogAction(
|
|
|
|
|
() => {
|
|
|
|
|
@ -682,7 +673,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
getNotificationResAttr(notificationButtonsObj) {
|
|
|
|
|
// console.log("getNotificationResAttr");
|
|
|
|
|
this.NotRespondAttributeList=[];
|
|
|
|
|
this.NotRespondAttributeList = [];
|
|
|
|
|
this.worklistMainService
|
|
|
|
|
.notificationResponseAttr(notificationButtonsObj)
|
|
|
|
|
.subscribe((result: NotificatonButtonResponse) => {
|
|
|
|
|
@ -779,7 +770,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAttachmentNotification(WorkListAttachObj) {
|
|
|
|
|
this.attachmentRes=[];
|
|
|
|
|
this.attachmentRes = [];
|
|
|
|
|
this.worklistAttachService.getAttach(WorkListAttachObj).
|
|
|
|
|
subscribe((result: NotificationGetAttachResponse) => {
|
|
|
|
|
this.handleWorkListAttachResult(result);
|
|
|
|
|
@ -797,7 +788,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
getActionHistory(WorkListActionHistoryObj) {
|
|
|
|
|
this.IsReachEnd = true;
|
|
|
|
|
this.actionHistoryRes=[];
|
|
|
|
|
this.actionHistoryRes = [];
|
|
|
|
|
this.worklistService.getActionHistory(WorkListActionHistoryObj).
|
|
|
|
|
subscribe((result: WorkListActionHistoryResponse) => {
|
|
|
|
|
this.handleWorkListActionHistoryResult(result);
|
|
|
|
|
@ -1105,7 +1096,7 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async openReplacementRoll() {
|
|
|
|
|
|
|
|
|
|
this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
|
|
|
|
|
const modal = await this.modalCtrl.create({
|
|
|
|
|
component: WorkListReplacementRollComponent,
|
|
|
|
|
backdropDismiss: false,
|
|
|
|
|
@ -1118,13 +1109,13 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
if (data.data.data == 'cancel' || data.data.data == undefined) {
|
|
|
|
|
return;
|
|
|
|
|
} else if (data.data.data == 'Success') {
|
|
|
|
|
} else if (data.data.data == 'Success') {
|
|
|
|
|
// this.openNotificationsDashboard();
|
|
|
|
|
this.messageSuccess = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageSuccess = false;
|
|
|
|
|
this.nextNotfification();
|
|
|
|
|
}, 2000);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageSuccess = false;
|
|
|
|
|
this.nextNotfification();
|
|
|
|
|
}, 2000);
|
|
|
|
|
// this.nextNotfification();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -1170,17 +1161,17 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getMOItemHistory(itemID ,orgID) {
|
|
|
|
|
getMOItemHistory(itemID, orgID) {
|
|
|
|
|
// console.log(itemID);
|
|
|
|
|
this.IsReachEnd = false;
|
|
|
|
|
const request = new MOItemHistoryReq();
|
|
|
|
|
request.P_ITEM_ID = parseInt(itemID);
|
|
|
|
|
request.P_PAGE_LIMIT = 100;
|
|
|
|
|
request.P_PAGE_NUM = 1;
|
|
|
|
|
request.P_ORG_ID= parseInt(orgID);
|
|
|
|
|
|
|
|
|
|
request.P_ORG_ID = parseInt(orgID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.worklistMainService.getMOItemHistory(request).
|
|
|
|
|
subscribe((result: MOItemHistoryRes) => {
|
|
|
|
|
// this.common.sharedService.setSharedData(
|
|
|
|
|
@ -1222,6 +1213,10 @@ export class WorklistMainMRComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
openRequestInfoDel(userData, flag) {
|
|
|
|
|
this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
|
|
|
|
|
this.actionButton(flag);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|