editData.jsp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <head>
  4. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  5. <script language="javascript">
  6. $(function(){
  7. // if('<s:property value="supplier.id" />' != null){
  8. // $("#suppId").val('<s:property value="supplier.id" />');
  9. // changeSelect();
  10. // }
  11. });
  12. function returnIndex(){
  13. $("#f1").attr("action", "index.action").attr("validate", false).submit();
  14. }
  15. function returnEdit(){
  16. $("#f1").attr("action", "editData.action").attr("validate", false).submit();
  17. }
  18. function returnDetail(){
  19. $("#f1").attr("action", "detail.action").attr("validate", false).submit();
  20. }
  21. function save(){
  22. var curDate = new Date();
  23. var windspeed = $("#windspeed").val();
  24. var limitload = $("#limitload").val();
  25. var thisload = $("#thisload").val();
  26. var lossPower = $("#lossPower").val();
  27. // 为空判断
  28. windspeed = windspeed.replace(/\s+/g, "");
  29. /*if(windspeed==""){
  30. alert("当日值不能为空");
  31. return false;
  32. }*/
  33. // 非法数字判断
  34. if(isNaN(windspeed)){
  35. alert("风速必须为数字");
  36. return false;
  37. }if(isNaN(limitload)){
  38. alert("限电负荷必须为数字");
  39. return false;
  40. }if(isNaN(thisload)){
  41. alert("当时负荷必须为数字");
  42. return false;
  43. }if(isNaN(lossPower)){
  44. alert("损失电量必须为数字");
  45. return false;
  46. }
  47. if($("#beginDate").val() > $("#endDate").val()){
  48. alert("恢复时刻不允许小于限电时刻!");
  49. }else if($("#endDate").val() > curDate){
  50. alert("恢复时刻不允许大于当前日期!");
  51. }else{
  52. $("#f1").attr("action", "saveData.action").submit();
  53. }
  54. }
  55. function selectAll(t) {
  56. $("input[name='wtIds']").attr("checked", t.checked);
  57. }
  58. </script>
  59. <style type="text/css">
  60. .mycss {
  61. font-family: "宋体";
  62. font-size: 12px;
  63. color: #000;
  64. text-decoration: none;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <s:form action="" method="post" id="f1">
  70. <lt:token/>
  71. <s:hidden name="page"></s:hidden>
  72. <s:hidden name="pageSize"></s:hidden>
  73. <s:hidden name="mainBrownouts.id"></s:hidden>
  74. <s:hidden name="wfId"></s:hidden>
  75. <table width="100%">
  76. <tr>
  77. <td align="left" class="mycss">
  78. ${mainBrownouts.id==null?"新增限电事件":"修改限电事件" }
  79. </td>
  80. <td align="right">
  81. <input type="button" class="button" value='保存' onclick="javascript:save()"/>
  82. <s:if test="mainBrownouts.id != null">
  83. <input type="button" class="button" value='返回' onclick="javascript:returnDetail()"/>
  84. </s:if>
  85. <s:else>
  86. <input type="button" class="button" value='返回' onclick="javascript:returnIndex()"/>
  87. </s:else>
  88. </td>
  89. </tr>
  90. </table>
  91. <hr />
  92. <s:actionerror cssClass="mycss"/>
  93. <s:actionmessage cssClass="mycss"/>
  94. <!-- 页面修改 开始 -->
  95. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C1C1C1">
  96. <tr>
  97. </tr>
  98. <tr>
  99. <td width="10%" height="26" bgcolor="#efefef"><span class="mycss">限电原因:</span></td>
  100. <td width="40%" bgcolor="#efefef"><span class="mycss"><s:select id="description" name="mainBrownouts.description" cssClass="required"
  101. list="%{#{'大风天气限负荷':'大风天气限负荷','调峰困难限负荷':'调峰困难限负荷','网架结构限负荷':'网架结构限负荷',
  102. '电网事故抢修限负荷':'电网事故抢修限负荷','线路检修限负荷':'线路检修限负荷','热电夜间供热限负荷':'热电夜间供热限负荷'}}" /></span></td>
  103. <td width="10%" height="26" bgcolor="#efefef"><span class="mycss">限电类型:</span></td>
  104. <td width="40%" bgcolor="#efefef"><span class="mycss"><s:if test="mainBrownouts.id == null">
  105. <s:select id="stopTypeId" list="%{#{'停机限电':'停机限电','非停机限电':'非停机限电'}}" name="mainBrownouts.stopTypeId" cssClass="required"/>
  106. </s:if>
  107. <s:else>
  108. <s:property value="mainBrownouts.stopTypeId" />
  109. </s:else></span></td>
  110. </tr>
  111. <tr>
  112. <td width="10%" height="26" bgcolor="#ffffff"><span class="mycss">限电指令:</span></td>
  113. <td width="40%" bgcolor="#ffffff"><span class="mycss"><s:textfield id="brownoutsDirective" name="mainBrownouts.brownoutsDirective" title="限电指令" cssStyle="width:90%"/></span></td>
  114. <td width="10%" height="26" bgcolor="#ffffff"><span class="mycss">当时风速(m/s):</span></td>
  115. <td width="40%" bgcolor="#ffffff"><span class="mycss"><s:textfield id="windspeed" name="mainBrownouts.windspeed" title="当时风速" cssStyle="width:90%" cssClass="numberbox gt0"/></span></td>
  116. </tr>
  117. <tr>
  118. <td width="10%" height="26" bgcolor="#efefef"><span class="mycss">限电负荷(万kW):</span></td>
  119. <td width="40%" bgcolor="#efefef"><span class="mycss"><s:textfield id="limitload" name="mainBrownouts.limitload" title="限电负荷" cssStyle="width:90%" cssClass="numberbox gt0"/></span></td>
  120. <td width="10%" height="26" bgcolor="#efefef"><span class="mycss">当时负荷(万kW):</span></td>
  121. <td width="40%" bgcolor="#efefef"><span class="mycss"><s:textfield id="thisload" name="mainBrownouts.thisload" title="当时负荷" cssStyle="width:90%" cssClass="numberbox gt0"/></span></td>
  122. </tr>
  123. <tr>
  124. <td width="10%" height="26" bgcolor="#ffffff"><span class="mycss">限电时刻:</span></td>
  125. <td width="40%" bgcolor="#ffffff"><span class="mycss"><s:if test="mainBrownouts .id== null">
  126. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  127. id="beginDate" name="beginTime" title="开始日期"/>
  128. </s:if>
  129. <s:else>
  130. <s:date name="mainBrownouts.stopTime" format="yyyy-MM-dd HH:mm:ss"/>
  131. </s:else></span></td>
  132. <td width="10%" height="26" bgcolor="#ffffff"><span class="mycss">恢复时刻:</span></td>
  133. <td width="40%" bgcolor="#ffffff"><span class="mycss"><s:if test="mainBrownouts.id == null">
  134. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  135. id="endDate" name="endTime" title="结束日期"/>
  136. </s:if>
  137. <s:else>
  138. <s:date name="mainBrownouts.startTime" format="yyyy-MM-dd HH:mm:ss"/>
  139. </s:else></span></td>
  140. </tr>
  141. <tr>
  142. <td width="10%" height="26" bgcolor="#efefef"><span class="mycss">损失电量(万kWh):</span></td>
  143. <td colspan="3" width="40%" bgcolor="#efefef"><span class="mycss"><s:textfield cssClass="numberbox gt0" id="lossPower" name="mainBrownouts.lossPower" title="损失电量" maxlength="500" cssStyle="width:90%"/></td>
  144. </tr>
  145. </table>
  146. <s:if test="mainBrownouts.id == null">
  147. <table width="98%">
  148. <tr>
  149. <td>
  150. 选择风机:<input type=checkbox name=ck id=ck onclick=javascript:selectAll(this)></input>(全选)
  151. </td>
  152. </tr>
  153. </table>
  154. <table width="98%">
  155. <tr>
  156. <td>
  157. <div >
  158. <s:checkboxlist list="wts" name="wtIds" listKey="id" listValue="code" theme="xhtml" template="customcheckboxlist.ftl"></s:checkboxlist>
  159. </div>
  160. </td>
  161. </tr>
  162. </table>
  163. </s:if>
  164. <!-- 页面修改 结束 -->
  165. </s:form>
  166. </body>