2021-05-31 06:21:16 +00:00
|
|
|
import ngModule from '../../../supplier/front/module';
|
|
|
|
import Section from 'salix/components/section';
|
|
|
|
|
|
|
|
class Controller extends Section {
|
|
|
|
$onInit() {
|
2021-06-01 08:10:09 +00:00
|
|
|
this.invoiceIn = {};
|
2021-05-31 06:21:16 +00:00
|
|
|
if (this.$params && this.$params.supplierFk)
|
2021-06-01 08:10:09 +00:00
|
|
|
this.invoiceIn.supplierFk = this.$params.supplierFk;
|
2021-05-31 06:21:16 +00:00
|
|
|
}
|
|
|
|
|
2021-06-01 08:10:09 +00:00
|
|
|
get companyFk() {
|
|
|
|
return this.invoiceIn.companyFk || this.vnConfig.companyFk;
|
2021-05-31 06:21:16 +00:00
|
|
|
}
|
|
|
|
|
2021-06-01 08:10:09 +00:00
|
|
|
set companyFk(value) {
|
|
|
|
this.invoiceIn.companyFk = value;
|
2021-05-31 06:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit() {
|
2021-06-01 08:10:09 +00:00
|
|
|
this.$.watcher.submit().then(
|
|
|
|
res => this.$state.go('invoiceIn.card.basicData', {id: res.data.id})
|
|
|
|
);
|
2021-05-31 06:21:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnInvoiceInCreate', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|