Merged in bugfix/PMCORE-2879_B (pull request #7862)

PMCORE-2879

Approved-by: Henry Jonathan Quispe Quispe
This commit is contained in:
Rodrigo Quelca
2021-04-07 21:29:08 +00:00
committed by Julio Cesar Laura Avendaño
5 changed files with 50 additions and 56 deletions

View File

@@ -308,6 +308,12 @@ export default {
});
}
},
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
},
};
</script>

View File

@@ -161,6 +161,7 @@ export default {
} else {
this.page = "MyCases";
}
this.lastPage = this.page;
},
/**
* Do a mapping of vue view for menus
@@ -212,9 +213,12 @@ export default {
this.pageId = null;
this.pageUri = item.item.href;
this.page = item.item.id || "MyCases";
if (this.$refs["component"] && this.$refs["component"].updateView) {
if (this.page === this.lastPage
&& this.$refs["component"]
&& this.$refs["component"].updateView) {
this.$refs["component"].updateView();
}
this.lastPage = this.page;
}
},
setCounter() {

View File

@@ -343,6 +343,12 @@ export default {
});
}
},
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
},
};
</script>

View File

@@ -61,7 +61,7 @@ import api from "./../api/index";
import utils from "./../utils/utils";
export default {
name: "Paused",
name: "Unassigned",
components: {
HeaderCounter,
ButtonFleft,
@@ -94,6 +94,7 @@ export default {
tableData: [],
options: {
filterable: false,
sendInitialRequest: false,
headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
case_title: this.$i18n.t("ID_CASE_TITLE"),
@@ -130,12 +131,8 @@ export default {
}
};
},
created() {
this.initFilters();
},
mounted() {
// force to open case
this.openDefaultCase();
this.initFilters();
},
watch: {},
computed: {
@@ -151,57 +148,31 @@ export default {
methods: {
/**
* Initialize filters
* updates the filters if there is an appUid parameter
*/
initFilters() {
let params;
let params,
filter = {refresh: true};
if(this.defaultOption) {
params = utils.getAllUrlParams(this.defaultOption);
if (params && params.openapplicationuid) {
this.$emit("onUpdateFilters",[
{
fieldId: "caseNumber",
filterVar: "caseNumber",
label: "",
options:[],
value: params.openapplicationuid,
autoShow: false
}
]);
}
}
},
/**
* Open a case when the component was mounted
*/
openDefaultCase() {
let params;
if(this.defaultOption) {
params = utils.getAllUrlParams(this.defaultOption);
if (params && params.app_uid && params.del_index) {
this.openCase({
APP_UID: params.app_uid,
DEL_INDEX: params.del_index
});
this.$emit("cleanDefaultOption");
}
//force to search in the parallel tasks
if (params && params.openapplicationuid) {
this.onUpdateFilters({
params: [
{
fieldId: "caseNumber",
filterVar: "caseNumber",
label: "",
options:[],
value: params.openapplicationuid,
autoShow: false
}
],
refresh: false
});
this.$emit("cleanDefaultOption");
filter = {
params: [
{
fieldId: "caseNumber",
filterVar: "caseNumber",
label: "",
options:[],
value: params.openapplicationuid,
autoShow: false
}
],
refresh: true
};
}
this.$emit("cleanDefaultOption");
}
this.onUpdateFilters(filter);
},
/**
* On row click event handler
@@ -236,7 +207,7 @@ export default {
paged: paged,
};
_.forIn(this.filters, function (item, key) {
_.forIn(this.$parent.filters, function (item, key) {
filters[item.filterVar] = item.value;
});
return new Promise((resolutionFunc, rejectionFunc) => {
@@ -334,13 +305,21 @@ export default {
},
onRemoveFilter(data) {},
onUpdateFilters(data) {
this.$emit("onUpdateFilters", data.params);
if (data.params) {
this.$emit("onUpdateFilters", data.params);
}
if (data.refresh) {
this.$nextTick(() => {
this.$refs["vueTable"].getData();
});
}
},
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
},
};
</script>

View File

@@ -90,13 +90,12 @@ if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) {
exit();
}
}
$appNumber = Application::getCaseNumber($openAppUid);
if (count($arrayDelIndex) === 1) {
//We will to open the case: one thread
$openCaseIE = true;
$defaultOption = '../cases/open?APP_UID=' . $openAppUid . '&DEL_INDEX=' . $arrayDelIndex[0] . '&action=' . $action;
$defaultOption = '../cases/open?APP_UID=' . $openAppUid . '&DEL_INDEX=' . $arrayDelIndex[0] . '&action=' . $action . '&openApplicationUid=' . $appNumber;
} else {
$appNumber = Application::getCaseNumber($openAppUid);
//We will to show the list: more than one thread
$defaultOption = '../cases/casesListExtJs?action=' . $action . '&openApplicationUid=' . $appNumber;
}