53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
|
import ngModule from '../module';
|
||
|
|
||
|
export default class Controller {
|
||
|
constructor($scope) {
|
||
|
this.$scope = $scope;
|
||
|
this.ticketSelected = null;
|
||
|
|
||
|
this.filter = {
|
||
|
include: [
|
||
|
{
|
||
|
relation: 'agency',
|
||
|
scope: {
|
||
|
fields: ['name']
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
relation: 'warehouseIn',
|
||
|
scope: {
|
||
|
fields: ['name']
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
relation: 'warehouseOut',
|
||
|
scope: {
|
||
|
fields: ['name']
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
};
|
||
|
}
|
||
|
|
||
|
exprBuilder(param, value) {
|
||
|
switch (param) {
|
||
|
case 'search':
|
||
|
return {id: value};
|
||
|
case 'ref':
|
||
|
return {[param]: {regexp: value}};
|
||
|
case 'id':
|
||
|
case 'agencyFk':
|
||
|
case 'warehouseOutFk':
|
||
|
case 'warehouseInFk':
|
||
|
return {[param]: value};
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Controller.$inject = ['$scope'];
|
||
|
|
||
|
ngModule.component('vnTravelIndex', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller
|
||
|
});
|