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