This commit is contained in:
2021-01-26 00:42:52 +00:00
parent 531c86a943
commit 43a7fcc9e5
6 changed files with 117 additions and 22 deletions

View File

@@ -5,12 +5,13 @@
MISC ITEMS THAT CAME UP
todo: DataList if there is a meta filter it should default to no filter first then apply teh meta filter as a temporary filter like if the user had hand selected it
The current filter if any applied fights with the meta filter and in many cases would block it completely
This way they can save it as a common filter if they want and
todo: Part form menu has links to inventory list filtered for that part not implemented yet but could be now
make sure it checks if useinvenotry is in effect
todo: confirm on delete cascade functionality for partassembly and partstocklevel records when either part or warehouse is deleted
todo: every form all fields error collection is set to "servererrors" but really its' any kind of validation error local or server so not sure why ti's named that
todo: userbiz validate can delete has funky error
@@ -174,13 +175,7 @@ Inventory related objects that need to be ported:
XPartSerial
XPartWarehouse
XPartInventory (was "PartByWarehouseInventory")
transformed into a inventory transaction ledger as per case 3847
PartRestock
contains partid/warehouseid/minimumstock level
accessible from the Part form as it's own edit window
no list of all
only when useinventory
very much like partassembly, can reuse from that base
XPartRestock
XPartInventoryAdjustment
XPartAssembly

View File

@@ -586,6 +586,9 @@ export default {
// Process and return server errors if any for form and field specified
// note that this is called in turn by every control on the form so it's only job
// is to return errors if they exist for *that* field
// Not to be confused with validation errors through the "rules" property
// that is separate and any errors returned here are *added* to the validation
// errors in the UI by Vuetify
//
serverErrors(vm, ref) {
let ret = [];

View File

@@ -15,6 +15,7 @@
:dataListSort="dataListSort"
:showSelect="rights.read"
:reload="reload"
:metaView="metaView"
v-on:selection-change="handleSelected"
data-cy="partInventoryTransactionsTable"
>
@@ -26,9 +27,35 @@
const FORM_KEY = "part-inventory-list";
export default {
created() {
this.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
let vm = this;
vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(this);
if (vm.$route.params.filter) {
let metaFilter = [];
//pre-filter by PartNumber or warehouse name or both
if (vm.$route.params.filter.PartPartNumber != null) {
metaFilter.push({
fld: "PartPartNumber",
filter: {
items: [{ op: "=", value: vm.$route.params.filter.PartPartNumber }]
}
});
}
if (vm.$route.params.filter.PartWarehouseName != null) {
metaFilter.push({
fld: "PartWarehouseName",
filter: {
items: [
{ op: "=", value: vm.$route.params.filter.PartWarehouseName }
]
}
});
}
vm.metaView = JSON.stringify(metaFilter);
}
generateMenu(vm);
},
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
@@ -42,6 +69,7 @@ export default {
rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.PartInventory,
selectedItems: [],
metaView: undefined,
reload: false
};
},

View File

@@ -15,6 +15,7 @@
:dataListSort="dataListSort"
:showSelect="rights.read"
:reload="reload"
:metaView="metaView"
v-on:selection-change="handleSelected"
data-cy="partInventoryTable"
>
@@ -26,9 +27,35 @@
const FORM_KEY = "part-inventory-list";
export default {
created() {
this.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
let vm = this;
vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(this);
if (vm.$route.params.filter) {
let metaFilter = [];
//pre-filter by PartNumber or warehouse name or both
if (vm.$route.params.filter.PartPartNumber != null) {
metaFilter.push({
fld: "PartPartNumber",
filter: {
items: [{ op: "=", value: vm.$route.params.filter.PartPartNumber }]
}
});
}
if (vm.$route.params.filter.PartWarehouseName != null) {
metaFilter.push({
fld: "PartWarehouseName",
filter: {
items: [
{ op: "=", value: vm.$route.params.filter.PartWarehouseName }
]
}
});
}
vm.metaView = JSON.stringify(metaFilter);
}
generateMenu(vm);
},
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
@@ -42,6 +69,7 @@ export default {
rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.PartInventory,
selectedItems: [],
metaView: undefined,
reload: false
};
},

View File

@@ -491,7 +491,18 @@ async function clickHandler(menuItem) {
});
}
break;
case "PartByWarehouseInventoryList":
m.vm.$router.push({
name: "inv-part-inventory",
params: { filter: { PartWarehouseName: m.vm.obj.name } }
});
break;
case "PartInventoryTransactionList":
m.vm.$router.push({
name: "inv-part-inventory-transactions",
params: { filter: { PartWarehouseName: m.vm.obj.name } }
});
break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -585,6 +596,26 @@ function generateMenu(vm) {
menuOptions.menuItems.push({ divider: true, inset: false });
if (
vm.obj.id != null &&
vm.obj.id != 0 &&
window.$gz.store.state.globalSettings.useInventory
) {
menuOptions.menuItems.push({
title: "PartByWarehouseInventoryList",
icon: "$ayiPallet",
key: FORM_KEY + ":PartByWarehouseInventoryList",
vm: vm
});
menuOptions.menuItems.push({
title: "PartInventoryTransactionList",
icon: "$ayiDolly",
key: FORM_KEY + ":PartInventoryTransactionList",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });
window.$gz.eventBus.$emit("menu-change", menuOptions);
}
@@ -605,6 +636,8 @@ async function initForm(vm) {
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([
"PartWarehouse",
"PartByWarehouseInventoryList",
"PartInventoryTransactionList",
"PartWarehouseName",
"PartWarehouseNotes",
"PartWarehouseCustom1",

View File

@@ -718,6 +718,18 @@ async function clickHandler(menuItem) {
params: { recordid: m.vm.obj.id }
});
break;
case "PartByWarehouseInventoryList":
m.vm.$router.push({
name: "inv-part-inventory",
params: { filter: { PartPartNumber: m.vm.obj.partNumber } }
});
break;
case "PartInventoryTransactionList":
m.vm.$router.push({
name: "inv-part-inventory-transactions",
params: { filter: { PartPartNumber: m.vm.obj.partNumber } }
});
break;
default:
window.$gz.eventBus.$emit(
@@ -807,8 +819,6 @@ function generateMenu(vm) {
menuOptions.menuItems.push({ divider: true, inset: false });
//---- SHOW ALL ---
//MIGRATE_OUTSTANDING part inventory link from part form
if (
vm.obj.id != null &&
vm.obj.id != 0 &&
@@ -817,17 +827,14 @@ function generateMenu(vm) {
menuOptions.menuItems.push({
title: "PartByWarehouseInventoryList",
icon: "$ayiPallet",
key: FORM_KEY + ":TODO-PartByWareHouseInventoryLinkForThisPart",
key: FORM_KEY + ":PartByWarehouseInventoryList",
vm: vm
});
//MIGRATE_OUTSTANDING part inventory transactions list for this part
menuOptions.menuItems.push({
title: "PartInventoryTransactionList",
icon: "$ayiDolly",
key:
FORM_KEY +
":TODO-PartByWareHouseInventoryTransactionListLinkForThisPart",
key: FORM_KEY + ":PartInventoryTransactionList",
vm: vm
});
@@ -871,6 +878,7 @@ async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([
"Part",
"PartByWarehouseInventoryList",
"PartInventoryTransactionList",
"PartSerialNumbersAvailable",
"PartStockingLevels",
"PartName",