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

51 lines
1.3 KiB
JavaScript

import ngModule from '../module';
import './style.scss';
class Controller {
constructor($scope, $http, $stateParams, vnToken) {
this.$http = $http;
this.$ = $scope;
this.$stateParams = $stateParams;
this.accessToken = vnToken.token;
}
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.$.itemDescriptor.itemFk = itemFk;
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();
}
showWorkerDescriptor(event, workerFk) {
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
showTicketDescriptor(event, ticketId) {
this.$.ticketDescriptor.ticketFk = ticketId;
this.$.ticketDescriptor.parent = event.target;
this.$.ticketDescriptor.show();
}
}
Controller.$inject = ['$scope', '$http', '$stateParams', 'vnToken'];
ngModule.component('vnClaimSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
}
});