water-property-list.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>用水性质信息列表</title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="${ctx}/qui/libs/js/framework.js"></script>
  9. <link href="${ctx}/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  10. <link rel="stylesheet" type="text/css" id="skin" prePath="${ctx}/qui/"/>
  11. <link rel="stylesheet" type="text/css" id="customSkin"/>
  12. <!--框架必需end-->
  13. <!--数据表格start-->
  14. <script src="${ctx}/qui/libs/js/table/quiGrid.js" type="text/javascript"></script>
  15. <!--数据表格end-->
  16. <!--箭头分页start-->
  17. <script type="text/javascript" src="${ctx}/qui/libs/js/nav/pageArrow.js"></script>
  18. <!--箭头分页end-->
  19. <!--表单异步提交start-->
  20. <script src="${ctx}/qui/libs/js/form/form.js" type="text/javascript"></script>
  21. <!--表单异步提交end-->
  22. <script type="text/javascript">
  23. var g_pageNo = 1;
  24. var g_pageSize = 10;
  25. //数据表格使用
  26. var g;
  27. var gridData;
  28. function initComplete(){
  29. g = $("#maingrid").quiGrid({
  30. columns: [
  31. { display: '编号', name: 'number', align: 'center', width: "8%"},
  32. { display: '用水性质名称', name: 'propertiesName', align: 'center', width: "8%"},
  33. // { display: '水价', name: 'waterPrices', align: 'center', width: "8%"},
  34. { display: '一月水价', name: 'janPrice', align: 'center', width: "4%"},
  35. { display: '二月水价', name: 'febPrice', align: 'center', width: "4%"},
  36. { display: '三月水价', name: 'marPrice', align: 'center', width: "4%"},
  37. { display: '四月水价', name: 'aprPrice', align: 'center', width: "4%"},
  38. { display: '五月水价', name: 'mayPrice', align: 'center', width: "4%"},
  39. { display: '六月水价', name: 'junPrice', align: 'center', width: "4%"},
  40. { display: '七月水价', name: 'julPrice', align: 'center', width: "4%"},
  41. { display: '八月水价', name: 'augPrice', align: 'center', width: "4%"},
  42. { display: '九月水价', name: 'septPrice', align: 'center', width: "4%"},
  43. { display: '十月水价', name: 'octPrice', align: 'center', width: "4%"},
  44. { display: '十一月水价', name: 'novPrice', align: 'center', width: "4%"},
  45. { display: '十二月水价', name: 'decPrice', align: 'center', width: "4%"},
  46. { display: '创建人', name: 'userName', align: 'center', width: "8%"},
  47. { display: '创建时间', name: 'createDate', align: 'center', width: "8%"},
  48. { display: '备注', name: 'remark', align: 'center', width: "8%"},
  49. { display: '操作', isAllowHide: false, align: 'left', width:"10%",
  50. render: function (rowdata, rowindex, value, column){
  51. return '<div class="padding_top4 padding_left20">'
  52. +'<a href="#" onclick="onEdit(' + rowdata.propertiesId +')"><span class="icon_edit">修改</span></a>'
  53. +'<a href="#" onclick="onDelete(' + rowdata.propertiesId +')"><span class="icon_remove">删除</span></a>'
  54. + '</div>';
  55. }
  56. }
  57. ],
  58. toolbar:{
  59. items:[
  60. <@pop_perm url="/waterProperties/edit.do">
  61. {text:'新增',click:addUnit,iconClass:'icon_add'},
  62. </@pop_perm>
  63. {line:true}
  64. ]
  65. },
  66. data:[],rownumbers:true,dataAction:'local',checkbox:false,usePager: false,
  67. height: '100%', width:"100%",heightDiff:-40
  68. });
  69. }
  70. $(function(){
  71. getData(g_pageNo,g_pageSize);
  72. });
  73. /**初始时通过向后台传递排序id、排序顺序、初始页码、每页条数**/
  74. function getData(pageNo,pageSize){
  75. jQuery.post("${ctx}/waterProperties/listPage.do",
  76. getFormParams(pageNo,pageSize),
  77. function(result){
  78. gridData = result;
  79. //刷新表格
  80. g.loadData(gridData);
  81. //设置左边内容页
  82. var content ="共有" + gridData["pager.totalRows"] + "条记录";
  83. $("#letfContent").html("");
  84. $("#letfContent").html(content);
  85. //取得分页组件
  86. var pager=$("#pager");
  87. //设置总页页数
  88. pager.attr("total",gridData["pager.totalRows"]);
  89. pager.render();
  90. //绑定翻页事件
  91. pager.unbind("pageChange");
  92. pager.bind("pageChange",function(e,index){
  93. g_pageNo = index + 1;
  94. getData(g_pageNo,g_pageSize);
  95. });
  96. //绑定选择每页显示记录数事件
  97. pager.bind("sizeChange",function(e,num){
  98. g_pageSize = num;
  99. getData(g_pageNo,g_pageSize);
  100. });
  101. },"json");
  102. }
  103. //查询
  104. function searchHandler(){
  105. //重新加载数据,设置当前页面为1
  106. getData(1,g_pageSize);
  107. }
  108. /**获得查询表单的提交查询的值**/
  109. function getFormParams(pageNo,pageSize){
  110. $("#pageNo").val(pageNo);
  111. $("#pageSize").val(pageSize);
  112. return $("#searchForm").formToArray();
  113. }
  114. /**重置于查询表单,然后重新加载表格数据**/
  115. function resetSearch(){
  116. $("#searchForm")[0].reset();
  117. //重新加载数据,设置当前页面为1
  118. getData(1,g_pageSize);
  119. }
  120. //编辑
  121. function onEdit(rowId) {
  122. top.Dialog.open({
  123. URL : "${ctx}/waterProperties/edit.do?propertiesId="+rowId,
  124. Title : "编辑用水性质",
  125. Width : 600,
  126. Height : 500
  127. });
  128. }
  129. //新增
  130. function addUnit() {
  131. top.Dialog.open({
  132. URL : "${ctx}/waterProperties/edit.do",
  133. Title : "新增用水性质",
  134. Width : 600,
  135. Height : 500
  136. });
  137. }
  138. //单条记录删除
  139. function onDelete(rowid){
  140. top.Dialog.confirm("确定要删除该记录吗?",function(){
  141. //删除记录
  142. jQuery.post("${ctx}/waterProperties/delete.do",
  143. {"ids":rowid},
  144. function(responseText){
  145. if(responseText.status=="y"){
  146. top.Dialog.alert(responseText.info);
  147. resetSearch();
  148. }else{
  149. top.Dialog.alert(responseText.info);
  150. }
  151. },
  152. "json");
  153. });
  154. }
  155. </script>
  156. </head>
  157. <body>
  158. <div class="box2" panelTitle="用水性质信息列表">
  159. <form action="" id="searchForm" method="post">
  160. <input type="hidden" id="pageNo" name="pageNo" value="1"/>
  161. <input type="hidden" id="pageSize" name="pageSize" value="10"/>
  162. <table>
  163. <tr>
  164. <td>项目用水性质名称:</td>
  165. <td>
  166. <input type="text" id="Q_propertiesName_S_LK" name="Q_propertiesName_S_LK" />
  167. </td>
  168. <td>编号:</td>
  169. <td>
  170. <input type="text" id="Q_number_S_LK" name="Q_number_S_LK" />
  171. </td>
  172. <td><button type="button" onclick="searchHandler()"><span class="icon_find">查询</span></button></td>
  173. <td><button type="button" onclick="resetSearch()"><span class="icon_reload">重置</span></button></td>
  174. </tr>
  175. </table>
  176. </form>
  177. </div>
  178. <div id="scrollContent">
  179. <div class="padding_right5">
  180. <div id="maingrid"></div>
  181. </div>
  182. </div>
  183. <!-- 分页组件 -->
  184. <div style="height:35px;">
  185. <div id="letfContent" class="float_left padding5"></div>
  186. <div class="float_right padding5">
  187. <div id="pager" total="0" class="pageArrow" showSelect="true" inputPosition="right"></div>
  188. </div>
  189. <div class="clear"></div>
  190. </div>
  191. </body>
  192. </html>