2019-01-18 12:36:13 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-18 07:35:59 +00:00
|
|
|
import Component from 'core/lib/component';
|
2019-10-10 06:07:11 +00:00
|
|
|
import './style.scss';
|
2019-01-18 12:36:13 +00:00
|
|
|
|
2020-03-18 07:35:59 +00:00
|
|
|
class Controller extends Component {
|
2019-09-25 09:26:12 +00:00
|
|
|
addStowaway(stowaway) {
|
|
|
|
let params = {id: stowaway.id, shipFk: this.ticket.id};
|
2019-10-24 22:53:53 +00:00
|
|
|
this.$http.post(`Stowaways/`, params)
|
2019-02-01 11:11:56 +00:00
|
|
|
.then(() => {
|
2019-02-04 11:24:47 +00:00
|
|
|
this.cardReload();
|
2019-02-01 11:11:56 +00:00
|
|
|
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
2019-06-21 11:19:51 +00:00
|
|
|
this.$.dialog.hide();
|
2019-01-18 12:36:13 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
show() {
|
2019-06-21 05:41:03 +00:00
|
|
|
this.$.dialog.show();
|
2019-01-18 12:36:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
hide() {
|
2019-06-21 05:41:03 +00:00
|
|
|
this.$.dialog.hide();
|
2019-01-18 12:36:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.component('vnAddStowaway', {
|
|
|
|
template: require('./addStowaway.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
2019-02-04 11:24:47 +00:00
|
|
|
ticket: '<',
|
|
|
|
cardReload: '&?'
|
2019-01-18 12:36:13 +00:00
|
|
|
}
|
|
|
|
});
|