salix/modules/travel/front/index/index.js

42 lines
990 B
JavaScript

import ngModule from '../module';
export default class Controller {
constructor($) {
this.$ = $;
}
preview(event, travel) {
this.stopEvent(event);
this.travelSelected = travel;
this.$.summary.show();
}
cloneTravel(event, travel) {
this.stopEvent(event);
this.$.clone.show(travel);
}
onCloneAccept(travel) {
const params = JSON.stringify({
ref: travel.ref,
agencyModeFk: travel.agencyFk,
shipped: travel.shipped,
landed: travel.landed,
warehouseInFk: travel.warehouseInFk,
warehouseOutFk: travel.warehouseOutFk
});
this.$state.go('travel.create', {q: params});
}
stopEvent(event) {
event.preventDefault();
event.stopImmediatePropagation();
}
}
Controller.$inject = ['$scope'];
ngModule.component('vnTravelIndex', {
template: require('./index.html'),
controller: Controller
});