Merged in bugfix/PMCORE-2697 (pull request #7729)

PMCORE-2697

Approved-by: Rodrigo Quelca <rockoinfo@yahoo.com>
This commit is contained in:
Henry Jonathan Quispe Quispe
2021-01-13 20:59:24 +00:00
committed by Julio Cesar Laura Avendaño
8 changed files with 78 additions and 54 deletions

View File

@@ -241,7 +241,9 @@ export default {
this.dataAttachedDocuments.items = att;
},
getDataCaseSummary() {
let that = this;
let action,
option,
that = this;
Api.cases
.casesummary(this.dataCase)
.then((response) => {
@@ -252,9 +254,7 @@ export default {
titleActions: this.$i18n.t("ID_ACTIONS"),
btnLabel: this.$i18n.t("ID_CANCEL_CASE"),
btnType: false,
onClick: () => {
that.$refs["modal-cancel-case"].show();
},
onClick: null,
label: {
numberCase: data[2].label,
process: data[0].label,
@@ -274,6 +274,19 @@ export default {
duration: response.data[11].value.split(" ")[1],
},
};
// Hack for identify the cancel case button
Api.cases
.actions(this.dataCase).then((response)=>{
action = _.find(response.data, function(o) { return o.id == "ACTIONS"; });
if(action){
option = _.find(action.options, function(o) { return o.fn == "cancelCase"; });
if(!option.hide){
that.dataCaseSummary.onClick = () => {
that.$refs["modal-cancel-case"].show();
};
}
}
});
})
.catch((err) => {
throw new Error(err);