This commit is contained in:
Carlos Jimenez Ruiz 2019-05-02 13:25:41 +02:00
parent 46756dfdcb
commit 28a69c8d2b
4 changed files with 28 additions and 0 deletions

View File

@ -48,6 +48,11 @@ module.exports = Self => {
type: 'Number',
description: 'The m3 filter',
http: {source: 'query'}
}, {
arg: 'warehouseFk',
type: 'Number',
description: 'The warehouse filter',
http: {source: 'query'}
}, {
arg: 'description',
type: 'String',
@ -81,6 +86,7 @@ module.exports = Self => {
case 'description':
return {'r.description': {like: `%${value}%`}};
case 'workerFk':
case 'warehouseFk':
case 'vehicleFk':
case 'agencyModeFk':
return {[param]: value};

View File

@ -9,6 +9,7 @@
<div class="vn-list">
<vn-card pad-medium-h>
<vn-searchbar
filter="$ctrl.filter"
panel="vn-route-search-panel"
on-search="$ctrl.onSearch($params)"
info="Search routes by id"

View File

@ -4,6 +4,19 @@ export default class Controller {
constructor($scope, vnToken) {
this.accessToken = vnToken.token;
this.$ = $scope;
this.setDefaultFilter();
}
setDefaultFilter() {
let to = new Date();
to.setDate(to.getDate() + 1);
to.setHours(0, 0, 0, 0);
let from = new Date();
from.setHours(0, 0, 0, 0);
this.filter = {from, to, warehouseFk: localStorage.defaultWarehouseFk};
}
showWorkerDescriptor(event, workerFk) {

View File

@ -55,6 +55,14 @@
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
label="Warehouse"
field="filter.warehouseFk"
url="/route/api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-textfield
vn-one
label="Description"