test → dev #1701
|
@ -339,8 +339,9 @@ export default class SmartTable extends Component {
|
|||
if (!header) return;
|
||||
|
||||
const tbody = this.element.querySelector('tbody');
|
||||
const columns = header.querySelectorAll('th');
|
||||
if (!tbody) return;
|
||||
|
||||
const columns = header.querySelectorAll('th');
|
||||
const hasSearchRow = tbody.querySelector('tr#searchRow');
|
||||
if (hasSearchRow) {
|
||||
if (this.$inputsScope)
|
||||
|
|
|
@ -36,9 +36,9 @@ module.exports = Self => {
|
|||
if (isSubordinate === false)
|
||||
throw new UserError(`You don't have enough privileges`);
|
||||
|
||||
const subordinate = await Worker.findById(ctx.args.workerFk);
|
||||
const subordinate = await Worker.findById(ctx.args.workerFk, {fields: ['id']});
|
||||
filter = mergeFilters(filter, {where: {
|
||||
userFk: subordinate.userFk
|
||||
userFk: subordinate.id
|
||||
}});
|
||||
|
||||
return Self.find(filter);
|
||||
|
|
|
@ -32,6 +32,28 @@ class Controller extends Descriptor {
|
|||
this.vnApp.showSuccess(this.$t('Department deleted.'));
|
||||
});
|
||||
}
|
||||
|
||||
loadData() {
|
||||
const filter = {
|
||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
||||
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
||||
include: [
|
||||
{relation: 'client',
|
||||
scope: {
|
||||
fields: ['id', 'name']
|
||||
}},
|
||||
{
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
return this.getData(`Departments/${this.id}`, {filter})
|
||||
.then(res => this.entity = res.data);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$element', '$scope', '$rootScope'];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
filter="::$ctrl.filter"
|
||||
data="$ctrl.hours">
|
||||
</vn-crud-model>
|
||||
<div ng-if="$ctrl.card.hasWorkCenter">
|
||||
<div>
|
||||
<vn-card class="vn-pa-lg vn-w-lg">
|
||||
<vn-table model="model" auto-load="false">
|
||||
<vn-thead>
|
||||
|
@ -106,12 +106,6 @@
|
|||
</vn-button>
|
||||
</vn-button-bar>
|
||||
</div>
|
||||
<div
|
||||
ng-if="!$ctrl.card.hasWorkCenter"
|
||||
class="bg-title"
|
||||
translate>
|
||||
Autonomous worker
|
||||
</div>
|
||||
|
||||
<vn-side-menu side="right">
|
||||
<div class="vn-pa-md">
|
||||
|
|
Loading…
Reference in New Issue