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

34 lines
853 B
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import ngModule from '../../../module';
2020-03-17 10:17:50 +00:00
import Section from 'salix/components/section';
2020-03-17 10:17:50 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.insurance = {
2023-01-16 14:18:24 +00:00
created: this.$filter('date')(Date.vnNew(), 'yyyy-MM-dd HH:mm:ss')
};
}
2018-07-10 06:23:32 +00:00
onSubmit() {
2020-03-17 10:17:50 +00:00
let params = {classificationId: this.$params.classificationId};
2018-07-10 06:23:32 +00:00
let state = 'client.card.creditInsurance.insurance.index';
2020-03-17 10:17:50 +00:00
this.$.watcher.submitGo(state, params).then(() => {
2018-07-10 06:23:32 +00:00
this.card.reload();
});
}
}
2020-03-17 10:17:50 +00:00
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientCreditInsuranceInsuranceCreate', {
2018-05-23 12:26:51 +00:00
template: require('./index.html'),
controller: Controller,
2018-07-10 06:23:32 +00:00
require: {
card: '^vnClientCard'
},
bindings: {
client: '<'
}
});