diff --git a/dl_admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/dl_admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
index fb18c5c..b808c6a 100644
--- a/dl_admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
+++ b/dl_admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
@@ -37,6 +37,9 @@ public class SysDept extends BaseEntity
/** 负责人 */
private String leader;
+ /** 负责人id */
+ private Long leaderId;
+
/** 联系电话 */
private String phone;
@@ -118,6 +121,16 @@ public class SysDept extends BaseEntity
this.leader = leader;
}
+ public Long getLeaderId()
+ {
+ return leaderId;
+ }
+
+ public void setLeaderId(Long leaderId)
+ {
+ this.leaderId = leaderId;
+ }
+
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
public String getPhone()
{
@@ -190,6 +203,7 @@ public class SysDept extends BaseEntity
.append("deptName", getDeptName())
.append("orderNum", getOrderNum())
.append("leader", getLeader())
+ .append("leaderId", getLeaderId())
.append("phone", getPhone())
.append("email", getEmail())
.append("status", getStatus())
diff --git a/dl_admin/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/dl_admin/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
index cf439f6..890abb2 100644
--- a/dl_admin/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/dl_admin/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
@@ -21,14 +22,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-
+
- select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+ select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader,d.leader_id, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
insert into sys_dept(
dept_id,
@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ancestors,
order_num,
leader,
+ leader_id,
phone,
email,
status,
@@ -107,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{ancestors},
#{orderNum},
#{leader},
+ #{leaderId},
#{phone},
#{email},
#{status},
@@ -114,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
)
-
+
update sys_dept
@@ -123,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ancestors = #{ancestors},
order_num = #{orderNum},
leader = #{leader},
+ leader_id = #{leaderId},
phone = #{phone},
email = #{email},
status = #{status},
@@ -131,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dept_id = #{deptId}
-
+
update sys_dept set ancestors =
-
+
- update sys_dept set status = '0' where dept_id in
+ update sys_dept set status = '0' where dept_id in
#{deptId}
-
+
update sys_dept set del_flag = '2' where dept_id = #{deptId}
diff --git a/dl_vue/src/views/cus/main/drawForm.vue b/dl_vue/src/views/cus/main/drawForm.vue
index b651190..2e5063c 100644
--- a/dl_vue/src/views/cus/main/drawForm.vue
+++ b/dl_vue/src/views/cus/main/drawForm.vue
@@ -366,7 +366,6 @@ export default {
}
listCountry(queryParams).then(response => {
this.countryList = response.data.records;
- this.total = response.data.total;
this.countryLoading = false;
});
} else {
diff --git a/dl_vue/src/views/system/dept/index.vue b/dl_vue/src/views/system/dept/index.vue
index e502b4e..d49b228 100644
--- a/dl_vue/src/views/system/dept/index.vue
+++ b/dl_vue/src/views/system/dept/index.vue
@@ -57,6 +57,7 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
+
@@ -120,8 +121,22 @@
-
-
+
+
+
+
@@ -161,7 +176,7 @@
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-
+import { listUser } from "@/api/system/user";
export default {
name: "Dept",
dicts: ['sys_normal_disable'],
@@ -189,6 +204,11 @@ export default {
deptName: undefined,
status: undefined
},
+
+ //可选用户列表
+ userList: [],
+ userLoading: false,
+
// 表单参数
form: {},
// 表单校验
@@ -199,6 +219,9 @@ export default {
deptName: [
{ required: true, message: "部门名称不能为空", trigger: "blur" }
],
+ leaderId:[
+ { required: true, message: "部门负责人不能为空", trigger: "blur" }
+ ],
orderNum: [
{ required: true, message: "显示排序不能为空", trigger: "blur" }
],
@@ -223,6 +246,31 @@ export default {
this.getList();
},
methods: {
+ /**选中负责人*/
+ leaderChange(row){
+
+ },
+
+ /** 搜索用户 */
+ remoteMethod(query,userId){
+ if (query !== ''){
+ this.userLoading = true;
+ const queryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ userName: query,
+ userId: userId
+ }
+ listUser(queryParams).then(res => {
+ this.userList = res.rows;
+ this.userLoading = false;
+ })
+ } else {
+ this.userList = []
+ }
+ },
+
+
/** 查询部门列表 */
getList() {
this.loading = true;
@@ -254,7 +302,7 @@ export default {
parentId: undefined,
deptName: undefined,
orderNum: undefined,
- leader: undefined,
+ leaderId: undefined,
phone: undefined,
email: undefined,
status: "0"
@@ -295,9 +343,11 @@ export default {
this.reset();
getDept(row.deptId).then(response => {
this.form = response.data;
+ this.remoteMethod(null,this.form.leaderId)
this.open = true;
this.title = "修改部门";
listDeptExcludeChild(row.deptId).then(response => {
+ console.log(response.data,'ssssssssssss')
this.deptOptions = this.handleTree(response.data, "deptId");
if (this.deptOptions.length == 0) {
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
@@ -309,6 +359,7 @@ export default {
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
+ console.log(this.form,'修改内容')
if (valid) {
if (this.form.deptId != undefined) {
updateDept(this.form).then(response => {