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

41 lines
894 B
JavaScript
Raw Normal View History

2018-02-20 11:33:17 +00:00
import ngModule from '../module';
2020-11-23 12:41:51 +00:00
import Summary from 'salix/components/summary';
2018-07-24 10:53:26 +00:00
import './style.scss';
2018-02-20 11:33:17 +00:00
2020-11-23 12:41:51 +00:00
class Controller extends Summary {
getSummary() {
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;
2018-02-20 11:33:17 +00:00
});
}
$onChanges() {
if (this.item && this.item.id)
this.getSummary();
2018-02-20 11:33:17 +00:00
}
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']);
}
2018-02-20 11:33:17 +00:00
}
ngModule.vnComponent('vnItemSummary', {
template: require('./index.html'),
controller: Controller,
2018-02-20 11:33:17 +00:00
bindings: {
item: '<',
},
2018-02-20 11:33:17 +00:00
});