Added boss on basic data and summary

This commit is contained in:
jorgebl 2021-02-19 17:45:45 +01:00
parent ddb443ab8f
commit 8deb11d333
4 changed files with 21 additions and 0 deletions

View File

@ -61,6 +61,11 @@
"type": "hasMany",
"model": "WorkerTeamCollegues",
"foreignKey": "workerFk"
},
"boss": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "bossFk"
}
}
}

View File

@ -29,6 +29,15 @@
ng-model="$ctrl.worker.phone"
rule>
</vn-textfield>
<vn-autocomplete
disabled="false"
ng-model="$ctrl.worker.bossFk"
url="Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
where="{role: 'employee'}"
label="Boss">
</vn-autocomplete>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -30,6 +30,10 @@
<vn-label-value label="Department"
value="{{worker.department.department.name}}">
</vn-label-value>
<vn-label-value
label="Boss"
value="{{worker.boss.firstName}}">
</vn-label-value>
<vn-label-value label="Phone"
value="{{worker.phone}}">
</vn-label-value>

View File

@ -34,6 +34,9 @@ class Controller extends Summary {
}, {
relation: 'client',
scope: {fields: ['fi']}
}, {
relation: 'boss',
scope: {fields: ['id', 'firstName']}
}, {
relation: 'sip',
scope: {fields: ['extension']}