From b811e66339c468d69abfadae611476d840d6a786 Mon Sep 17 00:00:00 2001
From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com>
Date: Tue, 23 Jul 2024 16:16:04 +0800
Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E6=B7=BB=E5=8A=A0=E5=85=AC=E5=8F=B8=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sgzb-ui/src/api/system/dept.js | 7 +-
sgzb-ui/src/views/system/dept/index.vue | 886 +++++++++++++++---------
sgzb-ui/src/views/system/user/index.vue | 29 +-
3 files changed, 596 insertions(+), 326 deletions(-)
diff --git a/sgzb-ui/src/api/system/dept.js b/sgzb-ui/src/api/system/dept.js
index d6a259e2..ce8a174a 100644
--- a/sgzb-ui/src/api/system/dept.js
+++ b/sgzb-ui/src/api/system/dept.js
@@ -56,10 +56,15 @@ export function apiGetPartTree() {
return request({
url: '/system/select/getPartTree',
method: 'post',
- data:{}
+ data: {}
})
}
+// 新增公司
+export const addCompanyApi = (data) => {
+ return request.post('/system/dept/addCompany', data)
+}
+
diff --git a/sgzb-ui/src/views/system/dept/index.vue b/sgzb-ui/src/views/system/dept/index.vue
index 9cf1b534..5b2b2964 100644
--- a/sgzb-ui/src/views/system/dept/index.vue
+++ b/sgzb-ui/src/views/system/dept/index.vue
@@ -1,336 +1,576 @@
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
- 新增
-
-
- 展开/折叠
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.createTime) }}
-
-
-
-
- 修改
- 新增
- 删除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
+ 搜索
+ 重置
+
+
+
+
+
+
+ 新增公司
+
+
+ 新增部门
+
+
+ 展开/折叠
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{dict.label}}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+ 修改
+ 新增
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增
+ 删除
+
+
+
+
+
+
diff --git a/sgzb-ui/src/views/system/user/index.vue b/sgzb-ui/src/views/system/user/index.vue
index d10bcb4a..53e50b58 100644
--- a/sgzb-ui/src/views/system/user/index.vue
+++ b/sgzb-ui/src/views/system/user/index.vue
@@ -15,7 +15,7 @@
@@ -548,6 +550,7 @@ import {
changeUserStatus,
deptTreeSelect,
} from '@/api/system/user'
+import { listDept } from '@/api/system/dept'
import { getToken } from '@/utils/auth'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -577,6 +580,8 @@ export default {
title: '',
// 部门树选项
deptOptions: undefined,
+ // 部门树选项(左侧)
+ deptOptionsTree: undefined,
// 是否显示弹出层
open: false,
// 部门名称
@@ -720,7 +725,10 @@ export default {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
- this.deptOptions = response.data
+ this.deptOptionsTree = response.data
+ })
+ listDept().then((response) => {
+ this.deptOptions = this.handleTree(response.data, 'deptId')
})
},
// 筛选节点
@@ -768,6 +776,7 @@ export default {
remark: undefined,
postIds: [],
roleIds: [],
+ companyId: undefined,
}
this.resetForm('form')
},
@@ -946,6 +955,22 @@ export default {
submitFileForm() {
this.$refs.upload.submit()
},
+ // 归属部门选择变化时
+ deptIdChange(val) {
+ console.log(val, '部门变化时')
+ // console.log(this.form, '表单数据--')
+ },
+ /** 转换部门数据结构 */
+ normalizer(node) {
+ if (node.children && !node.children.length) {
+ delete node.children
+ }
+ return {
+ id: node.deptId,
+ label: node.deptName,
+ children: node.children,
+ }
+ },
},
}