Add attendedBy and salesPerson filters #1661
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-09-02 12:23:49 +02:00
parent 37b9c5c4ce
commit 50c989a267
3 changed files with 32 additions and 16 deletions

View File

@ -44,9 +44,14 @@ module.exports = Self => {
description: 'The claim state id',
http: {source: 'query'}
}, {
arg: 'workerFk',
arg: 'salesPersonFk',
type: 'Integer',
description: 'The worker id',
description: 'The salesPerson id',
http: {source: 'query'}
}, {
arg: 'attenderFk',
type: 'Integer',
description: 'The attender worker id',
http: {source: 'query'}
}, {
arg: 'created',
@ -86,7 +91,9 @@ module.exports = Self => {
return {'c.id': value};
case 'claimStateFk':
return {'cl.claimStateFk': value};
case 'workerFk':
case 'salesPersonFk':
return {'c.salesPersonFk': value};
case 'attenderFk':
return {'cl.workerFk': value};
case 'created':
return {'cl.created': value};

View File

@ -36,7 +36,7 @@
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Worker">
label="Attended by">
</vn-autocomplete>
<vn-autocomplete
vn-one

View File

@ -31,6 +31,27 @@
<vn-horizontal>
<vn-autocomplete
vn-one
field="filter.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Salesperson">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
<vn-autocomplete
vn-one
field="filter.attenderFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Attended by">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
label="State"
field="filter.claimStateFk"
url="/claim/api/ClaimStates"
@ -38,18 +59,6 @@
value-field="id">
<tpl-item>{{description}}</tpl-item>
</vn-autocomplete>
<vn-autocomplete
vn-one
field="filter.workerFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Worker">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-date-picker
vn-one
label="Created"