7299_testToMaster #2411

Merged
alexm merged 342 commits from 7299_testToMaster into master 2024-05-07 05:30:42 +00:00
4 changed files with 25 additions and 110 deletions
Showing only changes of commit 3e1218463c - Show all commits

View File

@ -100,13 +100,21 @@
"relation": "user",
"scope": {
"fields": ["email", "name", "nickname", "roleFk"],
"include": {
"include": [
{
"relation": "role",
"scope": {
"fields": ["name"]
}
},
{
"relation": "emailUser",
"scope": {
"fields": ["email"]
}
}
]
}
}, {
"relation": "department",
"scope": {

View File

@ -4,37 +4,13 @@ import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name', 'emailVerified'],
include: {
relation: 'emailUser',
scope: {
fields: ['email']
}
}
}
}, {
relation: 'sip',
scope: {
fields: ['extension', 'secret']
}
}, {
relation: 'department',
scope: {
include: {
relation: 'department'
}
}
}
]
where: {
id: this.$params.id}
};
return Promise.all([
this.$http.get(`Workers/${this.$params.id}`, {filter})
.then(res => this.worker = res.data),
this.$http.get(`Workers/summary`, {filter})
.then(res => this.worker = res.data[0]),
this.$http.get(`Workers/${this.$params.id}/activeContract`)
.then(res => this.hasWorkCenter = res.data?.workCenterFk)
]);

View File

@ -37,41 +37,11 @@ class Controller extends Descriptor {
loadData() {
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name', 'emailVerified'],
include: {
relation: 'emailUser',
scope: {
fields: ['email']
}
}
}
}, {
relation: 'client',
scope: {
fields: ['fi']
}
}, {
relation: 'sip',
scope: {
fields: ['extension']
}
}, {
relation: 'department',
scope: {
include: {
relation: 'department'
}
}
}
]
where: {id: this.id},
};
return this.getData(`Workers/${this.id}`, {filter})
.then(res => this.entity = res.data);
return this.getData(`Workers/summary`, {filter})
.then(res => this.entity = res.data[0]);
}
getPassRequirements() {

View File

@ -10,53 +10,14 @@ class Controller extends Summary {
this.$.worker = null;
if (!value) return;
const query = `Workers/${value.id}`;
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name', 'roleFk'],
include: [{
relation: 'role',
scope: {
fields: ['name']
where: {
id: value.id
}
},
{
relation: 'emailUser',
scope: {
fields: ['email']
}
}]
}
},
{
relation: 'client',
scope: {fields: ['fi', 'phone']}
},
{
relation: 'boss',
scope: {fields: ['id', 'name']}
},
{
relation: 'sip',
scope: {fields: ['extension']}
},
{
relation: 'department',
scope: {
include: {
relation: 'department',
scope: {fields: ['id', 'code', 'name']}
}
}
}
]
};
this.$http.get(query, {params: {filter}}).then(res => {
this.$.worker = res.data;
this.$http.get(`Workers/summary`, {filter}).then(res => {
this.$.worker = res.data[0];
});
}