30 lines
731 B
JavaScript
30 lines
731 B
JavaScript
import ngModule from '../module';
|
|
import Section from 'salix/components/section';
|
|
|
|
class Controller extends Section {
|
|
constructor($element, $) {
|
|
super($element, $);
|
|
}
|
|
|
|
onSubmit() {
|
|
this.$.watcher.submit().then(
|
|
json => {
|
|
this.$state.go('item.card.basicData', {id: json.data.id});
|
|
|
|
redirect(this.$.$ctrl);
|
|
|
|
function redirect(ctrl) {
|
|
window.location.href = `/#!/supplier/${ctrl.supplier.supplier.id}/fiscal-data`;
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
Controller.$inject = ['$element', '$scope'];
|
|
|
|
ngModule.vnComponent('vnSupplierCreate', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|