diff --git a/client/core/src/autocomplete/autocomplete.js b/client/core/src/autocomplete/autocomplete.js index 64887f9e0..bf2d65b48 100644 --- a/client/core/src/autocomplete/autocomplete.js +++ b/client/core/src/autocomplete/autocomplete.js @@ -402,6 +402,9 @@ export default class Autocomplete extends Component { if (!this.locked) this.value = value; + + if (this.onChange) + this.onChange({item: this.value}); } showItem(item) { this.input.value = item ? item[this.showField] : ''; @@ -422,6 +425,7 @@ module.component('vnAutocomplete', { valueField: '@?', selectFields: '@?', initialData: ' $translate.refresh(), 500); + setTimeout(() => $translate.refresh(), 500); } let ocDeps = deps.map(item => { return { name: item } }); diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index 268bf0216..2416d8c1d 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -22,10 +22,11 @@ show-field="name" value-field="id" field="$ctrl.filter.warehouseFk" - url="/production/api/Warehouses/production" + url="/production/api/Warehouses/production" + on-change = "$ctrl.onChangeWareHouse(item)" label="Store"> - + diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index d19b46dc2..d2391c8c9 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -72,8 +72,10 @@ export default class ProductionIndex { delete this.child; } searchTickets(filter) { + this.filter = Object.assign({}, filter || {}, this.filter); + let filters = Object.assign({}, { - where: Object.assign({}, filter, this.filter) + where: this.filter }, { page: 1, limit: 700 @@ -87,6 +89,17 @@ export default class ProductionIndex { } ); } + refreshTickets() { + this.filter = {}; + this.filter.warehouseFk = this.userProfile.warehouseId; + this.searchTickets(); + } + onChangeWareHouse(item) { + if (item && item != this.filter.warehouseFk) { + this.filter.warehouseFk = item; + this.searchTickets(); + } + } $onInit() { for (let i = 1; i <= 24; i++) { let hour = [i].join(''); diff --git a/client/salix/src/configroutes.js b/client/salix/src/configroutes.js index 5b696afac..734931316 100644 --- a/client/salix/src/configroutes.js +++ b/client/salix/src/configroutes.js @@ -40,10 +40,10 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) { for (let file in routes) { let fileRoutes = routes[file].routes; let moduleName = routes[file].module; - let validations = routes[file].validations; + let validations = routes[file].validations || false; fileRoutes.forEach(function(route) { if (aclService.routeHasPermission(route)) { - let routeOptions = { + $stateProvider.state(route.state, { url: route.url, abstract: route.abstract || false, template: `<${route.component} ${getParams(route)}>`, @@ -53,9 +53,7 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) { data: { routes: fileRoutes } - }; - - $stateProvider.state(route.state, routeOptions); + }); } }); }