addMissiveNo.jsp复杂js判断--checkbox--json--全选--反选--取消
来源:互联网 发布:三级分销分成算法例子 编辑:程序博客网 时间:2024/05/29 15:09
[align=left][size=large]
<%@ page language="java"import="java.util.*,com.hxkj.commonbusiness.MissiveCombiz.MissiveTypeCombiz,com.hxkj.entity.*"%><%@ page contentType="text/html;charset=utf-8"%><%@ page import="java.util.*"%><%@page import="java.text.SimpleDateFormat"%><%@ include file="../common/taglibs.jsp"%><html:html><%String id = "-1";if (request.getAttribute("id") != null) {id = (String) request.getAttribute("id");}String path = request.getContextPath();//获取公文类别MissiveTypeCombiz misCom = new MissiveTypeCombiz();List<MissiveTypeBean> MissiveTypeBeans = misCom.getMissiveTypeByScope("-1");//全部,包含司发文和部门文pageContext.setAttribute("MissiveTypeBeans", MissiveTypeBeans);Date temp = new Date();SimpleDateFormat sdf = new SimpleDateFormat("yyyy");String tempStr = sdf.format(temp);%><head><link rel="stylesheet" href="<%=path%>/css/gcoa/css.css"><script language="Javascript" src="../../js/ortfunc.js"></script><script language="Javascript" src="../../js/ortfunct.js"></script><script language="Javascript" src="../../js/public.js"></script><!-- 选择部门时需要引入这两个js,从书中获取部门名称以及ID --><script type="text/javascript" src="<%=path%>/js/jquery.js"></script><script type="text/javascript" src="<%=path%>/js/user.js"></script><style type="text/css">.xian {border-bottom: 1px none;border-left: 1px none;border-top: 1px none;border-right: 1px none;text-align: left;font-size: 14px;background-color: ECF4FD;}</style><SCRIPT language="javascript">function saveMissiveNo(){var isTrue = true;var flag=0;var missiveType=document.getElementById("missiveType").value;var orgid=document.getElementById("orgid").value;var year=document.getElementById("year").value;var typeScope=document.getElementById("typeScope").value;//公司:不提示选择部门 if (typeScope == "") { alert( "请选择所属类型!" ); document.forms[0].typeScope.focus(); isTrue=false; }else if(document.forms[0].orgname.value==""&&typeScope!="0"){ alert('请选择部门'); document.forms[0].orgname.focus(); isTrue=false; }else if(document.form.missiveType.length>0) {for (i = 0; i < document.form.missiveType.length; i++) {if (document.form.missiveType[i].checked==true) {flag=1;break;} else {flag=0; }}if(flag==0){alert('请至少选择一个公文类别');document.forms[0].mm.focus();isTrue=false;} } if(document.getElementById("news").checked==true){ if(document.getElementById("dealType").value == ""||document.getElementById("dealType").value ==null){alert('请选择处理类型');document.forms[0].dealType.focus();isTrue=false; } }if(isTrue){ saveMissiveNoAjax(missiveType,orgid,year); document.forms[0].submit(); //新增成功之后重新返回addMissiveNo.jsp页面}}function saveMissiveNoAjax(x,y,z) { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("您的浏览器不支持AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.myForm.time.value=xmlHttp.responseText; } } xmlHttp.open("GET","<%=path%>/pages/MissiveNoManager/index.do?doaction=saveMissiveNo&missiveType="+x+"&orgid="+y+"&year="+z,true);//xz修改,针对ie8正文被锁bug xmlHttp.send(null); } function doChange(f){ if(f.value ==0) { document.getElementById("div").style.display="none"; document.getElementById("good").style.display="block"; document.getElementById("choice").style.display="block"; }else if(f.value ==1){ document.getElementById("div").style.display="block"; document.getElementById("good").style.display="block"; document.getElementById("good").value=""; document.getElementById("choice").style.display="block"; } else{ document.getElementById("div").style.display ="block"; document.getElementById("good").style.display="none"; document.getElementById("good").value=""; } }function getMissiveType(){var typeScope=$('#typeScope').val();if(typeScope==""){ document.getElementById("choice").style.display="none";}$.ajax({type:"POST",dataType:"json",url:"<%=path%>/pages/CommonSession/index.do",data:"doaction=searchByMissiveTypeScope&typeScope="+typeScope,success:function(data){var len=data.length;$('#good').contents().remove();//for循环for(i=0;i<len;i++){$('#good').append("<input type='checkbox' name='missiveType' id='" + data[i].MISSIVE_TYPE_ID + " ' value='" + data[i].MISSIVE_TYPE_ID + "'/>" + data[i].NAME);}//for循环结束}});}function selfMissiveType(){if(document.getElementById("news").checked){ document.getElementById("div3").style.display="block";}if(document.getElementById("old").checked){ document.getElementById("div3").style.display="none";}}//全选、反选、取消//全选function selectAll() {for (i = 0; i < document.form.missiveType.length; i++) {if (!document.form.missiveType[i].checked) {document.form.missiveType[i].checked = true;}}}//反选function selectRerverse() {for (i = 0; i < document.form.missiveType.length; i++) {if (document.form.missiveType[i].checked) {document.form.missiveType[i].checked = false;} else {document.form.missiveType[i].checked = true;}}}//取消function cancelAll() {for (i = 0; i < document.form.missiveType.length; i++) {if (document.form.missiveType[i].checked) {document.form.missiveType[i].checked = false;}}}</SCRIPT></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><form name="form" method="post"action="<%=path%>/pages/missiveManage/addMissiveNo.jsp" target="_self"><input type="hidden" name="id" value="<%=id%>" /><table width="98%" border="0" align="center" cellpadding="0"cellspacing="0" bgcolor="E9ECF5"><tr><td height="26" colspan="2" valign="middle" class="font13"><div align="center"> </div></td><td width="80%" height="26" valign="bottom" class="font13"><div align="right"><a href="javaScript:saveMissiveNo();" target="_self">保存</a> | <a href="<%=path%>/pages/missiveManage/MissiveNoManager.jsp"target="_parent">返回</a></div></td><td width="3%" valign="top" class="font13"><div align="right"><img src="<%=path%>/img/gcoa/tddir0101.gif" width="17" height="14"></div></td></tr></table><table width="98%" border="0" align="center" cellpadding="0"cellspacing="0" bgcolor="E9ECF5"><tr><td valign="top"><div align="center"><table width="95%" border="0" align="center" cellpadding="0"cellspacing="0" class="tablelsdi"><tr><td width="4%" background="<%=path%>/img/gcoa/tablelb01.gif"><img src="<%=path%>/img/gcoa/tablelb01-left.gif" width="21"height="22"></td><td width="82%" background="<%=path%>/img/gcoa/tablelb01.gif"class="font12w">新增公文字号</td><td width="14%" background="<%=path%>/img/gcoa/tablelb01.gif"><div align="right"><img src="<%=path%>/img/gcoa/tablelb01-right.gif" width="21"height="22"></div></td></tr></table><table width="95%" border="0" align="center" cellpadding="0"cellspacing="0" class="tablelb"><tr><td width="15%" height="30" bgcolor="E1EEFD" class="tablex"><div align="right">所属类型 </div></td><td width="55%" height="30" bgcolor="E1EEFD" class="tableleft"> <select name="typeScope" id="typeScope" style="width: 51%"onchange="doChange(this);getMissiveType()"><option value="" selected="selected">--请选择--</option><option value="0">公司</option><option value="1">部门</option></select></td></tr><tr id="div"><td height="30" bgcolor="ECF4FD" class="tablex"><div align="right">部门 </div></td><td height="30" bgcolor="ECF4FD" class="tableleft"> <input type="text" name="orgname" id="orgname"style="width: 40%" class="table" value="" readonly="readonly" /><input type="hidden" name="orgid" id="orgid" value="" /><input type="button" class="botton02" value="选择"onclick="selectorgAll();" /></td></tr><tr><td height="30" bgcolor="E1EEFD" class="tablex"><div align="right">是否新公文类型 </div></td><td height="30" bgcolor="E1EEFD" class="tableleft"> <input type="radio" name="like" id="news" value="1"onclick="selfMissiveType(this)" />是<span style="padding-left: 20px;"></span><input type="radio" name="like" id="old" value="0"onclick="selfMissiveType(this)" checked="checked" />否</td></tr><tr><td width="15%" height="30" bgcolor="ECF4FD" class="tablex"><div align="right" id="mm">公文类别 </div></td><td width="55%" height="30" bgcolor="ECF4FD" class="tableleft"> <div id="good" style="display: none"></div><div id="choice" style="display: none"><br/><font style="size: 5px;">可选操作:</font><spanstyle="padding-left: 15px;"></span><a href="javascript:selectAll()">全选</a><spanstyle="padding-left: 25px;"></span><a href="javascript:selectRerverse()">反选</a><spanstyle="padding-left: 25px;"></span><a href="javascript:cancelAll()">取消</a></div></td></tr><tr id="div3" style="display: none"><td width="15%" height="30" bgcolor="E1EEFD" class="tablex"><div align="right">处理类型 </div></td><td width="55%" height="30" bgcolor="E1EEFD" class="tableleft"> <select name="dealType" id="dealType" style="width: 51%"><option value="" selected="selected">--请选择--</option><option value="1">固定描述类型(年份)X号</option><option value="2">年份第X期(总第N期)</option><option value="3">部门+固定描述类型(年份)X号</option></select></td></tr><tr><td height="30" bgcolor="ECF4FD" class="tablex"><div align="right">年度 </div></td><td height="30" bgcolor="ECF4FD" class="tableleft"> <input type="text" name="year" id="year"value="<%=tempStr + 6%>" readonly="readonly" class="xian"></td></tr></table><br></div></td></tr></table></form></body></html:html>[/size][/align]
0 0
- addMissiveNo.jsp复杂js判断--checkbox--json--全选--反选--取消
- checkbox全选,反选和取消全选
- js判断checkbox至少有一项+checkbox全选反选
- js全选,反选,取消
- JS全选,反选,取消
- JQuery 实现checkbox全选、反选、取消
- Query--checkbox全选/反选/取消
- ListView + CheckBox (全选,反选,取消)
- js 全选,取消全选,反选
- js checkbox全选 反选 取消全部设置表单checkbox复选框勾选
- Android开发CheckBox控件,全选,反选,取消全选
- js实现同名checkbox的全选/全取消和反选
- js checkbox全选 反选 取消全部设置表单html复选框勾选
- JS之全选,反选,取消
- js--复选框--全选、反选、取消
- CheckBox 全选和反选 JS
- js实现checkbox全选,反选,全不选
- js 实现checkbox全选、全不选、反选
- 出现( linker command failed with exit code 1)错误总结
- 下拉列表select中使用ajax的json数据交换格式动态改变div层里面的复选框checkbox值
- 苹果电脑提示打不开 因为它来自身份不明的开发者 不能安装下载的苹果软件解决方法
- Jenkins持续集成遇到的问题
- java基础学习总结——基础语法1
- addMissiveNo.jsp复杂js判断--checkbox--json--全选--反选--取消
- 【支付信息】微信支付 来自 ios编程交流群
- JSP的6个动作
- 谈谈字符集和编码
- python——内置类型——整型 浮点型 字符串 布尔型 空型
- C++从指定目录读取txt文件内容
- BlockingQueue实现类 LinkedBlockingQueue源码分析
- java基础学习总结——基础语法2
- awk_能分段。根据段打印出来、进行匹配、逻辑判断