#1350 route.index
This commit is contained in:
parent
46756dfdcb
commit
28a69c8d2b
|
@ -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};
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue