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;
|
2019-02-15 11:39:21 +00:00
|
|
|
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();
|
2018-10-15 09:43:57 +00:00
|
|
|
}
|
|
|
|
|
2019-02-15 11:39:21 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2019-04-25 12:24:02 +00:00
|
|
|
showWorkerDescriptor(event, workerFk) {
|
2019-02-15 11:39:21 +00:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
2019-04-25 12:24:02 +00:00
|
|
|
this.selectedWorker = workerFk;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.workerDescriptor.parent = event.target;
|
|
|
|
this.$.workerDescriptor.show();
|
|
|
|
}
|
|
|
|
|
2018-09-06 10:47:25 +00:00
|
|
|
onDescriptorLoad() {
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.popover.relocate();
|
2018-09-06 10:47:25 +00:00
|
|
|
}
|
|
|
|
|
2018-11-19 07:42:29 +00:00
|
|
|
preview(event, order) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
this.selectedOrder = order;
|
2019-02-15 11:39:21 +00:00
|
|
|
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
|
|
|
|
});
|