Kaynağa Gözat

商户管理

xubh 5 yıl önce
ebeveyn
işleme
2085c1191f

+ 36 - 0
src/main/java/com/minpay/db/table/own/mapper/BranchManageMapper.java

@@ -0,0 +1,36 @@
+package com.minpay.db.table.own.mapper;
+
+
+import java.util.List;
+import java.util.Map;
+
+import com.startup.minpay.frame.jdbc.IMINMybatisEntityMapper;
+import com.startup.minpay.frame.jdbc.MINRowBounds;
+
+
+
+public interface BranchManageMapper extends IMINMybatisEntityMapper {
+	 List<Map<String, Object>> queryAllBranch(Map<String, String> map, MINRowBounds rows);
+	 List<Map<String,String>> queryAllBranch(Map<String, String> map);
+	 List<Map<String,String>>  queryBranchNo(Map<String, String> map);
+	 List<Map<String,String>> queryBranchNoByPointNo(Map<String, String> map);
+	 List<Map<String,String>> getUnInstallSchool(Map<String, String> map);
+	 List<Map<String,String>> getChildBranch(Map<String, String> map);
+	 /**
+	  * 查询子机构
+	  * @param map
+	  * @return
+	  */
+	 List<Map<String,String>> getChildBranchById(Map<String, String> map);
+	 
+	 List<Map<String, Object>> queryBranchByLevel(Map<String, String> map, MINRowBounds rows);
+	 int updateBranchUrl(Map<String, String> map);
+	 int updateBranchUrlState(Map<String, String> map);
+	 /**
+	  * 查询代理的所有校园
+	  * @param map
+	  * @return
+	  */
+	List<Map<String, Object>> queryAllSchool(Map<String, Object> map, MINRowBounds rows);
+	List<Map<String, Object>> queryAllSchool(Map<String, Object> map);
+}

+ 306 - 0
src/main/java/com/minpay/huicai/personmanage/action/DepartmentManageAction.java

