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

30 lines
731 B
JavaScript
Raw Normal View History

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