2017-06-03 11:01:47 +00:00
|
|
|
import ngModule from '../module';
|
2017-01-31 13:13:06 +00:00
|
|
|
|
2017-06-03 11:01:47 +00:00
|
|
|
export default class Controller {
|
2019-09-30 09:47:39 +00:00
|
|
|
constructor($scope, $state) {
|
2018-06-07 21:47:19 +00:00
|
|
|
this.$ = $scope;
|
2019-09-30 09:47:39 +00:00
|
|
|
this.$state = $state;
|
2018-03-01 11:51:35 +00:00
|
|
|
this.clientSelected = null;
|
2017-07-03 12:23:53 +00:00
|
|
|
}
|
2018-05-07 06:33:45 +00:00
|
|
|
|
2019-02-21 09:10:38 +00:00
|
|
|
openSummary(client, event) {
|
2019-11-10 10:08:44 +00:00
|
|
|
if (event.defaultPrevented) return;
|
2019-02-21 09:10:38 +00:00
|
|
|
event.preventDefault();
|
2019-11-10 10:08:44 +00:00
|
|
|
event.stopPropagation();
|
|
|
|
|
2018-03-01 11:51:35 +00:00
|
|
|
this.clientSelected = client;
|
2018-06-07 21:47:19 +00:00
|
|
|
this.$.dialogSummaryClient.show();
|
2018-03-01 11:51:35 +00:00
|
|
|
}
|
2019-09-30 09:47:39 +00:00
|
|
|
|
|
|
|
filterTickets(client, event) {
|
2019-11-10 10:08:44 +00:00
|
|
|
if (event.defaultPrevented) return;
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
|
2019-11-10 12:10:52 +00:00
|
|
|
this.$state.go(`ticket.index`,
|
|
|
|
{q: JSON.stringify({clientFk: client.id})});
|
2019-09-30 09:47:39 +00:00
|
|
|
}
|
2017-05-31 08:58:48 +00:00
|
|
|
}
|
2019-09-30 09:47:39 +00:00
|
|
|
Controller.$inject = ['$scope', '$state'];
|
2017-05-31 08:58:48 +00:00
|
|
|
|
2017-06-03 11:01:47 +00:00
|
|
|
ngModule.component('vnClientIndex', {
|
2017-05-31 08:58:48 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-06-03 11:01:47 +00:00
|
|
|
});
|