2020-10-20 07:44:44 +00:00
|
|
|
import ngModule from '../module';
|
2020-11-23 12:41:51 +00:00
|
|
|
import Summary from 'salix/components/summary';
|
2020-10-20 07:44:44 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2020-11-23 12:41:51 +00:00
|
|
|
class Controller extends Summary {
|
2020-10-20 07:44:44 +00:00
|
|
|
$onChanges() {
|
|
|
|
if (!this.supplier)
|
|
|
|
return;
|
|
|
|
|
|
|
|
this.getSummary();
|
|
|
|
}
|
|
|
|
|
2021-01-12 06:39:12 +00:00
|
|
|
get isAdministrative() {
|
|
|
|
return this.aclService.hasAny(['administrative']);
|
|
|
|
}
|
|
|
|
|
2020-10-20 07:44:44 +00:00
|
|
|
getSummary() {
|
2020-10-26 07:38:43 +00:00
|
|
|
return this.$http.get(`Suppliers/${this.supplier.id}/getSummary`).then(response => {
|
2020-10-20 07:44:44 +00:00
|
|
|
this.summary = response.data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnSupplierSummary', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
supplier: '<'
|
|
|
|
}
|
|
|
|
});
|