diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts
index adaefd2..d0806da 100644
--- a/src/api/system/dept/types.ts
+++ b/src/api/system/dept/types.ts
@@ -20,6 +20,8 @@ export interface DeptVO extends BaseEntity {
deptCategory: string;
orderNum: number;
leader: string;
+ vicePresident: number | string;
+ vicePresidentName: string;
phone: string;
email: string;
status: string;
@@ -52,6 +54,7 @@ export interface DeptForm {
deptCategory?: string;
orderNum?: number;
leader?: string;
+ vicePresident?: number | string;
phone?: string;
email?: string;
status?: string;
diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index baadca6..0d13a4f 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -48,6 +48,8 @@
>
+
+
@@ -75,8 +77,8 @@
-
-
+
+
@@ -106,12 +108,19 @@
-
-
+
+
+
+
+
+
+
+
+
@@ -145,7 +154,7 @@
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept';
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
import { UserVO } from '@/api/system/user/types';
-import { listUserByDeptId } from '@/api/system/user';
+import { listUserByDeptId, listUser } from '@/api/system/user';
interface DeptOptionsType {
deptId: number | string;
@@ -162,6 +171,7 @@ const showSearch = ref(true);
const deptOptions = ref([]);
const isExpandAll = ref(true);
const deptUserList = ref([]);
+const allUserList = ref([]);
const dialog = reactive({
visible: false,
@@ -179,6 +189,7 @@ const initFormData: DeptForm = {
deptCategory: undefined,
orderNum: 0,
leader: undefined,
+ vicePresident: undefined,
phone: undefined,
email: undefined,
status: '0'
@@ -223,6 +234,12 @@ async function getDeptAllUser(deptId: any) {
}
}
+/** 查询所有用户 */
+async function getAllUser() {
+ const res = await listUserByDeptId(100);
+ allUserList.value = res.data || [];
+}
+
/** 取消按钮 */
const cancel = () => {
reset();
@@ -266,7 +283,11 @@ const handleAdd = async (row?: DeptVO) => {
deptOptions.value = data;
if (row && row.deptId) {
form.value.parentId = row?.deptId;
+ // 加载父部门的用户列表,用于选择部门负责人
+ getDeptAllUser(row.deptId);
}
+ // 加载所有用户列表,用于选择分管副总
+ getAllUser();
dialog.visible = true;
dialog.title = '添加部门';
}
@@ -277,6 +298,8 @@ const handleUpdate = async (row: DeptVO) => {
reset();
//查询当前部门所有用户
getDeptAllUser(row.deptId);
+ // 加载所有用户列表,用于选择分管副总
+ getAllUser();
const res = await getDept(row.deptId);
form.value = res.data;
const response = await listDeptExcludeChild(row.deptId);