This commit is contained in:
2021-01-28 18:24:27 +00:00
parent 9cc6ca2a82
commit 6459f2590b
2 changed files with 40 additions and 25 deletions

View File

@@ -374,7 +374,7 @@ function ensureTemplateIsInStore(vm) {
async function initDataObject(vm) { async function initDataObject(vm) {
//Get all the fields *available* to this form (all the fields for the object defined in AyaFormFieldDefinitions.cs as SERVER) //Get all the fields *available* to this form (all the fields for the object defined in AyaFormFieldDefinitions.cs as SERVER)
//Note: this is not the actual customization data, just the list of fields that could be customized (or not if required mandatory) //Note: this is not the actual customization data, just the list of fields that could be customized (or not if required mandatory)
let url = "form-field-definition/" + vm.$route.params.formCustomTemplateKey; let url = "form-field-reference/" + vm.$route.params.formCustomTemplateKey;
let res = await window.$gz.api.get(url); let res = await window.$gz.api.get(url);
if (res.error) { if (res.error) {
//throw new Error(res.error); //throw new Error(res.error);

View File

@@ -13,7 +13,7 @@
:dataListKey="dataListKey" :dataListKey="dataListKey"
: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="partInventoryTransactionsTable" data-cy="partInventoryTransactionsTable"
> >
@@ -28,31 +28,46 @@ export default {
let vm = this; let vm = this;
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) {
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) { //Generate client criteria to send if filtered by part, whs or both
metaFilter.push({ //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
fld: "PartWarehouseName", if (vm.$route.params.filter) {
filter: { vm.clientCriteria = `${
items: [ vm.$route.params.filter.PartPartNumber
{ op: "=", value: vm.$route.params.filter.PartWarehouseName } ? vm.$route.params.filter.PartPartNumber
] : "0"
} },${
}); vm.$route.params.filter.PartWarehouseName
} ? vm.$route.params.filter.PartWarehouseName
vm.metaView = JSON.stringify(metaFilter); : "0"
}`;
} }
// 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); generateMenu(vm);
}, },
beforeDestroy() { beforeDestroy() {
@@ -67,7 +82,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,
resetListView: false resetListView: false
}; };