salix/modules/item/front/summary/index.js

41 lines
894 B
JavaScript

import ngModule from '../module';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Summary {
getSummary() {
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;
});
}
$onChanges() {
if (this.item && this.item.id)
this.getSummary();
}
get isBuyer() {
return this.aclService.hasAny(['buyer']);
}
get isReplenisher() {
return this.aclService.hasAny(['replenisher']);
}
get isAdministrative() {
return this.aclService.hasAny(['administrative']);
}
get isEmployee() {
return this.aclService.hasAny(['employee']);
}
}
ngModule.vnComponent('vnItemSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
item: '<',
},
});