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

44 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-08-24 11:16:11 +00:00
import ngModule from '../module';
2020-04-25 09:50:04 +00:00
import Descriptor from 'salix/components/descriptor';
2018-08-24 11:16:11 +00:00
2020-04-25 09:50:04 +00:00
class Controller extends Descriptor {
2018-10-03 06:00:19 +00:00
get claim() {
return this.entity;
2018-10-03 06:00:19 +00:00
}
set claim(value) {
this.entity = value;
2018-08-24 11:16:11 +00:00
}
2019-02-12 06:42:19 +00:00
showPickupOrder() {
2020-06-12 12:28:29 +00:00
this.vnReport.show('claim-pickup-order', {
2020-05-22 13:20:55 +00:00
recipientId: this.claim.clientFk,
claimId: this.claim.id
});
2019-01-25 14:08:11 +00:00
}
2019-09-06 09:06:44 +00:00
sendPickupOrder() {
2020-06-12 12:28:29 +00:00
return this.vnEmail.send('claim-pickup-order', {
recipient: this.claim.client.email,
2020-05-22 13:20:55 +00:00
recipientId: this.claim.clientFk,
claimId: this.claim.id
});
2019-09-06 09:06:44 +00:00
}
deleteClaim() {
return this.$http.delete(`Claims/${this.claim.id}`)
.then(() => {
this.vnApp.showSuccess(this.$t('Claim deleted!'));
this.$state.go('claim.index');
});
}
2018-08-24 11:16:11 +00:00
}
2020-04-25 09:50:04 +00:00
ngModule.vnComponent('vnClaimDescriptor', {
2018-08-24 11:16:11 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
2018-08-24 11:16:11 +00:00
}
});