maintain.jsp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp" %>
  3. <head>
  4. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
  5. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  6. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  7. <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagrid.js"></script>
  8. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  9. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  10. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  11. <style type="text/css">
  12. </style>
  13. <script type="text/javascript">
  14. function queryData(){
  15. // 对日期进行校验
  16. var checkboolean = checkEndTime();
  17. if(!checkboolean){
  18. return false;
  19. }
  20. var r=confirm("您确认要生成这段时间的数据吗?")
  21. if (r==true) {
  22. // 日期
  23. var startDate = $("#startDate").val();
  24. var endDate = $("#endDate").val();
  25. $("#formView").attr("action", "maintaingenerate.action?startDate="+startDate+"&endDate="+endDate).submit();
  26. }
  27. }
  28. function queryClear(){
  29. $("#startDate").val("");
  30. $("#endDate").val("");
  31. }
  32. function checkEndTime(){
  33. var startDate=$("#startDate").val();
  34. var start=new Date(startDate.replace("-", "/").replace("-", "/"));
  35. var endDate=$("#endDate").val();
  36. var end=new Date(endDate.replace("-", "/").replace("-", "/"));
  37. // 非空验证
  38. if(startDate==null || startDate==""){
  39. alert('开始时间不能为空');
  40. return false;
  41. }
  42. if(endDate==null || endDate==""){
  43. alert('结束时间不能为空');
  44. return false;
  45. }
  46. // 开始结束日期大小验证
  47. if(end<start){
  48. alert('开始日期不能大于结束日期');
  49. return false;
  50. }
  51. // 结束日期必须小于当前日期
  52. var dd = new Date();
  53. dd.setDate(dd.getDate()-1)
  54. if(end>dd){
  55. alert('结束日期必须小于当前日期,不能生成当天的数据');
  56. return false;
  57. }
  58. return true;
  59. }
  60. $(document).ready(function(){
  61. });
  62. </script>
  63. </head>
  64. <body>
  65. <form action="" method="post" id="formView">
  66. </form>
  67. <table width="100%">
  68. <tr>
  69. <td align="left" class="navbar" style="font-size: 12px;">场站统计分析批量生成</td>
  70. </tr>
  71. </table>
  72. <hr/>
  73. <hk:panel id="queryDiv" title="生成时间段" collapsible="true" display="true" colsePanel="false">
  74. <table width="100%" cellpadding="0" cellspacing="0" class="dataform">
  75. <tr>
  76. <td align="left" >
  77. 开始日期:<s:textfield
  78. cssClass="Wdate"
  79. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  80. id="startDate" name="startDate" title="开始日期"/>
  81. 结束日期:<s:textfield
  82. cssClass="Wdate"
  83. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  84. id="endDate" name="endDate" title="结束日期"/>
  85. <input type="button" class="button" onclick="javascript:queryData();" value="执行"/>
  86. <input type="button" class="button" onclick="javascript:queryClear();" value="清空"/>
  87. </td>
  88. </tr>
  89. </table>
  90. </hk:panel>
  91. </form>
  92. </body>