Sfoglia il codice sorgente

区分用户与员工

hfy 4 mesi fa
parent
commit
5d2a765b7d

+ 12 - 0
src/main/java/com/jeesite/modules/mes/dao/MesEmpUserDao.java

@@ -0,0 +1,12 @@
+package com.jeesite.modules.mes.dao;
+
+import com.jeesite.common.dao.CrudDao;
+import com.jeesite.common.mybatis.annotation.MyBatisDao;
+import com.jeesite.modules.sys.entity.EmpUser;
+
+
+@MyBatisDao
+public interface MesEmpUserDao extends CrudDao<EmpUser> {
+
+
+}

+ 20 - 0
src/main/java/com/jeesite/modules/mes/service/MesEmpUserService.java

@@ -0,0 +1,20 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.dao.MesEmpUserDao;
+import com.jeesite.modules.sys.entity.EmpUser;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Employee user query service.
+ */
+@Service
+public class MesEmpUserService extends CrudService<MesEmpUserDao, EmpUser> {
+
+    @Transactional(readOnly = true)
+    public Page<EmpUser> findEmpUserPage(EmpUser empUser) {
+        return super.findPage(empUser);
+    }
+}

+ 77 - 122
src/main/java/com/jeesite/modules/mes/web/EmpUserCustomController.java

@@ -4,6 +4,7 @@ import com.jeesite.common.config.Global;
 import com.jeesite.common.entity.Page;
 import com.jeesite.common.lang.StringUtils;
 import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.service.MesEmpUserService;
 import com.jeesite.modules.sys.entity.EmpUser;
 import com.jeesite.modules.sys.entity.EmployeeOffice;
 import com.jeesite.modules.sys.entity.Post;
@@ -35,24 +36,24 @@ public class EmpUserCustomController extends BaseController {
     @Autowired
     private EmpUserService empUserService;
 
-    @Autowired
-    private RoleService roleService;
-
     @ModelAttribute
     public EmpUser get(String userCode, boolean isNewRecord) {
         return empUserService.get(userCode, isNewRecord);
     }
-    @RequestMapping(value = {"formEmpoyee", "formEmployee"})
-    public String formEmpoyee(EmpUser empUser, String op, Model model) {
-        model.addAttribute("roleUserType", "employee");
+
+    @RequestMapping(value = "form")
+    public String form(EmpUser empUser, String op, Model model) {
         if ("copy".equals(op)) {
+            // 借用原生的 form 方法,获取全量数据(包括岗位、机构、角色)
             String view = empUserController.form(empUser, "edit", model);
 
             EmpUser fullUser = (EmpUser) model.asMap().get("empUser");
             if (fullUser != null) {
+                // 将原记录转化为新记录
                 fullUser.setIsNewRecord(true);
                 fullUser.setUserCode(null);
 
+                // 转换员工及附属机构的主键
                 if (fullUser.getEmployee() != null) {
                     fullUser.getEmployee().setIsNewRecord(true);
                     fullUser.getEmployee().setEmpCode(null);
@@ -66,6 +67,7 @@ public class EmpUserCustomController extends BaseController {
                     }
                 }
 
+                // 处理角色回显
                 List<Role> roleList = fullUser.getRoleList();
                 if (roleList != null && !roleList.isEmpty()) {
                     List<String> roleCodes = new ArrayList<>();
@@ -75,134 +77,55 @@ public class EmpUserCustomController extends BaseController {
                     fullUser.setUserRoleString(StringUtils.join(roleCodes, ","));
                 }
 
+                // 覆盖 Model 中的对象并注入角色列表和操作标识
                 model.addAttribute("empUser", fullUser);
                 model.addAttribute("roleList", roleList);
                 model.addAttribute("op", "add");
             }
 
-            return "modules/sys/user/empUserForm";
-        }
-
-        if ("add".equals(op) || "edit".equals(op)) {
-            empUser.setUserType("employee");
-            empUserController.form(empUser, op, model);
-            return "modules/sys/user/empUserForm";
+            // 注入自定义保存脚本,修改表单 action 为我们自己的 save
+            String customSaveScript = "<script>" +
+                    "$(function(){" +
+                    "  var overrideAction = function() {" +
+                    "      var form = $('#inputForm');" +
+                    "      if(form.length > 0 && form.attr('action').indexOf('/mes/empUserCustom/save') === -1) {" +
+                    "          form.attr('action', '" + Global.getAdminPath() + "/mes/empUserCustom/save');" +
+                    "      }" +
+                    "  };" +
+                    "  overrideAction();" +
+                    "  setInterval(overrideAction, 500);" +
+                    "});" +
+                    "</script>";
+            model.addAttribute("customSaveScript", customSaveScript);
+
+            // 为了防止 customSaveScript 没有被模板渲染,我们利用 extend 字段进行 XSS 注入(JeeSite 中扩展字段常用于透传)
+            // 或者更安全的做法,只需 model 传参。这里保留之前的做法。
+
+            return view;
         }
 
         return empUserController.form(empUser, op, model);
     }
-    @RequestMapping(value = "form")
-    public String form(EmpUser empUser, String op, Model model) {
-        if ("copy".equals(op)) {
-            String view = empUserController.form(empUser, "edit", model);
-            
-            EmpUser fullUser = (EmpUser) model.asMap().get("empUser");
-            if (fullUser != null) {
-                fullUser.setIsNewRecord(true);
-                fullUser.setUserCode(null);
-                
-                if (fullUser.getEmployee() != null) {
-                    fullUser.getEmployee().setIsNewRecord(true);
-                    fullUser.getEmployee().setEmpCode(null);
-                    
-                    List<EmployeeOffice> officeList = fullUser.getEmployee().getEmployeeOfficeList();
-                    if (officeList != null && !officeList.isEmpty()) {
-                        for (EmployeeOffice eo : officeList) {
-                            eo.setIsNewRecord(true);
-                            eo.setId(null);
-                        }
-                    }
-                }
-                
-                List<Role> roleList = fullUser.getRoleList();
-                if (roleList != null && !roleList.isEmpty()) {
-                    List<String> roleCodes = new ArrayList<>();
-                    for (Role role : roleList) {
-                        roleCodes.add(role.getRoleCode());
-                    }
-                    fullUser.setUserRoleString(StringUtils.join(roleCodes, ","));
-                }
-                
-                model.addAttribute("empUser", fullUser);
-                model.addAttribute("roleList", roleList);
-                model.addAttribute("op", "add");
-            }
-            
-            return "modules/sys/user/empUserForm";
-        }
-        
-        if ("add".equals(op) || "edit".equals(op)) {
-            empUserController.form(empUser, op, model);
-            return "modules/sys/user/empUserForm";
-        }
-        
-        return empUserController.form(empUser, op, model);
-    }
+        @Autowired
+   private PostService postService;
     @Autowired
-    private PostService postService;
-
-/*
-    @RequestMapping(value = "empUserList")
-    public String empUserList(EmpUser empUser, Model model) {
-        Role role = new Role();
-        role.setUserType("employee");
-        model.addAttribute("roleList", roleService.findList(role));
-        model.addAttribute("postList", postService.findList(new Post()));
-        empUser.setUserType("none");
+    private RoleService roleService;
+    @RequestMapping({"index"})
+    public String index(EmpUser empUser, Model model) {
         model.addAttribute("empUser", empUser);
         model.addAttribute("ctrlPermi", Global.getConfig("user.adminCtrlPermi", "2"));
-        return "modules/sys/user/empUserList";
+        return "modules/sys/user/employeeIndex";
     }
-*/
-
-    @RequestMapping(value = "employeeList")
+   @RequestMapping(value = "employeeList")
     public String employeeList(EmpUser empUser, Model model) {
-        Role role = new Role();
-        role.setUserType("employee");
-        model.addAttribute("roleList", roleService.findList(role));
-        model.addAttribute("postList", postService.findList(new Post()));
-        model.addAttribute("empUser", empUser);
-        model.addAttribute("ctrlPermi", Global.getConfig("user.adminCtrlPermi", "2"));
-        return "modules/sys/user/employeeList";
-    }
-
-    @RequestMapping(value = "listData")
-    @ResponseBody
-    public Page<EmpUser> listData(EmpUser empUser, Boolean isAll, String roleCode, String fixedRoleName,
-                                  HttpServletRequest request, HttpServletResponse response) {
-        roleCode = setFixedRole(empUser, roleCode, fixedRoleName);
-        return empUserController.listData(empUser, isAll, roleCode, request, response);
-    }
-
-    @RequestMapping(value = "exportData")
-    public void exportData(EmpUser empUser, Boolean isAll, String roleCode, String fixedRoleName,
-                           HttpServletResponse response) {
-        roleCode = setFixedRole(empUser, roleCode, fixedRoleName);
-        empUserController.exportData(empUser, isAll, roleCode, response);
-    }
-
-    private String setFixedRole(EmpUser empUser, String roleCode, String fixedRoleName) {
-        String fixedRoleCode = getRoleCodeByName(fixedRoleName);
-        if (StringUtils.isBlank(fixedRoleCode) && StringUtils.isNotBlank(fixedRoleName)) {
-            fixedRoleCode = "__none__";
-        }
-        if (StringUtils.isNotBlank(fixedRoleCode)) {
-            empUser.setRoleCode(fixedRoleCode);
-            return fixedRoleCode;
-        }
-        return roleCode;
-    }
-
-    private String getRoleCodeByName(String roleName) {
-        if (StringUtils.isBlank(roleName)) {
-            return "";
-        }
-        Role role = new Role();
-        role.setRoleName(roleName);
-        role = roleService.getByRoleName(role);
-        return role != null ? role.getRoleCode() : "";
-    }
-
+               Role role = new Role();
+               role.setUserType("employee");
+               model.addAttribute("roleList", roleService.findList(role));
+               model.addAttribute("postList", postService.findList(new Post()));
+               model.addAttribute("empUser", empUser);
+               model.addAttribute("ctrlPermi", Global.getConfig("user.adminCtrlPermi", "2"));
+               return "modules/sys/user/employeeList";
+           }
     @RequestMapping(value = "save")
     @ResponseBody
     public String save(@Validated EmpUser empUser, String oldLoginCode, HttpServletRequest request) {
@@ -212,7 +135,7 @@ public class EmpUserCustomController extends BaseController {
         if (uList != null && !uList.isEmpty()) {
             return renderResult(Global.FALSE, "保存用户失败,登录账号已存在(不能与原账号相同),请修改登录账号!");
         }
-        
+
         if (StringUtils.isNotBlank(empUser.getUserName())) {
             EmpUser where = new EmpUser();
             where.setUserName(empUser.getUserName());
@@ -221,7 +144,39 @@ public class EmpUserCustomController extends BaseController {
                 return renderResult(Global.FALSE, "保存用户失败,用户昵称已存在(不能与原昵称相同),请修改用户昵称!");
             }
         }
-        
+
         return empUserController.save(empUser, oldLoginCode, request);
     }
+    @RequestMapping({"listData"})
+    @ResponseBody
+    public Page<EmpUser> listData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletRequest request, HttpServletResponse response) {
+       empUser.setRoleCode("yonghu");
+        empUser.getEmployee().getOffice().setIsQueryChildren(true);
+        empUser.getEmployee().getCompany().setIsQueryChildren(true);
+        if (isAll == null || !isAll || Global.isStrictMode()) {
+            this.empUserService.addDataScopeFilter(empUser, ctrlPermi);
+        }
+
+        empUser.setPage(new Page(request, response));
+        Page<EmpUser> page = this.empUserService.findPage(empUser);
+        return page;
+    }
+    @Autowired
+    private MesEmpUserService mesEmpUserService;
+    @RequestMapping({"emplistData"})
+    @ResponseBody
+    public Page<EmpUser> emplistData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletRequest request, HttpServletResponse response) {
+        empUser.getEmployee().getOffice().setIsQueryChildren(true);
+        empUser.getEmployee().getCompany().setIsQueryChildren(true);
+        if (isAll == null || !isAll || Global.isStrictMode()) {
+            this.empUserService.addDataScopeFilter(empUser, ctrlPermi);
+        }
+        // 绑定分页对象
+        empUser.setPage(new Page(request, response));
+
+        // 查询
+        Page<EmpUser> page = mesEmpUserService.findEmpUserPage(empUser);
+
+        return page;
+    }
 }

