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

34 lines
849 B
JavaScript

import ngModule from '../../../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.insurance = {
created: this.$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss')
};
}
onSubmit() {
let params = {classificationId: this.$params.classificationId};
let state = 'client.card.creditInsurance.insurance.index';
this.$.watcher.submitGo(state, params).then(() => {
this.card.reload();
});
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.component('vnClientCreditInsuranceInsuranceCreate', {
template: require('./index.html'),
controller: Controller,
require: {
card: '^vnClientCard'
},
bindings: {
client: '<'
}
});