salix/modules/item/front/basic-data/index.js

28 lines
718 B
JavaScript
Raw Normal View History

2017-12-21 13:09:55 +00:00
import ngModule from '../module';
2020-02-17 06:22:55 +00:00
import Component from 'core/lib/component';
class Controller extends Component {
showIntrastat(event) {
if (event.defaultPrevented) return;
event.preventDefault();
2017-12-21 13:09:55 +00:00
2020-02-17 06:22:55 +00:00
this.newIntrastat = {
taxClassFk: this.item.taxClassFk
};
this.$.intrastat.show();
2018-02-20 13:30:02 +00:00
}
2020-02-17 11:47:03 +00:00
onIntrastatAccept() {
const query = `Items/${this.$params.id}/createIntrastat`;
return this.$http.patch(query, this.newIntrastat)
.then(res => this.item.intrastatFk = res.data.id);
2018-02-20 13:30:02 +00:00
}
}
ngModule.component('vnItemBasicData', {
template: require('./index.html'),
2017-12-21 13:09:55 +00:00
bindings: {
item: '<'
2018-02-20 13:30:02 +00:00
},
controller: Controller
2017-12-21 13:09:55 +00:00
});