projectplan.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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()%>/pages/apdata/jqgridDatas.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. a{ /* 统一设置所以样式 */
  13. font-family:Arial;
  14. font-size:12px;
  15. text-align:center;
  16. margin:3px;
  17. }
  18. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  19. color:#000000;
  20. padding:4px 10px 4px 10px;
  21. background-color:#f1f1f1;
  22. text-decoration:none;
  23. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  24. border-left:1px solid #EEEEEE;
  25. border-bottom:1px solid #717171;
  26. border-right:1px solid #717171;
  27. }
  28. a:hover{ /* 鼠标指针经过时的超链接 */
  29. color:#821818; /* 改变文字颜色 */
  30. padding:5px 8px 3px 12px; /* 改变文字位置 */
  31. background-color:#e2c4c9; /* 改变背景色 */
  32. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  33. border-left:1px solid #717171;
  34. border-bottom:1px solid #EEEEEE;
  35. border-right:1px solid #EEEEEE;
  36. }
  37. fieldset legend {
  38. color:#302A2A;
  39. font: bold 16px/2 Verdana, Geneva, sans-serif;
  40. font-weight: bold;
  41. text-align: left;
  42. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  43. }
  44. </style>
  45. <script type="text/javascript">
  46. var fcId = '<s:property value="wfId"/>';
  47. var projectid = '<s:property value="projectid"/>';
  48. function thisPage(){
  49. $("#f1").attr("action","planIndex.action").submit();
  50. }
  51. function addData(){
  52. $("#f1").attr("action","editDatas.action").submit();
  53. }
  54. function editData(id){
  55. var year=$("#year").val();
  56. $("#f1").attr("action","editDatas.action?vo.projectid="+id).submit();
  57. }
  58. function queryData(){
  59. var year = $("#year").val();
  60. var wfId = $("#wfId").val();
  61. var projectid=$("#projectid").val();
  62. var temp="queryData.action?year="+year
  63. //+"&month="+endDate
  64. +"&wfId="+wfId
  65. +"&projectid="+projectid;
  66. var url= encodeURI(encodeURI(temp));
  67. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  68. }
  69. function toExcel() {
  70. var beginDate = $("#year").val();
  71. var wfId = $("#wfId").val();
  72. var projectid=$("#projectid").val();
  73. var temp="projectPlanExcel.action?year="+beginDate
  74. //+"&month="+endDate
  75. +"&wfId="+wfId
  76. +"&projectid="+projectid;
  77. var url= encodeURI(encodeURI(temp));
  78. $('#toexcel').attr('href',url);
  79. }
  80. function changeFc(fcId){
  81. if(fcId!='' && fcId!=null )
  82. {
  83. var url = "changeWindpowerAjax.action?wfId="+fcId;
  84. $.ajax({
  85. type:"post",
  86. url:url,
  87. dataType:"json",
  88. success: function(data){
  89. if(data.length != 0){
  90. eval(data);
  91. $("#projectid").empty();
  92. $("#projectid").append("<option value=''>请选择</option>");
  93. for(var i=0; i<data.length; i++){
  94. $("#projectid").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  95. }
  96. }else{
  97. $("#projectid").empty();
  98. $("#projectid").append("<option value=''>请选择</option>");
  99. }
  100. }
  101. });
  102. }
  103. queryData();
  104. }
  105. $(document).ready(function () {
  106. showJqGrid();
  107. });
  108. function showJqGrid() {
  109. var year = $("#year").val();
  110. var wfId = $("#wfId").val();
  111. var projectid=$("#projectid").val();
  112. var temp="queryData.action?year="+year
  113. //+"&month="+endDate
  114. +"&wfId="+wfId
  115. +"&projectid="+projectid;
  116. var url= encodeURI(encodeURI(temp));
  117. var id = 'gridTable';
  118. var datatype = 'json';
  119. var colNames = ['编号','名称', '年', '1月','2月','3月','4月', '5月','6月','7月','8月', '9月','10月','11月','12月','合计'];
  120. var colModel = [
  121. { name: 'id', index: 'id', width: 150, align: 'center', hidden:true, frozen : true},
  122. { name: 'projectName', index: 'projectName', width: 150, align: 'center', frozen : true},
  123. { name: 'year', index: 'year', width: 150, align: 'center'},
  124. { name: 'gc01', index: 'gc01', width: 150, align: 'center'},
  125. { name: 'gc02', index: 'gc02', width: 150, align: 'center'},
  126. { name: 'gc03', index: 'gc03', width: 150, align: 'center'},
  127. { name: 'gc04', index: 'gc04', width: 150, align: 'center'},
  128. { name: 'gc05', index: 'gc05', width: 150, align: 'center'},
  129. { name: 'gc06', index: 'gc06', width: 150, align: 'center'},
  130. { name: 'gc07', index: 'gc07', width: 150, align: 'center'},
  131. { name: 'gc08', index: 'gc08', width: 150, align: 'center'},
  132. { name: 'gc09', index: 'gc09', width: 150, align: 'center'},
  133. { name: 'gc10', index: 'gc10', width: 150, align: 'center'},
  134. { name: 'gc11', index: 'gc11', width: 150, align: 'center'},
  135. { name: 'gc12', index: 'gc12', width: 150, align: 'center'},
  136. { name: 'generatingcapacity', index: 'generatingcapacity', width: 150, align: 'center'}
  137. ];
  138. var caption = '计划发电量列表';
  139. var sortname = 'projectName';
  140. var gridPagerID ='gridPager';
  141. var sortorder='desc';
  142. var height='auto';
  143. var width='1500';
  144. var rownumbers=true;
  145. var multiselect=false;
  146. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  147. multiselect,rownumbers);
  148. $("#gridTable").jqGrid('setFrozenColumns');
  149. }
  150. </script>
  151. <style type="text/css">
  152. fieldset legend {
  153. color:#302A2A;
  154. font: bold 16px/2 Verdana, Geneva, sans-serif;
  155. font-weight: bold;
  156. text-align: left;
  157. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  158. }
  159. </style>
  160. </head>
  161. <body>
  162. <form action="fittingtopindex.action" method="post" id="f1">
  163. <fieldset style="height: 60px" id="fst">
  164. <legend class="item_Name">查询条件</legend>
  165. <table class="item_Name">
  166. <tr>
  167. <th width="10%">
  168. 风场:
  169. </th>
  170. <td width="20%" >
  171. <s:select list="windpowers" cssStyle="width:90%" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:changeFc(this.value);" ></s:select>
  172. </td>
  173. <th width="10%">
  174. 项目:
  175. </th>
  176. <td width="20%">
  177. <select name="projectid" id="projectid" style="width:90%" onchange="javascript:queryData();">
  178. <option value="">请选择</option>
  179. </select>
  180. </td>
  181. <th width="5%">
  182. 年:
  183. </th>
  184. <td width="20%" style="text-align: left">
  185. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy',isShowWeek:true,readOnly:true})"
  186. id="year" name="year" title="年" onchange="javascript:queryData();"/>
  187. </td>
  188. <td width="200px" style="text-align: right">
  189. <a href="#" id="test" onclick="javascript:queryData();" >查询</a>
  190. <a href="#" id="test" onclick="javascript:addData();" >新增</a>
  191. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  192. </td>
  193. </tr>
  194. </table>
  195. </fieldset>
  196. <br/>
  197. <table id='gridTable' height="100%">
  198. </table>
  199. <div id='gridPager'></div>
  200. </form>
  201. </body>