HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -21,13 +21,7 @@
|
||||
</gz-data-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* Xeslint-disable */
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const FORM_KEY = "cust-customer-notes";
|
||||
export default {
|
||||
created() {
|
||||
@@ -51,7 +45,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
customerId: undefined,
|
||||
// customername: undefined,
|
||||
clientCriteria: undefined,
|
||||
preFilterMode: null,
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
@@ -76,7 +69,7 @@ async function clickHandler(menuItem) {
|
||||
if (!menuItem) {
|
||||
return;
|
||||
}
|
||||
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
const m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
if (m.owner == FORM_KEY && !m.disabled) {
|
||||
switch (m.key) {
|
||||
case "new":
|
||||
@@ -89,7 +82,7 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
break;
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open(
|
||||
const res = await m.vm.$refs.extensions.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.CustomerNote
|
||||
)
|
||||
@@ -100,7 +93,7 @@ async function clickHandler(menuItem) {
|
||||
break;
|
||||
case "report":
|
||||
{
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
const res = await m.vm.$refs.reportSelector.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.CustomerNote
|
||||
),
|
||||
@@ -110,7 +103,7 @@ async function clickHandler(menuItem) {
|
||||
return;
|
||||
}
|
||||
window.$gz.form.setLastReport(FORM_KEY, res);
|
||||
generateMenu(m.vm); //refresh the menu with the new report
|
||||
generateMenu(m.vm);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -126,7 +119,7 @@ async function clickHandler(menuItem) {
|
||||
//
|
||||
//
|
||||
function generateMenu(vm) {
|
||||
let menuOptions = {
|
||||
const menuOptions = {
|
||||
isMain: false,
|
||||
readOnly: !vm.rights.change,
|
||||
icon: "$ayiClipboard",
|
||||
@@ -148,8 +141,6 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
//REPORTS
|
||||
//Report not Print, print is a further option
|
||||
menuOptions.menuItems.push({
|
||||
title: "Report",
|
||||
icon: "$ayiFileAlt",
|
||||
@@ -157,8 +148,7 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
|
||||
//get last report selected
|
||||
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
|
||||
const lastReport = window.$gz.form.getLastReport(FORM_KEY);
|
||||
if (lastReport != null) {
|
||||
menuOptions.menuItems.push({
|
||||
title: lastReport.name,
|
||||
|
||||
Reference in New Issue
Block a user