This commit is contained in:
parent
0774a94d8b
commit
e38bf4f1b3
|
@ -5,7 +5,6 @@
|
|||
<slot-menu>
|
||||
<vn-item
|
||||
ng-click="deleteConfirmation.show()"
|
||||
ng-show="$ctrl.isEditable"
|
||||
name="deleteDepartment"
|
||||
translate>
|
||||
Delete
|
||||
|
|
|
@ -23,13 +23,11 @@ class Controller extends Descriptor {
|
|||
this.$state.go(`worker.index`,
|
||||
{q: JSON.stringify({departmentFk: department.id})});
|
||||
}
|
||||
|
||||
deleteDepartment() {
|
||||
return this.$http.post(`Departments/${this.id}/setDeleted`)
|
||||
.then(() => this.reload())
|
||||
return this.$http.delete(`Departments/${this.id}`)
|
||||
.then(() => {
|
||||
const isInsideDepartment = this.$state.current.name.startsWith('department');
|
||||
if (isInsideDepartment)
|
||||
this.$state.go('department.index');
|
||||
this.$state.go('worker.department');
|
||||
|
||||
this.vnApp.showSuccess(this.$t('Department deleted.'));
|
||||
});
|
||||
|
|
|
@ -5,3 +5,4 @@ import './card';
|
|||
import './descriptor';
|
||||
import './basic-data';
|
||||
import './search-panel';
|
||||
import './descriptor-popover';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "Workers",
|
||||
"icon" : "icon-worker",
|
||||
"validations" : true,
|
||||
"dependencies": ["account"],
|
||||
"dependencies": ["account", "worker"],
|
||||
"menus": {
|
||||
"main": [
|
||||
{"state": "worker.index", "icon": "icon-worker"},
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</vn-label-value>
|
||||
<vn-label-value label="Department">
|
||||
<span
|
||||
ng-click="workerDepartmentDescriptor.show($event, worker.department.department.id)"
|
||||
ng-click="workerDepartmentDescriptor.show($event, 31)"
|
||||
class="link">
|
||||
{{worker.department.department.name}}
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue