import ngModule from '../module'; class Controller { constructor($scope, $stateParams, $http) { this.$scope = $scope; this.$stateParams = $stateParams; this.$http = $http; } deleteExpedition(expedition) { this.expeditionId = expedition.id; this.$scope.deleteExpedition.show(); } returnDialog(response) { if (response === 'ACCEPT') { this.$http.delete(`/ticket/api/Expeditions/${this.expeditionId}`).then( () => this.$scope.model.refresh() ); } } showDescriptor(event, itemFk) { if (!itemFk) return; this.quicklinks = { btnThree: { icon: 'icon-transaction', state: `item.card.diary({ id: ${itemFk}, warehouseFk: ${this.ticket.warehouseFk}, ticketFk: ${this.ticket.id} })`, tooltip: 'Item diary', }, }; this.$scope.descriptor.itemFk = itemFk; this.$scope.descriptor.parent = event.target; this.$scope.descriptor.show(); } onDescriptorLoad() { this.$scope.popover.relocate(); } } Controller.$inject = ['$scope', '$stateParams', '$http']; ngModule.component('vnTicketExpedition', { template: require('./index.html'), controller: Controller, bindings: { ticket: '<', }, });