51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
import ngModule from '../module';
|
|
|
|
class Controller {
|
|
constructor($scope, $stateParams, $http) {
|
|
this.$scope = $scope;
|
|
this.$stateParams = $stateParams;
|
|
this.$http = $http;
|
|
this.filter = {
|
|
include: [{
|
|
relation: 'item',
|
|
scope: {
|
|
fields: ['name']
|
|
}
|
|
},
|
|
{
|
|
relation: 'box',
|
|
scope: {
|
|
fields: ['name']
|
|
}
|
|
},
|
|
{
|
|
relation: 'worker',
|
|
scope: {fields: ['firstName', 'name']}
|
|
}]
|
|
};
|
|
}
|
|
|
|
deleteExpedition(expedition) {
|
|
this.$http.delete(`/ticket/api/Expeditions/${expedition.id}`, this.params).then(
|
|
() => this.$scope.model.refresh()
|
|
);
|
|
}
|
|
|
|
showDescriptor(event, itemFk) {
|
|
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
|
|
});
|