bug fixed in production and production filters

This commit is contained in:
Daniel Herrero 2017-11-23 08:35:17 +01:00
parent 02fb54efa9
commit 5ad2c70400
3 changed files with 15 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<mg-ajax path="/production/api/States/list" options="vnIndex as states" actions="$ctrl.states = states.model;"></mg-ajax>
<mg-ajax path="/production/api/States/list" options="vnIndex as states" actions="$ctrl.sharedData.states = states.model;"></mg-ajax>
<mg-ajax path="/production/api/FakeProductions/list" options="vnIndexNonAuto as index"></mg-ajax>
<vn-card margin-large>
<vn-vertical pad-medium>
@ -11,6 +11,7 @@
advanced="true"
popover="vn-production-filter-panel"
ignore-keys = "['page', 'size', 'search', 'warehouseFk']"
data ="$ctrl.sharedData"
>
</vn-searchbar>
@ -30,7 +31,7 @@
</vn-horizontal>
<vn-horizontal vn-one margin-large-bottom>
<vn-one>
<vn-production-actions tickets="$ctrl.tickets" states="$ctrl.states" hour-items="$ctrl.hourItems"></vn-production-actions>
<vn-production-actions tickets="$ctrl.tickets" states="$ctrl.sharedData.states" hour-items="$ctrl.sharedData.hourItems"></vn-production-actions>
</vn-one>
<vn-two></vn-two>
</vn-horizontal>

View File

@ -8,7 +8,7 @@ export default class ProductionIndex {
this.$http = $http;
this.filter = {};
this.tickets = [];
this.states = [];
this.checkAll = 0;
this.footer = {
total: null,
@ -16,7 +16,12 @@ export default class ProductionIndex {
meters: null
};
this._search = null;
this.hourItems = [];
this.sharedData = {
states: [],
hourItems: []
};
this.child = undefined;
this.userProfile = aclConstant.userProfile;
this.filter.warehouseFk = this.userProfile.warehouseId;
@ -89,7 +94,7 @@ export default class ProductionIndex {
hour = [0, i].join('');
}
hour += ':00';
this.hourItems.push({id: i, name: hour});
this.sharedData.hourItems.push({id: i, name: hour});
}
this.filter.warehouseFk = this.$.displayValue = this.userProfile.warehouseId;
}

View File

@ -69,7 +69,8 @@ export default class Controller {
var childCtrl = angular.element(this.child).isolateScope().$ctrl;
childCtrl.filter = Object.assign({}, this.index.filter);
childCtrl.onSubmit = filter => this.onChildSubmit(filter);
if (this.data)
childCtrl.data = Object.assign({}, this.data);
event.preventDefault();
}
onChildSubmit(filter) {
@ -112,7 +113,8 @@ ngModule.component('vnSearchbar', {
advanced: '=',
popover: '@',
label: '@?',
ignoreKeys: '<?'
ignoreKeys: '<?',
data: '<?'
},
controller: Controller
});