53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
import ngModule from '../module';
|
|
|
|
class Controller {
|
|
constructor($scope, $http) {
|
|
this.$http = $http;
|
|
this.$ = $scope;
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
showItemDescriptor(event, itemFk) {
|
|
this.quicklinks = {
|
|
btnThree: {
|
|
icon: 'icon-transaction',
|
|
state: `item.card.diary({
|
|
id: ${itemFk}
|
|
})`,
|
|
tooltip: 'Item diary'
|
|
}
|
|
};
|
|
this.$.itemDescriptor.itemFk = itemFk;
|
|
this.$.itemDescriptor.parent = event.target;
|
|
this.$.itemDescriptor.show();
|
|
}
|
|
|
|
showWorkerDescriptor(event, userId) {
|
|
event.preventDefault();
|
|
event.stopImmediatePropagation();
|
|
this.selectedWorker = userId;
|
|
this.$.workerDescriptor.parent = event.target;
|
|
this.$.workerDescriptor.show();
|
|
}
|
|
}
|
|
|
|
Controller.$inject = ['$scope', '$http'];
|
|
|
|
ngModule.component('vnClaimSummary', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
claim: '<'
|
|
}
|
|
});
|