wuwen 3 rokov pred
rodič
commit
6950effd3c

+ 52 - 0
src/main/java/com/ssj/sys/controller/FxController.java

@@ -417,6 +417,50 @@ public class FxController  extends BaseController {
 	
 	
 	
+	@RequestMapping("/merchantAllEdit")
+    public String merchantAllEdit(Model model,
+            @RequestParam(required = false, defaultValue = "10") int pageSize,
+            @RequestParam(required = false, defaultValue = "1") int pageNo)throws Exception {
+		HttpSession session = request.getSession();
+		Admin admin =(Admin) session.getAttribute("admin");
+		Merchant merchant=merchantService.getMerchantByPosCode(admin.getLoginName());
+		
+	 	Map<String, Object> params = new HashMap<String, Object>();
+        params.put("LIKE_unitName", request.getParameter("LIKE_unitName")==null?"":request.getParameter("LIKE_unitName"));
+        params.put("LIKE_posCode", request.getParameter("LIKE_posCode")==null?"":request.getParameter("LIKE_posCode"));
+        if(request.getParameter("signType")!=null ) {
+        	if("0".equals(request.getParameter("signType").toString())){
+        		params.put("EQ_signType", 0);
+        	}else if("1".equals(request.getParameter("signType").toString())){
+        		params.put("GTE_signType", 1);
+        	}
+        }
+        
+        String orgCode=request.getParameter("LIKE_orgCode")==null?"":request.getParameter("LIKE_orgCode");
+        if(StringUtils.isNotEmpty(orgCode)) {
+        	params.put("LIKE_orgCode", orgCode);
+        }else {
+        	params.put("LIKE_orgCode", merchant.getOrgCode());
+        }
+        
+        SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        Page<Merchant> page = merchantService.findMerchantByPage(params, initPage(pageNo, pageSize, Direction.DESC, new String[]{"createTime"}));
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list", page.getContent());
+        params.put("signType", request.getParameter("signType")==null?"":request.getParameter("signType"));
+        sp.setParams(params);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+        model.addAttribute("curMerchant", merchant);
+        return "sys/fx/merchantAllEdit";
+    }
+	
+	
+	
 	@RequestMapping("/merchantBackupList")
     public String merchantBackupList(Model model,
             @RequestParam(required = false, defaultValue = "10") int pageSize,
@@ -520,6 +564,14 @@ public class FxController  extends BaseController {
 	
 
 	
+	@RequestMapping("/merchantAllEditMain")
+    public String merchantAllEditMain(Model model)throws Exception {
+        return "sys/fx/merchantAllEditMain";
+    }
+	
+	
+
+	
 	
 	
 	

+ 972 - 0
src/main/resources/templates/sys/fx/merchantAllEdit.html

@@ -0,0 +1,972 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	#signServiceAdd .zwfb_shop_table {
+		margin-top: 10px
+	}
+	#signServiceAdd tbody {
+	    display: table-row-group;
+	    vertical-align: middle;
+    	border-color: inherit;
+	}
+	#signServiceAdd .fwmc_xxk {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#signServiceAdd .fwmc_xxk li {
+	    float: left;
+	    width: 150px;
+	    height: 52px;
+	    border: 1px solid #ddd;
+	    font-size: 18px;
+	    color: #666;
+	    margin-right: 30px;
+	    text-align: center;
+	    margin-bottom: 10px;
+	    overflow: hidden;
+	    cursor: pointer;
+	}
+	#signServiceAdd .fwmc_xxk li p {
+	    line-height: 18px;
+	    font-size: 12px;
+	    color: #999;
+	    margin-top: 5px;
+	}
+	#signServiceAdd .zwsl_num {
+	    margin-left: 20px;
+	    font-size: 16px;
+	    color: #333;
+	}
+	#signServiceAdd .zwsl_num span {
+	    color: #999;
+	    font-size: 12px;
+	    padding-left: 10px;
+	}
+	#signServiceAdd .nmb_jj {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#signServiceAdd .nmb_jj li.jian {
+	    border-right: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#signServiceAdd .nmb_jj li {
+	    float: left;
+	    text-align: center;
+	    line-height: 30px;
+	    border: 1px solid #ddd;
+	    font-size: 20px;
+	    padding: 0 8px;
+	}
+	#signServiceAdd .nmb_jj li .srkk {
+	    width: 30px;
+	    font-size: 16px;
+	    border: none;
+	    line-height: 30px;
+	    text-align: center;
+	    outline: 0;
+	    background: #FFF;
+	}
+	#signServiceAdd .nmb_jj li.jia {
+	    border-left: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#signServiceAdd a.ty_but {
+	    width: 130px;
+	    height: 40px;
+	    line-height: 40px;
+	    text-align: center;
+	    display: block;
+	    font-size: 16px;
+	    color: #fff;
+	    border-radius: 3px;
+	    background: #169ed8;
+	}
+	#signServiceAdd a.ty_but:hover {
+	    background: #1187ba;
+	}
+	#signServiceAdd .fwmc_xxk li.sign_type_select_on {
+	    background: url(/static/sys/images/fwkk.jpg) no-repeat center;
+	    color: #169ed8;
+	    border: 1px solid #169ed8;
+	}
+	
+	
+	
+	
+	
+	
+	#libServiceAdd .zwfb_shop_table {
+		margin-top: 10px
+	}
+	#libServiceAdd tbody {
+	    display: table-row-group;
+	    vertical-align: middle;
+    	border-color: inherit;
+	}
+	#libServiceAdd .fwmc_xxk {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#libServiceAdd .fwmc_xxk li {
+	    float: left;
+	    width: 150px;
+	    height: 52px;
+	    border: 1px solid #ddd;
+	    font-size: 18px;
+	    color: #666;
+	    margin-right: 30px;
+	    text-align: center;
+	    margin-bottom: 25px;
+	    overflow: hidden;
+	    cursor: pointer;
+	}
+	#libServiceAdd .fwmc_xxk li p {
+	    line-height: 18px;
+	    font-size: 12px;
+	    color: #999;
+	    margin-top: 5px;
+	}
+	#libServiceAdd .zwsl_num {
+	    margin-left: 20px;
+	    font-size: 16px;
+	    color: #333;
+	}
+	#libServiceAdd .zwsl_num span {
+	    color: #999;
+	    font-size: 12px;
+	    padding-left: 10px;
+	}
+	#libServiceAdd .nmb_jj {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#libServiceAdd .nmb_jj li.jian {
+	    border-right: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#libServiceAdd .nmb_jj li {
+	    float: left;
+	    text-align: center;
+	    line-height: 30px;
+	    border: 1px solid #ddd;
+	    font-size: 20px;
+	    padding: 0 8px;
+	}
+	#libServiceAdd .nmb_jj li .srkk {
+	    width: 30px;
+	    font-size: 16px;
+	    border: none;
+	    line-height: 30px;
+	    text-align: center;
+	    outline: 0;
+	    background: #FFF;
+	}
+	#libServiceAdd .nmb_jj li.jia {
+	    border-left: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#libServiceAdd a.ty_but {
+	    width: 130px;
+	    height: 40px;
+	    line-height: 40px;
+	    text-align: center;
+	    display: block;
+	    font-size: 16px;
+	    color: #fff;
+	    border-radius: 3px;
+	    background: #169ed8;
+	}
+	#libServiceAdd a.ty_but:hover {
+	    background: #1187ba;
+	}
+	#libServiceAdd .fwmc_xxk li.sign_type_select_on {
+	    background: url(/static/sys/images/fwkk.jpg) no-repeat center;
+	    color: #169ed8;
+	    border: 1px solid #169ed8;
+	}
+	
+	
+	
+</style>
+<body>
+
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/fx/merchantAllEdit.html}" method="post">
+	<input type="hidden" name="reportType" id="reportType" />
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+		<li>
+		 <label>商户名称</label>
+		  <input name=LIKE_orgCode type="hidden" class="scinput" th:value="${search.get('LIKE_orgCode')}"/>
+		  <input name="LIKE_unitName" type="text" class="scinput" th:value="${search.get('LIKE_unitName')}"/>
+	    </li>
+		    
+	    <li>
+		 <label>商户账号</label>
+		  <input name="LIKE_posCode" type="text" class="scinput" th:value="${search.get('LIKE_posCode')}"/>
+	    </li>
+		    
+	    <li>
+		 <label>商户模式</label>
+		 	<select class="scinput select_width" name="signType" id="signType"   style="width: 150px;" >
+		 	 	<option value="" >全部</option>
+				<option value="0"  th:selected="${search.get('signType') eq '0' ? true : false}" >旧模式</option>
+				<option value="1"  th:selected="${search.get('signType') eq '1' ? true : false}">新模式</option>
+			</select>
+	    </li>
+	    
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+	</ul>
+	</form>
+	<ul style="margin-bottom: 10px" >
+	  <li>
+		<input type="button" id="button" class="scbtn" value="导出商户" />
+      </li>
+	</ul>
+	 
+	
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+
+		    	<th >商户账号</th>
+		    	<th >单位名称 </th>
+		    	<th >关联机构 </th>
+		    	<th >商户套餐 </th>
+		    	<th >商户模式 </th>
+		    	<th >平台管理费 </th>
+		    	<th style="width: 60px;">服务人数</th>
+		    	<th style="width: 60px;">签约端口数量</th>
+		    	<th style="width: 60px;">剩余机构塾币</th>
+		    	<th style="width: 60px;" >激活开始日期</th>
+		    	<th style="width: 60px;" >激活结束日期</th>
+		    	<th style="width: 60px;" >计费开始日期</th>
+		    	<th style="width: 60px;" >服务结束日期</th>
+		    	<th  >状态</th> 
+		        <th  >操作</th> 
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+		
+					<td th:title="${item.posCode}" th:text="${item.posCode}"></td>
+					<td th:title="${item.unitName}" th:text="${item.unitName}"></td>
+					<td  th:title="${item.libJoin!=null ? item.libJoin.leagueName : '' }" >
+						<a href="javascript:;" th:onclick="'openNew(\''+${item.libId}+'\')'" th:if="${item.libId!='' && item.libId!=null}"	class="tablelink">[[${item.libJoin.leagueName}]]</a>
+					</td>
+					
+					<td  th:switch="${item.mealType}">
+					   <span th:case="0" >塾币模式</span>
+					   <span th:case="1" >优选套餐</span>
+					   <span th:case="2" >VIP套餐</span>
+					   <span th:case="3" >尊享套餐</span>
+					   <span th:case="4" >校园服务</span>
+					   <span th:case="*" >--</span>
+					</td>
+					
+					<td  th:switch="${item.signType}">
+					   <span th:case="0" >塾币模式</span>
+					   <span th:case="1" >服务包1</span>
+					   <span th:case="2" >服务包2</span>
+					   <span th:case="3" >服务包3</span>
+					   <span th:case="4" >服务包4</span>
+					   <span th:case="5" >服务包5</span>
+					   <span th:case="*" >--</span>
+					</td>
+					
+					<td  th:text="${item.posType>1 ? item.outPrice: '--' }"></td>
+					<td  th:text="${item.posType>1 ? item.libService : '--'}"></td>
+					
+					<td  th:text="${item.posType<=1 ? item.portNum : '--' }"></td>
+					<td  th:text="${item.posType<=1 ? item.libService  : '--' }"></td>
+					
+					
+					<td  th:text="${item.posType>1 ? #calendars.format(item.startActiveTime,'yyyy-MM-dd'): '--'}" ></td> 
+					<td  th:text="${item.posType>1 ? #calendars.format(item.activeTime,'yyyy-MM-dd'): '--'}" ></td> 
+					<td  th:text="${item.posType>1 ? #calendars.format(item.computeTime,'yyyy-MM-dd'): '--'}" ></td> 
+					<td  th:text="${item.posType>1 ? #calendars.format(item.endActiveTime,'yyyy-MM-dd'): '--'}" ></td> 
+					<td  th:switch="${item.status}">
+					   <span th:case="1" >冻结&nbsp;</span>
+					   <span th:case="2" >正常&nbsp;</span>
+					   <span th:case="3" >正常&nbsp;</span>
+					   <span th:case="4" >删除&nbsp;</span>
+					</td>
+					<td  >   
+						<di th:if="
+						${ #httpSession.getAttribute('admin') !=null && 
+						(
+							#lists.contains(#httpSession.getAttribute('admin').authorities,'财务管理员')  ||
+							#lists.contains(#httpSession.getAttribute('admin').authorities,'超级管理员角色')  
+						)  }
+						">
+							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'platServiceAdd(\''+${item.id}+'\')'" class="tablelink">管理费</a>
+						
+							<a href="javascript:;" th:if="${item.posType==1 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'joinServiceEdit(\''+${item.id}+'\')'" class="tablelink">塾&nbsp;&nbsp;&nbsp;币</a>
+							<a href="javascript:;" th:if="${item.posType==2 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'libServiceAdd(\''+${item.id}+'\')'" class="tablelink">服务包</a>
+							<a href="javascript:;" th:if="${item.posType==3 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'libServiceScAdd(\''+${item.id}+'\')'" class="tablelink">服务包</a>
+							
+							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'signServiceAdd(\''+${item.id}+'\')'" class="tablelink">加油包</a>
+								
+						</di>
+						
+					 </td>  
+					
+					
+			</tr>
+		</tbody>
+	</table> 
+	
+	
+<div class="formbody" id="joinServiceEdit" style="display: none">
+	<input type="hidden" id="merchant_id" value="" >
+	<ul class="forminfo">
+		<li>
+			<label style="width: 100%;line-height: 30px;color: #ea2020;font-size: 15px">温馨提醒:1个塾币=1个月服务</label>
+		</li>
+		<li></li>
+		<li>
+			<label>机构端口:</label>
+			<label><b id="port_num">0</b> 个</label>
+			<input  onclick="joinServiceAdd(2);" type="button" style="width: 70px;height: 30px;border-radius: 50px;"  class="scbtn isportnum" value=" 添加 " />
+		</li>
+		
+		<li>
+			<label>机构塾币:</label>
+			<label><b id="lib_service_num">0</b> 个</label>
+			<input  onclick="joinServiceAdd(1);" type="button" style="width: 70px;height: 30px;border-radius: 50px;margin-right: 10px;"  class="scbtn" value=" 添加 " />&nbsp;
+			<input onclick="merchantallot(1);" type="button" style="width: 70px;height: 30px;border-radius: 50px;background: #ffb752!important;"  class="scbtn" value=" 分配 " />
+		</li>
+		
+		<li>
+			<label>平台塾币:</label>
+			<label><b id="platform_service_num">0</b> 个</label>
+			<input  onclick="joinServiceAdd(3);" type="button" style="width: 70px;height: 30px;border-radius: 50px;margin-right: 10px;"  class="scbtn" value=" 添加 " />&nbsp;
+			<input onclick="merchantallot(2);" type="button" style="width: 70px;height: 30px;border-radius: 50px;background: #ffb752!important;"  class="scbtn" value=" 分配 " />
+		</li>
+		
+	</ul>
+</div>
+
+
+<div class="formbody" id="libServiceAdd" style="display: none;">
+	<input type="hidden" id="lib_merchant_id" value="" >
+	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="zwfb_shop_table">
+	      <tbody>
+	      	<tr valign="top">
+		        <td align="right" width="70" style="line-height: 50px;font-weight: 700">续费服务包:</td>
+		        <td>
+		        	<ul class="fwmc_xxk">
+		           	<li class="sign_type_select sign_type_select_on"  data-type="5">
+		              <p>服务包1</p>
+		              30人<i>/1月/1000元</i>
+		           	</li>
+		          </ul>
+		        </td>
+	      </tr>
+	      
+	      <tr valign="top">
+  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">总服务月数量:</td>
+  	        <td>
+	        	<ul class="nmb_jj">
+		            <li><i>6月</i></li>
+	          </ul>
+	        </td>
+	      </tr>
+	      <tr>
+	        <td height="10"></td>
+	        <td></td>
+	      </tr>
+	      <tr valign="top">
+  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">已赠送月数量:</td>
+  	        <td>
+	        	<ul class="nmb_jj">
+		            <li><i>1月</i></li>
+	          </ul>
+	        </td>
+	      </tr>
+	       <tr>
+	        <td height="10"></td>
+	        <td></td>
+	      </tr>
+	      
+	      <tr>
+	        <td height="10"></td>
+	        <td></td>
+	      </tr>
+	      <tr valign="top">
+  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">已购买月数量:</td>
+  	        <td>
+	        	<ul class="nmb_jj">
+		            <li><i>5月</i></li>
+	          </ul>
+	        </td>
+	      </tr>
+	       <tr>
+	        <td height="10"></td>
+	        <td></td>
+	      </tr>
+	      
+	      <tr valign="top">
+  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">续费月数量:</td>
+  	        <td>
+	        	<ul class="nmb_jj">
+		            <li class="jian" id="lib_reduce_num">-</li>
+		            <li>
+		              <input name="" id="lib_add_service_num" type="text" value="1" class="srkk">
+		            </li>
+		            <li class="jia" id="lib_add_num">+</li>  
+	          </ul>
+	        </td>
+	      </tr>
+	      
+	      <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	   	 <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	      <tr>
+	        <td></td>
+	        <td><a class="ty_but ml20" href="javascript:#" onclick="saveLib();">添 加</a></td>
+	      </tr>
+	    </tbody>
+   	</table>
+    
+</div>
+
+
+
+<div class="formbody" id="signServiceAdd" style="display: none;">
+	<input type="hidden" id="meal_merchant_id" value="" >
+	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="zwfb_shop_table">
+	      <tbody>
+	      	<tr valign="top">
+		        <td align="right" width="70" style="line-height: 50px;font-weight: 700">加油包类型:</td>
+		        <td>
+		        	<ul class="fwmc_xxk">
+		            <li class="sign_type_select sign_type_select_on" data-type="4">
+		              <p>加油包-月包</p>
+		              1个月<i>/5人/1000元</i>
+		           	</li>
+		           	<li class="sign_type_select"  data-type="5">
+		              <p>加油包-数量包</p>
+		              5人<i>/1月/1000元</i>
+		           	</li>
+		          </ul>
+		        </td>
+	      	</tr>
+	      <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	      <tr>
+	        <td align="right" style="font-weight: 700">添加数量:</td>
+	        <td>
+	        	<ul class="nmb_jj">
+		            <li class="jian" id="meal_reduce_num">-</li>
+		            <li>
+		              <input name="" id="meal_add_service_num" type="text" value="1" class="srkk">
+		            </li>
+		            <li class="jia" id="meal_add_num">+</li>  
+	          </ul>
+	        </td>
+	      </tr>
+	      <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	   	 <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	      <tr>
+	        <td></td>
+	        <td><a class="ty_but ml20" href="javascript:#" onclick="saveMeal();">添 加</a></td>
+	      </tr>
+	    </tbody>
+   	</table>
+    
+</div>
+
+
+
+<div class="formbody" id="joinServiceAdd" style="display: none;">
+	<input type="hidden" id="service_type" value="" >
+	<ul class="seachform" style="margin-top: 40px;margin-left:38%">
+	    <li>
+		  <input type="button" id="reduce_num" style="width: 30px;height: 30px;border-radius: 50px;"  class="scbtn" value=" - " />
+	    </li>
+	    <li>
+		  <input type="text" id="add_service_num" value="1"  style="width: 50px;height: 30px;text-align: center;"   />
+	    </li>
+	    <li>
+		  <input type="button" id="add_num" style="width: 30px;height: 30px;border-radius: 50px;"  class="scbtn" value=" + " />
+	    </li>
+	</ul>
+	<button style="margin-top: 30px;margin-left: 38%" type="submit" onclick="save();" class="btn">提交</button>
+</div>
+	
+
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+
+
+</body>
+
+
+<script type="text/javascript">
+
+
+$(function () {
+	
+	$("#reduce_num").click(function (){
+		if($("#add_service_num").val()<=1){
+			parent.layer.msg("塾币不能小于1。",{icon:11});
+			return;
+		}
+		$("#add_service_num").val(parseInt($("#add_service_num").val())-1);
+	});
+	
+	$("#add_num").click(function (){
+		$("#add_service_num").val(parseInt($("#add_service_num").val())+1);
+	});
+	
+	$("#meal_reduce_num").click(function (){
+		if($("#meal_add_service_num").val()<=1){
+			parent.layer.msg("添加加油包数量不能小于1",{icon:11});
+			return;
+		}
+		$("#meal_add_service_num").val(parseInt($("#meal_add_service_num").val())-1);
+	});
+	
+	$("#meal_add_num").click(function (){
+		$("#meal_add_service_num").val(parseInt($("#meal_add_service_num").val())+1);
+	});
+	
+	$(".sign_type_select").click(function (){
+		$(".sign_type_select").removeClass("sign_type_select_on");
+		$(this).addClass("sign_type_select_on");
+	});
+	
+
+})
+
+
+function save(){
+	var type= $("#service_type").val();
+	var num=$("#add_service_num").val();
+	var merchantId=$("#merchant_id").val();
+	
+	var url="[[${sysUrl}]]/sys/fx/merchant/update/"+merchantId;
+	var params ={
+        'type' : type,
+        'num':num
+    };
+	$.post(url,params,function(data){
+		if(data.meta.success){
+			parent.layer.msg("设置成功",{icon:1});
+			parent.location.reload();
+			parent.layer.close(parent.layer.getFrameIndex(window.name));
+		}else{
+			parent.layer.msg(data.meta.message,{icon:11});
+		}
+	});
+}
+
+
+function joinServiceAdd(type){
+	var title='';
+	if(type==1){
+		title="添加机构塾币";
+	}else if(type==3){
+		title="添加平台塾币";
+	}else{
+		title="添加机构端口";
+	}
+	$("#add_service_num").val(1)
+	 $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+$("#merchant_id").val(),
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  $("#service_type").val(type);
+	    		  layer.open({
+	    			    type: 1,
+	    			    title: title,
+	    			    closeBtn: 1, //不显示关闭按钮
+	    			    shift: 0.8,
+	    			    offset: '150px',
+	    			    area: ['40%', '40%'],
+	    			    content: $("#joinServiceAdd")
+	    			});
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+	
+
+}
+
+
+
+function libServiceAdd(id){
+	var title="购买端口服务包";
+	parent.layer.open({
+	    type: 2,
+	    title: title,
+	    closeBtn: 1, //不显示关闭按钮
+	    shift: 0.8,
+	    offset: '10%',
+	    area: ['1015px', '60%'],
+	    content: '[[${sysUrl}]]/sys/fx/merchantMealAdd.html?id='+id
+	});
+}
+
+function libServiceScAdd(id){
+	var title="购买学校服务包";
+	parent.layer.open({
+	    type: 2,
+	    title: title,
+	    closeBtn: 1, //不显示关闭按钮
+	    shift: 0.8,
+	    offset: '10%',
+	    area: ['1015px', '60%'],
+	    content: '[[${sysUrl}]]/sys/fx/merchantMealScAdd.html?id='+id
+	});
+}
+
+function signServiceAdd(id){
+	var title="购买加油包";
+	parent.layer.open({
+	    type: 2,
+	    title: title,
+	    closeBtn: 1, //不显示关闭按钮
+	    shift: 0.8,
+	    offset: '10%',
+	    area: ['905px', '60%'],
+	    content: '[[${sysUrl}]]/sys/fx/merchantSignAdd.html?id='+id
+	});
+}
+
+
+function platServiceAdd(id){
+	var title="购买管理费";
+	parent.layer.open({
+	    type: 2,
+	    title: title,
+	    closeBtn: 1, //不显示关闭按钮
+	    shift: 0.8,
+	    offset: '10%',
+	    area: ['905px', '60%'],
+	    content: '[[${sysUrl}]]/sys/fx/merchantPlatAdd.html?id='+id
+	});
+}
+
+
+
+function saveMeal(){
+	parent.layer.confirm("确定为此商户添加加油包?", {
+		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+	}, function(){
+		var type=$(".sign_type_select_on").data("type");
+		var num=$("#meal_add_service_num").val();
+		var merchantId=$("#meal_merchant_id").val();
+		var url="[[${sysUrl}]]/sys/fx/merchant/updateMeal/"+merchantId;
+		var params ={
+	        'num':num,
+	        'type':type
+	    };
+		$.post(url,params,function(data){
+			if(data.meta.success){
+				parent.layer.msg("添加成功",{icon:1});
+				parent.location.reload();
+				parent.layer.close(parent.layer.getFrameIndex(window.name));
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+			}
+		});
+	});
+}
+
+
+
+
+function joinServiceEdit(id){
+	  $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+id,
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  
+	    		  $("#merchant_id").val(id);
+	    		  $("#lib_service_num").html(responseStr.data.merchant.libService);
+	    		  $("#platform_service_num").html(responseStr.data.merchant.platformService);
+	    		  $("#port_num").html(responseStr.data.merchant.portNum);
+	    		  
+	    		  if(responseStr.data.isPortNum){
+	    			  $(".isportnum").show();
+	    		  }else{
+	    			  $(".isportnum").hide();
+	    		  }
+	    		  
+	    		  layer.open({
+    			    type: 1,
+    			    title: '管理塾币',
+    			    closeBtn: 1, //不显示关闭按钮
+    			    shift: 0.8,
+    			    offset: '150px',
+    			    area: ['40%', '40%'],
+    			    content: $("#joinServiceEdit")
+	    		 });
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+}
+</script>
+
+<script type="text/javascript">
+
+	function  openNew(libId) {
+		//@{/sys/admin/curator/index.html(libId=${item.libId})}
+		window.open('[[${sysUrl}]]/sys/admin/curator/index.html?libId='+libId);
+	}
+		function merchantallot(type){
+			var id=$("#merchant_id").val();
+			var title="";
+			if(type==1){
+				title="分配机构塾币";
+			}else{
+				title="分配平台塾币";
+			}
+			layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '150px',
+			    area: ['40%', '40%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAllot.html?id='+id+'&type='+type
+			});
+		}
+
+		
+		
+		
+		function infomerchant(id){
+			var title="查看商户";
+			
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantInfo.html?id='+id
+			});
+		}
+
+
+		function savemerchant(id){
+			var title="端口商户建立";
+			if(id!=null && id!='' && id!=undefined){
+				title="修改端口商户";
+			}
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAdd.html?id='+id
+			});
+		}
+		
+		function savemerchantsc(id){
+			var title="学校商户建立";
+			if(id!=null && id!='' && id!=undefined){
+				title="修改商户";
+			}
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantScAdd.html?id='+id
+			});
+		}
+		
+		
+		function savemerchantold(id){
+			var title="塾币商户建立";
+			if(id!=null && id!='' && id!=undefined){
+				title="修改塾币商户";
+			}
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantOldAdd.html?id='+id
+			});
+		}
+		
+		
+		
+		function untyingmerchant(id){
+			
+			parent.layer.confirm("确定解绑机构?<br/>此动作会清空机构下塾币<br/>但此商户下的塾币会保留", {
+				icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+			}, function(){
+				$.ajax({
+					url : "[[${sysUrl}]]/sys/fx/merchant/untying",
+					type : "post",
+					data : {id:id},
+					dataType : "json",
+					success : function(data) {
+						if(data.meta.success){
+							parent.layer.msg("操作成功",{icon:1});
+					    	setTimeout(function(){
+					    		location.reload();
+							},1000);
+						}else{
+							alert("操作异常,请刷新后重试...")
+						}
+					}
+				});
+			});
+			
+		}
+
+
+		function updatemerchant(id,status){  
+			
+			if(status==1){
+				parent.layer.confirm("确定操作冻结此商户?", {
+					icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+				}, function(){
+					$.ajax({
+						url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+						type : "post",
+						data : {id:id,status:status},
+						dataType : "json",
+						success : function(data) {
+							if(data.meta.success){
+								parent.layer.msg("操作成功",{icon:1});
+						    	setTimeout(function(){
+						    		location.reload();
+								},1000);
+							}else{
+								alert("操作异常,请刷新后重试...")
+							}
+						}
+					});
+				});
+			}else{
+				
+				$.ajax({
+					url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+					type : "post",
+					data : {id:id,status:status},
+					dataType : "json",
+					success : function(data) {
+						if(data.meta.success){
+							parent.layer.msg("操作成功",{icon:1});
+					    	setTimeout(function(){
+					    		location.reload();
+							},1000);
+						}else{
+							alert("操作异常,请刷新后重试...")
+						}
+					}
+				});
+			}
+		}
+	
+	
+</script>
+
+<script type="text/javascript">
+$("#button").on('click',function(){
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchant";
+	$("#seachform").submit();
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantAllList.html";
+});
+</script>
+
+
+
+
+</html>

+ 467 - 0
src/main/resources/templates/sys/fx/merchantAllEditMain.html

@@ -0,0 +1,467 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+
+<link href="sys/css/bootstrap.css" th:href="@{/static/sys/css/bootstrap.css}" rel="stylesheet"/>
+<link href="sys/css/zTree/zTreeStyle.css" th:href="@{/static/sys/css/zTree/zTreeStyle.css}" rel="stylesheet"/>
+<script src="js/jquery-2.2.4.min.js" th:src="@{/static/js/jquery-2.2.4.min.js}"></script>
+<script src="sys/js/zTree/jquery.ztree.all-3.5.min.js" th:src="@{/static/sys/js/zTree/jquery.ztree.all-3.5.min.js}"></script>
+
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	
+	span{margin:0;padding:0;display: inline-block;}
+    	@media (min-width: 1200px){
+			.row-fluid [class*="span"] {
+			    margin-left: 0px;
+			}
+		}
+	
+	
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">商户管理</a></li>
+		<li><a href="#">所有商户</a></li>
+	</ul>
+</div>
+
+<div class="rightinfo container-fluid" style="padding-left: 10px;">
+	<div class="row-fluid">
+		<div id="divTree" class="span2" th:style="${ #httpSession.getAttribute('admin') !=null && #lists.contains(#httpSession.getAttribute('admin').authorities,'财务管理员')  ? 'width: 0%;display: none;' : '' }  " >
+			<ul id="columnsTree" class="ztree" style="min-height:540px; overflow: auto;"></ul>
+		</div>
+		
+		<div class="span10" th:style="${ #httpSession.getAttribute('admin') !=null && #lists.contains(#httpSession.getAttribute('admin').authorities,'财务管理员')  ? 'width: 100%;' : '' }  " >
+			<iframe id="listIframe" scrolling="auto" frameborder="0" style="width:104%;height:100%;"></iframe>
+		</div>
+	</div>
+</div>
+
+</body>
+
+
+<script type="text/javascript">
+function addTab(url) {
+	$("#listIframe").attr("src",url);
+	startInit("listIframe", 560);
+}
+
+function refreshList(){
+	$("#listIframe").attr("src", $("#listIframe").attr("src"));
+}
+
+var setting = {
+	async : {
+		enable : true,
+		autoParam : [ "id" ],
+		url : "[[${sysUrl}]]/sys/fx/merchantTree",
+		dataFilter : filter
+	},
+	data : {
+		key : {
+			name : "name"
+		},
+		simpleData : {
+			enable : true,
+			pIdKey : "pId"
+		}
+	},
+	callback : {
+		onClick : clickNode,
+		onAsyncSuccess : renderIcon
+	}
+};
+
+function filter(treeId, parentNode, childNodes) {
+	if (!childNodes)
+		return null;
+	for (var i = 0, l = childNodes.length; i < l; i++) {
+		childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
+	}
+	return childNodes;
+}
+
+function clickNode(event, treeId, treeNode, clickFlag) {
+	var url = "[[${sysUrl}]]/sys/fx/merchantAllEdit.html?LIKE_orgCode=" + treeNode.id;
+	addTab(url);
+	event.preventDefault();
+}
+
+function renderIcon(event, treeId, treeNode, msg){
+	var ztree = $.fn.zTree.getZTreeObj(treeId);
+	var nodes = null;
+	if(treeNode){
+		nodes = treeNode.children;
+	}
+	if(nodes){
+		for(var i = 0; i < nodes.length; i++){
+			nodes[i].icon="[[${imgUrl}]]/resources/images/menu_1.png";
+			ztree.updateNode(nodes[i]);
+		}
+	}
+	zTreeOnAsyncSuccess(event, treeId, treeNode, msg, ztree);
+}
+
+var firstAsyncSuccessFlag = 0;
+function zTreeOnAsyncSuccess(event, treeId, treeNode, msg, zTree) {
+	if (firstAsyncSuccessFlag == 0) {  
+	      try {  
+	             //调用默认展开第一个结点  
+	             var selectedNode = zTree.getSelectedNodes();  
+	             var nodes = zTree.getNodes();  
+	             zTree.expandNode(nodes[0], true);
+	             
+	             var childNodes = zTree.transformToArray(nodes[0]);  
+                 zTree.selectNode(childNodes[0]);  
+	          	 
+	             clickNode(event, treeId, treeNode, true);
+	             firstAsyncSuccessFlag = 1;
+	       } catch (err) {  
+	          
+	       }  
+	   }  
+}
+
+// 增删改节点之后,刷新局部
+function refreshNode(id, pid, name, op) {
+	var ztree = $.fn.zTree.getZTreeObj("columnsTree");
+	var pNode = ztree.getNodeByParam("id", pid, null);
+	// 添加一级节点
+	if (pNode == null) {
+		ztree.refresh();
+	}
+	// 父节点是叶子节点,只能是新增
+	if (!pNode.isParent) {
+		pNode.isParent = true;
+		ztree.reAsyncChildNodes(pNode, "refresh");
+	}
+	// 父节点未展开,直接返回
+	if (!pNode.open)
+		return;
+	// 新增节点,重新展开父节点
+	if (id == "") {
+		pNode.open = false;
+		ztree.reAsyncChildNodes(pNode, "refresh");
+		return;
+	}
+	// 删除
+	var treeNode = ztree.getNodeByParam("id", id, null);
+	if (op == "delete") {
+		ztree.removeNode(treeNode);
+	} else {
+		// 修改
+		treeNode.name = name;
+		ztree.updateNode(treeNode);
+	}
+}
+
+$(document).ready(function() {
+	$.fn.zTree.init($("#columnsTree"), setting);
+});
+
+var browserVersion = window.navigator.userAgent.toUpperCase();
+var isOpera = false;
+var isFireFox = false;
+var isChrome = false;
+var isSafari = false;
+var isIE = false;
+var iframeTime;
+function reinitIframe(iframeId, minHeight) {
+    try {
+    	if (typeof(reValue) == "undefined") {
+    		browserVersion = window.navigator.userAgent.toUpperCase();
+    	}
+        var iframe = document.getElementById(iframeId);
+        var bHeight = 0;
+        if (isChrome == false && isSafari == false)
+            bHeight = iframe.contentWindow.document.body.scrollHeight;
+
+        var dHeight = 0;
+        if (isFireFox == true)
+            dHeight = iframe.contentWindow.document.documentElement.offsetHeight + 2;
+        else if (isIE == false && isOpera == false)
+            dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
+        else
+            bHeight += 3;
+        var height = Math.max(bHeight, dHeight);
+        if (height < minHeight) height = minHeight;
+        iframe.style.height = height + "px";
+    } catch (ex) { }
+}
+function startInit(iframeId, minHeight) {
+	if (typeof(reValue) == "undefined") {
+		browserVersion = window.navigator.userAgent.toUpperCase();
+	}
+    isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
+    isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
+    isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
+    isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
+    if (!!window.ActiveXObject || "ActiveXObject" in window)
+        isIE = true;
+    reinitIframe(iframeId, minHeight);
+    if (iframeTime != null)
+        clearInterval(iframeTime)
+    iframeTime = window.setInterval("reinitIframe('" + iframeId + "'," + minHeight + ")", 100);
+}
+</script>
+
+<script type="text/javascript">
+
+
+$(function () {
+	
+	$("#reduce_num").click(function (){
+		if($("#add_service_num").val()<=1){
+			parent.layer.msg("塾币不能小于1。",{icon:11});
+			return;
+		}
+		$("#add_service_num").val(parseInt($("#add_service_num").val())-1);
+	});
+	
+	$("#add_num").click(function (){
+		$("#add_service_num").val(parseInt($("#add_service_num").val())+1);
+	});
+
+})
+
+
+function save(){
+	var type= $("#service_type").val();
+	var num=$("#add_service_num").val();
+	var merchantId=$("#merchant_id").val();
+	
+	var url="[[${sysUrl}]]/sys/fx/merchant/update/"+merchantId;
+	var params ={
+        'type' : type,
+        'num':num
+    };
+	$.post(url,params,function(data){
+		if(data.meta.success){
+			parent.layer.msg("设置成功",{icon:1});
+			parent.location.reload();
+			parent.layer.close(parent.layer.getFrameIndex(window.name));
+		}else{
+			parent.layer.msg(data.meta.message,{icon:11});
+		}
+	});
+}
+
+
+function joinServiceAdd(type){
+	var title='';
+	if(type==1){
+		title="添加机构塾币";
+	}else if(type==3){
+		title="添加平台塾币";
+	}else{
+		title="添加机构端口";
+	}
+	$("#add_service_num").val(1)
+	 $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+$("#merchant_id").val(),
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  $("#service_type").val(type);
+	    		  layer.open({
+	    			    type: 1,
+	    			    title: title,
+	    			    closeBtn: 1, //不显示关闭按钮
+	    			    shift: 0.8,
+	    			    offset: '150px',
+	    			    area: ['40%', '40%'],
+	    			    content: $("#joinServiceAdd")
+	    			});
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+	
+
+}
+
+
+function joinServiceEdit(id){
+	  $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+id,
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  
+	    		  $("#merchant_id").val(id);
+	    		  $("#lib_service_num").html(responseStr.data.merchant.libService);
+	    		  $("#platform_service_num").html(responseStr.data.merchant.platformService);
+	    		  $("#port_num").html(responseStr.data.merchant.portNum);
+	    		  
+	    		  layer.open({
+    			    type: 1,
+    			    title: '管理塾币',
+    			    closeBtn: 1, //不显示关闭按钮
+    			    shift: 0.8,
+    			    offset: '150px',
+    			    area: ['40%', '40%'],
+    			    content: $("#joinServiceEdit")
+	    		 });
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+}
+</script>
+
+<script type="text/javascript">
+
+		function merchantallot(type){
+			var id=$("#merchant_id").val();
+			var title="";
+			if(type==1){
+				title="分配机构塾币";
+			}else{
+				title="分配平台塾币";
+			}
+			layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '150px',
+			    area: ['40%', '40%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAllot.html?id='+id+'&type='+type
+			});
+		}
+
+
+		function savemerchant(id){
+			var title="开通商户";
+			if(id!=null && id!='' && id!=undefined){
+				title="修改商户";
+			}
+			layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['50%', '90%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAdd.html?id='+id
+			});
+		}
+
+
+		function updatemerchant(id,status){  
+			
+			if(status==4){
+				parent.layer.confirm("确定操作删除?", {
+					icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+				}, function(){
+					$.ajax({
+						url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+						type : "post",
+						data : {id:id,status:status},
+						dataType : "json",
+						success : function(data) {
+							if(data.meta.success){
+								parent.layer.msg("操作成功",{icon:1});
+						    	setTimeout(function(){
+						    		location.reload();
+								},1000);
+							}else{
+								alert("操作异常,请刷新后重试...")
+							}
+						}
+					});
+				});
+			}else{
+				
+				$.ajax({
+					url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+					type : "post",
+					data : {id:id,status:status},
+					dataType : "json",
+					success : function(data) {
+						if(data.meta.success){
+							parent.layer.msg("操作成功",{icon:1});
+					    	setTimeout(function(){
+					    		location.reload();
+							},1000);
+						}else{
+							alert("操作异常,请刷新后重试...")
+						}
+					}
+				});
+			}
+		}
+	
+	
+</script>
+
+<script type="text/javascript">
+$("#button").on('click',function(){
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchant";
+	$("#seachform").submit();
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantAllEdit.html";
+});
+
+$("#closeTree").on('click',function(){
+	var display =$('#divTree').css('display');
+	if(display == 'none'){
+		$("#divTree").show();
+		$(".span10").css("width","82.90598290598291%");
+	}else{
+		$("#divTree").hide();
+		$(".span10").css("width","95%");
+	}
+	
+});
+
+
+</script>
+
+
+
+
+</html>

+ 25 - 47
src/main/resources/templates/sys/fx/merchantAllList.html

@@ -288,20 +288,18 @@
 		    	<th >商户账号</th>
 		    	<th >单位名称 </th>
 		    	<th >关联机构 </th>
+		    	<th >商户类别 </th>
 		    	<th >商户类型 </th>
-		    	<th >商户套餐 </th>
-		    	<th >商户模式 </th>
-		    	<th >平台管理费 </th>
-		    	<th style="width: 60px;">服务人数</th>
-		    	<th style="width: 60px;">签约端口数量</th>
-		    	<th style="width: 60px;">剩余机构塾币</th>
+		    	<th >法人姓名 </th>
+		    	<th >法人电话 </th>
+		    	<th >商户代表 </th>
+		    	<th >代表电话 </th>
+		    	<th >甲方签约人 </th>
+		    	<th >合同编号 </th>
+		    	<th >合同签约时间 </th>
 		    	<th style="max-width: 160px;" >合同日期</th>
-<!-- 		    	<th style="width: 60px;" >激活开始日期</th> -->
-<!-- 		    	<th style="width: 60px;" >激活结束日期</th> -->
-<!-- 		    	<th style="width: 60px;" >计费开始日期</th> -->
-		    	<th style="width: 60px;" >服务结束日期</th>
 		    	<th  >状态</th> 
-		        <th  >操作</th> 
+		    	<th  >操作</th> 
 		    </tr> 
 		</thead>
 		<tbody>
@@ -320,37 +318,26 @@
 					   <span th:case="*" >--</span>
 					</td>
 					
-					<td  th:switch="${item.mealType}">
-					   <span th:case="0" >塾币模式</span>
-					   <span th:case="1" >优选套餐</span>
-					   <span th:case="2" >VIP套餐</span>
-					   <span th:case="3" >尊享套餐</span>
-					   <span th:case="4" >校园服务</span>
-					   <span th:case="*" >--</span>
-					</td>
-					
-					<td  th:switch="${item.signType}">
-					   <span th:case="0" >塾币模式</span>
-					   <span th:case="1" >服务包1</span>
-					   <span th:case="2" >服务包2</span>
-					   <span th:case="3" >服务包3</span>
-					   <span th:case="4" >服务包4</span>
-					   <span th:case="5" >服务包5</span>
-					   <span th:case="*" >--</span>
+					<td  th:switch="${item.type}">
+					   <span th:case="1" >直接签约</span>
+					   <span th:case="2" >内部消耗</span>
+					   <span th:case="3" >外部签约</span>
+					   <span th:case="4" >内部不结算</span>
+					   <span th:case="5" >直接签约</span>
 					</td>
 					
-					<td  th:text="${item.posType>1 ? item.outPrice: '--' }"></td>
-					<td  th:text="${item.posType>1 ? item.libService : '--'}"></td>
 					
-					<td  th:text="${item.posType<=1 ? item.portNum : '--' }"></td>
-					<td  th:text="${item.posType<=1 ? item.libService  : '--' }"></td>
 					
+					<td  th:text="${item.legalPerson}"></td>
+					<td  th:text="${item.phone }"></td>
+					<td  th:text="${item.deputyName }"></td>
+					<td  th:text="${item.deputyPhone }"></td>
+					<td  th:text="${item.signerPerson }"></td>
+					<td  th:text="${item.contractNo }"></td>
 					
+					<td  th:text="${item.contractTime!=null ? #calendars.format(item.contractTime,'yyyy-MM-dd'): '--'}" ></td> 
 					<td th:title="${item.signTime!=null ?  #dates.format(item.signTime, 'yyyy-MM-dd')+'~'+#dates.format(item.endSignTime, 'yyyy-MM-dd') : '--' }"  th:text="${item.signTime!=null ?  #dates.format(item.signTime, 'yyyy-MM-dd')+'~'+#dates.format(item.endSignTime, 'yyyy-MM-dd') : '--' }"></td>
-<!-- 					<td  th:text="${item.posType>1 ? #calendars.format(item.startActiveTime,'yyyy-MM-dd'): '--'}" ></td>  -->
-<!-- 					<td  th:text="${item.posType>1 ? #calendars.format(item.activeTime,'yyyy-MM-dd'): '--'}" ></td>  -->
-<!-- 					<td  th:text="${item.posType>1 ? #calendars.format(item.computeTime,'yyyy-MM-dd'): '--'}" ></td>  -->
-					<td  th:text="${item.posType>1 ? #calendars.format(item.endActiveTime,'yyyy-MM-dd'): '--'}" ></td> 
+					
 					<td  th:switch="${item.status}">
 					   <span th:case="1" >冻结&nbsp;</span>
 					   <span th:case="2" >正常&nbsp;</span>
@@ -365,26 +352,17 @@
 							#lists.contains(#httpSession.getAttribute('admin').authorities,'超级管理员角色')  
 						)  }
 						">
-							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'platServiceAdd(\''+${item.id}+'\')'" class="tablelink">管理费</a>
-						
-							<a href="javascript:;" th:if="${item.posType==1 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'joinServiceEdit(\''+${item.id}+'\')'" class="tablelink">塾&nbsp;&nbsp;&nbsp;币</a>
-							<a href="javascript:;" th:if="${item.posType==2 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'libServiceAdd(\''+${item.id}+'\')'" class="tablelink">服务包</a>
-							<a href="javascript:;" th:if="${item.posType==3 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'libServiceScAdd(\''+${item.id}+'\')'" class="tablelink">服务包</a>
-							
-							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'signServiceAdd(\''+${item.id}+'\')'" class="tablelink">加油包</a>
-							
-							<a href="javascript:;" th:if="${item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'updatemerchant(\''+${item.id}+'\',\'1\')'"   class="tablelink">冻结</a>
 							
 							<a href="javascript:;" th:if="${item.posType==1 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantold(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
 							<a href="javascript:;" th:if="${item.posType==2 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchant(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
 							<a href="javascript:;" th:if="${item.posType==3 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantsc(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
 						
+							<a href="javascript:;" th:if="${item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'updatemerchant(\''+${item.id}+'\',\'1\')'"   class="tablelink">冻结</a>
+							
 							<a href="javascript:;" th:if="${item.libId!='' && item.libId!=null && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'untyingmerchant(\''+${item.id}+'\')'"  	class="tablelink">解绑</a>
 						</di>
 						
 					 </td>  
-					
-					
 			</tr>
 		</tbody>
 	</table>