2022-10-11 09:43:01 +00:00
|
|
|
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-11 09:43:01 +00:00
|
|
|
|
2022-10-17 05:25:25 +00:00
|
|
|
redirect(this.$.$ctrl);
|
|
|
|
|
2022-10-18 11:07:10 +00:00
|
|
|
function redirect(ctrl) {
|
2022-10-17 05:25:25 +00:00
|
|
|
window.location.href = `/#!/supplier/${ctrl.supplier.supplier.id}/fiscal-data`;
|
|
|
|
}
|
|
|
|
}
|
2022-10-11 09:43:01 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$element', '$scope'];
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnSupplierCreate', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|