salix/modules/client/front/credit-insurance/insurance/create/index.js

34 lines
844 B
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import ngModule from '../../../module';
class Controller {
2018-07-10 06:23:32 +00:00
constructor($scope, $state, $filter) {
this.$scope = $scope;
this.$state = $state;
this.insurance = {
created: $filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss')
};
}
2018-07-10 06:23:32 +00:00
onSubmit() {
let params = {classificationId: this.$state.params.classificationId};
let state = 'client.card.creditInsurance.insurance.index';
this.$scope.watcher.submitGo(state, params).then(() => {
this.card.reload();
});
}
}
2018-07-10 06:23:32 +00:00
Controller.$inject = ['$scope', '$state', '$filter'];
2018-05-23 12:26:51 +00:00
ngModule.component('vnClientCreditInsuranceInsuranceCreate', {
template: require('./index.html'),
controller: Controller,
2018-07-10 06:23:32 +00:00
require: {
card: '^vnClientCard'
},
bindings: {
client: '<'
}
});