123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>用水性质信息列表</title>
- <!--框架必需start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/qui/libs/js/framework.js"></script>
- <link href="${ctx}/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="${ctx}/qui/"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <!--数据表格start-->
- <script src="${ctx}/qui/libs/js/table/quiGrid.js" type="text/javascript"></script>
- <!--数据表格end-->
- <!--箭头分页start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/nav/pageArrow.js"></script>
- <!--箭头分页end-->
- <!--表单异步提交start-->
- <script src="${ctx}/qui/libs/js/form/form.js" type="text/javascript"></script>
- <!--表单异步提交end-->
- <script type="text/javascript">
- var g_pageNo = 1;
- var g_pageSize = 10;
- //数据表格使用
- var g;
- var gridData;
- function initComplete(){
- g = $("#maingrid").quiGrid({
- columns: [
- { display: '编号', name: 'number', align: 'center', width: "8%"},
- { display: '用水性质名称', name: 'propertiesName', align: 'center', width: "8%"},
- // { display: '水价', name: 'waterPrices', align: 'center', width: "8%"},
- { display: '一月水价', name: 'janPrice', align: 'center', width: "4%"},
- { display: '二月水价', name: 'febPrice', align: 'center', width: "4%"},
- { display: '三月水价', name: 'marPrice', align: 'center', width: "4%"},
- { display: '四月水价', name: 'aprPrice', align: 'center', width: "4%"},
- { display: '五月水价', name: 'mayPrice', align: 'center', width: "4%"},
- { display: '六月水价', name: 'junPrice', align: 'center', width: "4%"},
- { display: '七月水价', name: 'julPrice', align: 'center', width: "4%"},
- { display: '八月水价', name: 'augPrice', align: 'center', width: "4%"},
- { display: '九月水价', name: 'septPrice', align: 'center', width: "4%"},
- { display: '十月水价', name: 'octPrice', align: 'center', width: "4%"},
- { display: '十一月水价', name: 'novPrice', align: 'center', width: "4%"},
- { display: '十二月水价', name: 'decPrice', align: 'center', width: "4%"},
- { display: '创建人', name: 'userName', align: 'center', width: "8%"},
- { display: '创建时间', name: 'createDate', align: 'center', width: "8%"},
- { display: '备注', name: 'remark', align: 'center', width: "8%"},
- { display: '操作', isAllowHide: false, align: 'left', width:"10%",
- render: function (rowdata, rowindex, value, column){
- return '<div class="padding_top4 padding_left20">'
- +'<a href="#" onclick="onEdit(' + rowdata.propertiesId +')"><span class="icon_edit">修改</span></a>'
- +'<a href="#" onclick="onDelete(' + rowdata.propertiesId +')"><span class="icon_remove">删除</span></a>'
- + '</div>';
- }
- }
- ],
- toolbar:{
- items:[
- <@pop_perm url="/waterProperties/edit.do">
- {text:'新增',click:addUnit,iconClass:'icon_add'},
- </@pop_perm>
- {line:true}
- ]
- },
- data:[],rownumbers:true,dataAction:'local',checkbox:false,usePager: false,
- height: '100%', width:"100%",heightDiff:-40
- });
- }
-
- $(function(){
- getData(g_pageNo,g_pageSize);
- });
-
- /**初始时通过向后台传递排序id、排序顺序、初始页码、每页条数**/
- function getData(pageNo,pageSize){
- jQuery.post("${ctx}/waterProperties/listPage.do",
- getFormParams(pageNo,pageSize),
- function(result){
- gridData = result;
- //刷新表格
- g.loadData(gridData);
- //设置左边内容页
- var content ="共有" + gridData["pager.totalRows"] + "条记录";
- $("#letfContent").html("");
- $("#letfContent").html(content);
- //取得分页组件
- var pager=$("#pager");
- //设置总页页数
- pager.attr("total",gridData["pager.totalRows"]);
- pager.render();
- //绑定翻页事件
- pager.unbind("pageChange");
- pager.bind("pageChange",function(e,index){
- g_pageNo = index + 1;
- getData(g_pageNo,g_pageSize);
- });
- //绑定选择每页显示记录数事件
- pager.bind("sizeChange",function(e,num){
- g_pageSize = num;
- getData(g_pageNo,g_pageSize);
- });
- },"json");
- }
-
-
- //查询
- function searchHandler(){
- //重新加载数据,设置当前页面为1
- getData(1,g_pageSize);
- }
-
- /**获得查询表单的提交查询的值**/
- function getFormParams(pageNo,pageSize){
- $("#pageNo").val(pageNo);
- $("#pageSize").val(pageSize);
- return $("#searchForm").formToArray();
- }
-
- /**重置于查询表单,然后重新加载表格数据**/
- function resetSearch(){
- $("#searchForm")[0].reset();
- //重新加载数据,设置当前页面为1
- getData(1,g_pageSize);
- }
-
- //编辑
- function onEdit(rowId) {
- top.Dialog.open({
- URL : "${ctx}/waterProperties/edit.do?propertiesId="+rowId,
- Title : "编辑用水性质",
- Width : 600,
- Height : 500
- });
- }
-
- //新增
- function addUnit() {
- top.Dialog.open({
- URL : "${ctx}/waterProperties/edit.do",
- Title : "新增用水性质",
- Width : 600,
- Height : 500
- });
- }
- //单条记录删除
- function onDelete(rowid){
- top.Dialog.confirm("确定要删除该记录吗?",function(){
- //删除记录
- jQuery.post("${ctx}/waterProperties/delete.do",
- {"ids":rowid},
- function(responseText){
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info);
- resetSearch();
- }else{
- top.Dialog.alert(responseText.info);
- }
-
- },
- "json");
- });
- }
- </script>
- </head>
- <body>
- <div class="box2" panelTitle="用水性质信息列表">
- <form action="" id="searchForm" method="post">
- <input type="hidden" id="pageNo" name="pageNo" value="1"/>
- <input type="hidden" id="pageSize" name="pageSize" value="10"/>
- <table>
- <tr>
- <td>项目用水性质名称:</td>
- <td>
- <input type="text" id="Q_propertiesName_S_LK" name="Q_propertiesName_S_LK" />
- </td>
- <td>编号:</td>
- <td>
- <input type="text" id="Q_number_S_LK" name="Q_number_S_LK" />
- </td>
- <td><button type="button" onclick="searchHandler()"><span class="icon_find">查询</span></button></td>
- <td><button type="button" onclick="resetSearch()"><span class="icon_reload">重置</span></button></td>
- </tr>
- </table>
- </form>
- </div>
- <div id="scrollContent">
- <div class="padding_right5">
- <div id="maingrid"></div>
- </div>
- </div>
- <!-- 分页组件 -->
- <div style="height:35px;">
- <div id="letfContent" class="float_left padding5"></div>
- <div class="float_right padding5">
- <div id="pager" total="0" class="pageArrow" showSelect="true" inputPosition="right"></div>
- </div>
- <div class="clear"></div>
- </div>
- </body>
- </html>
|