lamphua 1 рік тому
джерело
коміт
bd0b31912f

+ 10
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java Переглянути файл

430
     {
430
     {
431
         return success(deptService.selectDeptTreeList(dept));
431
         return success(deptService.selectDeptTreeList(dept));
432
     }
432
     }
433
+
434
+    /**
435
+     * 获取部门树列表
436
+     */
437
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
438
+    @GetMapping("/deptTreeNew")
439
+    public AjaxResult deptTreeNew(SysDept dept)
440
+    {
441
+        return success(deptService.selectDeptTreeListNew(dept));
442
+    }
433
 }
443
 }

+ 93
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/TreeSelectNew.java Переглянути файл

1
+package com.ruoyi.system.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import com.ruoyi.common.core.domain.entity.SysDept;
5
+import com.ruoyi.common.core.domain.entity.SysMenu;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
7
+import com.ruoyi.common.utils.spring.SpringUtils;
8
+import com.ruoyi.system.mapper.SysUserMapper;
9
+import com.ruoyi.system.mapper.SysUserPostMapper;
10
+import com.ruoyi.system.service.ISysUserService;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+
13
+import java.io.Serializable;
14
+import java.util.List;
15
+import java.util.stream.Collectors;
16
+
17
+/**
18
+ * Treeselect树结构实体类
19
+ * 
20
+ * @author ruoyi
21
+ */
22
+public class TreeSelectNew implements Serializable
23
+{
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /** 节点ID */
27
+    private Long id;
28
+
29
+    /** 节点名称 */
30
+    private String label;
31
+
32
+    /** 子节点 */
33
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
34
+    private List<TreeSelectNew> children;
35
+
36
+    public TreeSelectNew()
37
+    {
38
+
39
+    }
40
+
41
+    public TreeSelectNew(SysDept dept)
42
+    {
43
+        this.id = dept.getDeptId();
44
+        SysUser sysUser = new SysUser();
45
+        sysUser.setDeptId(dept.getDeptId());
46
+        SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
47
+        List<SysUser> list = userMapper.selectUserList(sysUser);
48
+        if (dept.getDeptId() == 103) {
49
+            SysUserPostMapper userPostMapper = SpringUtils.getBean(SysUserPostMapper.class);
50
+            list = userPostMapper.selectGmAssistant(new SysUser());
51
+        }
52
+        String count = "(" + (list == null ? 0 : list.size()) + ")";
53
+        this.label = dept.getDeptName() + count;
54
+        this.children = dept.getChildren().stream().map(TreeSelectNew::new).collect(Collectors.toList());
55
+    }
56
+
57
+    public TreeSelectNew(SysMenu menu)
58
+    {
59
+        this.id = menu.getMenuId();
60
+        this.label = menu.getMenuName();
61
+        this.children = menu.getChildren().stream().map(TreeSelectNew::new).collect(Collectors.toList());
62
+    }
63
+
64
+    public Long getId()
65
+    {
66
+        return id;
67
+    }
68
+
69
+    public void setId(Long id)
70
+    {
71
+        this.id = id;
72
+    }
73
+
74
+    public String getLabel()
75
+    {
76
+        return label;
77
+    }
78
+
79
+    public void setLabel(String label)
80
+    {
81
+        this.label = label;
82
+    }
83
+
84
+    public List<TreeSelectNew> getChildren()
85
+    {
86
+        return children;
87
+    }
88
+
89
+    public void setChildren(List<TreeSelectNew> children)
90
+    {
91
+        this.children = children;
92
+    }
93
+}

+ 18
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java Переглянути файл

1
 package com.ruoyi.system.service;
1
 package com.ruoyi.system.service;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+
4
 import com.ruoyi.common.core.domain.TreeSelect;
5
 import com.ruoyi.common.core.domain.TreeSelect;
6
+import com.ruoyi.system.domain.TreeSelectNew;
5
 import com.ruoyi.common.core.domain.entity.SysDept;
