Last report implemented throughout
This commit is contained in:
@@ -324,7 +324,7 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
const FORM_KEY = "inv-part";
|
||||
const FORM_KEY = "inv-part-edit";
|
||||
const API_BASE_URL = "part/";
|
||||
const FORM_CUSTOM_TEMPLATE_KEY = "Part"; //<-- Should always be CoreBizObject AyaType name here where possible
|
||||
|
||||
@@ -677,34 +677,18 @@ async function clickHandler(menuItem) {
|
||||
m.vm.duplicate();
|
||||
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.Part }
|
||||
});
|
||||
} else {
|
||||
//general report selector chosen
|
||||
|
||||
let res = await m.vm.$refs.reportSelector.open({
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
{
|
||||
AType: window.$gz.type.Part,
|
||||
selectedRowIds: [m.vm.obj.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.Part }
|
||||
});
|
||||
},
|
||||
m.id
|
||||
);
|
||||
if (res == null) {
|
||||
return;
|
||||
}
|
||||
window.$gz.form.setLastReport(FORM_KEY, res);
|
||||
generateMenu(m.vm);
|
||||
break;
|
||||
case "PartSerialNumbersAvailable":
|
||||
m.vm.$router.push({
|
||||
@@ -842,6 +826,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
|
||||
|
||||
Reference in New Issue
Block a user