This commit is contained in:
parent
d09889b08a
commit
9f9963af56
|
@ -7,63 +7,30 @@
|
||||||
ng-click="$ctrl.handleExcluded()"
|
ng-click="$ctrl.handleExcluded()"
|
||||||
translate
|
translate
|
||||||
ng-if="!$ctrl.excluded">
|
ng-if="!$ctrl.excluded">
|
||||||
Click to exclude the user from getting disabled
|
Delete
|
||||||
</vn-item>
|
|
||||||
<vn-item
|
|
||||||
ng-click="$ctrl.handleExcluded()"
|
|
||||||
translate
|
|
||||||
ng-if="$ctrl.excluded">
|
|
||||||
Click to allow the user to be disabled
|
|
||||||
</vn-item>
|
</vn-item>
|
||||||
</slot-menu>
|
</slot-menu>
|
||||||
<slot-body>
|
<slot-body>
|
||||||
|
<h2>{{worker.department.name}}</h2>
|
||||||
|
<p>{{worker.department.id}}</p>
|
||||||
<div class="attributes">
|
<div class="attributes">
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="User"
|
label="Chat"
|
||||||
value="{{$ctrl.worker.user.name}}">
|
value="{{$ctrl.worker.department.chatName}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Email"
|
label="Email"
|
||||||
value="{{$ctrl.worker.user.emailUser.email}}">
|
value="{{$ctrl.worker.department.emailNotification}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Department"
|
label="Self-consumption customer"
|
||||||
value="{{$ctrl.worker.department.department.name}}">
|
value="{{$ctrl.worker.department.clientFK}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Phone"
|
label="Boss department"
|
||||||
value="{{$ctrl.worker.phone}}">
|
value="{{$ctrl.worker.department.workerFk}}">
|
||||||
</vn-label-value>
|
|
||||||
<vn-label-value
|
|
||||||
label="Extension"
|
|
||||||
value="{{$ctrl.worker.sip.extension}}">
|
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</div>
|
</div>
|
||||||
<div class="icons">
|
|
||||||
<vn-icon
|
|
||||||
vn-tooltip="This user can't be disabled"
|
|
||||||
icon="person"
|
|
||||||
ng-if="$ctrl.worker.excluded">
|
|
||||||
</vn-icon>
|
|
||||||
</div>
|
|
||||||
<div class="quicklinks">
|
|
||||||
<div ng-transclude="btnOne">
|
|
||||||
<vn-quick-link
|
|
||||||
tooltip="Go to client"
|
|
||||||
state="['client.card.summary', {id: $ctrl.id}]"
|
|
||||||
icon="person">
|
|
||||||
</vn-quick-link>
|
|
||||||
</div>
|
|
||||||
<div ng-transclude="btnTwo">
|
|
||||||
<vn-quick-link
|
|
||||||
vn-acl="hr"
|
|
||||||
vn-acl-action="remove"
|
|
||||||
tooltip="Go to user"
|
|
||||||
state="['account.card.summary', {id: $ctrl.id}]"
|
|
||||||
icon="face">
|
|
||||||
</vn-quick-link>
|
|
||||||
</div>
|
|
||||||
<div ng-transclude="btnThree"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</slot-body>
|
</slot-body>
|
||||||
</vn-descriptor-content>
|
</vn-descriptor-content>
|
||||||
|
|
|
@ -7,90 +7,51 @@ class Controller extends Descriptor {
|
||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get worker() {
|
get department() {
|
||||||
// return this.entity;
|
return this.entity;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// set worker(value) {
|
set department(value) {
|
||||||
// this.entity = value;
|
this.entity = value;
|
||||||
|
}
|
||||||
|
loadData() {
|
||||||
|
const filter = {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'user',
|
||||||
|
scope: {
|
||||||
|
fields: ['name'],
|
||||||
|
include: {
|
||||||
|
relation: 'emailUser',
|
||||||
|
scope: {
|
||||||
|
fields: ['email']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
relation: 'client',
|
||||||
|
scope: {
|
||||||
|
fields: ['fi']
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
relation: 'sip',
|
||||||
|
scope: {
|
||||||
|
fields: ['extension']
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
relation: 'department',
|
||||||
|
scope: {
|
||||||
|
include: {
|
||||||
|
relation: 'department'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
// if (value)
|
return this.getData(`Workers/${this.id}`, {filter})
|
||||||
// this.getIsExcluded();
|
.then(res => this.entity = res.data);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// get excluded() {
|
|
||||||
// return this.entity.excluded;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// set excluded(value) {
|
|
||||||
// this.entity.excluded = value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// getIsExcluded() {
|
|
||||||
// this.$http.get(`workerDisableExcludeds/${this.entity.id}/exists`).then(data => {
|
|
||||||
// this.excluded = data.data.exists;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// handleExcluded() {
|
|
||||||
// if (this.excluded) {
|
|
||||||
// this.$http.delete(`workerDisableExcludeds/${this.entity.id}`);
|
|
||||||
// this.excluded = false;
|
|
||||||
// } else {
|
|
||||||
// this.$http.post(`workerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
|
|
||||||
// this.excluded = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// loadData() {
|
|
||||||
// const filter = {
|
|
||||||
// include: [
|
|
||||||
// {
|
|
||||||
// relation: 'user',
|
|
||||||
// scope: {
|
|
||||||
// fields: ['name'],
|
|
||||||
// include: {
|
|
||||||
// relation: 'emailUser',
|
|
||||||
// scope: {
|
|
||||||
// fields: ['email']
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }, {
|
|
||||||
// relation: 'client',
|
|
||||||
// scope: {
|
|
||||||
// fields: ['fi']
|
|
||||||
// }
|
|
||||||
// }, {
|
|
||||||
// relation: 'sip',
|
|
||||||
// scope: {
|
|
||||||
// fields: ['extension']
|
|
||||||
// }
|
|
||||||
// }, {
|
|
||||||
// relation: 'department',
|
|
||||||
// scope: {
|
|
||||||
// include: {
|
|
||||||
// relation: 'department'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// };
|
|
||||||
|
|
||||||
// return this.getData(`Workers/${this.id}`, {filter})
|
|
||||||
// .then(res => this.entity = res.data);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// onUploadResponse() {
|
|
||||||
// const timestamp = Date.vnNew().getTime();
|
|
||||||
// const src = this.$rootScope.imagePath('user', '520x520', this.worker.id);
|
|
||||||
// const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.worker.id);
|
|
||||||
// const newSrc = `${src}&t=${timestamp}`;
|
|
||||||
// const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
|
|
||||||
|
|
||||||
// this.$.photo.setAttribute('src', newSrc);
|
|
||||||
// this.$.photo.setAttribute('zoom-image', newZoomSrc);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.$inject = ['$element', '$scope', '$rootScope'];
|
Controller.$inject = ['$element', '$scope', '$rootScope'];
|
||||||
|
|
Loading…
Reference in New Issue