+ 57 - 0
src/main/resources/mappings/modules/mes/MesEmpUserDao.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeesite.modules.mes.dao.MesEmpUserDao">
+
+    <sql id="empUserJoins">
+        <if test="roleCode != null and roleCode != ''">
+            JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
+        </if>
+        <if test="employee.postCode != null and employee.postCode != ''">
+            JOIN ${_prefix}sys_employee_post ep ON e.emp_code = ep.emp_code
+        </if>
+    </sql>
+
+    <sql id="empUserWhere">
+        ${sqlMap.where.toSql()}
+        <if test="roleCode != null and roleCode != ''">
+            AND ur2.role_code = #{roleCode}
+        </if>
+        <if test="employee.postCode != null and employee.postCode != ''">
+            AND (
+                ep.post_code = #{employee.postCode}
+                OR EXISTS (
+                    SELECT 1 FROM ${_prefix}sys_employee_office
+                    WHERE emp_code = e.emp_code
+                        AND post_code = #{employee.postCode}
+                )
+            )
+        </if>
+        AND NOT EXISTS (
+            SELECT 1 FROM ${_prefix}sys_user_role ur_yonghu
+            WHERE ur_yonghu.user_code = a.user_code
+                AND ur_yonghu.role_code = 'yonghu'
+        )
+    </sql>
+
+    <!-- Query employee users -->
+    <select id="findList" resultType="EmpUser">
+        SELECT ${sqlMap.column.toSql()}
+        FROM ${sqlMap.table.toSql()}
+        <include refid="empUserJoins"/>
+        <where>
+            <include refid="empUserWhere"/>
+        </where>
+        ORDER BY ${sqlMap.order.toSql()}
+    </select>
+
+    <!-- Query employee user count -->
+    <select id="findCount" resultType="long">
+        SELECT COUNT(DISTINCT a.user_code)
+        FROM ${sqlMap.table.toSql()}
+        <include refid="empUserJoins"/>
+        <where>
+            <include refid="empUserWhere"/>
+        </where>
+    </select>
+
+</mapper>

+ 122 - 0
src/main/resources/mappings/modules/sys/EmpUserDao.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeesite.modules.sys.dao.EmpUserDao">
+    
+    <!-- 查询数据  -->
+	<select id="findList" resultType="EmpUser">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<if test="roleCode != null and roleCode != ''">
+			JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
+		</if>
+		<if test="employee.postCode != null and employee.postCode != ''">
+			JOIN ${_prefix}sys_employee_post ep ON e.emp_code = ep.emp_code
+		</if>
+		<where>
+
+			${sqlMap.where.toSql()}
+			<if test="roleCode != null and roleCode != ''">
+				AND ur2.role_code = #{roleCode}
+			</if>
+			<if test="employee.postCode != null and employee.postCode != ''">
+				AND (
+					ep.post_code = #{employee.postCode}
+					OR EXISTS (
+						SELECT 1 FROM ${_prefix}sys_employee_office
+						WHERE emp_code = e.emp_code
+							AND post_code = #{employee.postCode}
+					)
+				)
+			</if>
+			AND ur2.role_code != 'yonghu'
+
+			<!-- 附属部门查询,根据业务需要添加查询条件
+			<if test="employee.office.officeCode != null and employee.office.officeCode != ''">
+				OR EXISTS (
+					SELECT 1 FROM ${_prefix}sys_employee_office
+					WHERE emp_code = e.emp_code
+						AND office_code = #{employee.office.officeCode}
+				)
+			</if> -->
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select>
+	
+	<sql id="userColumns">
+		a.user_code as "userCode",
+		a.user_name as "userName"
+	</sql>
+	
+	<!-- 查询全部用户,仅返回基本信息  -->
+	<select id="findUserList" resultType="EmpUser">
+		SELECT 
+		    <include refid="userColumns"/>
+		FROM ${_prefix}sys_user a
+		WHERE a.status = #{STATUS_NORMAL}
+			AND a.user_type = #{USER_TYPE_EMPLOYEE}
+			<if test="global.useCorpModel">
+		    	AND a.corp_code = #{corpCode}
+		    </if>
+	</select>
+	
+	<!-- 根据部门编码查询用户,仅返回基本信息  -->
+	<select id="findUserListByOfficeCodes" resultType="EmpUser">
+		SELECT 
+		    <include refid="userColumns"/>
+		FROM ${_prefix}sys_user a
+		JOIN ${_prefix}sys_employee e ON e.emp_code = a.ref_code
+		JOIN ${_prefix}sys_office o ON o.office_code = e.office_code
+		WHERE a.status = #{STATUS_NORMAL}
+			AND a.user_type = #{USER_TYPE_EMPLOYEE}
+			<if test="global.useCorpModel">
+		    	AND a.corp_code = #{corpCode}
+		    </if>
+		    AND e.status = #{STATUS_NORMAL}
+		    AND o.status = #{STATUS_NORMAL}
+			AND o.office_code IN
+			<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
+				#{code}
+			</foreach>
+	</select>
+	
+	<!-- 根据角色编码查询用户,仅返回基本信息  -->
+	<select id="findUserListByRoleCodes" resultType="EmpUser">
+		SELECT 
+		    <include refid="userColumns"/>
+		FROM ${_prefix}sys_user a
+		JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
+		JOIN ${_prefix}sys_role r ON r.role_code = ur2.role_code
+		WHERE a.status = #{STATUS_NORMAL}
+			AND a.user_type = #{USER_TYPE_EMPLOYEE}
+			<if test="global.useCorpModel">
+		    	AND a.corp_code = #{corpCode}
+		    </if>
+		    AND r.status = #{STATUS_NORMAL}
+			AND r.role_code IN
+			<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
+				#{code}
+			</foreach>
+	</select>
+	
+	<!-- 根据岗位编码查询用户,仅返回基本信息  -->
+	<select id="findUserListByPostCodes" resultType="EmpUser">
+		SELECT 
+		    <include refid="userColumns"/>
+		FROM ${_prefix}sys_user a
+		JOIN ${_prefix}sys_employee e ON e.emp_code = a.ref_code
+		JOIN ${_prefix}sys_employee_post ep ON ep.emp_code = e.emp_code
+		JOIN ${_prefix}sys_post p ON p.post_code = ep.post_code
+		WHERE a.status = #{STATUS_NORMAL}
+			AND a.user_type = #{USER_TYPE_EMPLOYEE}
+			<if test="global.useCorpModel">
+		    	AND a.corp_code = #{corpCode}
+		    </if>
+		    AND e.status = #{STATUS_NORMAL}
+		    AND p.status = #{STATUS_NORMAL}
+			AND p.post_code IN
+			<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
+				#{code}
+			</foreach>
+	</select>
+	
+</mapper>

+ 46 - 25
src/main/resources/views/modules/sys/user/empUserForm.html

@@ -9,7 +9,7 @@
 				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
 			</div>
 		</div>
-		<#form:form id="inputForm" model="${empUser}" action="${ctx}/mes/empUserCustom/save" method="post" class="form-horizontal">
+		<#form:form id="inputForm" model="${empUser}" action="${ctx}/sys/empUser/save" method="post" class="form-horizontal">
 			<#form:hidden name="op" value="${op}"/>
 			<#form:hidden name="userType" value="employee"/>
 			<#form:hidden path="userCode"/>
@@ -24,7 +24,7 @@
 								<span class="required ">*</span> ${text('归属机构')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-8">
 								<#form:treeselect id="office" title="${text('机构选择')}"
-									path="employee.office.officeCode" labelPath="employee.office.officeName"
+									path="employee.office.officeCode" labelPath="employee.office.officeName" 
 									url="${ctx}/sys/office/treeData?ctrlPermi=${ctrlPermi}"
 									class="required" allowClear="false" canSelectRoot="true" canSelectParent="true"/>
 							</div>
@@ -36,7 +36,7 @@
 								<span class="required hide">*</span> ${text('归属公司')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-8">
 								<#form:treeselect id="company" title="${text('公司选择')}"
-									path="employee.company.companyCode" labelPath="employee.company.companyName"
+									path="employee.company.companyCode" labelPath="employee.company.companyName" 
 									url="${ctx}/sys/company/treeData?ctrlPermi=${ctrlPermi}"
 									btnClass="" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
 							</div>
@@ -78,7 +78,7 @@
 								<div class="input-group">
 									<#form:input path="email" maxlength="300" class="form-control email"/>
 									<span class="input-group-addon"><i class="fa fa-fw fa-envelope"></i></span>
-								</div>
+				                </div>
 							</div>
 						</div>
 					</div>
@@ -90,7 +90,7 @@
 								<div class="input-group">
 									<#form:input path="mobile" maxlength="100" class="form-control mobile"/>
 									<span class="input-group-addon"><i class="fa fa-fw fa-mobile"></i></span>
-								</div>
+				                </div>
 							</div>
 						</div>
 					</div>
@@ -104,7 +104,16 @@
 								<div class="input-group">
 									<#form:input path="phone" maxlength="100" class="form-control phone"/>
 									<span class="input-group-addon"><i class="fa fa-fw fa-phone"></i></span>
-								</div>
+				                </div>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6 hide">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('权重(排序)')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="userWeight" value="0" maxlength="8" class="form-control digits" placeholder="${text('权重越大排名越靠前,请填写数字。')}"/>
 							</div>
 						</div>
 					</div>
@@ -143,6 +152,15 @@
 							</div>
 						</div>
 					</div>
+					<div class="col-xs-6 hide">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('英文名')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="employee.empNameEn" value="moren" maxlength="32" class="form-control "/>
+							</div>
+						</div>
+					</div>
 				</div>
 				<div class="row">
 					<div class="col-xs-12">
@@ -176,7 +194,7 @@
 					<table id="roleGrid"></table>
 					<#form:hidden name="userRoleString"/>
 				</div>
-				<% } %>
+			    <% } %>
 				<% if(op == 'add' || op == 'edit') { %>
 				<#form:extend collapsed="true" />
 				<% } %>
@@ -203,7 +221,7 @@
 <script>
 $("#empOfficeGrid").dataGrid({
 	data: ${toJson(empUser.employee.employeeOfficeList)},
-	datatype: "local",
+	datatype: "local", // 设置本地数据
 	columnModel: [
 		{header:'${text("附属机构")}', name:'officeName', sortable:false, width:100,
 			formatter: function(val, obj, row, act){
@@ -211,15 +229,15 @@ $("#empOfficeGrid").dataGrid({
 			}, editable: true, edittype: "custom", editoptions: {
 				custom_element: function(val, editOptions) {
 					return js.template('treeselectTpl', {
-						id: 'office_'+editOptions.id, title: '机构选择',
-						name: 'officeCode', value: val.split('|')[0],
+						id: 'office_'+editOptions.id, title: '机构选择', 
+						name: 'officeCode', value: val.split('|')[0], 
 						labelName: 'officeName', labelValue: val.split('|')[1],
 						url: '${ctx}/sys/office/treeData', cssClass: 'required'
 					});
 				}
 			}
 		},
-		{header:'${text("附属岗位")}', name:'postCode', sortable:false, width:100,
+		{header:'${text("附属岗位")}', name:'postCode', sortable:false, width:100, 
 			editable:true, edittype:'select', editoptions:{'class':'form-control',
 				items: $.merge([{postName:'&nbsp;',postCode:''}], ${toJson(postList)}),
 				itemLabel: 'postName', itemValue: 'postCode', dataInit: function(element){
@@ -233,30 +251,33 @@ $("#empOfficeGrid").dataGrid({
 			return actions.join('');
 		}, editoptions: {defaultValue: 'new'}}
 	],
-	autoGridHeight: function(){return 'auto'},
-
-	editGrid: true,
-	editGridInitRowNum: 0,
-	editGridAddRowBtn: $('#empOfficeGridAddRowBtn'),
-	editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL},
-
-	editGridInputFormListName: 'employee.employeeOfficeList',
-	editGridInputFormListAttrs: 'officeCode,officeName,postCode,postName,',
-
+	autoGridHeight: function(){return 'auto'}, // 设置自动高度
+	
+	// 编辑表格参数
+	editGrid: true,				// 是否是编辑表格
+	editGridInitRowNum: 0,		// 编辑表格的初始化新增行数
+	editGridAddRowBtn: $('#empOfficeGridAddRowBtn'),	// 子表增行按钮
+	editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL},	// 新增行的时候初始化的数据
+	
+	// 编辑表格的提交数据参数
+	editGridInputFormListName: 'employee.employeeOfficeList', // 提交的数据列表名
+	editGridInputFormListAttrs: 'officeCode,officeName,postCode,postName,', // 提交数据列表的属性字段
+	
 	ajaxSuccess: function(){
-
+		
 	}
 });
 //<% if(hasPermi('sys:empUser:authRole') && (op == 'add' || op == 'auth')) { %>
+// 加载角色列表
 var roleGrid = $("#roleGrid").dataGrid({
 	url: '${ctx}/sys/role/treeData',
 	postData: [
-		{name:'userType',value:"${roleUserType!'user'}"},
+		{name:'userType',value:'employee'},
 		{name:'ctrlPermi',value:'${ctrlPermi}'}
 	],
 	columnModel: [
 		{header:'${text("角色名称")}', name:'name', sortable:false, width:100, align:"center"},
-		{header:'${text("角色编码")}', name:'id', sortable:false, width:100, align:"center"}
+		{header:'${text("角色编码")}', name:'id', sortable:false, width:100, align:"center"}  
 	],
 	showCheckbox: true,
 	autoGridHeight: function(){
@@ -267,7 +288,7 @@ var roleGrid = $("#roleGrid").dataGrid({
 	},
 	ajaxSuccess: function(){
 		//<% for (role in roleList!){ %>
-		roleGrid.dataGrid('setSelectRow', '${role.roleCode}');
+ 		roleGrid.dataGrid('setSelectRow', '${role.roleCode}');
 		//<% } %>
 	}
 });

+ 167 - 168
src/main/resources/views/modules/sys/user/empUserList.html

@@ -1,16 +1,16 @@
-<% layout('/layouts/default.html', {title: '用户管理', libs: ['dataGrid']}){ %>
+<% layout('/layouts/default.html', {title: '员工管理', libs: ['dataGrid']}){ %>
 <div class="main-content">
 	<div class="box box-main">
 		<div class="box-header">
 			<div class="box-title">
-				<i class="fa icon-user"></i> ${text('用户管理')}
+				<i class="fa icon-user"></i> ${text('员工管理')}
 			</div>
 			<div class="box-tools pull-right">
 				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
 				<a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
 				<% if(hasPermi('sys:empUser:edit')){ %>
-					<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
-					<a href="${ctx}/mes/empUserCustom/form?op=add" class="btn btn-default btnTool" title="${text('新增用户')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+				<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
+				<a href="${ctx}/sys/empUser/form?op=add" class="btn btn-default btnTool" title="${text('新增用户')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
 				<% } %>
 				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
 				<!-- <div class="btn-group">
@@ -26,202 +26,201 @@
 			</div>
 		</div>
 		<div class="box-body">
-			<#form:form id="searchForm" model="${empUser}" action="${ctx}/sys/user/listData" method="post" class="form-inline "
-					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
-				<#form:hidden name="ctrlPermi" value="${@Global.getConfig('user.adminCtrlPermi', '2')}"/>
-				<#form:hidden name="userType" value="user"/>
+			<#form:form id="searchForm" model="${empUser}" action="${ctx}/mes/empUserCustom/listData" method="post" class="form-inline "
+			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+			<#form:hidden name="ctrlPermi" value="${@Global.getConfig('user.adminCtrlPermi', '2')}"/>
+			<div class="form-group">
+				<label class="control-label">${text('账号')}:</label>
+				<div class="control-inline">
+					<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('昵称')}:</label>
+				<div class="control-inline">
+					<#form:input path="userName" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('姓名')}:</label>
+				<div class="control-inline">
+					<#form:input path="refName" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('手机')}:</label>
+				<div class="control-inline">
+					<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('状态')}:</label>
+				<div class="control-inline width-90">
+					<#form:select path="status" dictType="sys_user_status" blankOption="true" class="form-control isQuick"/>
+				</div>
+			</div>
+			<!-- <div class="form-row"></div> -->
+			<div class="form-group">
+				<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
+				<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
+				<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
+			</div>
+			<div class="form-more">
 				<div class="form-group">
-					<label class="control-label">${text('账号')}:</label>
-					<div class="control-inline">
-						<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
+					<label class="control-label">${text('机构')}:</label>
+					<div class="control-inline width-90">
+						<#form:treeselect id="office" title="${text('机构选择')}"
+						path="employee.office.officeCode" labelPath="employee.office.officeName"
+						url="${ctx}/sys/office/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
+						btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('昵称')}:</label>
-					<div class="control-inline">
-						<#form:input path="userName" maxlength="100" class="form-control width-90"/>
+					<label class="control-label">${text('公司')}:</label>
+					<div class="control-inline width-90">
+						<#form:treeselect id="company" title="${text('公司选择')}"
+						path="employee.company.companyCode" labelPath="employee.company.companyName"
+						url="${ctx}/sys/company/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
+						btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('姓名')}:</label>
+					<label class="control-label">${text('邮箱')}:</label>
 					<div class="control-inline">
-						<#form:input path="refName" maxlength="100" class="form-control width-90"/>
+						<#form:input path="email" maxlength="300" class="form-control width-90"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('手机')}:</label>
+					<label class="control-label">${text('电话')}:</label>
 					<div class="control-inline">
-						<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
+						<#form:input path="phone" maxlength="100" class="form-control width-90"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('状态')}:</label>
+					<label class="control-label">${text('岗位')}:</label>
 					<div class="control-inline width-90">
-						<#form:select path="status" dictType="sys_user_status" blankOption="true" class="form-control isQuick"/>
+						<#form:select name="employee.postCode" items="${postList}"
+						itemLabel="postName" itemValue="postCode" blankOption="true" class="form-control isQuick"/>
 					</div>
 				</div>
-				<!-- <div class="form-row"></div> -->
 				<div class="form-group">
-					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
-					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
-					<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
-				</div>
-				<div class="form-more">
-					<div class="form-group">
-						<label class="control-label">${text('机构')}:</label>
-						<div class="control-inline width-90">
-							<#form:treeselect id="office" title="${text('机构选择')}"
-									path="employee.office.officeCode" labelPath="employee.office.officeName" 
-									url="${ctx}/sys/office/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
-									btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('公司')}:</label>
-						<div class="control-inline width-90">
-							<#form:treeselect id="company" title="${text('公司选择')}"
-									path="employee.company.companyCode" labelPath="employee.company.companyName" 
-									url="${ctx}/sys/company/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
-									btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('邮箱')}:</label>
-						<div class="control-inline">
-							<#form:input path="email" maxlength="300" class="form-control width-90"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('电话')}:</label>
-						<div class="control-inline">
-							<#form:input path="phone" maxlength="100" class="form-control width-90"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('岗位')}:</label>
-						<div class="control-inline width-90">
-							<#form:select name="employee.postCode" items="${postList}"
-								itemLabel="postName" itemValue="postCode" blankOption="true" class="form-control isQuick"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('角色')}:</label>
-						<div class="control-inline width-120">
-							<#form:select name="roleCode" items="${roleList}"
-								itemLabel="roleName" itemValue="roleCode" blankOption="true" class="form-control isQuick"/>
-						</div>
+					<label class="control-label">${text('角色')}:</label>
+					<div class="control-inline width-120">
+						<#form:select name="roleCode" items="${roleList}"
+						itemLabel="roleName" itemValue="roleCode" blankOption="true" class="form-control isQuick"/>
 					</div>
 				</div>
-			</#form:form>
-			<table id="dataGrid"></table>
-			<div id="dataGridPage"></div>
-		</div>
+			</div>
+		</#form:form>
+		<table id="dataGrid"></table>
+		<div id="dataGridPage"></div>
 	</div>
 </div>
+</div>
 <% } %>
 <script>
-// 初始化DataGrid对象
-$('#dataGrid').dataGrid({
-	searchForm: $("#searchForm"),
-	columnModel: [
-		{header:'${text("登录账号")}', name:'loginCode', index:'a.login_code', width:125, align:"center", frozen:true, formatter: function(val, obj, row, act){
-			return '<a href="${ctx}/mes/empUserCustom/form?userCode='+row.userCode+'&op=edit" class="btnList" data-title="${text("编辑用户")}">'+(val||row.id)+'</a>';
-		}},
-		{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:125, align:"center"},
-		{header:'${text("员工姓名")}', name:'refName', index:'a.ref_name', width:125, align:"center"},
-		{header:'${text("归属机构")}', name:'employee.office.officeName', index:'o.office_name', width:135, align:"center"},
-		{header:'${text("归属公司")}', name:'employee.company.companyName', index:'c.company_name', width:135, align:"center"},
-		{header:'${text("电子邮箱")}', name:'email', index:'a.email', width:120, align:"center"},
-		{header:'${text("手机号码")}', name:'mobile', index:'a.mobile', width:120, align:"center"},
-		{header:'${text("办公电话")}', name:'phone', index:'a.phone', width:120, align:"center"},
-		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:125, align:"center", frozen:true},
-		{header:'${text("状态")}', name:'status', index:'a.status', width:60, align:"center", frozen:true, formatter: function(val, obj, row, act){
-			return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
-		}},
-		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
-			var actions = [];
-			//<% if(hasPermi('sys:empUser:edit')){ %>
-				actions.push('<a href="${ctx}/mes/empUserCustom/form?userCode='+row.userCode+'&op=edit" class="btnList" title="${text("编辑用户")}"><i class="fa fa-pencil"></i></a>&nbsp;');
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:updateStatus')){ %>
-				if (row.status == Global.STATUS_NORMAL){
-					actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
-				}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
-					actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
-				}
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:edit')){ %>
-				actions.push('<a href="${ctx}/sys/empUser/delete?userCode='+row.userCode+'" class="btnList" title="${text("删除用户")}" data-confirm="${text("确认要删除该用户吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
-				actions.push('<a href="${ctx}/mes/empUserCustom/form?userCode='+row.userCode+'&op=copy" class="btnList" title="${text("复制用户")}"><i class="fa fa-copy"></i></a>&nbsp;');
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:authRole,sys:empUser:authDataScope,sys:empUser:resetpwd', 'or')){ %>
-				actions.push('<a href="javascript:" class="btnMore" title="${text("更多操作")}"><i class="fa fa-chevron-circle-right"></i></a>&nbsp;');
-				actions.push('<div class="moreItems">');
-				//<% if(hasPermi('sys:empUser:authRole')){ %>
+	// 初始化DataGrid对象
+	$('#dataGrid').dataGrid({
+		searchForm: $("#searchForm"),
+		columnModel: [
+			{header:'${text("登录账号")}', name:'loginCode', index:'a.login_code', width:125, align:"center", frozen:true, formatter: function(val, obj, row, act){
+					return '<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=edit" class="btnList" data-title="${text("编辑用户")}">'+(val||row.id)+'</a>';
+				}},
+			{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:125, align:"center"},
+			{header:'${text("员工姓名")}', name:'refName', index:'a.ref_name', width:125, align:"center"},
+			{header:'${text("归属机构")}', name:'employee.office.officeName', index:'o.office_name', width:135, align:"center"},
+			{header:'${text("归属公司")}', name:'employee.company.companyName', index:'c.company_name', width:135, align:"center"},
+			{header:'${text("电子邮箱")}', name:'email', index:'a.email', width:120, align:"center"},
+			{header:'${text("手机号码")}', name:'mobile', index:'a.mobile', width:120, align:"center"},
+			{header:'${text("办公电话")}', name:'phone', index:'a.phone', width:120, align:"center"},
+			{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:125, align:"center", frozen:true},
+			{header:'${text("状态")}', name:'status', index:'a.status', width:60, align:"center", frozen:true, formatter: function(val, obj, row, act){
+					return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
+				}},
+			{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+					var actions = [];
+					//<% if(hasPermi('sys:empUser:edit')){ %>
+					actions.push('<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=edit" class="btnList" title="${text("编辑用户")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:updateStatus')){ %>
+					if (row.status == Global.STATUS_NORMAL){
+						actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
+					}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
+						actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
+					}
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:edit')){ %>
+					actions.push('<a href="${ctx}/sys/empUser/delete?userCode='+row.userCode+'" class="btnList" title="${text("删除用户")}" data-confirm="${text("确认要删除该用户吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
+					actions.push('<a href="${ctx}/mes/empUserCustom/form?userCode='+row.userCode+'&op=copy" class="btnList" title="${text("复制用户")}"><i class="fa fa-copy"></i></a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:authRole,sys:empUser:authDataScope,sys:empUser:resetpwd', 'or')){ %>
+					actions.push('<a href="javascript:" class="btnMore" title="${text("更多操作")}"><i class="fa fa-chevron-circle-right"></i></a>&nbsp;');
+					actions.push('<div class="moreItems">');
+					//<% if(hasPermi('sys:empUser:authRole')){ %>
 					actions.push('<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=auth" class="btn btn-default btn-xs btnList" title="${text("用户分配角色")}"><i class="fa fa-check-square-o"></i> ${text("分配角色")}</a>&nbsp;');
-				//<% } %>
-				//<% if(hasPermi('sys:empUser:authDataScope')){ %>
-				actions.push('<a href="${ctx}/mes/mesUserSkill/list?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配技能")}"><i class="fa fa-check-circle-o"></i> ${text("分配技能")}</a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:authDataScope')){ %>
+					actions.push('<a href="${ctx}/mes/mesUserSkill/list?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配技能")}"><i class="fa fa-check-circle-o"></i> ${text("分配技能")}</a>&nbsp;');
 
-				actions.push('<a href="${ctx}/mes/mesLineProcess/formAuth?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户工位授权")}"><i class="fa fa-check-circle-o"></i> ${text("工位授权")}</a>&nbsp;');
+					actions.push('<a href="${ctx}/mes/mesLineProcess/formAuth?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户工位授权")}"><i class="fa fa-check-circle-o"></i> ${text("工位授权")}</a>&nbsp;');
 
 					actions.push('<a href="${ctx}/sys/empUser/formAuthDataScope?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配数据权限")}"><i class="fa fa-check-circle-o"></i> ${text("数据权限")}</a>&nbsp;');
-				//<% } %>
-				//<% if(hasPermi('sys:empUser:resetpwd')){ %>
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:resetpwd')){ %>
 					actions.push('<a href="${ctx}/sys/empUser/resetpwd?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户密码重置")}" data-confirm="${text("确认要将该用户密码重置到初始状态吗?")}"><i class="fa fa-reply-all"></i> ${text("重置密码")}</a>&nbsp;');
-				//<% } %>
-				actions.push('<a href="${ctx}/mes/mesLogin/qrcode?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("二维码")}"><i class="fa fa-fw fa-qrcode"></i> ${text("二维码")}</a>&nbsp;');
-				actions.push('</div>');
-			//<% } %>
-			var html = '<div style="overflow-x:auto;white-space:nowrap;width:100%;text-align:left;padding:2px 0;">' + actions.join('') + '<\/div>';
-			return html;
-		}}
-	],
-	frozenCols: true,
-	// 加载成功后执行事件
-	ajaxSuccess: function(data){
-		
-	}
-});
-$('#btnExport').click(function(){
-	js.ajaxSubmitForm($('#searchForm'), {
-		url:'${ctx}/sys/empUser/exportData',
-		downloadFile:true
+					//<% } %>
+					actions.push('<a href="${ctx}/mes/mesLogin/qrcode?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("二维码")}"><i class="fa fa-fw fa-qrcode"></i> ${text("二维码")}</a>&nbsp;');
+					actions.push('</div>');
+					//<% } %>
+					var html = '<div style="overflow-x:auto;white-space:nowrap;width:100%;text-align:left;padding:2px 0;">' + actions.join('') + '<\/div>';
+					return html;
+				}}
+		],
+		frozenCols: true,
+		// 加载成功后执行事件
+		ajaxSuccess: function(data){
+
+		}
+	});
+	$('#btnExport').click(function(){
+		js.ajaxSubmitForm($('#searchForm'), {
+			url:'${ctx}/sys/empUser/exportData',
+			downloadFile:true
+		});
 	});
-});
-$('#btnImport').click(function(){
-	js.layer.open({
-		type: 1,
-		area: ['400px'],
-		title: '${text("导入用户数据")}',
-		resize: false,
-		scrollbar: true,
-		content: js.template('importTpl'),
-		success: function(layero, index){
-			layero.find('input[type="checkbox"]').iCheck();
-		},
-		btn: ['<i class="fa fa-check"></i> ${text("导入")}',
-			'<i class="fa fa-remove"></i> ${text("关闭")}'],
-		btn1: function(index, layero){
-			var form = {
-				inputForm: layero.find('#inputForm'),
-				file: layero.find('#file').val()
-			};
-		    if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
-		    	js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
-		        return false;
-		    }
-			js.ajaxSubmitForm(form.inputForm, function(data){
-				js.showMessage(data.message);
-				if(data.result == Global.TRUE){
-					js.layer.closeAll();
+	$('#btnImport').click(function(){
+		js.layer.open({
+			type: 1,
+			area: ['400px'],
+			title: '${text("导入用户数据")}',
+			resize: false,
+			scrollbar: true,
+			content: js.template('importTpl'),
+			success: function(layero, index){
+				layero.find('input[type="checkbox"]').iCheck();
+			},
+			btn: ['<i class="fa fa-check"></i> ${text("导入")}',
+				'<i class="fa fa-remove"></i> ${text("关闭")}'],
+			btn1: function(index, layero){
+				var form = {
+					inputForm: layero.find('#inputForm'),
+					file: layero.find('#file').val()
+				};
+				if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
+					js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
+					return false;
 				}
-				page();
-			}, "json");
-			return true;
-		}
+				js.ajaxSubmitForm(form.inputForm, function(data){
+					js.showMessage(data.message);
+					if(data.result == Global.TRUE){
+						js.layer.closeAll();
+					}
+					page();
+				}, "json");
+				return true;
+			}
+		});
 	});
-});
 </script>
 <script id="importTpl" type="text/template">//<!--
 <form id="inputForm" action="${ctx}/sys/empUser/importData" method="post" enctype="multipart/form-data"
@@ -240,4 +239,4 @@ $('#btnImport').click(function(){
 		</div>
 	</div>
 </form>
-//--></script>
+//--></script>

+ 80 - 0
src/main/resources/views/modules/sys/user/employeeIndex.html

@@ -0,0 +1,80 @@
+<% layout('/layouts/default.html', {title: '员工管理', libs: ['layout','zTree']}){ %>
+<div class="ui-layout-west">
+	<div class="main-content">
+		<div class="box box-main">
+			<div class="box-header">
+				<div class="box-title">
+					<i class="fa icon-grid"></i> ${text('组织机构')}
+				</div>
+				<div class="box-tools pull-right">
+					<% if(hasPermi('sys:office:edit')){ %>
+						<button type="button" class="btn btn-box-tool addTabPage" data-href="${ctx}/sys/office/list" title="${text('机构管理')}"><i class="fa fa-edit"></i></button>
+					<% } %>
+					<button type="button" class="btn btn-box-tool" id="btnExpand" title="${text('展开')}" style="display:none;"><i class="fa fa-chevron-up"></i></button>
+					<button type="button" class="btn btn-box-tool" id="btnCollapse" title="${text('折叠')}"><i class="fa fa-chevron-down"></i></button>
+					<button type="button" class="btn btn-box-tool" id="btnRefresh" title="${text('刷新')}"><i class="fa fa-refresh"></i></button>
+				</div>
+			</div>
+			<div class="ui-layout-content">
+				<div id="tree" class="ztree"></div>
+			</div>
+		</div>
+	</div>
+</div>
+<div class="ui-layout-center">
+	<iframe id="mainFrame" name="mainFrame" class="ui-layout-content p0"
+		src="${ctx}/mes/empUserCustom/employeeList"></iframe>
+</div> 
+<% } %>
+<script>
+// 初始化布局
+$('body').layout({
+	west__initClosed: $(window).width() <= 767, // 是否默认关闭
+	west__size: window.lang == 'en' ? 215 : 200
+});
+// 主页框架
+var win = $("#mainFrame")[0].contentWindow;
+// 树结构初始化加载
+var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
+	async:{enable:true,autoParam:["id=parentCode"],url:"${ctx}/sys/office/treeData"},
+	callback:{onClick:function(event, treeId, treeNode){
+		tree.expandNode(treeNode);
+		//win.$('button[type=reset]').click();
+		win.$('#officeCode').val(treeNode.id);
+		win.$('#officeName').val(treeNode.name);
+		win.page(1);
+	}}
+}, tree, loadTree = function(){
+	js.ajaxSubmit(setting.async.url+"?___t="+new Date().getTime(), {
+			ctrlPermi:'${ctrlPermi}'/*1拥有的权限 2管理的权限*/,
+			parentCode:'${parameter.parentCode!}'}, function(data){
+		tree = $.fn.zTree.init($("#tree"), setting, data);
+		var level = -1, nodes;
+		while (++level <= 1) {
+			nodes = tree.getNodesByParam("level", level);
+			if (nodes.length > 10) { break; }
+			for(var i=0; i<nodes.length; i++) {
+	 			tree.expandNode(nodes[i], true, false, false);
+			}
+		}
+	}, null, null, js.text('loading.message'));
+};loadTree();
+// 工具栏按钮绑定
+$('#btnExpand').click(function(){
+	tree.expandAll(true);
+	$(this).hide();
+	$('#btnCollapse').show();
+});
+$('#btnCollapse').click(function(){
+	tree.expandAll(false);
+	$(this).hide();
+	$('#btnExpand').show();
+});
+$('#btnRefresh').click(function(){
+	loadTree();
+});
+// 调用子页分页函数
+function page(){
+	win.page();
+}
+</script>

+ 165 - 166
src/main/resources/views/modules/sys/user/employeeList.html

@@ -9,8 +9,8 @@
 				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
 				<a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
 				<% if(hasPermi('sys:empUser:edit')){ %>
-					<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
-					<a href="${ctx}/mes/empUserCustom/formEmpoyee?op=add" class="btn btn-default btnTool" title="${text('新增用户')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+				<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
+				<a href="${ctx}/sys/empUser/form?op=add" class="btn btn-default btnTool" title="${text('新增用户')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
 				<% } %>
 				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
 				<!-- <div class="btn-group">
@@ -26,202 +26,201 @@
 			</div>
 		</div>
 		<div class="box-body">
-			<#form:form id="searchForm" model="${empUser}" action="${ctx}/sys/empUser/listData" method="post" class="form-inline "
-					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
-				<#form:hidden name="ctrlPermi" value="${@Global.getConfig('user.adminCtrlPermi', '2')}"/>
-				<#form:hidden name="userType" value="employee"/>
+			<#form:form id="searchForm" model="${empUser}" action="${ctx}/mes/empUserCustom/emplistData" method="post" class="form-inline "
+			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+			<#form:hidden name="ctrlPermi" value="${@Global.getConfig('user.adminCtrlPermi', '2')}"/>
+			<div class="form-group">
+				<label class="control-label">${text('账号')}:</label>
+				<div class="control-inline">
+					<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('昵称')}:</label>
+				<div class="control-inline">
+					<#form:input path="userName" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('姓名')}:</label>
+				<div class="control-inline">
+					<#form:input path="refName" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('手机')}:</label>
+				<div class="control-inline">
+					<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="control-label">${text('状态')}:</label>
+				<div class="control-inline width-90">
+					<#form:select path="status" dictType="sys_user_status" blankOption="true" class="form-control isQuick"/>
+				</div>
+			</div>
+			<!-- <div class="form-row"></div> -->
+			<div class="form-group">
+				<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
+				<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
+				<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
+			</div>
+			<div class="form-more">
 				<div class="form-group">
-					<label class="control-label">${text('账号')}:</label>
-					<div class="control-inline">
-						<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
+					<label class="control-label">${text('机构')}:</label>
+					<div class="control-inline width-90">
+						<#form:treeselect id="office" title="${text('机构选择')}"
+						path="employee.office.officeCode" labelPath="employee.office.officeName"
+						url="${ctx}/sys/office/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
+						btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('昵称')}:</label>
-					<div class="control-inline">
-						<#form:input path="userName" maxlength="100" class="form-control width-90"/>
+					<label class="control-label">${text('公司')}:</label>
+					<div class="control-inline width-90">
+						<#form:treeselect id="company" title="${text('公司选择')}"
+						path="employee.company.companyCode" labelPath="employee.company.companyName"
+						url="${ctx}/sys/company/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
+						btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('姓名')}:</label>
+					<label class="control-label">${text('邮箱')}:</label>
 					<div class="control-inline">
-						<#form:input path="refName" maxlength="100" class="form-control width-90"/>
+						<#form:input path="email" maxlength="300" class="form-control width-90"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('手机')}:</label>
+					<label class="control-label">${text('电话')}:</label>
 					<div class="control-inline">
-						<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
+						<#form:input path="phone" maxlength="100" class="form-control width-90"/>
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('状态')}:</label>
+					<label class="control-label">${text('岗位')}:</label>
 					<div class="control-inline width-90">
-						<#form:select path="status" dictType="sys_user_status" blankOption="true" class="form-control isQuick"/>
+						<#form:select name="employee.postCode" items="${postList}"
+						itemLabel="postName" itemValue="postCode" blankOption="true" class="form-control isQuick"/>
 					</div>
 				</div>
-				<!-- <div class="form-row"></div> -->
 				<div class="form-group">
-					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
-					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
-					<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
-				</div>
-				<div class="form-more">
-					<div class="form-group">
-						<label class="control-label">${text('机构')}:</label>
-						<div class="control-inline width-90">
-							<#form:treeselect id="office" title="${text('机构选择')}"
-									path="employee.office.officeCode" labelPath="employee.office.officeName" 
-									url="${ctx}/sys/office/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
-									btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('公司')}:</label>
-						<div class="control-inline width-90">
-							<#form:treeselect id="company" title="${text('公司选择')}"
-									path="employee.company.companyCode" labelPath="employee.company.companyName" 
-									url="${ctx}/sys/company/treeData?ctrlPermi=${@Global.getConfig('user.adminCtrlPermi', '2')}"
-									btnClass="btn-sm" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('邮箱')}:</label>
-						<div class="control-inline">
-							<#form:input path="email" maxlength="300" class="form-control width-90"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('电话')}:</label>
-						<div class="control-inline">
-							<#form:input path="phone" maxlength="100" class="form-control width-90"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('岗位')}:</label>
-						<div class="control-inline width-90">
-							<#form:select name="employee.postCode" items="${postList}"
-								itemLabel="postName" itemValue="postCode" blankOption="true" class="form-control isQuick"/>
-						</div>
-					</div>
-					<div class="form-group">
-						<label class="control-label">${text('角色')}:</label>
-						<div class="control-inline width-120">
-							<#form:select name="roleCode" items="${roleList}"
-								itemLabel="roleName" itemValue="roleCode" blankOption="true" class="form-control isQuick"/>
-						</div>
+					<label class="control-label">${text('角色')}:</label>
+					<div class="control-inline width-120">
+						<#form:select name="roleCode" items="${roleList}"
+						itemLabel="roleName" itemValue="roleCode" blankOption="true" class="form-control isQuick"/>
 					</div>
 				</div>
-			</#form:form>
-			<table id="dataGrid"></table>
-			<div id="dataGridPage"></div>
-		</div>
+			</div>
+		</#form:form>
+		<table id="dataGrid"></table>
+		<div id="dataGridPage"></div>
 	</div>
 </div>
+</div>
 <% } %>
 <script>
-// 初始化DataGrid对象
-$('#dataGrid').dataGrid({
-	searchForm: $("#searchForm"),
-	columnModel: [
-		{header:'${text("登录账号")}', name:'loginCode', index:'a.login_code', width:125, align:"center", frozen:true, formatter: function(val, obj, row, act){
-			return '<a href="${ctx}/mes/empUserCustom/formEmpoyee?userCode='+row.userCode+'&op=edit" class="btnList" data-title="${text("编辑用户")}">'+(val||row.id)+'</a>';
-		}},
-		{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:125, align:"center"},
-		{header:'${text("员工姓名")}', name:'refName', index:'a.ref_name', width:125, align:"center"},
-		{header:'${text("归属机构")}', name:'employee.office.officeName', index:'o.office_name', width:135, align:"center"},
-		{header:'${text("归属公司")}', name:'employee.company.companyName', index:'c.company_name', width:135, align:"center"},
-		{header:'${text("电子邮箱")}', name:'email', index:'a.email', width:120, align:"center"},
-		{header:'${text("手机号码")}', name:'mobile', index:'a.mobile', width:120, align:"center"},
-		{header:'${text("办公电话")}', name:'phone', index:'a.phone', width:120, align:"center"},
-		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:125, align:"center", frozen:true},
-		{header:'${text("状态")}', name:'status', index:'a.status', width:60, align:"center", frozen:true, formatter: function(val, obj, row, act){
-			return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
-		}},
-		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
-			var actions = [];
-			//<% if(hasPermi('sys:empUser:edit')){ %>
-				actions.push('<a href="${ctx}/mes/empUserCustom/formEmpoyee?userCode='+row.userCode+'&op=edit" class="btnList" title="${text("编辑用户")}"><i class="fa fa-pencil"></i></a>&nbsp;');
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:updateStatus')){ %>
-				if (row.status == Global.STATUS_NORMAL){
-					actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
-				}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
-					actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
-				}
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:edit')){ %>
-				actions.push('<a href="${ctx}/sys/empUser/delete?userCode='+row.userCode+'" class="btnList" title="${text("删除用户")}" data-confirm="${text("确认要删除该用户吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
-				actions.push('<a href="${ctx}/mes/empUserCustom/formEmpoyee?userCode='+row.userCode+'&op=copy" class="btnList" title="${text("复制用户")}"><i class="fa fa-copy"></i></a>&nbsp;');
-			//<% } %>
-			//<% if(hasPermi('sys:empUser:authRole,sys:empUser:authDataScope,sys:empUser:resetpwd', 'or')){ %>
-				actions.push('<a href="javascript:" class="btnMore" title="${text("更多操作")}"><i class="fa fa-chevron-circle-right"></i></a>&nbsp;');
-				actions.push('<div class="moreItems">');
-				//<% if(hasPermi('sys:empUser:authRole')){ %>
+	// 初始化DataGrid对象
+	$('#dataGrid').dataGrid({
+		searchForm: $("#searchForm"),
+		columnModel: [
+			{header:'${text("登录账号")}', name:'loginCode', index:'a.login_code', width:125, align:"center", frozen:true, formatter: function(val, obj, row, act){
+					return '<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=edit" class="btnList" data-title="${text("编辑用户")}">'+(val||row.id)+'</a>';
+				}},
+			{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:125, align:"center"},
+			{header:'${text("员工姓名")}', name:'refName', index:'a.ref_name', width:125, align:"center"},
+			{header:'${text("归属机构")}', name:'employee.office.officeName', index:'o.office_name', width:135, align:"center"},
+			{header:'${text("归属公司")}', name:'employee.company.companyName', index:'c.company_name', width:135, align:"center"},
+			{header:'${text("电子邮箱")}', name:'email', index:'a.email', width:120, align:"center"},
+			{header:'${text("手机号码")}', name:'mobile', index:'a.mobile', width:120, align:"center"},
+			{header:'${text("办公电话")}', name:'phone', index:'a.phone', width:120, align:"center"},
+			{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:125, align:"center", frozen:true},
+			{header:'${text("状态")}', name:'status', index:'a.status', width:60, align:"center", frozen:true, formatter: function(val, obj, row, act){
+					return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
+				}},
+			{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+					var actions = [];
+					//<% if(hasPermi('sys:empUser:edit')){ %>
+					actions.push('<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=edit" class="btnList" title="${text("编辑用户")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:updateStatus')){ %>
+					if (row.status == Global.STATUS_NORMAL){
+						actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
+					}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
+						actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
+					}
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:edit')){ %>
+					actions.push('<a href="${ctx}/sys/empUser/delete?userCode='+row.userCode+'" class="btnList" title="${text("删除用户")}" data-confirm="${text("确认要删除该用户吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
+					actions.push('<a href="${ctx}/mes/empUserCustom/form?userCode='+row.userCode+'&op=copy" class="btnList" title="${text("复制用户")}"><i class="fa fa-copy"></i></a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:authRole,sys:empUser:authDataScope,sys:empUser:resetpwd', 'or')){ %>
+					actions.push('<a href="javascript:" class="btnMore" title="${text("更多操作")}"><i class="fa fa-chevron-circle-right"></i></a>&nbsp;');
+					actions.push('<div class="moreItems">');
+					//<% if(hasPermi('sys:empUser:authRole')){ %>
 					actions.push('<a href="${ctx}/sys/empUser/form?userCode='+row.userCode+'&op=auth" class="btn btn-default btn-xs btnList" title="${text("用户分配角色")}"><i class="fa fa-check-square-o"></i> ${text("分配角色")}</a>&nbsp;');
-				//<% } %>
-				//<% if(hasPermi('sys:empUser:authDataScope')){ %>
-				actions.push('<a href="${ctx}/mes/mesUserSkill/list?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配技能")}"><i class="fa fa-check-circle-o"></i> ${text("分配技能")}</a>&nbsp;');
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:authDataScope')){ %>
+					actions.push('<a href="${ctx}/mes/mesUserSkill/list?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配技能")}"><i class="fa fa-check-circle-o"></i> ${text("分配技能")}</a>&nbsp;');
 
-				actions.push('<a href="${ctx}/mes/mesLineProcess/formAuth?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户工位授权")}"><i class="fa fa-check-circle-o"></i> ${text("工位授权")}</a>&nbsp;');
+					actions.push('<a href="${ctx}/mes/mesLineProcess/formAuth?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户工位授权")}"><i class="fa fa-check-circle-o"></i> ${text("工位授权")}</a>&nbsp;');
 
 					actions.push('<a href="${ctx}/sys/empUser/formAuthDataScope?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配数据权限")}"><i class="fa fa-check-circle-o"></i> ${text("数据权限")}</a>&nbsp;');
-				//<% } %>
-				//<% if(hasPermi('sys:empUser:resetpwd')){ %>
+					//<% } %>
+					//<% if(hasPermi('sys:empUser:resetpwd')){ %>
 					actions.push('<a href="${ctx}/sys/empUser/resetpwd?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户密码重置")}" data-confirm="${text("确认要将该用户密码重置到初始状态吗?")}"><i class="fa fa-reply-all"></i> ${text("重置密码")}</a>&nbsp;');
-				//<% } %>
-				actions.push('<a href="${ctx}/mes/mesLogin/qrcode?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("二维码")}"><i class="fa fa-fw fa-qrcode"></i> ${text("二维码")}</a>&nbsp;');
-				actions.push('</div>');
-			//<% } %>
-			var html = '<div style="overflow-x:auto;white-space:nowrap;width:100%;text-align:left;padding:2px 0;">' + actions.join('') + '<\/div>';
-			return html;
-		}}
-	],
-	frozenCols: true,
-	// 加载成功后执行事件
-	ajaxSuccess: function(data){
-		
-	}
-});
-$('#btnExport').click(function(){
-	js.ajaxSubmitForm($('#searchForm'), {
-		url:'${ctx}/sys/empUser/exportData',
-		downloadFile:true
+					//<% } %>
+					actions.push('<a href="${ctx}/mes/mesLogin/qrcode?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("二维码")}"><i class="fa fa-fw fa-qrcode"></i> ${text("二维码")}</a>&nbsp;');
+					actions.push('</div>');
+					//<% } %>
+					var html = '<div style="overflow-x:auto;white-space:nowrap;width:100%;text-align:left;padding:2px 0;">' + actions.join('') + '<\/div>';
+					return html;
+				}}
+		],
+		frozenCols: true,
+		// 加载成功后执行事件
+		ajaxSuccess: function(data){
+
+		}
+	});
+	$('#btnExport').click(function(){
+		js.ajaxSubmitForm($('#searchForm'), {
+			url:'${ctx}/sys/empUser/exportData',
+			downloadFile:true
+		});
 	});
-});
-$('#btnImport').click(function(){
-	js.layer.open({
-		type: 1,
-		area: ['400px'],
-		title: '${text("导入用户数据")}',
-		resize: false,
-		scrollbar: true,
-		content: js.template('importTpl'),
-		success: function(layero, index){
-			layero.find('input[type="checkbox"]').iCheck();
-		},
-		btn: ['<i class="fa fa-check"></i> ${text("导入")}',
-			'<i class="fa fa-remove"></i> ${text("关闭")}'],
-		btn1: function(index, layero){
-			var form = {
-				inputForm: layero.find('#inputForm'),
-				file: layero.find('#file').val()
-			};
-		    if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
-		    	js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
-		        return false;
-		    }
-			js.ajaxSubmitForm(form.inputForm, function(data){
-				js.showMessage(data.message);
-				if(data.result == Global.TRUE){
-					js.layer.closeAll();
+	$('#btnImport').click(function(){
+		js.layer.open({
+			type: 1,
+			area: ['400px'],
+			title: '${text("导入用户数据")}',
+			resize: false,
+			scrollbar: true,
+			content: js.template('importTpl'),
+			success: function(layero, index){
+				layero.find('input[type="checkbox"]').iCheck();
+			},
+			btn: ['<i class="fa fa-check"></i> ${text("导入")}',
+				'<i class="fa fa-remove"></i> ${text("关闭")}'],
+			btn1: function(index, layero){
+				var form = {
+					inputForm: layero.find('#inputForm'),
+					file: layero.find('#file').val()
+				};
+				if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
+					js.showMessage("${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
+					return false;
 				}
-				page();
-			}, "json");
-			return true;
-		}
+				js.ajaxSubmitForm(form.inputForm, function(data){
+					js.showMessage(data.message);
+					if(data.result == Global.TRUE){
+						js.layer.closeAll();
+					}
+					page();
+				}, "json");
+				return true;
+			}
+		});
 	});
-});
 </script>
 <script id="importTpl" type="text/template">//<!--
 <form id="inputForm" action="${ctx}/sys/empUser/importData" method="post" enctype="multipart/form-data"
@@ -240,4 +239,4 @@ $('#btnImport').click(function(){
 		</div>
 	</div>
 </form>
-//--></script>
+//--></script>