7
 import com.ruoyi.common.core.domain.entity.SysDept;
6
 
8
 
7
 /**
9
 /**
25
      * @param dept 部门信息
27
      * @param dept 部门信息
26
      * @return 部门树信息集合
28
      * @return 部门树信息集合
27
      */
29
      */
30
+    public List<TreeSelectNew> selectDeptTreeListNew(SysDept dept);
31
+
32
+    /**
33
+     * 查询部门树结构信息
34
+     *
35
+     * @param dept 部门信息
36
+     * @return 部门树信息集合
37
+     */
28
     public List<TreeSelect> selectDeptTreeList(SysDept dept);
38
     public List<TreeSelect> selectDeptTreeList(SysDept dept);
29
 
39
 
30
     /**
40
     /**
41
      * @param depts 部门列表
51
      * @param depts 部门列表
42
      * @return 下拉树结构列表
52
      * @return 下拉树结构列表
43
      */
53
      */
54
+    public List<TreeSelectNew> buildDeptTreeSelectNew(List<SysDept> depts);
55
+
56
+    /**
57
+     * 构建前端所需要下拉树结构
58
+     *
59
+     * @param depts 部门列表
60
+     * @return 下拉树结构列表
61
+     */
44
     public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
62
     public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
45
 
63
 
46
     /**
64
     /**

+ 29
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java Переглянути файл

4
 import java.util.Iterator;
4
 import java.util.Iterator;
5
 import java.util.List;
5
 import java.util.List;
6
 import java.util.stream.Collectors;
6
 import java.util.stream.Collectors;
7
+
8
+import com.ruoyi.common.core.domain.TreeSelect;
7
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
9
 import com.ruoyi.common.annotation.DataScope;
11
 import com.ruoyi.common.annotation.DataScope;
10
 import com.ruoyi.common.constant.UserConstants;
12
 import com.ruoyi.common.constant.UserConstants;
11
-import com.ruoyi.common.core.domain.TreeSelect;
13
+import com.ruoyi.system.domain.TreeSelectNew;
12
 import com.ruoyi.common.core.domain.entity.SysDept;
14
 import com.ruoyi.common.core.domain.entity.SysDept;
13
 import com.ruoyi.common.core.domain.entity.SysRole;
15
 import com.ruoyi.common.core.domain.entity.SysRole;
14
 import com.ruoyi.common.core.domain.entity.SysUser;
16
 import com.ruoyi.common.core.domain.entity.SysUser;
55
      * @return 部门树信息集合
57
      * @return 部门树信息集合
56
      */
58
      */
57
     @Override
59
     @Override
60
+    public List<TreeSelectNew> selectDeptTreeListNew(SysDept dept)
61
+    {
62
+        List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
63
+        return buildDeptTreeSelectNew(depts);
64
+    }
65
+
66
+    /**
67
+     * 查询部门树结构信息
68
+     *
69
+     * @param dept 部门信息
70
+     * @return 部门树信息集合
71
+     */
72
+    @Override
58
     public List<TreeSelect> selectDeptTreeList(SysDept dept)
73
     public List<TreeSelect> selectDeptTreeList(SysDept dept)
59
     {
74
     {
60
         List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
75
         List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
95
      * @return 下拉树结构列表
110
      * @return 下拉树结构列表
96
      */
111
      */
97
     @Override
112
     @Override
113
+    public List<TreeSelectNew> buildDeptTreeSelectNew(List<SysDept> depts)
114
+    {
115
+        List<SysDept> deptTrees = buildDeptTree(depts);
116
+        return deptTrees.stream().map(TreeSelectNew::new).collect(Collectors.toList());
117
+    }
118
+
119
+    /**
120
+     * 构建前端所需要下拉树结构
121
+     *
122
+     * @param depts 部门列表
123
+     * @return 下拉树结构列表
124
+     */
125
+    @Override
98
     public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts)
126
     public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts)
