validateButtons/Done
parent
96f5f30e0e
commit
51c9c6482f
|
|
@ -295,7 +295,7 @@ export class DataService {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
let approval = this.validateApproval(resp.approvalStatus);
|
||||
res.push({
|
||||
resourceId: resp.resourceId,
|
||||
approvalStatus: this.validateApproval(resp.approvalStatus),
|
||||
|
|
@ -311,15 +311,14 @@ export class DataService {
|
|||
supportGroup: resp.supportGroup,
|
||||
tasks: tasks,
|
||||
supportGroupId: resp.supportGroupId,
|
||||
implementerEdit: resp.implementerEdit,
|
||||
flagApprove: resp.flagApprove,
|
||||
flagCancel: resp.flagChancel,
|
||||
flagPermit: resp.flagPermit,
|
||||
flagReject: resp.flagReject,
|
||||
implementerEdit: this.validateImplementerEdit(resp.state),
|
||||
flagApproval: approval,
|
||||
flagReject: approval,
|
||||
flagCancel: this.validateCancel(resp.state),
|
||||
flagPermit: this.validatePermit(resp.state),
|
||||
changeImplementerLogin: resp.changeImplementerLogin,
|
||||
packageName: resp.packageName,
|
||||
coordinatorSg: resp.coordinatorSg
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -331,16 +330,38 @@ export class DataService {
|
|||
return promise;
|
||||
}
|
||||
|
||||
validateApproval(approval):number{
|
||||
if(approval!=""){
|
||||
return 1;
|
||||
validateImplementerEdit(state):boolean{
|
||||
if(state == 1){
|
||||
return true
|
||||
}else{
|
||||
return 0;
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
validateCancel(state):boolean{
|
||||
if(state == 1){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
validatePermit(state): boolean{
|
||||
if(state == 0){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
validateApproval(approval):boolean{
|
||||
if(approval!==""){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getStateNameById(stateNr): String {
|
||||
if(this.selectedLanguage == 'EN'){
|
||||
for (let state of this.states) {
|
||||
|
|
|
|||
|
|
@ -621,6 +621,7 @@ public logg(args){
|
|||
let allReject: boolean = true;
|
||||
let allCancel: boolean = true;
|
||||
let allImplementer: boolean = true;
|
||||
let allTransition: boolean = true;
|
||||
this.selectedRescourceIds = [];
|
||||
for (const change of this.selRecs) {
|
||||
if(change.taskData.approvalStatus == 1){
|
||||
|
|
@ -645,7 +646,7 @@ public logg(args){
|
|||
}else{
|
||||
allApprove = false;
|
||||
}
|
||||
if(change.taskData.flagReject == true && allCancel == true){
|
||||
if(change.taskData.flagReject == true && allReject == true){
|
||||
allReject = true;
|
||||
}else{
|
||||
allReject = false;
|
||||
|
|
@ -660,10 +661,18 @@ public logg(args){
|
|||
}else{
|
||||
allImplementer = false;
|
||||
}
|
||||
if(change.taskData.state > 0 && allTransition == true){
|
||||
allTransition = true;
|
||||
}else{
|
||||
allTransition = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(allStates){
|
||||
this.toolbar = [];
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
if(allTransition){
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
}
|
||||
if(allPermit){
|
||||
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
|
||||
}
|
||||
|
|
@ -720,6 +729,7 @@ public logg(args){
|
|||
let allReject: boolean = true;
|
||||
let allCancel: boolean = true;
|
||||
let allImplementer: boolean = true;
|
||||
let allTransition: boolean = true;
|
||||
this.selectedRescourceIds = [];
|
||||
for (const change of this.selRecs) {
|
||||
if(change.taskData.state == this.selRecs[0].taskData.state){
|
||||
|
|
@ -760,11 +770,18 @@ public logg(args){
|
|||
}else{
|
||||
allImplementer = false;
|
||||
}
|
||||
if(change.taskData.state > 0 && allTransition == true){
|
||||
allTransition = true;
|
||||
}else{
|
||||
allTransition = false;
|
||||
}
|
||||
|
||||
}
|
||||
if(allStates){
|
||||
this.toolbar = [];
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
if(allTransition){
|
||||
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
|
||||
}
|
||||
if(allPermit){
|
||||
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue