jsp中动态添加全选复选框

<%@ page contentType="text/html; charset=GBK" language="java"  %>
<%@ page import="com.audit.service.ExamineMvoteOrderService" %>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.HashMap" %>
<%@page import="com.order.po.MVoteListOrderPO"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>股东大会订单审核</title>
<link href="<%=request.getContextPath() %>/web/mvote/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath() %>/web/pki/js/pki.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath() %>/web/js/pubjs.js"></script>
	
<script >
	function exitPKI(){
		if(mytest.IsLogin())
		{
			mytest.disaLogout();
		}
		window.location.href="<%=request.getContextPath() %>/auditorder/mvote.do?method=logout";
	} 
	
	function tosel(){
		var selstatus = document.getElementById("selstatus").value;
		window.location.href="<%=request.getContextPath() %>/auditorder/mvote.do?method=listAllMovte&selforstatus="+selstatus; 
	}

	function docheck(){
		var selstatus = document.getElementById("selstatus").value;
		var zlistsize = <%=((List) request.getAttribute("zrtList")).size()%>;
		var page = <%=request.getAttribute("page")%>;
		if(selstatus==<%=MVoteListOrderPO.ORDER_STATUS_SUBMITED%>){
			document.getElementById("chkth").style.display='';
			document.getElementById("btndiv").style.display='';			
			for(var i=0;i<zlistsize;i++){
				var num = (page-1)*10;
				var endid = i+num+1;
				var chkid = "chktd" + endid;
				document.getElementById(chkid).style.display='';
			}
		}
	}
	
	function checkAll(){
		var arrSon = document.getElementsByName("chkSon");
		var allchk = document.getElementById("chkall");
		var tempState=allchk.checked;
		for(var i=0;i<arrSon.length;i++){
			if(arrSon[i].checked!=tempState){
				arrSon[i].click();
				
			}
		}
		doaudite();
	}
	
	function ChkSonClick(){
		var arrSon = document.getElementsByName("chkSon");
		var allchk = document.getElementById("chkall");
		for(var i=0;i<arrSon.length;i++){
			if(!arrSon[i].checked) {
		     allchk.checked = false;
		     return;
		    }
		}
		allchk.checked = true;
		doaudite();
	}

	function doaudite(){
		var chklist = document.getElementsByName("chkSon");
		var arr = new Array();
		for(var i=0;i<chklist.length;i++){
			if(chklist[i].checked == true){
				arr.push(chklist[i].value);
			}
		}
	}
	
	function batchsub(str){
		var chklist = document.getElementsByName("chkSon");
		var num = 0;
		for(var i=0;i<chklist.length;i++){
			if(chklist[i].checked == true){
				num += 1;
			}
		}
		if(num ==0){
			alert("请至少选择一条订单进行审核!");
			return ;
		}
		var arraylist = new Array();
		for(var i=0;i<chklist.length;i++){
			if(chklist[i].checked == true){
				arraylist.push(chklist[i].value);
			}
		}
		window.location.href="<%=request.getContextPath() %>/auditorder/mvote.do?method=batchAudit&submitType="+str+"&arrayls="+arraylist;
	}
	
	function exam(id){
		window.location.href="<%=request.getContextPath() %>/auditorder/mvote.do?method=load&id="+id;
	}
</script>	
<style type="text/css">
table {
	width:700px;
	border-collapse: collapse;
	}
table th {
	background:#EBF1FD;
}
table th,table td {
	padding:4px 3px;
	border: solid 1px #ABBFD7;
	text-align: center;
}

.vote_uplode_btn {
	min-width:80px;
	height:23px;
	background: url("<%=request.getContextPath() %>/web/images/vote_uplode.png") repeat-x;
	border:none;
}
</style>

</head>

<body onload="docheck()">
<OBJECT ID="mytest"
	CLASSID="CLSID:3DE5C04B-916B-40FC-B976-60119CA5EB21"	
	CODEBASE="<%=request.getContextPath() %>/web/pki/ActiveCCM.CAB#version=1,0,6,0" width="0" height="0">
</OBJECT>
<div id="box">
  <div id="main">
	<jsp:include flush="true" page="../orderaudit/auditHeader.jsp"></jsp:include>
	<div class="main">
	<jsp:include flush="true" page="../orderaudit/auditLeft.jsp"></jsp:include>
		<div class="right"><!-- InstanceBeginEditable name="right" -->
		<h1><span>欢迎您,<%=ExamineMvoteOrderService.getInstance().getName(request) %>! <a href="#" onclick="exitPKI();" class="fontback">注销</a></span>股东大会订单审核列表</h1>
			<div class="rightnav">
 			<div >
 					<h2 align="center">&nbsp;</h2>
 					<div style="margin-bottom: 8px;">
 						<dl>
 						订单状态:
 						<select id="selstatus" name="selstatus" >
 							<c:forEach items="${requestScope.statusMap}" var="item" >  
 								<c:if test="${item.key==status}">
 									<option value="${item.key}" selected="selected">${item.value}</option>
 								</c:if> 
 								<c:if test="${item.key!=status}">
 									<option value="${item.key}">${item.value}</option>
 								</c:if>
 								
 							</c:forEach>
 						</select>
 						<input type="button" class="vote_uplode_btn" value="查询" onclick="tosel();" />
 						</dl>
 					</div>
    				<table width="100%">
    					<tr>
    						<th width="30" id="chkth" style="display: none;"><input type="checkbox" name="chkall" id="chkall" onclick="checkAll()"/>全选</th>
    						<th>序号</th>
	     					<th>公司代码</th>
	     					<th width="60">公司简称</th>
	     					<th width="60">券商简称</th>
	     					<th>股东大会名称</th>
	     					<th width="60">代征集日期</th>
	     					<th width="60">股东大会召开日</th>
	     					<th width="60">股权登记日</th>
	     					<th width="40">状态</th>
	     					<th width="100">审核</th>
    					</tr>
    					
    					<logic:notEmpty name="zrtList">
    					<logic:iterate id="zrtList" name="zrtList" indexId="indexid">
     						<tr>
     							<% int pages =(((Integer) request.getAttribute("page")).intValue()-1)*10; %>
     							<td id="chktd<%=indexid.intValue()+1+pages%>" style="display: none;"><input type="checkbox" name="chkSon" id="chk<%=indexid.intValue()+1+pages%>" value='<bean:write name="zrtList" property="id"/>' onclick="ChkSonClick()"/></td>
     							<td><%=indexid.intValue()+1+pages%></td>
     							<td><bean:write name="zrtList" property="gsdm"/></td>
     							<td><bean:write name="zrtList" property="gsjc" /></td>
     							<td><bean:write name="zrtList" property="qsShortName"/></td>
     							<td><bean:write name="zrtList" property="voteName"/></td>
     							<td><bean:write format="yyyy-MM-dd" name="zrtList" property="beginDate"/></td>
     							<td><bean:write format="yyyy-MM-dd" name="zrtList" property="vtEnd"/></td>
     							<td><bean:write format="yyyy-MM-dd" name="zrtList" property="regDate"/></td>
     							<td>
     								<logic:equal name="zrtList" property="status" value="1">待审核</logic:equal>
     								<logic:equal name="zrtList" property="status" value="2">审核通过</logic:equal>
     								<logic:equal name="zrtList" property="status" value="3">审核拒绝</logic:equal>
     								<logic:equal name="zrtList" property="status" value="-2">审核作废</logic:equal>
     							</td>
     							<td>
     								<logic:equal name="zrtList" property="status" value="1">
     									<a href="#" onclick="javascript:exam('<bean:write name="zrtList" property="id"/>')">审核</a>
     								</logic:equal>
     								<logic:equal name="zrtList" property="status" value="2">
     									<a href="#" onclick="javascript:exam('<bean:write name="zrtList" property="id"/>')">查看</a>
     								</logic:equal>
     								<logic:equal name="zrtList" property="status" value="3">
     									<a href="#" onclick="javascript:exam('<bean:write name="zrtList" property="id"/>')">查看</a>
     								</logic:equal>
     								<logic:equal name="zrtList" property="status" value="-2">
     									<a href="#" onclick="javascript:exam('<bean:write name="zrtList" property="id"/>')">查看</a>
     								</logic:equal>
     							</td>
     						</tr>
     					</logic:iterate>
     					</logic:notEmpty> 
     					</table>
     					<div style="margin-top: 10px;">
     						<div id="btndiv" style="float: left;display: none">
	     						<input type="button" class="vote_uplode_btn" name="saveMvote" value="审核通过"   onclick="batchsub('ok');"/>
		   						<input type="button" class="vote_uplode_btn" name="subMvote" value="审核不通过"  onclick="batchsub('no');"/>
     						</div>
     						<div  style="margin-left: 40px;">
     							<%out.println((String)request.getAttribute("pageStr")); %>
							</div>
     					</div>
      			</div>
      		</div>
		</div>
	</div>
	<jsp:include flush="true" page="../mvote/include/mvoteFooter.jsp"></jsp:include>
	</div>
 
</body>
</html>

转载于:https://my.oschina.net/gao0516/blog/102723

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值