99
     {
127
     {
100
         List<SysDept> deptTrees = buildDeptTree(depts);
128
         List<SysDept> deptTrees = buildDeptTree(depts);

+ 2
- 2
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml Переглянути файл

105
         <where>
105
         <where>
106
             <if test="applier != null "> and ca.applier = #{applier}</if>
106
             <if test="applier != null "> and ca.applier = #{applier}</if>
107
             <if test="useDept != null "> and ca.use_dept = #{useDept}</if>
107
             <if test="useDept != null "> and ca.use_dept = #{useDept}</if>
108
-            <if test="cars != null  and cars != ''"> and ca.cars like concat('%', #{cars}, '%')</if>
109
-            <if test="drivers != null  and drivers != ''"> and ca.drivers like concat('%', #{drivers}, '%')</if>
108
+            <if test="cars != null  and cars != ''"> and find_in_set(ca.cars, #{cars})</if>
109
+            <if test="drivers != null  and drivers != ''"> and find_in_set(ca.drivers, #{drivers})</if>
110
             <if test="projectId != null  and projectId != ''"> and ca.project_id = #{projectId}</if>
110
             <if test="projectId != null  and projectId != ''"> and ca.project_id = #{projectId}</if>
111
             <if test="applyReason != null  and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
111
             <if test="applyReason != null  and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
112
             <if test="passengers != null "> and ca.passengers = #{passengers}</if>
112
             <if test="passengers != null "> and ca.passengers = #{passengers}</if>

+ 3
- 3
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml Переглянути файл

75
         <where>  
75
         <where>  
76
             <if test="applier != null "> and da.applier = #{applier}</if>
76
             <if test="applier != null "> and da.applier = #{applier}</if>
77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
77
             <if test="useDept != null "> and da.use_dept = #{useDept}</if>
78
-            <if test="devices != null  and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
79
-            <if test="modifyDevices != null  and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
80
-            <if test="repairDevices != null  and repairDevices != ''"> and da.repair_devices like concat('%', #{repairDevices}, '%')</if>
78
+            <if test="devices != null  and devices != ''"> and find_in_set(da.devices, #{devices})</if>
79
+            <if test="modifyDevices != null  and modifyDevices != ''"> and find_in_set(da.modify_devices, #{modifyDevices})</if>
80
+            <if test="repairDevices != null  and repairDevices != ''"> and find_in_set(da.repair_devices, #{repairDevices})</if>
81
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
81
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
82
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
82
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
83
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
83
             <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>

+ 12
- 0
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Переглянути файл

114
 		<if test="phonenumber != null and phonenumber != ''">
114
 		<if test="phonenumber != null and phonenumber != ''">
115
 			AND u.phonenumber like concat('%', #{phonenumber}, '%')
115
 			AND u.phonenumber like concat('%', #{phonenumber}, '%')
116
 		</if>
116
 		</if>
117
+		<if test="degree != null and degree != ''">
118
+			AND u.degree = #{degree}
119
+		</if>
120
+		<if test="titles != null and titles != ''">
121
+			AND find_in_set(u.titles, #{titles})
122
+		</if>
123
+		<if test="certificates != null and certificates != ''">
124
+			AND find_in_set(u.certificates, #{certificates})
125
+		</if>
126
+		<if test="politicalAffiliation != null and politicalAffiliation != ''">
127
+			AND find_in_set(u.political_affiliation, #{political_affiliation})
128
+		</if>
117
 		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
129
 		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
118
 			AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
130
 			AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
119
 		</if>
131
 		</if>

+ 8
- 0
oa-ui/src/api/system/user.js Переглянути файл

142
     method: 'get'
142
     method: 'get'
143
   })
143
   })
144
 }
144
 }
145
+
146
+// 查询部门下拉树结构
147
+export function deptTreeSelectNew() {
148
+  return request({
149
+    url: '/system/user/deptTreeNew',
150
+    method: 'get'
151
+  })
152
+}

+ 152
- 134
oa-ui/src/views/oa/staff/index.vue Переглянути файл

1
 <template>
1
 <template>
2
   <div class="app-container">
2
   <div class="app-container">
3
     <el-row :gutter="20">
3
     <el-row :gutter="20">
4
+      <!--部门数据-->
5
+      <el-col :span="5" :xs="24">
6
+        <div class="head-container">
7
+          <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search"
8
+            style="margin-bottom: 20px" />
9
+        </div>
10
+        <div class="head-container">
11
+          <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
12
+            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
13
+            @node-click="handleNodeClick" />
14
+        </div>
15
+      </el-col>
4
       <!--用户数据-->
16
       <!--用户数据-->
5
-      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
6
-        <el-form-item label="姓名" prop="nickName">
7
-          <el-input v-model="queryParams.nickName" placeholder="请输入姓名" clearable style="width: 240px"
8
-            @keyup.enter.native="handleQuery" />
9
-        </el-form-item>
10
-        <el-form-item label="手机号码" prop="phonenumber">
11
-          <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px"
12
-            @keyup.enter.native="handleQuery" />
13
-        </el-form-item>
14
-        <el-form-item label="部门">
15
-          <el-select v-model="queryParams.deptId" clearable @change="handleQuery">
16
-            <el-option v-for="item in deptList" :key="item.id" :label="item.label" :value="item.id">
17
-            </el-option>
18
-          </el-select>
19
-        </el-form-item>
20
-        <el-form-item>
21
-          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
22
-          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
23
-        </el-form-item>
24
-      </el-form>
17
+      <el-col :span="19" :xs="24">
18
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
19
+          <el-form-item label="姓名" prop="nickName">
20
+            <el-input v-model="queryParams.nickName" placeholder="请输入姓名" clearable style="width: 140px"
21
+              @keyup.enter.native="handleQuery" />
22
+          </el-form-item>
23
+          <el-form-item label="职称" prop="titles">
24
+            <el-select v-model="queryParams.titles" clearable placeholder="请输入职称" style="width:100%;">
25
+                <el-option v-for="dict in dict.type.sys_user_titles" :key="dict.value" :label="dict.label"
26
+                  :value="dict.value" />
27
+              </el-select>
28
+          </el-form-item>
29
+          <el-form-item label="执业证书" prop="certificates">
30
+            <el-select v-model="queryParams.certificates" clearable placeholder="请输入执业证书" style="width:100%;">
31
+                <el-option v-for="dict in dict.type.sys_user_certificates" :key="dict.value" :label="dict.label"
32
+                  :value="dict.value" />
33
+              </el-select>
34
+          </el-form-item>
35
+          <el-form-item label="学历" prop="degree">
36
+            <el-select v-model="queryParams.degree" clearable placeholder="请输入学历" style="width:100%;">
37
+                <el-option v-for="dict in dict.type.sys_user_degree" :key="dict.value" :label="dict.label"
38
+                  :value="dict.value" />
39
+              </el-select>
40
+          </el-form-item>
41
+          <el-form-item>
42
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
43
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
44
+          </el-form-item>
45
+        </el-form>
25
 
46
 
26
-      <el-row :gutter="10" class="mb8">
27
-        <el-col :span="1.5">
28
-          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
29
-            v-hasPermi="['system:user:add']">新增</el-button>
30
-        </el-col>
31
-        <el-col :span="1.5">
32
-          <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
33
-            v-hasPermi="['system:user:edit']">修改</el-button>
34
-        </el-col>
35
-        <el-col :span="1.5">
36
-          <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
37
-            v-hasPermi="['system:user:remove']">删除</el-button>
38
-        </el-col>
39
-        <!-- <el-col :span="1.5">
47
+        <el-row :gutter="10" class="mb8">
48
+          <el-col :span="1.5">
49
+            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
50
+              v-hasPermi="['system:user:add']">新增</el-button>
51
+          </el-col>
52
+          <el-col :span="1.5">
53
+            <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
54
+              v-hasPermi="['system:user:edit']">修改</el-button>
55
+          </el-col>
56
+          <el-col :span="1.5">
57
+            <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
58
+              v-hasPermi="['system:user:remove']">删除</el-button>
59
+          </el-col>
60
+          <!-- <el-col :span="1.5">
40
           <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
61
           <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
41
             v-hasPermi="['system:user:import']">导入</el-button>
62
             v-hasPermi="['system:user:import']">导入</el-button>
42
         </el-col> -->
63
         </el-col> -->
43
-        <el-col :span="1.5">
44
-          <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
45
-            v-hasPermi="['system:user:export']">导出</el-button>
46
-        </el-col>
47
-        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
48
-      </el-row>
64
+          <el-col :span="1.5">
65
+            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
66
+              v-hasPermi="['system:user:export']">导出</el-button>
67
+          </el-col>
68
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
69
+        </el-row>
49
 
70
 
50
-      <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
51
-        <el-table-column type="selection" width="50" align="center" />
52
-        <el-table-column label="序号" width="50" align="center" prop="userId">
53
-          <template slot-scope="scope">
54
-            {{ scope.row.userId - 1 }}
55
-          </template>
56
-        </el-table-column>
57
-        <!-- <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> -->
58
-        <el-table-column label="姓名" align="center" key="nickName" prop="nickName" v-if="columns[0].visible"
59
-          :show-overflow-tooltip="true" />
60
-        <el-table-column label="年龄" align="center" key="age" prop="age" v-if="columns[1].visible">
61
-          <template slot-scope="scope">
62
-            {{ getAgeByIdCard(scope.row.idCard) }}
63
-          </template>
64
-        </el-table-column>
65
-        <el-table-column label="性别" align="center" key="sex" prop="sex" v-if="columns[2].visible"
66
-          :show-overflow-tooltip="true">
67
-          <template slot-scope="scope">
68
-            {{ scope.row.sex == 0 ? '男' : '女' }}
69
-          </template>
70
-        </el-table-column>
71
-        <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible"
72
-          width="120" />
73
-        <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[4].visible"
74
-          :show-overflow-tooltip="true" />
75
-        <el-table-column label="岗级" align="center" key="postLevel" v-if="columns[5].visible"
76
-          :show-overflow-tooltip="true">
77
-          <template slot-scope="scope">
78
-            {{ selectDictLabel(dict.type.sys_user_postlevel, scope.row.postLevel) +
79
-      selectDictLabel(dict.type.sys_user_salarylevel, scope.row.salaryLevel) }}
80
-          </template>
81
-        </el-table-column>
82
-        <el-table-column label="职称" align="center" key="titles" prop="titles" v-if="columns[6].visible"
83
-          :show-overflow-tooltip="true">
84
-          <template slot-scope="scope">
85
-            {{ selectDictLabel(dict.type.sys_user_titles, scope.row.titles) }}
86
-          </template>
87
-        </el-table-column>
88
-        <el-table-column label="执业证书" align="center" key="certificates" prop="certificates" v-if="columns[7].visible"
89
-          :show-overflow-tooltip="true">
90
-          <template slot-scope="scope">
91
-            {{ formatCrtificates(dict.type.sys_user_certificates, scope.row.certificates) }}
92
-          </template>
93
-        </el-table-column>
94
-        <el-table-column label="入职年月" align="center" key="entryDate" prop="entryDate" v-if="columns[8].visible"
95
-          :show-overflow-tooltip="true">
96
-          <template slot-scope="scope">
97
-            <span>{{ parseTime(scope.row.entryDate, '{y}-{m}') }}</span>
98
-          </template>
99
-        </el-table-column>
100
-        <el-table-column label="合同签订" align="center" key="contractSign" prop="contractSign" v-if="columns[8].visible"
101
-          :show-overflow-tooltip="true">
102
-          <template slot-scope="scope">
103
-            <span>{{ parseTime(scope.row.contractSign, '{y}-{m}-{d}') }}</span>
104
-          </template>
105
-        </el-table-column>
106
-        <el-table-column label="合同期满" align="center" key="contractExpire" prop="contractExpire"
107
-          v-if="columns[8].visible" :show-overflow-tooltip="true">
108
-          <template slot-scope="scope">
109
-            <span>{{ parseTime(scope.row.contractExpire, '{y}-{m}-{d}') }}</span>
110
-          </template>
111
-        </el-table-column>
112
-        <!-- <el-table-column label="固定成本(天)" align="center" key="salary" prop="salary.salary" :show-overflow-tooltip="true">
71
+        <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
72
+          <el-table-column type="selection" width="50" align="center" />
73
+          <el-table-column label="序号" width="50" align="center" prop="userId">
74
+            <template slot-scope="scope">
75
+              {{ scope.row.userId - 1 }}
76
+            </template>
77
+          </el-table-column>
78
+          <!-- <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> -->
79
+          <el-table-column label="姓名" align="center" key="nickName" prop="nickName" v-if="columns[0].visible"
80
+            :show-overflow-tooltip="true" />
81
+          <el-table-column label="年龄" align="center" key="age" prop="age" v-if="columns[1].visible">
82
+            <template slot-scope="scope">
83
+              {{ getAgeByIdCard(scope.row.idCard) }}
84
+            </template>
85
+          </el-table-column>
86
+          <el-table-column label="性别" align="center" key="sex" prop="sex" v-if="columns[2].visible"
87
+            :show-overflow-tooltip="true">
88
+            <template slot-scope="scope">
89
+              {{ scope.row.sex == 0 ? '男' : '女' }}
90
+            </template>
91
+          </el-table-column>
92
+          <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible"
93
+            width="120" />
94
+          <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[4].visible"
95
+            :show-overflow-tooltip="true" />
96
+          <el-table-column label="岗级" align="center" key="postLevel" v-if="columns[5].visible"
97
+            :show-overflow-tooltip="true">
98
+            <template slot-scope="scope">
99
+              {{ selectDictLabel(dict.type.sys_user_postlevel, scope.row.postLevel) +
100
+                selectDictLabel(dict.type.sys_user_salarylevel, scope.row.salaryLevel) }}
101
+            </template>
102
+          </el-table-column>
103
+          <el-table-column label="职称" align="center" key="titles" prop="titles" v-if="columns[6].visible"
104
+            :show-overflow-tooltip="true">
105
+            <template slot-scope="scope">
106
+              {{ selectDictLabel(dict.type.sys_user_titles, scope.row.titles) }}
107
+            </template>
108
+          </el-table-column>
109
+          <!-- <el-table-column label="执业证书" align="center" key="certificates" prop="certificates" v-if="columns[7].visible"
110
+            :show-overflow-tooltip="true">
111
+            <template slot-scope="scope">
112
+              {{ formatCrtificates(dict.type.sys_user_certificates, scope.row.certificates) }}
113
+            </template>
114
+          </el-table-column>
115
+          <el-table-column label="入职年月" align="center" key="entryDate" prop="entryDate" v-if="columns[8].visible"
116
+            :show-overflow-tooltip="true">
117
+            <template slot-scope="scope">
118
+              <span>{{ parseTime(scope.row.entryDate, '{y}-{m}') }}</span>
119
+            </template>
120
+          </el-table-column> -->
121
+          <el-table-column label="合同签订" align="center" key="contractSign" prop="contractSign" v-if="columns[7].visible"
122
+            :show-overflow-tooltip="true">
123
+            <template slot-scope="scope">
124
+              <span>{{ parseTime(scope.row.contractSign, '{y}-{m}-{d}') }}</span>
125
+            </template>
126
+          </el-table-column>
127
+          <el-table-column label="合同期满" align="center" key="contractExpire" prop="contractExpire"
128
+            v-if="columns[8].visible" :show-overflow-tooltip="true">
129
+            <template slot-scope="scope">
130
+              <span>{{ parseTime(scope.row.contractExpire, '{y}-{m}-{d}') }}</span>
131
+            </template>
132
+          </el-table-column>
133
+          <!-- <el-table-column label="固定成本(天)" align="center" key="salary" prop="salary.salary" :show-overflow-tooltip="true">
113
           <template slot-scope="scope">
134
           <template slot-scope="scope">
114
             {{ scope.row.salary ? scope.row.salary.salary : "" }}
135
             {{ scope.row.salary ? scope.row.salary.salary : "" }}
115
           </template>
136
           </template>
116
         </el-table-column> -->
137
         </el-table-column> -->
117
-        <el-table-column label="状态" align="center" key="status" v-if="columns[9].visible">
118
-          <template slot-scope="scope">
119
-            <el-tag type="success" v-if="scope.row.status == 0">在职</el-tag>
120
-            <el-tag type="danger" v-if="scope.row.status == 1">离职</el-tag>
121
-            <el-tag type="warning" v-if="scope.row.status == 2">退休</el-tag>
122
-            <!-- <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
138
+          <el-table-column label="状态" align="center" key="status" v-if="columns[9].visible">
139
+            <template slot-scope="scope">
140
+              <el-tag type="success" v-if="scope.row.status == 0">在职</el-tag>
141
+              <el-tag type="danger" v-if="scope.row.status == 1">离职</el-tag>
142
+              <el-tag type="warning" v-if="scope.row.status == 2">退休</el-tag>
143
+              <!-- <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
123
               @change="handleStatusChange(scope.row)"></el-switch> -->
144
               @change="handleStatusChange(scope.row)"></el-switch> -->
124
-          </template>
125
-        </el-table-column>
145
+            </template>
146
+          </el-table-column>
126
 
147
 
127
-        <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
128
-          <template slot-scope="scope" v-if="scope.row.userId !== 1">
129
-            <el-button size="mini" type="text" icon="el-icon-view" v-hasPermi="['system:user:query']"
130
-              @click="handleView(scope.row)">详情</el-button>
131
-            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
132
-              v-hasPermi="['system:user:edit']">修改</el-button>
133
-            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
134
-              v-hasPermi="['system:user:remove']">删除</el-button>
135
-          </template>
136
-        </el-table-column>
137
-      </el-table>
148
+          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
149
+            <template slot-scope="scope" v-if="scope.row.userId !== 1">
150
+              <el-button size="mini" type="text" icon="el-icon-view" v-hasPermi="['system:user:query']"
151
+                @click="handleView(scope.row)">详情</el-button>
152
+              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
153
+                v-hasPermi="['system:user:edit']">修改</el-button>
154
+              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
155
+                v-hasPermi="['system:user:remove']">删除</el-button>
156
+            </template>
157
+          </el-table-column>
158
+        </el-table>
138
 
159
 
139
-      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
140
-        @pagination="getList" />
160
+        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
161
+          @pagination="getList" />
162
+      </el-col>
141
     </el-row>
163
     </el-row>
142
-
143
     <!-- 添加或修改用户配置对话框 -->
164
     <!-- 添加或修改用户配置对话框 -->
144
     <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
165
     <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
145
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
166
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
218
                 value-format="yyyy-MM" />
239
                 value-format="yyyy-MM" />
219
             </el-form-item>
240
             </el-form-item>
220
             <el-form-item label="政治面貌" prop="politicalAffiliation">
241
             <el-form-item label="政治面貌" prop="politicalAffiliation">
221
-              <el-select v-model="form.politicalAffiliation" multiple clearable placeholder="请选择政治面貌"
222
-                style="width:100%;">
242
+              <el-select v-model="form.politicalAffiliation" multiple clearable placeholder="请选择政治面貌" style="width:100%;">
223
                 <el-option v-for="dict in dict.type.sys_user_political" :key="dict.value" :label="dict.label"
243
                 <el-option v-for="dict in dict.type.sys_user_political" :key="dict.value" :label="dict.label"
224
                   :value="dict.value" />
244
                   :value="dict.value" />
225
               </el-select>
245
               </el-select>
316
 </template>
336
 </template>
317
 
337
 
318
 <script>
338
 <script>
319
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
339
+import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelectNew } from "@/api/system/user";
320
 import { getToken } from "@/utils/auth";
340
 import { getToken } from "@/utils/auth";
321
 import Treeselect from "@riophae/vue-treeselect";
341
 import Treeselect from "@riophae/vue-treeselect";
322
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
342
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
345
       title: "",
365
       title: "",
346
       // 部门树选项
366
       // 部门树选项
347
       deptOptions: undefined,
367
       deptOptions: undefined,
348
-      deptList: [],
349
       // 是否显示弹出层
368
       // 是否显示弹出层
350
       open: false,
369
       open: false,
351
       // 部门名称
370
       // 部门名称
403
         { key: 4, label: `部门`, visible: true },
422
         { key: 4, label: `部门`, visible: true },
404
         { key: 5, label: `岗级`, visible: true },
423
         { key: 5, label: `岗级`, visible: true },
405
         { key: 6, label: `职称`, visible: true },
424
         { key: 6, label: `职称`, visible: true },
406
-        { key: 7, label: `执业证书`, visible: true },
407
-        { key: 8, label: `入职年月`, visible: true },
425
+        { key: 7, label: `合同签订`, visible: true },
426
+        { key: 8, label: `合同期满`, visible: true },
408
         { key: 9, label: `状态`, visible: true },
427
         { key: 9, label: `状态`, visible: true },
409
       ],
428
       ],
410
       // 表单校验
429
       // 表单校验
465
     },
484
     },
466
     /** 查询部门下拉树结构 */
485
     /** 查询部门下拉树结构 */
467
     getDeptTree() {
486
     getDeptTree() {
468
-      deptTreeSelect().then(response => {
487
+      deptTreeSelectNew().then(response => {
469
         this.deptOptions = response.data;
488
         this.deptOptions = response.data;
470
-        this.deptList = response.data[0].children
471
       });
489
       });
472
     },
490
     },
473
     // 筛选节点
491
     // 筛选节点
634
               this.getList();
652
               this.getList();
635
             });
653
             });
