63 lines
1.6 KiB
JavaScript
63 lines
1.6 KiB
JavaScript
import ngModule from '../module';
|
|
|
|
class Controller {
|
|
constructor($scope, $stateParams, $http) {
|
|
this.$ = $scope;
|
|
this.$stateParams = $stateParams;
|
|
this.$http = $http;
|
|
}
|
|
|
|
deleteExpedition(expedition) {
|
|
this.expeditionId = expedition.id;
|
|
this.$.deleteExpedition.show();
|
|
}
|
|
|
|
returnDialog(response) {
|
|
if (response === 'ACCEPT') {
|
|
this.$http.delete(`Expeditions/${this.expeditionId}`).then(
|
|
() => this.$.model.refresh()
|
|
);
|
|
}
|
|
}
|
|
|
|
showItemDescriptor(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.$.itemDescriptor.itemFk = itemFk;
|
|
this.$.itemDescriptor.parent = event.target;
|
|
this.$.itemDescriptor.show();
|
|
}
|
|
|
|
showWorkerDescriptor(event, workerFk) {
|
|
event.preventDefault();
|
|
event.stopImmediatePropagation();
|
|
this.selectedWorker = workerFk;
|
|
this.$.workerDescriptor.parent = event.target;
|
|
this.$.workerDescriptor.show();
|
|
}
|
|
|
|
onDescriptorLoad() {
|
|
this.$.popover.relocate();
|
|
}
|
|
}
|
|
|
|
Controller.$inject = ['$scope', '$stateParams', '$http'];
|
|
|
|
ngModule.component('vnTicketExpedition', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
ticket: '<',
|
|
},
|
|
});
|