123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <!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-->
- <style type="text/css">
- .position{
- margin:5px 0px 5px 20px;
- }
- </style>
- <script type="text/javascript">
- var g_pageNo = 1;
- var g_pageSize = 10;
- //数据表格使用
- var g;
- var gridData;
- var gridArray=[];
- function initComplete(){
- g = $("#maingrid").quiGrid({
- columns: [
- { display: '区间类别', name: '', align: 'center', width: "8%",
- render : function(rowdata, rowindex, value, column){
- return "惩罚区间";
- }
- },
- // { display: '用户类型', name: 'userType', align: 'center', width: "8%",
- // render : function(rowdata, rowindex, value, column){
- // if("1"==value)
- // return "自来水户";
- // if("2"==value)
- // return "取水户";
- // }
- // },
- { display: '用户类别', name: 'baseOrgTypeName',align: 'center', width: "8%"},
- { display: '考核区间类别', name: 'sectionType', align: 'center', width: "8%",
- render : function(rowdata, rowindex, value, column){
- if("quarter"==value)
- return "季度考核";
- if("month"==value)
- return "月份考核";
- if("yearhf"==value)
- return "半年考核";
- }
- },
- { display: '状态', name: 'status', align: 'center', width: "8%",
- render : function(rowdata, rowindex, value, column){
- if("0"==value)
- return "<font color=red>禁用</font>";
- if("1"==value)
- return "<font color=blue>启用</font>";
- }
- },
- { display: '创建人', name: 'userName', align: 'center', width: "10%"},
- { display: '创建时间', name: 'createDate', align: 'center', width: "10%"},
- { display: '备注', name: 'remark', align: 'center', width: "20%"},
- { display: '操作', isAllowHide: false, align: 'left', width:"15%",
- render: function (rowdata, rowindex, value, column){
- return '<div class="padding_top4 padding_left20">'
- +'<a href="#" onclick="onEdit(' + rowdata.punishmentId +')"><span class="icon_edit">修改</span></a>'
- +'<a href="#" onclick="onDelete(' + rowdata.punishmentId +')"><span class="icon_remove">删除</span></a>'
- + '</div>';
- }
- }
-
- ],
- toolbar:{
- items:[
- <@pop_perm url="/punishmentSection/editPunishSection.do">
- {text:'新增',click:addUnit,iconClass:'icon_add'},
- </@pop_perm>
- {line:true}
- ]
- },
- data:[],
- rownumbers:true,
- dataAction:'local',
- checkbox:false,
- usePager: false,
- isScroll: false,
- frozen:false,
- height: '100%',
- width:"100%",
- heightDiff:-40,
- detail: { onShowDetail: showBaseSection, height: 'auto' }
-
- });
-
- //显示所选惩罚区间下的区段
- function showBaseSection(row, detailPanel,callback){
- $.post('${ctx}/section/listSection.do',{punishmentId:row.punishmentId},function(result){
- if(result.rows.length > 0){
- var childGrid = document.createElement('div');
- $(detailPanel).append(childGrid);
- var childGrid=$(childGrid).css('margin','5px 0px 5px 55px').quiGrid({
- columns: [
- { display: '区间段', name: 'section', align: 'center',width: "8%"},
- { display: '开始区间(%)', name: 'sectionUpLimit', align: 'center',width: "10%"},
- { display: '结束区间(%)', name: 'sectionLowerLimit', align: 'center',width: "10%"},
- { display: '是否包含开始', name: 'containUp', align: 'center',width: "10%",
- render : function(rowdata, rowindex, value, column){
- if("0"==value)
- return "否";
- if("1"==value)
- return "是";
- }
- } ,
- { display: '是否包含结束', name: 'containLower', align: 'center',width: "10%",
- render : function(rowdata, rowindex, value, column){
- if("0"==value)
- return "否";
- if("1"==value)
- return "是";
- }
- },
- { display: '加价水价', name: 'progressivesPrice', align: 'center',width: "10%"},
- { display: '创建人', name: 'userName', align: 'center',width: "12%"},
- { display: '创建时间', name: 'createTime', align: 'center',width: "10%"},
- { display: '操作', isAllowHide: false, align: 'center', width:"13%",
- render: function (rowdata, rowindex, value, column){
- return '<div class="padding_top4 padding_left20">'
- +'<a href="#" onclick="onEditSection(' + rowdata.sectionId +')"><span class="icon_edit">修改</span></a>'
- +'<a href="#" onclick="onDeleteSection(' + rowdata.sectionId +','+row.punishmentId+')"><span class="icon_remove">删除</span></a>'
- + '</div>';
- }
- }
- ],
- toolbar:{
- items:[
- <@pop_perm url="/section/edit.do">
- {text:'新增',click:function(){addSection(row.punishmentId)},iconClass:'icon_add'},
- </@pop_perm>
- {line:true}
- ]
- },
- isScroll: false,width: '80%', columnWidth: 120,usePager:false,
- url: '${ctx}/section/listSection.do?punishmentId='+ row.punishmentId,
- data: result,
- //onAfterShowData可以自定义回调
- onAfterShowData: callback
- });
- var obj={};
- obj.id=row.punishmentId;
- obj.g=childGrid;
- gridArray.push(obj);
- }
- },"json");
-
- }
- }
-
- //点击分页触发
- $(function(){
- getData(g_pageNo,g_pageSize);
- })
-
- /**初始时通过向后台传递排序id、排序顺序、初始页码、每页条数**/
- function getData(pageNo,pageSize){
- jQuery.post("${ctx}/punishmentSection/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}/punishmentSection/editPunishSection.do?punishmentId="+rowId,
- Title : "编辑惩罚区间",
- Width : 670,
- Height : 600
- });
- }
-
- //新增惩罚区间
- function addUnit() {
- top.Dialog.open({
- URL : "${ctx}/punishmentSection/editPunishSection.do",
- Title : "新增惩罚区间",
- Width : 670,
- Height : 600
- });
- }
-
- //单条记录删除(惩罚区间)
- function onDelete(rowid){
- top.Dialog.confirm("确定要删除该记录吗?",function(){
- //删除记录
- jQuery.post("${ctx}/punishmentSection/delete.do",
- {"ids":rowid},
- function(responseText){
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info);
- resetSearch();
- }else{
- top.Dialog.alert(responseText.info);
- }
-
- },
- "json");
- });
- }
-
- //新增区间
- function addSection(punishmentId) {
- top.Dialog.open({
- URL : "${ctx}/section/edit.do?punishmentId="+punishmentId,
- Title : "新增区间",
- Width : 650,
- Height : 240
- });
- }
-
- //编辑区间
- function onEditSection(rowId) {
- top.Dialog.open({
- URL : "${ctx}/section/edit.do?sectionId="+rowId,
- Title : "编辑区间",
- Width : 650,
- Height : 240
- });
- }
-
-
- //单条记录删除(区间)
- function onDeleteSection(rowid,punishmentId){
- top.Dialog.confirm("确定要删除该记录吗?",function(){
- //删除记录
- jQuery.post("${ctx}/section/delete.do",
- {"ids":rowid},
- function(responseText){
- if(responseText.status=="y"){
- handleResult(punishmentId);
- }else{
- top.Dialog.alert(responseText.info);
- }
-
- },
- "json");
- });
- }
-
- //删除后的提示
- function handleResult(punishmentId){
- top.Dialog.alert("删除成功!");
- //只刷新当前子表
- var childGrid;
- $.each(gridArray,function(idx,item){
- if(item.id==punishmentId){
- childGrid=item.g;
- }
- })
- childGrid.loadData();
- }
-
- //只刷新当前子表
- function refreshChild(punishmentId){
- var childGrid;
- $.each(gridArray,function(idx,item){
- if(item.id==punishmentId){
- childGrid=item.g;
- }
- })
- if(childGrid){
- childGrid.loadData();
- }
- }
- </script>
- </head>
- <body>
- <div>
- <form action="" id="searchForm" method="post">
- <input type="hidden" id="pageNo" name="pageNo" value="1" /> <input
- type="hidden" id="pageSize" name="pageSize" value="10" />
- </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>
|