@@ -0,0 +1,306 @@
+package com.minpay.huicai.personmanage.action;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.minpay.common.bean.User;
+import com.minpay.common.constant.Constant;
+import com.minpay.common.exception.BusinessCodeException;
+import com.minpay.common.format.IFormatService;
+import com.minpay.common.service.ILogService;
+import com.minpay.common.service.IPublicService;
+import com.minpay.common.util.RegexUtil;
+import com.minpay.db.table.mapper.ImBranchMapper;
+import com.minpay.db.table.mapper.ImUserMapper;
+import com.minpay.db.table.model.ImBranch;
+import com.minpay.db.table.model.ImBranchExample;
+import com.minpay.db.table.model.ImUser;
+import com.minpay.db.table.model.ImUserExample;
+import com.minpay.db.table.own.mapper.BranchManageMapper;
+import com.startup.minpay.frame.business.IMINAction;
+import com.startup.minpay.frame.business.MINHttpServletRequestContext;
+import com.startup.minpay.frame.business.res.MINActionResult;
+import com.startup.minpay.frame.constant.IMINBusinessConstant;
+import com.startup.minpay.frame.constant.IMINTransactionEnum;
+import com.startup.minpay.frame.data.format.MINCopyFormat;
+import com.startup.minpay.frame.exception.MINBusinessException;
+import com.startup.minpay.frame.jdbc.MINRowBounds;
+import com.startup.minpay.frame.service.base.IMINDataBaseService;
+import com.startup.minpay.frame.service.base.Service;
+import com.startup.minpay.frame.session.MINSession;
+import com.startup.minpay.frame.target.MINAction;
+import com.startup.minpay.frame.target.MINComponent;
+import com.startup.minpay.frame.target.MINParam;
+import com.startup.minpay.frame.target.MINValidator;
+
+/**
+ * 部门管理
+ * @author Zhumq
+ *
+ */
+@MINComponent
+public class DepartmentManageAction implements IMINAction {
+	
+	/**查询部门*/
+	public final static String	BRANCH_QUERY_ALL		= "branchQueryAll";
+	
+	/**添加部门*/
+	public final static String	ADD_BRANCH  			= "addBranch";
+	
+	/**删除部门*/
+	public final static String	DELETE_BRANCH		    = "deleteBranch";
+	
+	/**编辑部门*/
+	public final static String	MODIFY_BRANCH	  		= "modifyBranch";
+	
+	/**部门人员列表*/
+	public final static String STAFFLIST                = "staffList";
+	
+	/**
+	 * 查询当前操作员所属机构以及下属机构信息
+	 * @param page
+	 * @param limit
+	 * @param branchLevel
+	 * @param branchId
+	 * @param branchName
+	 * @param branchStatus
+	 * @param session
+	 * @return
+	 */
+	@MINAction(value = BRANCH_QUERY_ALL, transaction = IMINTransactionEnum.CMT)
+	public MINActionResult branchQueryAll(
+			@MINParam(key = "page", defaultValue = "1") int page,
+			@MINParam(key = "limit", defaultValue = "3") int limit,
+			@MINParam(key = "branchLevel") String[] branchLevel,
+			@MINParam(key = "branchId") String branchId,
+			@MINParam(key = "type") String type,
+			@MINParam(key = "branchName") String branchName,
+			@MINParam(key = "branchStatus") String branchStatus,
+			@MINParam(key = "branchType") String branchType,
+			@MINParam(key = "bIds") String bIds,
+			MINSession session
+			) throws MINBusinessException {
+		
+		MINActionResult res = new MINActionResult();
+		MINRowBounds rows = new MINRowBounds(page, limit);
+		User user = session.getUser();
+		String bId = user.getBranchid();
+		if(bId==null || "".equals(bId)){
+			throw new MINBusinessException("获取客户开户机构号失败!");
+		}
+		if(!"".equals(bIds)){
+			bId = bIds;
+		}
+		Map<String,String> map = new HashMap<String,String>();
+		map.put("bId", bId);
+		map.put("branchId", branchId);
+		map.put("branchName", branchName);
+		map.put("branchStatus", branchStatus);
+		map.put("branchType", branchType);
+		List<Map<String, Object>> ls = null;
+		//如果操作员所属机构为系统机构则查询所有机构信息
+		if("88888888".equals(bId)){
+			ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(BranchManageMapper.class).queryAllBranch(map,rows);
+		}else{
+			ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(BranchManageMapper.class).queryBranchByLevel(map,rows);
+		}
+		for(Map<String,Object> m : ls){
+			if(bId.equals(m.get("branchId").toString())){
+				m.put("flag", "0");
+			}else{
+				m.put("flag", "1");
+			}
+		}
+		ls = new MINCopyFormat("{stt:'sttdesc',level:'leveldesc',branchType:'branchTypedesc'}").format(ls);
+		ls = Service.lookup(IFormatService.class).formatEnum(ls, "{sttdesc:'IM_BRANCH_STATE',leveldesc:'IM_BRANCH_LEVEL',branchTypedesc:'BRANCH_TYPE'}");
+		res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
+		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
+		
+		return res;
+	}
+	
+	
+	/**
+	 * 添加部门(添加商户)
+	 * @param fapResult
+	 * @param pointName  机构名称
+	 * @param shortName	   简称
+	 * @param remark	 简介
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = ADD_BRANCH, transaction = IMINTransactionEnum.CMT)
+	public MINActionResult addBranch(
+			MINHttpServletRequestContext fapResult,
+			@MINParam(key ="pointName") String pointName,
+			@MINParam(key ="shortName") String shortName,
+			@MINParam(key ="remark") String remark,
+			@MINParam(key ="person") String person,
+			@MINParam(key ="phone") String phone,
+			MINSession session
+			) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		User user = session.getUser();
+		String branchId = user.getBranchid();
+		ImBranch imb =	Service.lookup(IMINDataBaseService.class)
+						.getMybatisMapper(ImBranchMapper.class)
+						.selectByPrimaryKey(branchId);
+		if(imb==null){
+			throw  new MINBusinessException("获取机构信息异常!");
+		}
+		//检查机构名称
+		ImBranchExample ibe = new ImBranchExample();
+		ibe.createCriteria().andNameEqualTo(pointName);
+		List<ImBranch> branchList = Service.lookup(IMINDataBaseService.class).selectByExample(ImBranchMapper.class, ibe);
+		if(branchList.size()>0){
+			throw new  BusinessCodeException("JINM0108");
+		}
+		String pointNo = Service.lookup(IPublicService.class).getSequence("IM_BRANCH_NO");
+		Integer level = imb.getLevel();
+		ImBranch ib = new ImBranch();
+		ib.setId(pointNo);
+		ib.setName(pointName);
+		ib.setLevel(level+1);
+		ib.setParentid(branchId);
+		ib.setStt("0");
+		ib.setDesc(remark);
+		ib.setPerson(person);
+		ib.setPhone(phone);
+		ib.setShortname(shortName);
+		int i =  Service.lookup(IMINDataBaseService.class).insertSelective(ImBranchMapper.class, ib);
+		if(0==i){
+			throw  new MINBusinessException("新增机构异常");
+		}
+		// 记录日志
+		String logInfo = "新增机构 :"+pointName+",机构编号:"+pointNo;
+		Service.lookup(ILogService.class).logging(session, logInfo);
+		return res;
+	}
+
+	@MINValidator(value = ADD_BRANCH)
+	public MINActionResult uaddBranchValidator(
+			@MINParam(key ="pointName", regex = RegexUtil.NOT_NULL,min = 0, max = 100, error = "商户名称不能超过100个字符") String pointName,
+			@MINParam(key ="shortName") String shortName,
+			@MINParam(key ="remark", max = 300, error = "描述不能超过300个字符") String remark,
+			@MINParam(key ="person",regex = RegexUtil.NOT_NULL,min = 0, max = 100, error = "联系人不能超过30个字符") String person,
+			@MINParam(key ="phone", regex = RegexUtil.NOT_NULL,min = 0, max = 20, error = "联系方式不能超过20个字符") String phone,
+			MINSession session) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		return res;
+	}
+
+
+	
+	/**
+	 * 修改部门
+	 * @param fapResult
+	 * @param pointNo
+	 * @param pointName
+	 * @param pointPerson
+	 * @param personTlephone
+	 * @param remark
+	 * @param address
+	 * @param shortName
+	 * @param content
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = MODIFY_BRANCH)
+	public MINActionResult modifyBranch(
+			MINHttpServletRequestContext fapResult,
+			@MINParam(key ="branchId") String pointNo,
+			@MINParam(key ="pointName") String pointName,
+			@MINParam(key ="pointPerson") String pointPerson,
+			@MINParam(key ="personTlephone") String personTlephone,
+			@MINParam(key ="remark") String remark,
+			@MINParam(key ="address") String address,
+			@MINParam(key ="shortName") String shortName,
+			@MINParam(key ="content") String content, 
+			MINSession session
+			) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		//检查部门名称
+		ImBranchExample ibe = new ImBranchExample();
+		ibe.createCriteria().andNameEqualTo(pointName).andIdNotEqualTo(pointNo);
+		List<ImBranch> branchList = Service.lookup(IMINDataBaseService.class).selectByExample(ImBranchMapper.class, ibe);
+		if(branchList.size()>0){
+			throw new  BusinessCodeException("JINM0108");
+		}
+		ImBranch ib = new ImBranch();
+		
+		ib.setId(pointNo);
+		ib.setName(pointName); 
+		ib.setPhone(personTlephone); 
+		ib.setPerson(pointPerson);
+		ib.setDesc(remark);
+		ib.setShortname(shortName);
+		ib.setAddress(address);
+		int i =  Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(ImBranchMapper.class, ib);
+		if(0==i){
+			throw  new MINBusinessException("插入数据时出现异常");
+		}
+		// 记录日志
+		String logInfo = "修改部门 :"+pointName+",部门编号:"+pointNo;
+		Service.lookup(ILogService.class).logging(session, logInfo);	
+		return res;
+	}
+	
+	
+	/**
+	 * 删除部门
+	 * @param branchId
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = DELETE_BRANCH)
+	public MINActionResult deleteBranch(
+			@MINParam(key ="branchId") String branchId,
+			MINSession session
+			) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		//查询改部门下 有无操作员
+		ImUserExample example = new ImUserExample();
+		example.createCriteria().andBranchidEqualTo(branchId);
+		List<ImUser> userCount = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImUserMapper.class).selectByExample(example);
+		// 大于0 则表示有操作员不允许删除  否则可删除
+		if(userCount.size()>0) {
+			throw  new MINBusinessException("该部门存在操作员,禁止删除!");
+		}else {
+			ImBranch ib = new ImBranch();
+			ib.setId(branchId);
+			ib.setStt(Constant.DEPT_STT_DEL);
+			int ret = Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(ImBranchMapper.class, ib);
+			 if(0 == ret){
+				throw  new MINBusinessException("更新数据时出现异常");
+			 }
+			String logInfo = "删除部门 ,部门编号:"+branchId;
+			Service.lookup(ILogService.class).logging(session, logInfo);	
+		}
+		return res;
+	}
+	/**
+	 * 查看该部门人员
+	 * @param branchId
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = STAFFLIST)
+	public MINActionResult staffList(
+			@MINParam(key ="branchId") String branchId,
+			MINSession session
+			) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		//查看该部门人员
+		ImUserExample example = new ImUserExample();
+		example.createCriteria().andBranchidEqualTo(branchId);
+		List<ImUser> userList = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImUserMapper.class).selectByExample(example);
+		res.set(IMINBusinessConstant.F_PAGING_LAY, userList);
+		return res;
+	}
+	
+}

+ 193 - 0
src/main/resources/com/minpay/db/table/own/mapper/BranchManageMapper.xml

@@ -0,0 +1,193 @@
+<?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.minpay.db.table.own.mapper.BranchManageMapper">
+	<select id="queryBranchByLevel" resultType="hashmap" parameterType="java.util.Map">
+		SELECT
+			  BRH_ID        AS "branchId",
+			  BRH_NAME      AS "name",
+			  BRH_LEVEL     AS "level",
+			  BRH_PARENTID  AS "parentId",
+			  BRH_REGIONID  AS "regionId",
+			  BRH_DESC      AS "desc",
+			  BRH_ADDRESS   AS "address",
+			  BRH_STT       AS "stt",
+			  BRH_PERSON    AS "person",
+			  BRH_PHONE     AS "phone",
+			  BRH_SHORTNAME AS "shortName",
+			  brh_name      AS "branchName",
+			  usr_name      AS "usrName",
+			  COUNT(USR_BRANCHID) AS "count" 
+		FROM IM_BRANCH 
+		LEFT JOIN im_user 
+		ON im_user.USR_BRANCHID = im_branch.BRH_ID
+		where 1=1	  
+	   <if test=" bId !=null and bId != ''">
+	   	and   BRH_ID in(SELECT BRH_ID FROM im_branch WHERE BRH_ID= #{bId,jdbcType=VARCHAR} OR BRH_PARENTID = #{bId,jdbcType=VARCHAR} ) 
+	   </if>	
+			 
+       <if test=" branchId !=null and branchId != ''">
+	   and BRH_ID = #{branchId,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" branchName !=null and branchName != ''">
+	   and BRH_NAME like  concat('%' , #{branchName,jdbcType=VARCHAR},'%')
+	   </if>
+	   <if test=" branchStatus !=null and branchStatus != ''">
+	   and BRH_STT =  #{branchStatus,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" branchType !=null and branchType != ''">
+	   	and BRH_TYPE =  #{branchType,jdbcType=VARCHAR}
+	   </if>
+	   GROUP BY BRH_ID
+	   ORDER BY BRH_LEVEL, BRH_ID
+	</select>
+	
+	<select id="queryAllBranch" resultType="hashmap" parameterType="java.util.Map">
+			SELECT
+				  BRH_ID        AS "branchId",
+				  BRH_NAME      AS "name",
+				  BRH_LEVEL     AS "level",
+				  BRH_PARENTID  AS "parentId",
+				  BRH_REGIONID  AS "regionId",
+				  BRH_DESC      AS "desc",
+				  BRH_ADDRESS   AS "address",
+				  BRH_STT       AS "stt",
+				  BRH_PERSON    AS "person",
+				  BRH_PHONE     AS "phone",
+				  BRH_SHORTNAME AS "shortName",
+				  brh_name      AS "branchName",
+				  usr_name      AS "usrName",
+				  COUNT(USR_BRANCHID) AS "count" 
+			FROM IM_BRANCH 
+			LEFT JOIN im_user 
+			ON im_user.USR_BRANCHID = im_branch.BRH_ID
+			  where 1=1
+			  and  BRH_STT != "2"
+			 <!--  and BRH_ID in(SELECT brh_id  FROM im_branch WHERE FIND_IN_SET(brh_id, getChildBranch({bId,jdbcType=VARCHAR})) ) 	0 -->
+       <if test=" branchId !=null and branchId != ''">
+	  		and BRH_ID = #{branchId,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" branchName !=null and branchName != ''">
+	   		and BRH_NAME like  concat('%' , #{branchName,jdbcType=VARCHAR},'%')
+	   </if>
+	   <if test=" branchStatus !=null and branchStatus != ''">
+	   		and BRH_STT =  #{branchStatus,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" agentId !=null and agentId != ''">
+	   		and BRH_PARENTID =  #{agentId,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" branchType !=null and branchType != ''">
+	   		and BRH_TYPE =  #{branchType,jdbcType=VARCHAR}
+	   </if>
+	   GROUP BY BRH_ID
+	   ORDER BY BRH_ID desc
+	</select>
+	<select id="queryAllSchool" resultType="hashmap" parameterType="java.util.Map">
+			SELECT BRH_ID         AS "branchId",
+			       BRH_NAME       AS "name",
+			       BRH_LEVEL      AS "level",
+			       BRH_PARENTID   AS "parentId",
+			       BRH_REGIONID   AS "regionId",
+			       BRH_DESC       AS "desc",
+			       BRH_ADDRESS    AS "address",
+			       BRH_STT        AS "stt",
+			       BRH_PERSON     AS "person",
+			       BRH_PHONE      AS "phone",
+			       BRH_SHORTNAME  AS "shortName",
+			       BRH_TYPE		  AS "branchType",
+			       BRH_IMG		  AS "img",
+	               BRH_CONTENT	  AS "content",
+			       BRH_NAME       AS  "branchName",
+			       BRH_PROVINCE   AS "province",
+			       BRH_CITY 	  AS "city",
+			       BRH_AREA		  AS "area",
+			       MCD_CODE  	  as "code"
+			  FROM IM_BRANCH  
+			  LEFT JOIN  ms_invite_code ON MCD_BRANCHID = BRH_ID  
+			  where 1=1
+			 <!--  and BRH_ID in(SELECT brh_id  FROM im_branch WHERE FIND_IN_SET(brh_id, getChildBranch({bId,jdbcType=VARCHAR})) ) 	0 -->
+       
+	   <if test=" branchName !=null and branchName != ''">
+	   		and BRH_NAME like  concat('%' , #{branchName,jdbcType=VARCHAR},'%')
+	   </if>
+	   <if test=" branchStatus !=null and branchStatus != ''">
+	   		and BRH_STT =  #{branchStatus,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" type !=null and type != ''">
+	   		and BRH_TYPE =  #{type,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" agentId !=null and agentId != ''">
+	   		and BRH_PARENTID =  #{agentId,jdbcType=VARCHAR}
+	   </if>
+	   <if test=" branchId !=null and branchId != ''">
+	   		and BRH_ID =  #{branchId,jdbcType=VARCHAR}
+	   </if>
+	   ORDER BY  BRH_ID desc
+	</select>
+	
+	<select id="queryBranchNo" resultType="hashmap" parameterType="java.util.Map">
+		SELECT BRH_ID         AS "branchNo",
+			       BRH_NAME       AS "branchName"
+			  FROM IM_BRANCH 
+			  WHERE BRH_LEVEL = '1'
+	</select>
+	<select id="queryBranchNoByPointNo" resultType="hashmap" parameterType="java.util.Map">
+		SELECT BRH_ID         AS "branchNo",
+			       BRH_NAME       AS "branchName"
+			  FROM IM_BRANCH 
+			  WHERE 
+			  <if test=" pointNo !=null and pointNo != ''">
+	   			 BRH_ID =  #{pointNo,jdbcType=VARCHAR}
+	
+	   </if>
+	</select>
+	<select id="getUnInstallSchool" resultType="hashmap" parameterType="java.util.Map">
+		SELECT BRH_ID         AS "branchNo",
+			   BRH_NAME       AS "branchName",
+			   BRH_TYPE		  AS "type",
+			   BRH_LEVEL	  AS "level"
+			  FROM IM_BRANCH  
+			  WHERE BRH_TYPE = '02'
+			  AND BRH_READY = #{ready,jdbcType=VARCHAR}
+			  AND BRH_STT =  #{state,jdbcType=VARCHAR}
+			  AND BRH_ID NOT IN (
+			  	SELECT MWT_BRHID 
+			  	FROM ms_worker_task )
+	</select>
+	
+	<select id="getChildBranch" resultType="hashmap" parameterType="java.util.Map">
+		SELECT BRH_ID 		AS "branchId",
+			   BRH_NAME 	AS "branchName"
+			  FROM IM_BRANCH 
+			 WHERE 
+			 		BRH_ID = #{branchId,jdbcType=VARCHAR} OR 
+			 		BRH_PARENTID = #{branchId,jdbcType=VARCHAR}
+			 ORDER BY BRH_LEVEL, BRH_ID
+	</select>
+	
+	<select id="getChildBranchById" resultType="hashmap" parameterType="java.util.Map">
+		SELECT BRH_ID 		AS "branchId",
+			   BRH_NAME 	AS "branchName"
+			  FROM IM_BRANCH 
+			 WHERE  BRH_PARENTID = #{branchId,jdbcType=VARCHAR}
+			 ORDER BY BRH_LEVEL, BRH_ID
+	</select>
+	
+	<update id="updateBranchUrl"  parameterType="java.util.Map">		
+		UPDATE im_branch SET 
+			 BRH_URL = (#{url,jdbcType=VARCHAR})
+		WHERE  
+		<if test="branchId != null and branchId != ''">
+			 BRH_ID= (#{branchId,jdbcType=VARCHAR})
+		</if>
+	</update>
+	<update id="updateBranchUrlState"  parameterType="java.util.Map">		
+		UPDATE im_branch SET 
+		<if test="urlState != null and urlState != ''">
+			 BRH_URLSTATE = (#{urlState,jdbcType=VARCHAR})
+		</if>
+		WHERE  
+		<if test="branchId != null and branchId != ''">
+			 BRH_ID= (#{branchId,jdbcType=VARCHAR})
+		</if>
+	</update>
+</mapper>

+ 146 - 0
src/main/webapp/admin/departmentManage/addDepartment.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<meta charset="utf-8">
+	<title>增加商户</title>
+	<meta name="renderer" content="webkit">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+</head>
+<script>
+</script>
+<body class="content">
+<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+</fieldset>
+<form class="layui-form" action="">
+	<div style="padding-bottom:60px; ">
+
+		<div class="layui-form-item">
+			<div class="layui-inline">
+				<label class="layui-form-label" style = "width: 150px;">*商户名称:</label>
+				<div class="layui-input-inline">
+					<input type="tel" name="pointName" id = "pointName" maxlength="20" lay-verify="pointName"  placeholder="请输入商户名称"autocomplete="off" class="layui-input">
+				</div>
+			</div>
+		</div>
+
+		<div class="layui-form-item">
+			<div class="layui-inline">
+				<label class="layui-form-label" style = "width: 150px;">*联系人:</label>
+				<div class="layui-input-inline">
+					<input type="tel" name="person" id="person"  lay-verify="person" maxlength="20" autocomplete="off" placeholder="请输入联系人" class="layui-input">
+				</div>
+			</div>
+		</div>
+
+		<div class="layui-form-item">
+			<div class="layui-inline">
+				<label class="layui-form-label" style = "width: 150px;">*联系方式:</label>
+				<div class="layui-input-inline">
+					<input type="tel" name="phone" maxlength="20" lay-verify="phone"  maxlength="20" autocomplete="off" class="layui-input" placeholder="请输入联系方式"   >
+				</div>
+			</div>
+		</div>
+		<div class="layui-form-item layui-form-text">
+			<label class="layui-form-label">描述:</label>
+			<div class="layui-input-block">
+				<textarea name="remark"  placeholder="请输入内容" class="layui-textarea"></textarea>
+			</div>
+		</div>
+		<div class="layui-form-item box-button" >
+			<div class="layui-input-block">
+				<button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
+				<button  class="layui-btn"  id="cancel" onclick = "testNewPage()">取消</button>
+			</div>
+		</div>
+	</div>
+</form>
+<script src="../../js/min-loader-next.js"></script>
+<script>
+	function testNewPage() {
+		// 打开新增页面
+		deleteTabPage('315002-01');
+	}
+	layui.use('form', function(){
+		var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
+		$.request({
+			action : 'RoleManageAction/roleQueryByBranchId',
+			data : { },
+			success : function(data) {
+				var selectName ="roleid";
+				var html = '<select lay-verify="roleid" name="';
+				html = html + selectName;
+				html = html + '" lay-filter="';
+				html = html + '"';
+				html = html + '><option value="">请选择</option>';
+				$.each(data.MINQueryResult, function(i, j) {
+					html = html + '<option ';
+					html = html + 'value="';
+					html = html + j.id + '">';
+					html = html + j.name+ '</option>';
+				})
+				html = html + '</select>';
+				$("#zcySelect").html(html);
+				form.render();
+			},
+		});
+// 	    		//监听取消
+// 	      	$('#cancel').on('click', function(){
+//       	    	 parent.layer.close(parent.layer.index);
+//       	   	});
+	});
+
+	function renderForm(){
+		layui.use('form', function(){
+			var form = layui.form();//高版本建议把括号去掉,有的低版本,需要加()
+			form.render();
+		});
+	}
+	layui.use(['form', 'layedit', 'laydate','layer'], function() {
+		var form = layui.form,
+				layer = layui.layer,
+				layedit = layui.layedit,
+				laydate = layui.laydate;
+
+		//自定义验证规则
+		form.verify({
+			pointName: function(value) {
+				if (isEmpty(value)) {
+					return   '用户名不能为空!';
+				}
+			},
+			person: function(value) {
+				if (isEmpty(value)) {
+					return   '联系人不能为空!';
+				}
+			},
+			phone: function(value) {
+				if (isEmpty(value)) {
+					return   '联系方式不能为空!';
+				}
+			}
+
+		});
+		//监听提交
+		form.on('submit(demo1)', function(data) {
+			$.request({
+				action : '../../DepartmentManageAction/addBranch',
+				data :  data.field ,
+				success : function(data) {
+					layer.alert('保存成功!',  function(){
+						deleteTabPage('101003-01');
+					});
+				},
+				error : function(data) {
+					layer.alert(data.MINErrorMessage, {
+						icon: 5,
+						title: "提示"
+					});
+				}
+			});
+			return false;
+		});
+	});
+</script>
+</body>
+</html>

+ 297 - 0
src/main/webapp/admin/departmentManage/departmentManage.html

@@ -0,0 +1,297 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>商户管理</title>
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+
+<body class="content">
+	<div class="order-body">
+		<div class="order-tiaojian back-gray">
+			<div class="tiaojian-part1" id = "conditions">
+				<div class="fl f12-gray4-op mt4">所选条件:</div>
+			</div>
+			<div class="tiaojian-part2 fr  demoTable">
+				<button class="layui-btn order-bnt1"  data-type="reload" >搜索</button>
+				<button class="layui-btn  order-bnt2" data-type="reset">重置</button>
+				<button class="layui-btn order-bnt2" id = "addDepartment">添加</button>
+				<a href="#" id="toggle" class="top">收起</a>
+			</div>
+		</div>
+		<form class="layui-form"  action="javascript:void(0)"  id = "formName">
+			<div class="order-select back-border"  id="content">
+				<div class="layui-inline">
+					<label class="f12-gray4">名称:</label>
+					<input onchange = "changeSelectCon(0,this,'inp')" lay-verify="branchName"   class="search-select" type="tel" name="branchName"  id ="branchName" value="" placeholder="请输入名称" />
+				</div>
+			</div>
+		</form>
+
+	</div>
+	<div class="shadow-content" style="margin:1.5rem;">
+		<table id="tableTest"  lay-filter="tableFilter"></table>
+	</div>
+    <!--操作功能-->
+    <script type="text/html" id="barDemo">
+      	<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
+     	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
+		{{#     if(isPermission('01000102')){}} 
+			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
+		{{# } }}
+     	
+   </script>
+ 
+    <script type="text/html" id="checkboxDemo">
+     	<input type="checkbox"  {{ d.certtype =='1' ? 'checked' : '' }}>
+   </script>
+   
+	<script>
+     	var table;
+     	layui.use('table', function(){
+		  	table = layui.table;
+		  	table.render({
+			    elem: '#tableTest'
+			    ,limit:10
+			   	// ,height: 315
+			    ,url: 'DepartmentManageAction/branchQueryAll' //数据接口
+			    ,method: 'post'
+			    ,where:{MINView:"JSON"}
+			    ,page: true //开启分页
+			    ,cols: [[ //表头
+			    	 {field: 'id', type: 'numbers', title: '序号'}
+			     	,{field: 'branchId', title: '编号', width:'15%', sort: true}
+			     	,{field: 'name', title: '商户名称', width:'20%',sort: true}
+			      	,{field: 'count', title: '操作员人数', width:'12%'}
+			     	,{field: 'desc', title: '备注', width:'20%', sort: true}
+			      	,{field: 'sttdesc', title: '状态', width:'10%', sort: true}
+			      	,{field: 'operate', title: '操作', width: '20%', toolbar: '#barDemo'}
+		    	]]
+		    	,done: function(res, curr, count){
+		        	//如果是异步请求数据方式,res即为你接口返回的信息。
+		        	console.log(res);
+		    	}
+		    	,even: true //开启隔行背景
+			});
+			//监听操作按钮
+			var $ = layui.$, active = {
+				//搜索
+			    reload: function(){
+					reLoadFun();
+
+			    } //重置
+	    		,reset : function(){
+	    			$('#formName')[0].reset();
+	    		}
+			};
+			//添加操作员
+			$(document).on('click','#addDepartment',function(){
+				openMainTabPage('101003-01', '添加商户', 'departmentManage/addDepartment.html', '', '101003', reLoadFun);
+			});
+
+			// 监听工具条(操作)
+			table.on('tool(tableFilter)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
+			    var data = obj.data; //获得当前行数据
+			    var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
+			    var tr = obj.tr; //获得当前行 tr 的DOM对象
+			    var  branchId = data.branchId;
+			    if(layEvent === 'detail'){ //查看
+			    	showDetail(data);
+			    } else if(layEvent === 'del'){ //删除
+		    		layer.confirm('是否确定要删除该部门?', function(index){
+			    		$.request({
+							action : '../../DepartmentManageAction/deleteBranch',
+							data : {
+								branchId : branchId //用户名
+							},
+							success : function(data) {
+								location.reload(); //刷新页面
+							 		layer.alert('操作成功!', {
+										icon: 6,
+										title: "提示"
+								}); 	
+							
+							},
+							error : function(data) {
+							 	layer.alert(data.MINErrorMessage, {
+									icon: 5,
+									title: "提示"
+								}); 
+							}
+						});	
+			        	//向服务端发送删除指令
+		      		});
+			  	} else if(layEvent === 'edit'){ //编辑
+			    	editDetail(data);
+			  	}
+		  	});
+			$('.demoTable .layui-btn').on('click', function(){
+				var type = $(this).data('type');
+				active[type] ? active[type].call(this) : '';
+			});    
+		});
+     	//查询详情
+		function showDetail(data) {
+    	  	var params = {};
+	    	params.columnNumber = 2; //每行显示两个字段
+	    	// 要显示的数据
+	    	params.fields = [
+                {field: 'branchId', title: 'ID'},
+                {field: 'name', title: '部门名称'},
+                {field: 'sttdesc', title: '状态'},
+                {field: 'address', title: '地址'}
+            ]; 
+		    // 寄存当前数据
+		    setNowRowData(data, params);
+	    	layer.open({
+	    	      type: 2,
+	    	      title: '部门详情',
+	    	      shadeClose: true,
+	    	      shade: 0.8,
+	    	      area: ['75%', '85%'],
+	    	      content: 'detailDepartment.html'
+	    	});
+      	}
+      	//编辑
+      	function editDetail(data) {
+    	    var params = {};
+	    	params.columnNumber = 2; //每行显示两个字段
+		    // 寄存当前数据
+		    layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
+	    	layer.open({
+	    	      type: 2,
+	    	      title: '编辑',
+	    	      shadeClose: true,
+	    	      // shade: true , 
+	    	      shade: 0.8,
+	    	      //maxmin: true, //开启最大化最小化按钮
+	    	      area: ['75%', '85%'],
+	    	      content: 'editDepartment.html' ,
+	    	});
+      	}
+		function reLoadFun() {
+			//单位名称
+			var branchName = $("#branchName").val();
+			//执行重载
+			table.reload('tableTest', {
+				page: {
+					curr: 1 //重新从第 1 页开始
+				}
+				,where: {
+					branchName : branchName
+				}
+			});
+		}
+
+      	/**搜索栏*/
+		function changeSelectCon(index, t, type, dateValue){
+			if (type == "date") {
+				if (isEmpty(dateValue)) {
+					$("#search" + index).remove();
+				} else {
+					$("#search" + index).remove();
+					if (isEmpty($("#search" + index).attr("name"))) {
+						$("#conditions").append(getSelectConHtml(index, t, type,dateValue));
+					}
+				}
+			} else if (type == 'inp') {
+				if (isEmpty($(t).val())) {
+					$("#search" + index).remove();
+				} else {
+					$("#search" + index).remove();
+					if (isEmpty($("#search" + index).attr("name"))) {
+						$("#conditions").append(getSelectConHtml(index, t, type));
+					}
+				}
+			} else {
+				if (isEmpty($(t).val())) {
+					$("#search" + index).remove();
+				} else {
+					$("#search" + index).remove();
+					if (isEmpty($("#search" + index).attr("name"))) {
+						$(t).attr("id","subjects");
+						$("#conditions").append(getSelectConHtml(index, t, type));
+					}
+				}
+			}
+		}
+		var array = new Array('名称');
+		function getSelectConHtml(index, t, type,dateValue){
+			var name;
+			var value;
+			if(type == "inp"){
+				value = t.value.substr(0,5)+"..";
+			}
+			if (type == "date") {
+				value = dateValue;
+			}
+			if(type == "sel" && dateValue =="state"){
+				value = $("#state").find("option:selected").text();
+			}
+			if(type == "sel" && dateValue =="roleid"){
+				value = $("#roleid").find("option:selected").text();
+			}
+			if (type == "date") {
+				name = $("#"+t).attr("id");
+			} else {
+				name = $(t).attr("id");
+			}
+			var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
+					'<div class="fl">' + array[index] + '</div>' +
+					':<i class="iconfont">'+value+'</i>' +
+					'<svg class="icon" aria-hidden="true">' +
+					'<use xlink:href="#iconicon_close1"></use>' +
+					'</svg>' +
+					'</div>';
+			return html;
+		}
+		$("#toggle").click(function() {
+			$(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
+					"<i class='iconfont up iconSelect_drop-down'/></i>");
+			$("#content").slideToggle();
+		});
+		function removeSearch(t) {
+			if ($(t).attr("name") == 'state') {
+				initSelect('state', "IM_USER_STATE", "state", ' ', true);
+				form.render();
+				$(t).remove();
+			} if ($(t).attr("name") == 'roleid') {
+				$.request({
+					action : '../../RoleManageAction/roleQueryByBranchId',
+					data : { },
+					success : function(data) {
+						var selectName ="roleid";
+						var html = '<select name="';
+						html = html + selectName;
+						html = html + '" lay-filter="';
+						html = html + selectName;
+						html = html + '"';
+						html = html + '><option value="">全部</option>';
+						$.each(data.MINQueryResult, function(i, j) {
+							html = html + '<option ';
+							html = html + 'value="';
+							html = html + j.id + '">';
+							html = html + j.name+ '</option>';
+						})
+						html = html + '</select>';
+						$("#seleRoleid").html(html);
+						form.render();
+					}
+				});
+
+				form.on('select(roleid)', function(data){
+					changeSelectCon(4, data.elem, "sel","roleid");
+				});
+
+				$(t).remove();
+			} else {
+				$("#"+$(t).attr("name")).val('');
+				$(t).remove();
+			}
+		}
+		/**搜索栏end*/
+	</script>
+</body>
+
+</html>

+ 150 - 0
src/main/webapp/admin/departmentManage/detailDepartment.html

@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>部门详情</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+
+<body>
+     <div id = "aa" style="margin-top: 20px;margin-left: 20px;margin-right: 120px;">
+	    <table id="detail" class="layui-table"  style="margin-top: 20px;margin-left: 20px;margin-right: 120px;">
+	     </table>
+    </div>  
+    <div style="margin-top: 20px;margin-left: 40px;margin-right: 120px;"> 
+    <p>部门人员列表:</p>
+    <table class="layui-table" id="productTable">
+	</table>
+	</div>
+    <script>
+	// 获取要显示的数据格式
+	var params = layui.sessionData("ROW_DATA").NOW_ROW.params;
+	var fields = params.fields;
+	var branchId = layui.sessionData("ROW_DATA").NOW_ROW["branchId"];
+	
+	var html = ''; 
+	var columnNumber = params.columnNumber;
+	// 显示的列数
+	if(isEmpty(columnNumber)) {
+		columnNumber = 2;// 默认显示2列
+	}
+	// 循环所有的字段
+	layui.each(fields, function(index, item){ 
+			if(index % columnNumber == 0) {
+				html = html +  '<tr>'; 
+			}
+			html = html +  '<td bgcolor="#F5F5F5" style="text-align:right;"><strong>' + item.title+ ':</strong></td>'; 
+			var fieldsVal = layui.sessionData("ROW_DATA").NOW_ROW[item.field];
+			if(isEmpty(fieldsVal)) {
+				fieldsVal = "";
+			}
+			// 是否设定了最大显示位数
+			if(!isEmpty(item.maxlength) 
+					&& !isEmpty(fieldsVal) 
+					&& fieldsVal.length > item.maxlength) {
+				var id = "td" + rndNum(10);
+				html = html +  '<td id="' + id + '" onMouseOver=\'showTips(\"'+ id + '\",\"' + fieldsVal+'\");\'>' + fieldsVal.substring(0, item.maxlength) + '</td>';
+  
+			}
+			// 是否是图片
+			else if(!isEmpty(item.img)) {
+				var imgDiv = '<img onClick = \'showPic(\"' + fieldsVal+'\");\'  layer-src="'+ fieldsVal +'" src="'+ fieldsVal +'" alt="图片">';
+				html = html +  '<td>' + imgDiv + '</td>';
+				
+			}	
+			else {
+				html = html +  '<td>' + fieldsVal + '</td>';
+			}
+			if(index % columnNumber != 0) {
+				html = html +  '</tr>'; 
+			}
+	 });
+	$("#detail").html(html);
+	
+	// 超长显示
+	function showTips(id, val) {
+		layui.use('layer', function(){
+			  var layer = layui.layer;
+			  layer.open({
+					  type: 4,
+					  tips: [1,'#6495ED'],
+					  time: 5000,
+					  content: [val, '#' + id] //数组第二项即吸附元素选择器或者DOM
+			  }); 
+			});  
+	}
+	
+	function showPic(fieldsVal) {
+		layui.use('layer', function(){
+			  var layer = layui.layer;
+			var showphotos = {
+					  "title": "", //相册标题
+					  "id": 123, //相册id
+					  "start": 0, //初始显示的图片序号,默认0
+					  "data": [   //相册包含的图片,数组格式
+					    {
+					      "alt": "图片",
+					      "pid": 666, //图片id
+					      "src": fieldsVal, //原图地址
+					      "thumb": fieldsVal //缩略图地址
+					    }
+					  ]
+					};
+			
+			layer.photos({
+			    photos: showphotos
+			    ,shift: 5 //0-6的选择,指定弹出图片动画类型,默认随机
+			 });
+		});
+	}
+	
+	// 加载报价单产品信息
+	layui.use('table', function(){
+		  var table = layui.table;
+		  table.render({
+		    elem: '#productTable'
+		    ,url:'../../DepartmentManageAction/staffList'
+		    ,where:{
+		    	branchId : branchId,
+		    	MINView:"JSON"
+		    }
+		    ,cols: [[
+		      {type:'numbers',field: 'id', title: '序号',width:'10%', align: 'center', fixed: true}
+		      ,{field:'name', title: '姓名'}
+		      ,{field:'logonname',title: '登录名'}
+		      ,{field:'phone',title: '手机号'}
+		      ,{field:'address',title: '地址'}
+// 		      ,{field:'statusDesc',title: '状态'}
+		    ]]
+		  });
+	});
+		
+	
+		// 加载报价单产品信息
+// 	layui.use('table', function(){
+// 		  var table = layui.table;
+// 		  table.render({
+// 		    elem: '#productTable'
+// 		    ,url:'../../QuoteManageAction/queryQuationDetail'
+// 		    ,where:{
+// 		    	id : id,
+// 		    	MINView:"JSON"
+// 		    }
+// 		    ,cols: [[
+// 		      {field:'name', title: '产品名称'}
+// 		      ,{field:'model',title: '型号/规格'}
+// 		      ,{field:'brand',title: '品牌'}
+// 		      ,{field:'number',title: '数量'}
+// 		      ,{field:'statusDesc',title: '状态'}
+// 		    ]]
+// 		  });
+// 	});
+    </script>
+
+</body>
+
+</html>

+ 146 - 0
src/main/webapp/admin/departmentManage/editDepartment.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>修改部门</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+</head>
+
+<body>
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+    </fieldset>
+	<div style="margin-top: 20px;margin-left: 20px;margin-right: 120px; padding-bottom:60px;">
+	    <form class="layui-form" action="javascript:void(0)">
+	     	<div class="layui-form-item" style="display: none">
+	            <label class="layui-form-label">部门ID:</label>
+	            <div class="layui-input-block">
+	                <input type="text" id = "editbranchId" name="branchId" lay-verify="title" autocomplete="off"class="layui-input" >
+	            </div>
+	        </div>
+	        
+	        <div class="layui-form-item">
+	            <label class="layui-form-label">*部门名称:</label>
+	            <div class="layui-input-block">
+	                <input type="text" id = "editbranchName" 
+	                 maxlength="100"
+	                name="pointName" lay-verify="title" autocomplete="off" placeholder="请输入名称" class="layui-input">
+	            </div>
+	        </div>
+        
+	        <div class="layui-form-item">
+	            <label class="layui-form-label">部门简称:</label>
+	            <div class="layui-input-block">
+	                <input type="text"  id = "editshortName"name="shortName" autocomplete="off" placeholder="请输入简称" class="layui-input">
+	            </div>
+	        </div>
+	          <div class="layui-form-item layui-form-text">
+	            <label class="layui-form-label">部门描述:</label>
+	            <div class="layui-input-block">
+	                <textarea name="remark" id = "editdesc"  placeholder="请输入内容" class="layui-textarea"></textarea>
+	            </div>
+	        </div>
+			<!-- <div class="layui-form-item">
+	            <div class="layui-inline">
+	                <label class="layui-form-label">*联系人:</label>
+	                <div class="layui-input-inline">
+	                    <input  type="tel" name="pointPerson" id = "editperson" autocomplete="off" lay-verify="pointPerson" class="layui-input">
+	                </div>
+	            </div>
+	        </div>
+	        <div class="layui-form-item">
+	            <div class="layui-inline">
+	                <label class="layui-form-label">*手机:</label>
+	                <div class="layui-input-inline">
+	                    <input type="tel" name="personTlephone" lay-verify="phone" id = "editphone" name="personTlephone"  autocomplete="off" class="layui-input">
+	                </div>
+	            </div>
+	        </div>
+	        
+	        <div class="layui-form-item">
+	            <label class="layui-form-label">部门地址:</label>
+	          <div class="layui-input-inline">
+	                <input type="tel" name="address" id = "editaddress" autocomplete="off" placeholder="" class="layui-input">
+	            </div>
+	        </div> -->
+	        <div class="layui-form-item box-button">
+	            <div class="layui-input-block">
+	                <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
+	                <button onclick = "parent.layer.closeAll('iframe');" type="button" class="layui-btn layui-btn-primary">取消</button>
+	            </div>
+	        </div>
+	    </form>
+    </div>
+      <script src="../../js/min-loader-next.js"></script>
+    <script>
+    //反现
+    var rowData = layui.sessionData("ROW_DATA").NOW_ROW;
+    layui.each(rowData, function(index, item){ 
+    	$("#edit"+index+"").val(item);
+    })
+      layui.use(['form', 'layedit', 'laydate'], function() {
+            var form = layui.form,
+                layer = layui.layer,
+                layedit = layui.layedit,
+                laydate = layui.laydate;
+
+            //日期
+            laydate.render({
+                elem: '#date'
+            });
+            laydate.render({
+                elem: '#date1'
+            });
+
+            //创建一个编辑器
+            var editIndex = layedit.build('LAY_demo_editor');
+            //自定义验证规则
+            form.verify({
+            	title: function(value, item) {
+                    if (isEmpty(value)) {
+                        return '部门名称不能为空';
+                    }
+                    if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
+                        return '部门名称不能有特殊字符';
+                      }
+                },
+                pointPerson : function(valueb, item) {
+                    if (isEmpty(valueb)) {
+                        return '联系人不能为空';
+                    }
+                    if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(valueb)){
+                        return '联系人不能有特殊字符';
+                     }
+                }
+            });
+    		//监听提交
+            form.on('submit(demo1)', function(data) {
+            	$.request({
+					action : '../../DepartmentManageAction/modifyBranch',
+					data :  data.field ,
+					success : function(data) {
+						 layer.alert('操作成功!',  function(){
+							 window.parent.location.reload(); 
+			                 parent. layer.close(layer.index);  
+						}); 	
+						 
+					},
+					error : function(data) {
+						 layer.alert(data.MINErrorMessage, {
+							icon: 5,
+							title: "提示"
+						}); 
+					}
+				});	
+                return false;
+            });
+    
+      });
+    </script>
+
+</body>
+
+</html>