|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
<div class="aside-title">组织架构</div>
|
|
|
|
|
<div class="aside-action">
|
|
|
|
|
<el-button type="text" @click="state.condition1.hiddenDisable = !state.condition1.hiddenDisable">
|
|
|
|
|
{{ state.condition1.hiddenDisable ? '隐藏' : '显示' }}禁用部门
|
|
|
|
|
{{ state.condition1.hiddenDisable ? '显示' : '隐藏' }}禁用部门
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -38,6 +38,9 @@
|
|
|
|
|
<el-icon name="Edit" />
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-switch v-model="data.isEnable" @click.stop="handleEnabled(data)" />
|
|
|
|
|
<el-button type="text" @click.stop="handleDelete(data)">
|
|
|
|
|
<el-icon name="Delete" />
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -46,7 +49,7 @@
|
|
|
|
|
<el-dialog
|
|
|
|
|
v-model="formState.formVisible"
|
|
|
|
|
:title="(formState.form.id ? '编辑' : '新增') + '部门'"
|
|
|
|
|
width="300px"
|
|
|
|
|
width="420px"
|
|
|
|
|
>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="refsForm"
|
|
|
|
@ -68,6 +71,7 @@
|
|
|
|
|
expandTrigger: 'hover',
|
|
|
|
|
emitPath: false,
|
|
|
|
|
}"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="组织名称" prop="name">
|
|
|
|
@ -107,6 +111,52 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
</template>
|
|
|
|
|
</table-list>
|
|
|
|
|
<el-dialog v-model="transferState.transferVisible" title="员工调动">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="refsForm2"
|
|
|
|
|
v-loading="loading5"
|
|
|
|
|
label-width="130px"
|
|
|
|
|
:model="transferState.transferForm"
|
|
|
|
|
:rules="transferState.transferRules"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="原所在组织">
|
|
|
|
|
<el-cascader
|
|
|
|
|
v-model="state.condition2.departmentId"
|
|
|
|
|
disabled
|
|
|
|
|
:options="list"
|
|
|
|
|
:props="{
|
|
|
|
|
label: 'name',
|
|
|
|
|
value: 'id',
|
|
|
|
|
trigger: 'hover',
|
|
|
|
|
checkStrictly: true,
|
|
|
|
|
emitPath: false,
|
|
|
|
|
children: 'childDepartment',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="调动到目标组织" prop="departmentId">
|
|
|
|
|
<el-cascader
|
|
|
|
|
v-model="transferState.transferForm.departmentId"
|
|
|
|
|
:options="list"
|
|
|
|
|
:props="{
|
|
|
|
|
label: 'name',
|
|
|
|
|
value: 'id',
|
|
|
|
|
trigger: 'hover',
|
|
|
|
|
checkStrictly: true,
|
|
|
|
|
emitPath: false,
|
|
|
|
|
children: 'childDepartment',
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="选择角色权限" prop="handType">
|
|
|
|
|
<el-radio-group v-model="transferState.transferForm.handType" :opts="opts.handType" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="transferState.transferVisible = false">取消</el-button>
|
|
|
|
|
<el-button :loading="loading5" type="primary" @click="handleSaveTransfer">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="角色" name="role">
|
|
|
|
|
<template v-if="state.condition2.departmentId">
|
|
|
|
@ -247,7 +297,35 @@
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const handleTransferEmployee = () => {};
|
|
|
|
|
const transferState = reactive({
|
|
|
|
|
transferVisible: false,
|
|
|
|
|
transferForm: {
|
|
|
|
|
employeeId: null,
|
|
|
|
|
departmentId: null,
|
|
|
|
|
handType: null,
|
|
|
|
|
},
|
|
|
|
|
transferRules: {
|
|
|
|
|
departmentId: [{ required: true, message: '调动到目标组织不能为空' }],
|
|
|
|
|
handType: [{ required: true, message: '选择角色权限不能为空' }],
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
const refsForm2 = ref(null);
|
|
|
|
|
const loading5 = ref(false);
|
|
|
|
|
const handleTransferEmployee = (row) => {
|
|
|
|
|
transferState.transferVisible = true;
|
|
|
|
|
transferState.transferForm = { employeeId: row.id, departmentI: null, handType: 1 };
|
|
|
|
|
};
|
|
|
|
|
const handleSaveTransfer = async () => {
|
|
|
|
|
try {
|
|
|
|
|
await proxy.$validate(refsForm2);
|
|
|
|
|
loading5.value = true;
|
|
|
|
|
await store.dispatch('deptEmployee/transfer', transferState.transferForm);
|
|
|
|
|
loading5.value = false;
|
|
|
|
|
transferState.transferVisible = false;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log('取消调动', e);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
let employeeConfig = reactive({
|
|
|
|
|
page: false,
|
|
|
|
|
columns: [
|
|
|
|
@ -290,7 +368,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '操作',
|
|
|
|
|
width: 300,
|
|
|
|
|
width: 120,
|
|
|
|
|
slots: {
|
|
|
|
|
default: ({ row }) => (
|
|
|
|
|
<div>
|
|
|
|
@ -406,6 +484,9 @@
|
|
|
|
|
const handleEnabled = (row) => {
|
|
|
|
|
store.dispatch('dept/enable', row);
|
|
|
|
|
};
|
|
|
|
|
const handleDelete = (row) => {
|
|
|
|
|
store.dispatch('dept/remove', [row.id]);
|
|
|
|
|
};
|
|
|
|
|
const handleSave = async () => {
|
|
|
|
|
formState.submitting = true;
|
|
|
|
|
try {
|
|
|
|
|