2018-09-05 11:47:15 +00:00
|
|
|
import ngModule from '../module';
|
2019-09-26 09:41:56 +00:00
|
|
|
import './style.scss';
|
2018-09-05 11:47:15 +00:00
|
|
|
|
|
|
|
class Controller {
|
2019-09-26 09:41:56 +00:00
|
|
|
constructor($scope, $http, $stateParams, vnToken) {
|
2018-09-05 11:47:15 +00:00
|
|
|
this.$http = $http;
|
2018-11-21 12:29:46 +00:00
|
|
|
this.$ = $scope;
|
2019-09-26 09:41:56 +00:00
|
|
|
this.$stateParams = $stateParams;
|
|
|
|
this.accessToken = vnToken.token;
|
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
|
|
|
|
2019-02-15 11:39:21 +00:00
|
|
|
showItemDescriptor(event, itemFk) {
|
|
|
|
this.$.itemDescriptor.itemFk = itemFk;
|
|
|
|
this.$.itemDescriptor.parent = event.target;
|
|
|
|
this.$.itemDescriptor.show();
|
|
|
|
}
|
|
|
|
|
2019-04-25 12:24:02 +00:00
|
|
|
showWorkerDescriptor(event, workerFk) {
|
|
|
|
this.selectedWorker = workerFk;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.workerDescriptor.parent = event.target;
|
|
|
|
this.$.workerDescriptor.show();
|
2018-11-21 12:29:46 +00:00
|
|
|
}
|
2019-02-21 06:46:27 +00:00
|
|
|
|
|
|
|
showTicketDescriptor(event, ticketId) {
|
|
|
|
this.$.ticketDescriptor.ticketFk = ticketId;
|
|
|
|
this.$.ticketDescriptor.parent = event.target;
|
|
|
|
this.$.ticketDescriptor.show();
|
|
|
|
}
|
2018-09-05 11:47:15 +00:00
|
|
|
}
|
|
|
|
|
2019-09-26 09:41:56 +00:00
|
|
|
Controller.$inject = ['$scope', '$http', '$stateParams', 'vnToken'];
|
2018-09-05 11:47:15 +00:00
|
|
|
|
|
|
|
ngModule.component('vnClaimSummary', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
claim: '<'
|
|
|
|
}
|
|
|
|
});
|