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

34 lines
833 B
JavaScript

import ngModule from '../module';
export default class Controller {
constructor($scope, $state) {
this.$ = $scope;
this.$state = $state;
this.clientSelected = null;
}
openSummary(client, event) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.clientSelected = client;
this.$.dialogSummaryClient.show();
}
filterTickets(client, event) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.$state.go(`ticket.index`,
{q: JSON.stringify({clientFk: client.id})});
}
}
Controller.$inject = ['$scope', '$state'];
ngModule.component('vnClientIndex', {
template: require('./index.html'),
controller: Controller
});