Last report implemented throughout

This commit is contained in:
2021-09-09 22:36:00 +00:00
parent 3fb25fce47
commit 130a6d5f03
104 changed files with 634 additions and 2169 deletions

View File

@@ -99,37 +99,20 @@ async function clickHandler(menuItem) {
}
break;
case "report":
if (m.id != null) {
//last report selected is in m.id
m.vm.$router.push({
name: "ay-report",
params: { recordid: m.id, ayatype: window.$gz.type.CustomerNote }
});
} else {
//general report selector chosen
{
let res = await m.vm.$refs.reportSelector.open(
m.vm.$refs.gzdatatable.getDataListSelection(
window.$gz.type.CustomerNote
)
),
m.id
);
//if null for no selection
//just bail out
if (res == null) {
return;
}
//persist last report selected
window.$gz.form.setLastReport(FORM_KEY, res);
//Now open the report viewer...
m.vm.$router.push({
name: "ay-report",
params: { recordid: res.id, ayatype: window.$gz.type.CustomerNote }
});
generateMenu(m.vm); //refresh the menu with the new report
}
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -179,6 +162,7 @@ function generateMenu(vm) {
if (lastReport != null) {
menuOptions.menuItems.push({
title: lastReport.name,
notrans: true,
icon: "$ayiFileAlt",
key: FORM_KEY + ":report:" + lastReport.id,
vm: vm