salix/client/order/src/catalog/index.js

48 lines
909 B
JavaScript
Raw Normal View History

2018-07-24 07:35:23 +00:00
import ngModule from '../module';
class Controller {
constructor($scope, $stateParams) {
this.$scope = $scope;
this.$stateParams = $stateParams;
}
applyFilter() {
this.$scope.model.filter = this.filter;
this.$scope.model.refresh();
}
set order(value) {
this._order = value;
if (!value) return;
this.filter = {
2018-08-21 11:38:16 +00:00
orderFk: value.id,
where: {}
2018-07-24 07:35:23 +00:00
};
}
get order() {
return this._order;
}
2018-08-21 11:38:16 +00:00
preview(event, item) {
event.preventDefault();
this.$scope.pricesPopover.show(event, item);
}
onDescriptorLoad() {
this.$scope.popover.relocate();
}
2018-07-24 07:35:23 +00:00
}
Controller.$inject = ['$scope', '$stateParams'];
2018-08-21 11:38:16 +00:00
ngModule.component('vnOrderCatalog', {
2018-07-24 07:35:23 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
order: '<'
}
});