diff --git a/src/api/permission/dept.js b/src/api/permission/dept.js
index 71ded74..bb5a964 100644
--- a/src/api/permission/dept.js
+++ b/src/api/permission/dept.js
@@ -13,6 +13,13 @@ export const searchEmployee = (params) => {
params,
});
};
+export const transferEmployee = (data) => {
+ return request({
+ url: '/uc/employee/employee',
+ method: 'put',
+ params: data,
+ });
+};
export const children = (params) => {
return request({
url: '/uc/department/child',
diff --git a/src/store/modules/permission/dept/dept.js b/src/store/modules/permission/dept/dept.js
index a908f60..d1dcc33 100644
--- a/src/store/modules/permission/dept/dept.js
+++ b/src/store/modules/permission/dept/dept.js
@@ -7,6 +7,20 @@ const state = () => ({
total: 0,
opts: {
init: false,
+ handType: [
+ {
+ label: '删除原组织权限并调动',
+ value: 1,
+ },
+ {
+ label: '删除所有权限并调动',
+ value: 2,
+ },
+ {
+ label: '保留所有权限并调动',
+ value: 3,
+ },
+ ],
system: [],
},
});
diff --git a/src/store/modules/permission/dept/deptEmployee.js b/src/store/modules/permission/dept/deptEmployee.js
index 0f79bd6..c311723 100644
--- a/src/store/modules/permission/dept/deptEmployee.js
+++ b/src/store/modules/permission/dept/deptEmployee.js
@@ -49,6 +49,16 @@ const actions = {
}
return res;
},
+ transfer: async ({ dispatch }, data) => {
+ let res = await api.transferEmployee(data);
+ if (res) {
+ ElMessage.success('调动成功');
+ dispatch('search');
+ } else {
+ ElMessage.error('调动失败');
+ }
+ return res;
+ },
remove: async ({ dispatch }, idList) => {
if (!idList.length) {
ElMessage.warning('请选择要删除的数据');
diff --git a/src/views/permission/dept/index.vue b/src/views/permission/dept/index.vue
index 40c8c98..88e82f3 100644
--- a/src/views/permission/dept/index.vue
+++ b/src/views/permission/dept/index.vue
@@ -5,7 +5,7 @@
组织架构
- {{ state.condition1.hiddenDisable ? '隐藏' : '显示' }}禁用部门
+ {{ state.condition1.hiddenDisable ? '显示' : '隐藏' }}禁用部门
@@ -38,6 +38,9 @@
+
+
+
@@ -46,7 +49,7 @@
@@ -107,6 +111,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确定
+
+
@@ -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 }) => (
@@ -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 {
diff --git a/src/views/permission/employee/index.vue b/src/views/permission/employee/index.vue
index 77ed870..8ac993e 100644
--- a/src/views/permission/employee/index.vue
+++ b/src/views/permission/employee/index.vue
@@ -14,10 +14,7 @@
>
-
-
-
-
+
@@ -60,7 +57,6 @@
const state = reactive({
condition: {
departmentId: null,
- employeeName: null,
userName: null,
phone: null,
},