Summary boss shown on descriptor
This commit is contained in:
parent
06dcb4b28c
commit
1f1db53d41
|
@ -42,6 +42,11 @@
|
||||||
"model": "Account",
|
"model": "Account",
|
||||||
"foreignKey": "userFk"
|
"foreignKey": "userFk"
|
||||||
},
|
},
|
||||||
|
"boss": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Account",
|
||||||
|
"foreignKey": "bossFk"
|
||||||
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Client",
|
"model": "Client",
|
||||||
|
@ -61,11 +66,6 @@
|
||||||
"type": "hasMany",
|
"type": "hasMany",
|
||||||
"model": "WorkerTeamCollegues",
|
"model": "WorkerTeamCollegues",
|
||||||
"foreignKey": "workerFk"
|
"foreignKey": "workerFk"
|
||||||
},
|
|
||||||
"boss": {
|
|
||||||
"type": "belongsTo",
|
|
||||||
"model": "Worker",
|
|
||||||
"foreignKey": "bossFk"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,8 +31,12 @@
|
||||||
value="{{worker.department.department.name}}">
|
value="{{worker.department.department.name}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Boss"
|
label="Boss">
|
||||||
value="{{worker.boss.firstName}}">
|
<span
|
||||||
|
ng-click="workerDescriptor.show($event, worker.boss.id)"
|
||||||
|
class="link">
|
||||||
|
{{::worker.boss.nickname}}
|
||||||
|
</span>
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Phone"
|
<vn-label-value label="Phone"
|
||||||
value="{{worker.phone}}">
|
value="{{worker.phone}}">
|
||||||
|
@ -54,4 +58,7 @@
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
<vn-worker-descriptor-popover
|
||||||
|
vn-id="workerDescriptor">
|
||||||
|
</vn-worker-descriptor-popover>
|
|
@ -11,8 +11,8 @@ class Controller extends Summary {
|
||||||
this.$.worker = null;
|
this.$.worker = null;
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
|
|
||||||
let query = `Workers/${value.id}`;
|
const query = `Workers/${value.id}`;
|
||||||
let filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'user',
|
relation: 'user',
|
||||||
|
@ -31,16 +31,20 @@ class Controller extends Summary {
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
relation: 'client',
|
relation: 'client',
|
||||||
scope: {fields: ['fi']}
|
scope: {fields: ['fi']}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
relation: 'boss',
|
relation: 'boss',
|
||||||
scope: {fields: ['id', 'firstName']}
|
scope: {fields: ['id', 'nickname']}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
relation: 'sip',
|
relation: 'sip',
|
||||||
scope: {fields: ['extension']}
|
scope: {fields: ['extension']}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
relation: 'department',
|
relation: 'department',
|
||||||
scope: {
|
scope: {
|
||||||
include: {
|
include: {
|
||||||
|
|
Loading…
Reference in New Issue