HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -22,15 +22,13 @@
</gz-data-table>
</div>
</template>
<script>
const FORM_KEY = "part-inventory-list";
export default {
created() {
let vm = this;
const vm = this;
vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
window.$gz.eventBus.$on("menu-click", clickHandler);
//Generate client criteria to send if filtered by part, whs or both
//ClientCriteria is optional for this list, Format for this list is "PARTID,WAREHOUSEID" where the id is 0 if not filtered or the id to filter
//OPTIONAL FILTER
@@ -44,7 +42,6 @@ export default {
viz: vm.$route.params.filter.viz,
clearable: true
};
vm.clientCriteria = `${
vm.$route.params.filter.PartPartNumber
? vm.$route.params.filter.PartPartNumber
@@ -55,7 +52,6 @@ export default {
: ""
}`;
}
generateMenu(vm);
},
beforeDestroy() {
@@ -90,17 +86,16 @@ 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":
m.vm.$router.push({
name: "inv-part-adjustment"
// , params: { recordid: 0 }
});
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.PartInventoryDataList
)
@@ -111,7 +106,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.PartInventoryDataList
),
@@ -121,7 +116,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:
@@ -137,7 +132,7 @@ async function clickHandler(menuItem) {
//
//
function generateMenu(vm) {
let menuOptions = {
const menuOptions = {
isMain: true,
icon: "$ayiPallet",
title: "PartInventoryList",
@@ -158,8 +153,6 @@ function generateMenu(vm) {
});
}
//REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: "Report",
icon: "$ayiFileAlt",
@@ -167,8 +160,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,