This commit is contained in:
parent
45085cccc8
commit
8860c77147
|
@ -4,15 +4,14 @@
|
|||
base-state="worker.department">
|
||||
<slot-menu>
|
||||
<vn-item
|
||||
ng-click="$ctrl.handleExcluded()"
|
||||
translate
|
||||
ng-if="!$ctrl.excluded">
|
||||
ng-click="deleteConfirmation.show()"
|
||||
ng-show="$ctrl.isEditable"
|
||||
name="deleteDepartment"
|
||||
translate>
|
||||
Delete
|
||||
</vn-item>
|
||||
</slot-menu>
|
||||
<slot-body>
|
||||
<h2>{{department}}</h2>
|
||||
<p>{{department.id}}</p>
|
||||
<div class="attributes">
|
||||
<vn-label-value
|
||||
label="Chat"
|
||||
|
@ -38,6 +37,11 @@
|
|||
<vn-worker-summary worker="$ctrl.worker"></vn-worker-summary>
|
||||
</vn-popup>
|
||||
|
||||
<vn-confirm
|
||||
vn-id="deleteConfirmation"
|
||||
on-accept="$ctrl.deleteDepartment()"
|
||||
question="You are going to delete this department">
|
||||
</vn-confirm>
|
||||
<!-- Upload photo dialog -->
|
||||
<!-- <vn-upload-photo
|
||||
vn-id="uploadPhoto"
|
||||
|
|
|
@ -14,6 +14,19 @@ class Controller extends Descriptor {
|
|||
set department(value) {
|
||||
this.entity = value;
|
||||
}
|
||||
|
||||
deleteDepartment() {
|
||||
return this.$http.post(`Departments/${this.id}/setDeleted`)
|
||||
.then(() => this.reload())
|
||||
.then(() => {
|
||||
const isInsideDepartment = this.$state.current.name.startsWith('department');
|
||||
if (isInsideDepartment)
|
||||
this.$state.go('department.index');
|
||||
|
||||
this.vnApp.showSuccess(this.$t('Department deleted.'));
|
||||
});
|
||||
}
|
||||
|
||||
loadData() {
|
||||
const filter = {
|
||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
||||
|
|
Loading…
Reference in New Issue