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: '',
+ onChange: '&?',
data: '',
itemAs: '@?',
field: '=',
diff --git a/client/core/src/date-picker/date-picker.js b/client/core/src/date-picker/date-picker.js
index b60f20409..f0a829df4 100644
--- a/client/core/src/date-picker/date-picker.js
+++ b/client/core/src/date-picker/date-picker.js
@@ -7,8 +7,8 @@ import Flatpickr from 'vendor/src/flatpickr';
const _NAME = 'datePicker';
export const NAME = util.getName(_NAME);
-directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate', '$document', '$transitions'];
-export function directive(resolve, normalizer, $translate, $document, $transitions) {
+directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate'];
+export function directive(resolve, normalizer, $translate) {
return {
restrict: 'E',
template: function(_, attrs) {
@@ -26,6 +26,9 @@ export function directive(resolve, normalizer, $translate, $document, $transitio
if (!initOptions.locale)
initOptions.locale = $translate.use();
+ if (!initOptions.dateFormat && initOptions.locale === 'es')
+ initOptions.dateFormat = 'd-m-Y';
+
if (!input.matches('input'))
input = input.querySelector('input');
diff --git a/client/core/src/lib/moduleLoader.js b/client/core/src/lib/moduleLoader.js
index 8b9952cb3..10c2cc903 100644
--- a/client/core/src/lib/moduleLoader.js
+++ b/client/core/src/lib/moduleLoader.js
@@ -31,7 +31,7 @@ export function factory($translatePartialLoader, $http, $window, $ocLazyLoad, $q
$translatePartialLoader.addPart(dep);
// FIXME: https://github.com/angular-translate/angular-translate/pull/1674
// promises.push($translate.refresh());
- setTimeout (() => $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)}>${route.component}>`,
@@ -53,9 +53,7 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) {
data: {
routes: fileRoutes
}
- };
-
- $stateProvider.state(route.state, routeOptions);
+ });
}
});
}