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

34 lines
844 B
JavaScript

import ngModule from '../../../module';
class Controller {
constructor($scope, $state, $filter) {
this.$scope = $scope;
this.$state = $state;
this.insurance = {
created: $filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss')
};
}
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();
});
}
}
Controller.$inject = ['$scope', '$state', '$filter'];
ngModule.component('vnClientCreditInsuranceInsuranceCreate', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnClientCard'
},
bindings: {
client: '<'
}
});