2018-08-07 09:57:11 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
export default class Controller {
|
|
|
|
constructor($scope) {
|
|
|
|
this.$ = $scope;
|
|
|
|
this.ticketSelected = null;
|
2018-09-04 13:08:36 +00:00
|
|
|
}
|
|
|
|
|
2019-02-10 21:52:35 +00:00
|
|
|
stateColor(claim) {
|
2019-04-15 09:06:42 +00:00
|
|
|
switch (claim.description) {
|
2019-02-10 21:52:35 +00:00
|
|
|
case 'Pendiente':
|
|
|
|
return 'warning';
|
|
|
|
case 'Gestionado':
|
|
|
|
return 'notice';
|
|
|
|
case 'Resuelto':
|
|
|
|
return 'success';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-15 11:39:21 +00:00
|
|
|
showClientDescriptor(event, clientFk) {
|
|
|
|
this.$.clientDescriptor.clientFk = clientFk;
|
|
|
|
this.$.clientDescriptor.parent = event.target;
|
|
|
|
this.$.clientDescriptor.show();
|
2018-08-31 12:35:20 +00:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
2019-04-25 12:24:02 +00:00
|
|
|
showWorkerDescriptor(event, workerFk) {
|
2019-02-15 11:39:21 +00:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
2019-04-25 12:24:02 +00:00
|
|
|
this.selectedWorker = workerFk;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.workerDescriptor.parent = event.target;
|
|
|
|
this.$.workerDescriptor.show();
|
|
|
|
}
|
|
|
|
|
2018-09-05 11:47:15 +00:00
|
|
|
preview(event, claim) {
|
|
|
|
this.claimSelected = claim;
|
|
|
|
this.$.dialogSummaryClaim.show();
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
2018-08-31 12:35:20 +00:00
|
|
|
onDescriptorLoad() {
|
|
|
|
this.$.popover.relocate();
|
|
|
|
}
|
2019-04-15 09:06:42 +00:00
|
|
|
|
|
|
|
onSearch(params) {
|
|
|
|
if (params)
|
|
|
|
this.$.model.applyFilter(null, params);
|
|
|
|
else
|
|
|
|
this.$.model.clear();
|
|
|
|
}
|
2018-08-07 09:57:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$scope'];
|
|
|
|
|
|
|
|
ngModule.component('vnClaimIndex', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|