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

42 lines
990 B
JavaScript
Raw Normal View History

2018-11-13 06:44:03 +00:00
import ngModule from '../module';
export default class Controller {
2020-03-16 17:08:44 +00:00
constructor($) {
this.$ = $;
2018-11-13 06:44:03 +00:00
}
2019-10-24 10:49:18 +00:00
preview(event, travel) {
this.stopEvent(event);
2019-10-24 10:49:18 +00:00
this.travelSelected = travel;
this.$.summary.show();
2019-12-20 06:55:00 +00:00
}
cloneTravel(event, travel) {
this.stopEvent(event);
this.$.clone.show(travel);
}
2019-12-20 06:55:00 +00:00
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});
2019-12-20 06:55:00 +00:00
}
2020-03-10 13:09:26 +00:00
stopEvent(event) {
2019-10-24 10:49:18 +00:00
event.preventDefault();
event.stopImmediatePropagation();
}
2018-11-13 06:44:03 +00:00
}
Controller.$inject = ['$scope'];
ngModule.component('vnTravelIndex', {
template: require('./index.html'),
controller: Controller
});