salix/modules/order/front/index/index.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-07-18 12:38:43 +00:00
import ngModule from '../module';
export default class Controller {
2019-02-27 11:03:54 +00:00
constructor($scope, $state, $stateParams) {
this.$stateParams = $stateParams;
this.$state = $state;
this.$ = $scope;
2018-07-18 12:38:43 +00:00
this.ticketSelected = null;
}
2019-02-27 11:03:54 +00:00
onSearch(params) {
if (params)
this.$.model.applyFilter(null, params);
else
this.$.model.clear();
}
showClientDescriptor(event, clientFk) {
this.$.clientDescriptor.clientFk = clientFk;
this.$.clientDescriptor.parent = event.target;
this.$.clientDescriptor.show();
2018-09-06 10:47:25 +00:00
event.preventDefault();
event.stopImmediatePropagation();
}
showWorkerDescriptor(event, workerFk) {
event.preventDefault();
event.stopImmediatePropagation();
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
2018-09-06 10:47:25 +00:00
onDescriptorLoad() {
this.$.popover.relocate();
2018-09-06 10:47:25 +00:00
}
preview(event, order) {
event.preventDefault();
event.stopImmediatePropagation();
this.selectedOrder = order;
this.$.summary.show();
2018-07-18 12:38:43 +00:00
}
}
2019-02-27 11:03:54 +00:00
Controller.$inject = ['$scope', '$state', '$stateParams'];
2018-07-18 12:38:43 +00:00
ngModule.component('vnOrderIndex', {
template: require('./index.html'),
controller: Controller
});