#911 claim.development

This commit is contained in:
Gerard 2018-12-10 10:16:54 +01:00
parent f5b36c5d20
commit e52012ac41
2 changed files with 9 additions and 8 deletions

View File

@ -21,12 +21,6 @@
data="claimResponsibles"
order="description">
</vn-crud-model>
<vn-crud-model
url="/client/api/Clients/activeWorkersWithRole"
where="{role: 'salesPerson'}"
data="activeSalesPersons"
order="firstName">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimRedeliveries"
data="claimRedeliveries"
@ -78,8 +72,11 @@
vn-one
label="Worker"
field="claimDevelopment.workerFk"
data="activeSalesPersons"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
where="{role: 'employee'}"
show-field="firstName"
value-field="id"
vn-acl="salesAssistant">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>

View File

@ -37,7 +37,11 @@ module.exports = Self => {
case 'role':
return {'r.name': value};
case 'firstName':
return {or: [{'w.firstName': {like: `%${value}%`}}, {'w.name': {like: `%${value}%`}}]};
return {or: [
{'w.firstName': {like: `%${value}%`}},
{'w.name': {like: `%${value}%`}},
{'u.name': {like: `%${value}%`}}
]};
case 'id':
return {'w.id': value};
}