fix skip action

mekawy-issues
ashwaq 6 years ago
parent ea34f65959
commit 00e36290d4

@ -275,7 +275,7 @@ export class WorkListReplacementRollComponent implements OnInit {
});
}, 5000);
this.cs.openNotificationPage();
}
} // not valid it

@ -141,6 +141,7 @@ export class WorkListRfcComponent implements OnInit {
});
}, 5000);
this.cs.openNotificationPage();
}
} // valid it

@ -321,26 +321,58 @@ export class WorklistMainMRComponent implements OnInit {
} // valid it
}
// public nextNotfification() {
// //let itemExist = false;
// let itemNo = this.getPassNotificationDetails.ROW_NUM;
// itemNo += 1;
// if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage();
// } else {
// for (let i = 0; i < this.notificationArray.length; i++) {
// if (this.notificationArray[i].ROW_NUM == itemNo) {
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// // itemExist = true;
// this.intializeNotificationDetail();
// // this.common.openNotificationPage();
// break;
// }
// }
// // if(itemExist==false){
// // this.nextNotfification();
// // }
// }
// }
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
if (itemNo > this.notificationArray.length) {
this.common.openNotificationPage();
} else {
for (let i = 0; i < this.notificationArray.length; i++) {
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// itemExist = true;
this.intializeNotificationDetail();
// this.common.openNotificationPage();
break;
}
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
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 == "MR" ){
this.intializeNotificationDetail();
}else{
this.common.openWorklistMainPage();
}
// if(itemExist==false){
// this.nextNotfification();
// }
}
else{
this.common.openNotificationPage();
}
}

@ -36,6 +36,7 @@ import { MoreActionModalComponent } from '../more-action-modal/more-action-modal
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
@Component({
selector: 'app-worklist-main-po',
@ -354,24 +355,54 @@ export class WorklistMainPoComponent implements OnInit {
} // valid it
}
// public nextNotfification() {
// //let itemExist = false;
// let itemNo = this.getPassNotificationDetails.ROW_NUM;
// itemNo += 1;
// if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage();
// } else {
// for (let i = 0; i < this.notificationArray.length; i++) {
// if (this.notificationArray[i].ROW_NUM == itemNo) {
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// // itemExist = true;
// this.intializeNotificationDetail();
// break;
// }
// }
// // if(itemExist==false){
// // this.nextNotfification();
// // }
// }
// }
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
if (itemNo > this.notificationArray.length) {
this.common.openNotificationPage();
} else {
for (let i = 0; i < this.notificationArray.length; i++) {
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// itemExist = true;
this.intializeNotificationDetail();
break;
}
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.intializeNotificationDetail();
}else
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){
this.common.openWorklistMainPRPage()
}
else
if(this.notificationArray[index].REQUEST_TYPE == "MR" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
}
// if(itemExist==false){
// this.nextNotfification();
// }
}
else{
this.common.openNotificationPage();
}
}

@ -351,24 +351,55 @@ export class WorklistMainPRComponent implements OnInit {
} // valid it
}
// public nextNotfification() {
// //let itemExist = false;
// let itemNo = this.getPassNotificationDetails.ROW_NUM;
// itemNo += 1;
// if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage();
// } else {
// for (let i = 0; i <= this.notificationArray.length; i++) {
// if (this.notificationArray[i].ROW_NUM == itemNo) {
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// // itemExist = true;
// this.intializeNotificationDetail();
// break;
// }
// }
// // if(itemExist==false){
// // this.nextNotfification();
// // }
// }
// }
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
if (itemNo > this.notificationArray.length) {
this.common.openNotificationPage();
} else {
for (let i = 0; i <= this.notificationArray.length; i++) {
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// itemExist = true;
this.intializeNotificationDetail();
break;
}
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.common.openWorklistMainPOPage()
}else
if(this.notificationArray[index].REQUEST_TYPE == "PR" ){
this.intializeNotificationDetail();
}
else
if(this.notificationArray[index].REQUEST_TYPE == "MR" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
}
// if(itemExist==false){
// this.nextNotfification();
// }
}
else{
this.common.openNotificationPage();
}
}

@ -156,8 +156,8 @@ export class WorklistMainComponent implements OnInit {
HomeComponent.NOTIFICATION_DATA,
false
);
console.log(this.getPassNotificationDetails.ROW_NUM);
console.log("for next()"+ this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR,
false
@ -363,31 +363,59 @@ export class WorklistMainComponent implements OnInit {
} // valid it
}
// public nextNotfification() {
// //let itemExist = false;
// let itemNo = this.getPassNotificationDetails.ROW_NUM;
// itemNo += 1;
// if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage();
// } else {
// for (let i = 0; i < this.notificationArray.length; i++) {
// if (this.notificationArray[i].ROW_NUM == itemNo) {
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// // itemExist = true;
// this.intializeNotificationDetail();
// break;
// }
// }
// // if(itemExist==false){
// // this.nextNotfification();
// // }
// }
// }
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
console.log( this.notificationArray);
let sortArr =this.sortArray(this.notificationArray);
console.log( sortArr);
const sortedActivities = this.notificationArray.slice().sort((a, b) => b.BEGIN_DATE - a.BEGIN_DATE)
console.log(sortedActivities);
// if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage();
// } else {
// for (let i = 0; i < this.notificationArray.length; i++) {
// if (this.notificationArray[i].ROW_NUM == itemNo) {
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// // itemExist = true;
// this.intializeNotificationDetail();
// break;
// }
// }
// // if(itemExist==false){
// // this.nextNotfification();
// // }
// }
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
index += 1;
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
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 == "MR" ){
this.common.openWorklistMainMRPage()
}else{
this.intializeNotificationDetail();
}
}
else{
this.common.openNotificationPage();
}
}
@ -642,7 +670,8 @@ export class WorklistMainComponent implements OnInit {
handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
this.NotRespondAttributeList =
this.NotRespondAttributeList = [];
result.NotificationGetRespondAttributesList;
if (
result.NotificationRespondRolesList != "" &&

Loading…
Cancel
Save