salix/modules/client/front/index/index.js

34 lines
833 B
JavaScript
Raw Normal View History

2017-06-03 11:01:47 +00:00
import ngModule from '../module';
2017-06-03 11:01:47 +00:00
export default class Controller {
constructor($scope, $state) {
this.$ = $scope;
this.$state = $state;
this.clientSelected = null;
2017-07-03 12:23:53 +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();
this.clientSelected = client;
this.$.dialogSummaryClient.show();
}
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})});
}
}
Controller.$inject = ['$scope', '$state'];
2017-06-03 11:01:47 +00:00
ngModule.component('vnClientIndex', {
template: require('./index.html'),
controller: Controller
2017-06-03 11:01:47 +00:00
});