This commit is contained in:
@@ -374,7 +374,7 @@ function ensureTemplateIsInStore(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)
|
||||
//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);
|
||||
if (res.error) {
|
||||
//throw new Error(res.error);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
:dataListKey="dataListKey"
|
||||
:showSelect="rights.read"
|
||||
:reload="reload"
|
||||
:metaView="metaView"
|
||||
:clientCriteria="clientCriteria"
|
||||
v-on:selection-change="handleSelected"
|
||||
data-cy="partInventoryTransactionsTable"
|
||||
>
|
||||
@@ -28,31 +28,46 @@ export default {
|
||||
let vm = this;
|
||||
vm.rights = window.$gz.role.getRights(window.$gz.type.PartInventory);
|
||||
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) {
|
||||
metaFilter.push({
|
||||
fld: "PartWarehouseName",
|
||||
filter: {
|
||||
items: [
|
||||
{ op: "=", value: vm.$route.params.filter.PartWarehouseName }
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
vm.metaView = JSON.stringify(metaFilter);
|
||||
//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
|
||||
if (vm.$route.params.filter) {
|
||||
vm.clientCriteria = `${
|
||||
vm.$route.params.filter.PartPartNumber
|
||||
? vm.$route.params.filter.PartPartNumber
|
||||
: "0"
|
||||
},${
|
||||
vm.$route.params.filter.PartWarehouseName
|
||||
? vm.$route.params.filter.PartWarehouseName
|
||||
: "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);
|
||||
},
|
||||
beforeDestroy() {
|
||||
@@ -67,7 +82,7 @@ export default {
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
ayType: window.$gz.type.PartInventory,
|
||||
selectedItems: [],
|
||||
metaView: undefined,
|
||||
clientCriteria: undefined,
|
||||
reload: false,
|
||||
resetListView: false
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user