33 lines
716 B
JavaScript
33 lines
716 B
JavaScript
import ngModule from '../module';
|
|
import Descriptor from 'salix/components/descriptor';
|
|
|
|
class Controller extends Descriptor {
|
|
get order() {
|
|
return this.entity;
|
|
}
|
|
|
|
set order(value) {
|
|
this.entity = value;
|
|
}
|
|
|
|
get ticketFilter() {
|
|
return JSON.stringify({orderFk: this.id});
|
|
}
|
|
|
|
deleteOrder() {
|
|
return this.$http.delete(`Orders/${this.id}`)
|
|
.then(() => {
|
|
this.$state.go('order.index');
|
|
this.vnApp.showSuccess(this.$t('Order deleted'));
|
|
});
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnOrderDescriptor', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
order: '<'
|
|
}
|
|
});
|