2018-09-05 11:47:15 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
class Controller {
|
2018-11-21 12:29:46 +00:00
|
|
|
constructor($http, $scope) {
|
2018-09-05 11:47:15 +00:00
|
|
|
this.$http = $http;
|
2018-11-21 12:29:46 +00:00
|
|
|
this.$ = $scope;
|
2018-09-05 11:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getSummary() {
|
|
|
|
this.$http.get(`/claim/api/Claims/${this.claim.id}/getSummary`).then(response => {
|
|
|
|
this.summary = response.data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$onChanges() {
|
|
|
|
if (this.claim && this.claim.id)
|
|
|
|
this.getSummary();
|
|
|
|
}
|
2018-11-21 12:29:46 +00:00
|
|
|
|
|
|
|
// Item Descriptor
|
|
|
|
showDescriptor(event, itemFk) {
|
|
|
|
this.quicklinks = {
|
|
|
|
btnThree: {
|
|
|
|
icon: 'icon-transaction',
|
|
|
|
state: `item.card.diary({
|
|
|
|
id: ${itemFk}
|
|
|
|
})`,
|
|
|
|
tooltip: 'Item diary'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
this.$.descriptor.itemFk = itemFk;
|
|
|
|
this.$.descriptor.parent = event.target;
|
|
|
|
this.$.descriptor.show();
|
|
|
|
}
|
2018-09-05 11:47:15 +00:00
|
|
|
}
|
|
|
|
|
2018-11-21 12:29:46 +00:00
|
|
|
Controller.$inject = ['$http', '$scope'];
|
2018-09-05 11:47:15 +00:00
|
|
|
|
|
|
|
ngModule.component('vnClaimSummary', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
claim: '<'
|
|
|
|
}
|
|
|
|
});
|