2020-09-07 06:15:43 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import Section from 'salix/components/section';
|
2022-01-20 07:31:30 +00:00
|
|
|
import './style.scss';
|
2020-09-07 06:15:43 +00:00
|
|
|
|
2022-01-20 07:31:30 +00:00
|
|
|
class Controller extends Section {
|
|
|
|
showFilterDialog(travel) {
|
|
|
|
this.activeTravel = travel;
|
|
|
|
this.travelFilterParams = {};
|
|
|
|
this.travelFilter = {
|
|
|
|
include: [
|
|
|
|
{
|
|
|
|
relation: 'agency',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
relation: 'warehouseIn',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
relation: 'warehouseOut',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
this.$.filterDialog.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
selectTravel(id) {
|
|
|
|
this.entry.travelFk = id;
|
|
|
|
this.$.filterDialog.hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
filter() {
|
|
|
|
const filter = this.travelFilter;
|
|
|
|
const params = this.travelFilterParams;
|
|
|
|
const where = {};
|
|
|
|
for (let key in params) {
|
|
|
|
const value = params[key];
|
|
|
|
if (!value) continue;
|
|
|
|
|
|
|
|
switch (key) {
|
2022-07-13 12:36:03 +00:00
|
|
|
case 'agencyModeFk':
|
2022-01-20 07:31:30 +00:00
|
|
|
case 'warehouseInFk':
|
|
|
|
case 'warehouseOutFk':
|
|
|
|
case 'shipped':
|
|
|
|
case 'landed':
|
|
|
|
where[key] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
filter.where = where;
|
|
|
|
this.$.travelsModel.applyFilter(filter);
|
|
|
|
}
|
|
|
|
}
|
2020-09-07 06:15:43 +00:00
|
|
|
ngModule.vnComponent('vnEntryBasicData', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
bindings: {
|
|
|
|
entry: '<'
|
2022-01-20 07:31:30 +00:00
|
|
|
},
|
|
|
|
controller: Controller
|
2020-09-07 06:15:43 +00:00
|
|
|
});
|