#997 worker summary
This commit is contained in:
parent
e553d63492
commit
7893c784aa
|
@ -15,6 +15,12 @@
|
|||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"roleFk": {
|
||||
"type": "number",
|
||||
"mysql": {
|
||||
"columnName": "role"
|
||||
}
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -35,6 +41,13 @@
|
|||
"type": "date"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"role": {
|
||||
"type": "belongsTo",
|
||||
"model": "Role",
|
||||
"foreignKey": "roleFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"property": "login",
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
& > * {
|
||||
@extend .pad-small;
|
||||
}
|
||||
& > .attributes > h5 {
|
||||
@extend .pad-small-bottom;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
& > .icons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "bs.workerMana"
|
||||
"table": "bs.workerMana"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "Number"
|
||||
"type": "Number"
|
||||
},
|
||||
"workerFk": {
|
||||
"id": true,
|
||||
"type": "Number"
|
||||
"id": true,
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"worker": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,38 @@
|
|||
<vn-card class="summary">
|
||||
<h5>{{worker.name}}</h5>
|
||||
<vn-vertical pad-medium>
|
||||
<vn-horizontal pad-medium>
|
||||
<vn-one>
|
||||
<vn-label-value label="Id"
|
||||
value="{{worker.id}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Name"
|
||||
value="{{worker.name}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
<h5>{{worker.firstName}} {{worker.name}}</h5>
|
||||
<vn-horizontal pad-medium>
|
||||
<vn-one>
|
||||
<h4 translate>Basic data</h4>
|
||||
<vn-label-value label="Id"
|
||||
value="{{worker.id}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Fiscal identifier"
|
||||
value="{{worker.client.fi}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Email"
|
||||
value="{{worker.user.email}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Department"
|
||||
value="{{worker.department.department}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Phone"
|
||||
value="{{worker.phone}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<h4 translate>User info</h4>
|
||||
<vn-label-value label="User id"
|
||||
value="{{worker.userFk}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="User"
|
||||
value="{{worker.user.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Role"
|
||||
value="{{worker.user.role.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Extension"
|
||||
value="{{worker.sip.phone}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
|
@ -15,11 +15,36 @@ class Controller {
|
|||
set worker(value) {
|
||||
this._worker = value;
|
||||
this.$.worker = null;
|
||||
if (value) {
|
||||
this.$http.get(`api/Workers/${value.id}`).then(res => {
|
||||
this.$.worker = res.data;
|
||||
});
|
||||
}
|
||||
if (!value) return;
|
||||
|
||||
let query = `api/Workers/${value.id}`;
|
||||
let filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'email', 'roleFk'],
|
||||
include: {
|
||||
relation: 'role',
|
||||
scope: {fields: ['name']}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {fields: ['fi']}
|
||||
}, {
|
||||
relation: 'department',
|
||||
scope: {fields: ['department']}
|
||||
}, {
|
||||
relation: 'sip',
|
||||
scope: {fields: ['extension']}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.$http.get(query, {params: {filter}}).then(res => {
|
||||
this.$.worker = res.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue