salix/modules/supplier/front/create/index.js

30 lines
737 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);
async 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
});