<%@page import="com.beyondsoft.base.util.SystemUtil"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>查询商户信息</title>
<link href="<%=request.getContextPath()%>/css/main.css" rel="stylesheet"
type="text/css" />
<link href="<%=request.getContextPath()%>/css/base.css" rel="stylesheet"
type="text/css" />
<script src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/js/changecolor.js"></script>
<script language="javascript">
$(document).ready(function(){
//默认值
$.change();
});
</script>
<title>商户黑名单信息管理</title>
</head>
<body>
<div class="rihgt_memu">
<div class="container">
<div class="tab_list">
<h1>商户黑名单信息查询</h1>
</td>
<fieldset class="fieldset">
<legend class="legend" title="test"><span style="padding:6px;">查询条件</span></legend>
<div>
<form action="" name="querForm" id="querFormId" method="post">
<input type="hidden" id="offsetid" value="${offset}"/>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="advance_table" style="border:0;display:block;">
<tr>
<td width="109" align="right" class="gray no_left_border">商户名称</td>
<td width="278"><input type="text" name="merchantName" id="merchantName" value="${merchantTerm.merchantName}" class="input_text_200"/></td>
<td width="93" align="right" class="gray">商户代码</td>
<td width="293" class="no_right_border"><input type="text" name="merchantId" id="merchantId" value="${merchantTerm.merchantId}" class="input_text_200"/></td>
</tr>
<tr>
<td width="109" align="right" class="gray no_left_border">商户状态</td>
<td width="278"><select id="state" name="state" class="drop_list">
<option value="0">--请选择--</option>
<option value="1" <c:if test="${merchantTerm.state == 1}">selected="selected"</c:if>>正常</option>
<option value="-1" <c:if test="${merchantTerm.state == -1}">selected="selected"</c:if>>黑名单</option>
</select></td>
</tr>
<tr height="40">
<td colspan="4" align="right" class="no_left_border no_bottom_border no_right_border">
<div align="center" style="height:35px; clear:both; margin:10px 0 10px 210px;">
<input name="querySub" id="querySub" style="color:#fff;" type="button" class="button_bg2" onMouseOver="this.className='button_bg2_on'" onmouseout="this.className='button_bg2'" onClick="queryMerchant();" value="查询"/>
<input name="sub2" style="color:#fff;" type="button" class="button_bg2" onMouseOver="this.className='button_bg2_on'" onmouseout="this.className='button_bg2'" onClick="quantity();" value="批量列入黑名单"/></div></td>
</tr>
</table>
</form>
</div>
</fieldset>
<div class="table2">
<table width="100%" id="table" class="fieldset" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px;">
<tr>
<th style="text-align:center;">序号</th>
<th>全选<input type="checkbox" name="chkAll" id="chkAll"/></th>
<th style="text-align:center;">注册名称</th>
<th style="text-align:center;">商户代码</th>
<th style="text-align:center;">经营地</th>
<th style="text-align:center;">注册资本</th>
<th style="text-align:center;">企业规模</th>
<th style="text-align:center;">商户级别</th>
<th style="text-align:center;">支付主体</th>
<th style="text-align:center;">网站运营情况</th>
<th style="text-align:center;">联系人</th>
<th style="text-align:center;">商户状态</th>
<th style="text-align:center;">操作</th>
</tr>
<c:set var="temp" value="${offset+1}"></c:set>
<% int i = 0; %>
<c:if test="${page.data.size() != 0 }">
<c:forEach items="${page.data}" var="merchants">
<% if(i%2 == 1){
i++;
%>
<tr>
<td height="39" align="center">${temp}</td>
<c:set var="temp" value="${temp+1}"></c:set>
<td height="39" align="center">
<c:choose>
<c:when test="${merchants.state==-1}">
<input type="checkbox" name="nochbox" value="${merchants.id}" disabled=true/>
</c:when>
<c:otherwise>
<input type="checkbox" id="${merchants.id}yes" name="yesbox" value="${merchants.id}"/>
</c:otherwise>
</c:choose>
</td>
<td align="center">${merchants.merchantName}</td>
<td align="center">${merchants.merchantId}</td>
<td align="center">
<c:if test="${merchants.region == 1}">大陆</c:if>
<c:if test="${merchants.region == 2}">港澳台</c:if>
<c:if test="${merchants.region == 3}">海外</c:if></td>
<td align="center">${merchants.regCapital}</td>
<td align="center">
<c:if test="${merchants.scale == 1}">50人以下</c:if>
<c:if test="${merchants.scale == 2}">51-100人</c:if>
<c:if test="${merchants.scale == 3}">100-500人</c:if>
<c:if test="${merchants.scale == 4}">500人以上</c:if>
</td>
<td align="center">
<c:if test="${merchants.level == 1}">一级商户</c:if>
<c:if test="${merchants.level == 2}">二级商户</c:if>
</td>
<td align="center">
<c:if test="${merchants.paySubject == 1}">企业</c:if>
<c:if test="${merchants.paySubject == 2}">个人</c:if>
<c:if test="${merchants.paySubject == 3}">都有</c:if>
</td>
<td align="center">
<c:if test="${merchants.webStatus == 1}">无</c:if>
<c:if test="${merchants.webStatus == 2}">网站建设中</c:if>
<c:if test="${merchants.webStatus == 3}">已建站未运营</c:if>
<c:if test="${merchants.webStatus == 4}">已运营</c:if>
</td>
<td align="center">${merchants.connector}</td>
<td align="center">
<c:if test="${merchants.state == 1}">未审核</c:if>
<c:if test="${merchants.state == 2}">已审核</c:if>
<c:if test="${merchants.state == -1}">被驳回</c:if>
<c:if test="${merchants.state == -2}">黑名单</c:if>
</td>
<td align="center">
<c:choose>
<c:when test="${merchants.state == -1}">
<a href="javascript:onetOuch('${merchants.id}');"><img src="<%=request.getContextPath()%>/p_w_picpaths/quit_ico.gif" title="解除黑名单" width="13" height="14" class="img" "this.style.cursor= 'hand';"/></a>
</c:when>
<c:otherwise>
<a href="javascript:oneSet('${merchants.id}');"><img src="<%=request.getContextPath()%>/p_w_picpaths/nodel_ico.gif" title="列入黑名单" width="13" height="14" class="img" "this.style.cursor= 'hand';"/></a>
</c:otherwise>
</c:choose>
</td>
</tr>
<%} else {
i++;
%>
<tr class="on">
<td height="39" align="center">${temp}</td>
<c:set var="temp" value="${temp+1}"></c:set>
<td height="39" align="center">
<c:choose>
<c:when test="${merchants.state==-1}">
<input type="checkbox" name="nochbox" value="${merchants.id}" disabled=true/>
</c:when>
<c:otherwise>
<input type="checkbox" id="${merchants.id}yes" name="yesbox" value="${merchants.id}"/>
</c:otherwise>
</c:choose>
</td>
<td align="center">${merchants.merchantName}</td>
<td align="center">${merchants.merchantId}</td>
<td align="center">
<c:if test="${merchants.region == 1}">大陆</c:if>
<c:if test="${merchants.region == 2}">港澳台</c:if>
<c:if test="${merchants.region == 3}">海外</c:if></td>
<td align="center">${merchants.regCapital}</td>
<td align="center">
<c:if test="${merchants.scale == 1}">50人以下</c:if>
<c:if test="${merchants.scale == 2}">51-100人</c:if>
<c:if test="${merchants.scale == 3}">100-500人</c:if>
<c:if test="${merchants.scale == 4}">500人以上</c:if>
</td>
<td align="center">
<c:if test="${merchants.level == 1}">一级商户</c:if>
<c:if test="${merchants.level == 2}">二级商户</c:if>
</td>
<td align="center">
<c:if test="${merchants.paySubject == 1}">企业</c:if>
<c:if test="${merchants.paySubject == 2}">个人</c:if>
<c:if test="${merchants.paySubject == 3}">都有</c:if>
</td>
<td align="center">
<c:if test="${merchants.webStatus == 1}">无</c:if>
<c:if test="${merchants.webStatus == 2}">网站建设中</c:if>
<c:if test="${merchants.webStatus == 3}">已建站未运营</c:if>
<c:if test="${merchants.webStatus == 4}">已运营</c:if>
</td>
<td align="center">${merchants.connector}</td>
<td align="center">
<c:if test="${merchants.state == 1}">未审核</c:if>
<c:if test="${merchants.state == 2}">已审核</c:if>
<c:if test="${merchants.state == -1}">被驳回</c:if>
<c:if test="${merchants.state == -2}">黑名单</c:if>
</td>
<td align="center">
<c:choose>
<c:when test="${merchants.state == -1}">
<a href="javascript:onetOuch('${merchants.id}');"><img src="<%=request.getContextPath()%>/p_w_picpaths/quit_ico.gif" title="解除黑名单" width="13" height="14" class="img" "this.style.cursor= 'hand';"/></a>
</c:when>
<c:otherwise>
<a href="javascript:oneSet('${merchants.id}');"><img src="<%=request.getContextPath()%>/p_w_picpaths/nodel_ico.gif" title="列入黑名单" width="13" height="14" class="img" "this.style.cursor= 'hand';"/></a>
</c:otherwise>
</c:choose>
</td>
</tr>
<%} %>
</c:forEach>
</c:if>
</table>
<!--分页-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:0;margin:10px -2px;">
<tr>
<td width="81%" style="border:0;">
<div style="clear:both;text-align:center; margin-top:10px; margin-bottom:10px;">
<c:if test="${page.totalCount < 1 }">
<span align="center" style="color:red;">暂无符合查询条件的记录</span>
</c:if>
<c:if test="${page.totalCount > 1 }">
<pg:pager items="${page.totalCount}" url="blacklist"
export="currentPageNumber=pageNumber" maxIndexPages="8"
maxPageItems="${page.pageSize}">
<pg:param name="merchantName" value="${merchantTerm.merchantName}" />
<pg:param name="merchantId" value="${merchantTerm.merchantId}" />
<pg:param name="state" value="${merchantTerm.state}" />
<div class="page csBlue">
<ul>
<pg:first>
<li><a href="${pageUrl}">首页</a></li>
</pg:first>
<pg:prev>
<li><a href="${pageUrl}">前一页</a></li>
</pg:prev>
<pg:pages>
<c:choose>
<c:when test="${currentPageNumber eq pageNumber}">
<li class="thisclass">${pageNumber}</li>
</c:when>
<c:otherwise>
<li><a href="${pageUrl}">${pageNumber}</a>
</li>
</c:otherwise>
</c:choose>
</pg:pages>
<pg:next>
<li><a href="${pageUrl}">后一页</a></li>
</pg:next>
<pg:last>
<li><a href="${pageUrl}">尾页</a></li>
</pg:last>
</ul>
<div class="clear"></div>
</div>
<div class="clear"></div>
</pg:pager>
<!--翻页 end-->
</c:if>
</div></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
<script language="javascript">
function queryMerchant() {
document.querFormId.action="<%=request.getContextPath()%>/admin/merchant/blacklist";
querFormId.submit();
}
</script>
<script type="text/javascript">
$(function(){
$("#chkAll").click(function () {//当点击全选框时
var flag = $("#chkAll").prop("checked");//判断全选按钮状态
$("[id$='yes']").each(function () {//查找每一个id以yes结尾的checbox
$(this).prop("checked", flag);//选中或则取消选中
});
});
//如果全部项都勾上了,则全选按钮也勾上,否则反之
$("[id$='yes']").each(function () {
$(this).click(function () {
if ($("[id$='yes']:checked").length == $("[id$='yes']").length)
{$("#chkAll").prop("checked", "checked");}
else
{$("#chkAll").removeProp("checked");}
});
});
});
//批量列入黑名单
function quantity(){
var off = $("#offsetid").val();
var str = $("input[name='yesbox']");
var objarray=str.length;
var chekIds="";
for (var i=0;i<objarray;i++)
{
if(str[i].checked == true)
{
chekIds+=str[i].value+",";
}
}
if(chekIds==""){
alert("请选择需要列入黑名单的商户");
return;
}else{
/*
*表单提交中若带的参数名称与javabean中的对应则系统会自动将这个参数封装到表单bean中(前提是表单提交)
*/
if(confirm("请确定将其选中的列入黑名单")){
document.querFormId.action="<%=request.getContextPath()%>/admin/merchant/executeblack?strid="+chekIds+"&pager.offset="+off;
querFormId.submit();
}
}
}
//单步列入黑名单
function oneSet(id) {
var off = $("#offsetid").val();
var merchantName = $("#merchantName").val();
var merchantid = $("#merchantId").val();
var state = $("#state").val();
if(state == null) {
return;
}
if(confirm("请确定将其列入黑名单")) {
location.href="<%=request.getContextPath()%>/admin/merchant/executeblack?strid="+id+"&merchantName="+merchantName+"&merchantId="+merchantid+"&state="+state+"&pager.offset="+off;
}
}
//单步解除黑名单
function onetOuch(id) {
var off = $("#offsetid").val();
var merchantName = $("#merchantName").val();
var merchantid = $("#merchantId").val();
var state = $("#state").val();
if(state == null) {
return;
}
if(confirm("请确定将其解除黑名单")) {
location.href="<%=request.getContextPath()%>/admin/merchant/executeouch?strid="+id+"&merchantName="+merchantName+"&merchantId="+merchantid+"&state="+state+"&pager.offset="+off;
}
}
</script>
</html>
复选框checkbox全选与否js
原创
©著作权归作者所有:来自51CTO博客作者panguixiang的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:省市级联jquery和jsp
下一篇:权限管理表-小例子

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
复选框 全选
给你个例子:<checkbox name="checkbox" value="1" > 选项1</checkbox><checkbox name="checkbox" value="2" > 选项2</checkbox><br><br><checkb
JavaScript ViewUI i++ javascript -
全选反选复选框js
全选反选复选框js
input 全选反选