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", "type": "hasMany",
"model": "WorkerTeamCollegues", "model": "WorkerTeamCollegues",
"foreignKey": "workerFk" "foreignKey": "workerFk"
},
"boss": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "bossFk"
} }
} }
} }

View File

@ -29,6 +29,15 @@
ng-model="$ctrl.worker.phone" ng-model="$ctrl.worker.phone"
rule> rule>
</vn-textfield> </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-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

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

View File

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