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

52 lines
1.3 KiB
JavaScript

import ngModule from '../module';
export default class Controller {
constructor($scope, $state, $stateParams) {
this.$stateParams = $stateParams;
this.$state = $state;
this.$ = $scope;
this.ticketSelected = null;
}
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();
event.preventDefault();
event.stopImmediatePropagation();
}
showWorkerDescriptor(event, userId) {
event.preventDefault();
event.stopImmediatePropagation();
this.selectedWorker = userId;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
onDescriptorLoad() {
this.$.popover.relocate();
}
preview(event, order) {
event.preventDefault();
event.stopImmediatePropagation();
this.selectedOrder = order;
this.$.summary.show();
}
}
Controller.$inject = ['$scope', '$state', '$stateParams'];
ngModule.component('vnOrderIndex', {
template: require('./index.html'),
controller: Controller
});