salix/modules/order/front/descriptor/index.js

33 lines
716 B
JavaScript
Raw Normal View History

2018-07-18 12:21:58 +00:00
import ngModule from '../module';
2020-04-25 09:50:04 +00:00
import Descriptor from 'salix/components/descriptor';
2018-07-18 12:21:58 +00:00
2020-04-25 09:50:04 +00:00
class Controller extends Descriptor {
get order() {
return this.entity;
2018-07-18 12:21:58 +00:00
}
2018-10-03 06:00:19 +00:00
2018-12-12 10:43:57 +00:00
set order(value) {
this.entity = value;
2018-12-12 10:43:57 +00:00
}
get ticketFilter() {
return JSON.stringify({orderFk: this.id});
2018-12-12 10:43:57 +00:00
}
deleteOrder() {
return this.$http.delete(`Orders/${this.id}`)
.then(() => {
2019-08-29 11:16:38 +00:00
this.$state.go('order.index');
this.vnApp.showSuccess(this.$t('Order deleted'));
2019-08-29 11:16:38 +00:00
});
}
2018-07-18 12:21:58 +00:00
}
2020-04-25 09:50:04 +00:00
ngModule.vnComponent('vnOrderDescriptor', {
2018-07-18 12:21:58 +00:00
template: require('./index.html'),
2020-04-25 09:50:04 +00:00
controller: Controller,
2018-07-18 12:21:58 +00:00
bindings: {
order: '<'
2020-04-25 09:50:04 +00:00
}
2018-07-18 12:21:58 +00:00
});