This commit is contained in:
2021-01-28 15:50:06 +00:00
parent b597e42fcd
commit 3eaf222e42
3 changed files with 45 additions and 32 deletions

View File

@@ -149,10 +149,7 @@ todo: DataList view and filter are combined and this is wrong
public ActionResult GetDefaultDataListView([FromRoute] string dataListKey) public ActionResult GetDefaultDataListView([FromRoute] string dataListKey)
Test the everloving shit out of this Test the everloving shit out of this
CURRENTLY: most lists default view ok (not filtering yet just default no filter) except: CURRENTLY: most lists default view ok (not filtering yet just default no filter) except:
Contacts - Customer users list is empty when it shouldn't be
CustomerNotes - needs criteria sent of customer id
Part->PartInventory, Transactions, menu option list - not filtering at all Part->PartInventory, Transactions, menu option list - not filtering at all
Warehouse '' ditto above Warehouse '' ditto above
@@ -180,6 +177,7 @@ todo: *biz objects with foreign key constraints should call ValidateCanDelete
iow: apartinventory REFERENCES apartwarehouseid so PartWarehouseBiz ValidateCanDelete must check if there are any apartinventory with this warehouse iow: apartinventory REFERENCES apartwarehouseid so PartWarehouseBiz ValidateCanDelete must check if there are any apartinventory with this warehouse
(also PartWarehouseBiz ValidateCanDelete is the references for this code) (also PartWarehouseBiz ValidateCanDelete is the references for this code)
todo: ClientNote form link back to customer disappears on save of NEW record only (not update), should always be present
todo: standardize routes and route names and form names todo: standardize routes and route names and form names
Use plural and singular names throughout for consistency Use plural and singular names throughout for consistency

View File

@@ -409,6 +409,10 @@ export default {
type: String, type: String,
default: undefined default: undefined
}, },
clientCriteria: {
type: String,
default: undefined
},
showSelect: { showSelect: {
type: Boolean, type: Boolean,
default: false default: false
@@ -502,7 +506,7 @@ export default {
selectedRowIds: selectedRowIds, selectedRowIds: selectedRowIds,
dataListKey: vm.dataListKey, dataListKey: vm.dataListKey,
listView: untokenizeListView(vm.listView), listView: untokenizeListView(vm.listView),
metaView: vm.metaView clientCriteria: vm.clientCriteria
}; };
}, },
handleSelectChange() { handleSelectChange() {
@@ -646,7 +650,7 @@ export default {
limit: listOptions.Limit, limit: listOptions.Limit,
dataListKey: vm.dataListKey, dataListKey: vm.dataListKey,
listView: untokenizedListView, listView: untokenizedListView,
metaView: vm.metaView clientCriteria: vm.clientCriteria
}); });
if (res.error) { if (res.error) {
@@ -695,7 +699,7 @@ export default {
vm.getDataFromApi(); vm.getDataFromApi();
}, },
beforeUpdate() { beforeUpdate() {
if (this.metaView != null && this.listViewId != 0) { if (this.clientCriteria != null && this.listViewId != 0) {
this.resetListView(); this.resetListView();
} }
} }

View File

@@ -15,7 +15,7 @@
:dataListSort="dataListSort" :dataListSort="dataListSort"
:showSelect="rights.read" :showSelect="rights.read"
:reload="reload" :reload="reload"
:metaView="metaView" :clientCriteria="clientCriteria"
v-on:selection-change="handleSelected" v-on:selection-change="handleSelected"
data-cy="partInventoryTable" data-cy="partInventoryTable"
> >
@@ -31,30 +31,41 @@ export default {
vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory); vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
if (vm.$route.params.filter) { //Generate client criteria to send if filtered by part, whs or both
let metaFilter = []; vm.clientCriteria = `p:${
//pre-filter by PartNumber or warehouse name or both vm.$route.params.filter.PartPartNumber
if (vm.$route.params.filter.PartPartNumber != null) { ? vm.$route.params.filter.PartPartNumber
metaFilter.push({ : "*"
fld: "PartPartNumber", },w:${
filter: { vm.$route.params.filter.PartWarehouseName
items: [{ op: "=", value: vm.$route.params.filter.PartPartNumber }] ? vm.$route.params.filter.PartWarehouseName
} : "*"
}); }`;
}
if (vm.$route.params.filter.PartWarehouseName != null) { // if (vm.$route.params.filter) {
metaFilter.push({ // vm.clientCriteria = "";
fld: "PartWarehouseName", // //pre-filter by PartNumber or warehouse name or both
filter: { // if (vm.$route.params.filter.PartPartNumber != null) {
items: [ // metaFilter.push({
{ op: "=", value: vm.$route.params.filter.PartWarehouseName } // fld: "PartPartNumber",
] // filter: {
} // items: [{ op: "=", value: vm.$route.params.filter.PartPartNumber }]
}); // }
} // });
vm.metaView = JSON.stringify(metaFilter); // }
}
// if (vm.$route.params.filter.PartWarehouseName != null) {
// metaFilter.push({
// fld: "PartWarehouseName",
// filter: {
// items: [
// { op: "=", value: vm.$route.params.filter.PartWarehouseName }
// ]
// }
// });
// }
// vm.clientCriteria = `PartPartNumber:`;
// }
generateMenu(vm); generateMenu(vm);
}, },
beforeDestroy() { beforeDestroy() {
@@ -69,7 +80,7 @@ export default {
rights: window.$gz.role.defaultRightsObject(), rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.PartInventory, ayType: window.$gz.type.PartInventory,
selectedItems: [], selectedItems: [],
metaView: undefined, clientCriteria: undefined,
reload: false reload: false
}; };
}, },