636
           } else {
654
           } else {
637
-            this.form.certificates = this.form.certificates.length == 0? '' : this.form.certificates;
655
+            this.form.certificates = this.form.certificates.length == 0 ? '' : this.form.certificates;
638
             this.form.politicalAffiliation = this.form.politicalAffiliation.length == 0 ? '' : this.form.politicalAffiliation;
656
             this.form.politicalAffiliation = this.form.politicalAffiliation.length == 0 ? '' : this.form.politicalAffiliation;
639
             addUser(this.form).then(response => {
657
             addUser(this.form).then(response => {
640
               this.$modal.msgSuccess("新增成功");
658
               this.$modal.msgSuccess("新增成功");

+ 2
- 2
oa-ui/src/views/system/user/index.vue Переглянути файл

298
 </template>
298
 </template>
299
 
299
 
300
 <script>
300
 <script>
301
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
301
+import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelectNew } from "@/api/system/user";
302
 import { getToken } from "@/utils/auth";
302
 import { getToken } from "@/utils/auth";
303
 import Treeselect from "@riophae/vue-treeselect";
303
 import Treeselect from "@riophae/vue-treeselect";
304
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
304
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
442
     },
442
     },
443
     /** 查询部门下拉树结构 */
443
     /** 查询部门下拉树结构 */
444
     getDeptTree() {
444
     getDeptTree() {
445
-      deptTreeSelect().then(response => {
445
+      deptTreeSelectNew().then(response => {
446
         this.deptOptions = response.data;
446
         this.deptOptions = response.data;
447
       });
447
       });
448
     },
448
     },

Завантаження…
Відмінити
Зберегти