2020-09-02 12:08:56 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import Section from 'salix/components/section';
|
2020-09-03 06:09:37 +00:00
|
|
|
import './style.scss';
|
2020-09-02 12:08:56 +00:00
|
|
|
|
|
|
|
export default class Controller extends Section {
|
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
|
|
|
|
|
|
|
this.entry = {
|
|
|
|
companyFk: this.vnConfig.companyFk
|
|
|
|
};
|
|
|
|
|
|
|
|
if (this.$params && this.$params.supplierFk)
|
|
|
|
this.entry.supplierFk = parseInt(this.$params.supplierFk);
|
|
|
|
if (this.$params && this.$params.travelFk)
|
|
|
|
this.entry.travelFk = parseInt(this.$params.travelFk);
|
|
|
|
if (this.$params && this.$params.companyFk)
|
|
|
|
this.entry.companyFk = parseInt(this.$params.companyFk);
|
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit() {
|
|
|
|
this.$.watcher.submit().then(
|
|
|
|
res => this.$state.go('entry.card.basicData', {id: res.data.id})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
searchFunction($search) {
|
|
|
|
return {or: [
|
2020-09-03 14:52:35 +00:00
|
|
|
{'agencyModeName': {like: `%${$search}%`}},
|
|
|
|
{'warehouseInName': {like: `%${$search}%`}},
|
|
|
|
{'warehouseOutName': {like: `%${$search}%`}},
|
|
|
|
{'shipped': new Date($search)},
|
|
|
|
{'landed': new Date($search)}
|
2020-09-02 12:08:56 +00:00
|
|
|
]};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$element', '$scope'];
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnEntryCreate', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|