点击后面的对账详情,会在easyUI上面打开一个tab页,在每次都打开对应的tab页。

function showExceptionDetails(value, row) {
        var searchReconType = $('#searchReconType').combobox('getValue');
        if(row!=null && row.reconDate != "" && row.reconFinishTime != ""){
            return "<a href=\"javascript:void(0)\" title=\"显示对账结果管理\" name=\"exceptionDetails\" onclick=\"self.parent.addTab('"+"对账结果管理:".concat(row.batchNo)+"','/htm/reconResult.htm?batchNo=" +row.batchNo+ "&searchReconTimeStart="+ timeStamp2DateTime(row.reconDate) +"&searchReconTimeEnd="+ timeStamp2DateTime(row.reconFinishTime) +"&searchReconType="+ searchReconType +"','icon-add')\" >"+"差错详情"+"</a>";
        }else {
            return "<a href=\"javascript:void(0)\" title=\"显示对账结果管理\" name=\"exceptionDetails\" onclick=\"self.parent.addTab('" + "对账结果管理:".concat(row.batchNo) + "','/htm/reconResult.htm?batchNo=" + row.batchNo + "','icon-add')\" >" + "差错详情" + "</a>";
        }
    }

这点可以对easyUI中datagrid中的数据进行初始化,通过formtter函数

<table id="dg" class="easyui-datagrid" title="存管 -- 对账批次管理" singleSelect="true" fitColumns="true" nowrap="false" striped="true"
       SelectOnCheck="true" CheckOnSelect="true" rownumbers="true" pagination="true" pageSize="50" pageList="[50, 100, 200]" toolbar="#tb" fit="true">
    <thead>
    <tr>
        <th field="select" align="center" checkbox="true"></th>
        <th field="batchNo" align="center" width="10%">批次号</th>
        <th field="reconDate" align="center" width="10%" formatter="timeStamp2DateTime">对账日期</th>
        <th field="payChannel" align="center" width="9%" formatter="showPayChannel">支付渠道</th>
        <th field="reconType" align="center" width="9%" formatter="showReconType">对账类型</th>
        <th field="reconFinishTime" align="center" width="15%" formatter="timeStampDateTime2">对账完成时间</th>
        <th field="totalCount" align="center" width="10%">笑脸订单笔数</th>
        <th field="errorCount" align="center" width="7%">差错笔数</th>
        <th field="reconStatus" align="center" width="10%" formatter="showReconStatus">批次对账结果</th>
        <th field="remark" align="center" width="10%">备注</th>
        <th field="exceptionDetails" align="center" width="7%" formatter="showExceptionDetails">异常明细</th>
    </tr>
    </thead>
</table>

该地方就可以对显示的数据进行初始化显示,当我们点击差错详情的时候,会打开差错详情的tab页

easyUI打开tab页面

在跳转的时候,将批次号、对账时间和对账类型传递过去之后,在页面加载的时候,需要进行初始化,

$(function(){
        $("#dg").parent().find("div.datagrid-header-check").children("input[type='checkbox']").eq(0).attr("style", "display:none;");
        $("#searchReconTimeStart").datebox("setValue", currNDate(1));//默认1天前
        $("#searchReconTimeEnd").datebox("setValue", currNDate(1));//默认1天前
        var batchNo = getQueryString("batchNo");
        var searchReconTimeStart = getQueryString("searchReconTimeStart");
        var searchReconType = getQueryString("searchReconType");
        if(batchNo != null && batchNo != ""){
            $("#searchBatchNo").textbox("setValue",batchNo);
        }
        if(searchReconTimeStart != null && searchReconTimeStart != ""){
            $("#searchReconTimeStart").datebox("setValue",searchReconTimeStart);
            $("#searchReconTimeEnd").datebox("setValue",searchReconTimeStart);
        }
        if(searchReconType != null){
            $("#searchReconType").combobox("setValue", searchReconType);
        }

        //翻页控件,已支持分页
        $("#dg").datagrid().datagrid("getPager").pagination({
            //改变pageSize会执行 onChangePageSize,onSelectPage
            //点上一页或下一页只会执行 onSelectPage
            //刷新会执行 onSelectPage,onRefresh。所以删掉了onRefresh
            onChangePageSize: function(pageSize) {
                $("#pageSize").val(pageSize);
            },
            onSelectPage: function(pageNumber, pageSize) {
                $("#pageSize").val(pageSize);
                $("#pageNumber").val(pageNumber);
                datagridBind();
            },
            beforePageText: '第',
            afterPageText: '共{pages}页',
            displayMsg: '显示{from}到{to}条记录,共{total}条记录&nbsp;&nbsp;&nbsp;&nbsp;'//已支持分页,重新调整显示文字
        });
        datagridBind();
    });

因为我是通过URL传递这些初始值,所以在初始化的时候需要获取到URL中相对应的值,

function getQueryString(name){
        var reg = new RegExp('(^|&)'+name+'=([^&]*)(&|$)','i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

 

相关文章:

  • 2021-08-09
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案