<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <%@include file="../../../../../frame/assets/header-all.jsp"%> 
    <script type='text/javascript' src='../../../../../dwr/interface/CheTracingSetService.js'></script>
    <script type='text/javascript' src='../../../../../dwr/interface/VpUserRoleService.js'></script>
    <link rel="stylesheet" type="text/css" href="../../../../resource/css/map.frame.css">

</head>
<body>
<body class="easyui-layout"   onselectstart="return false">
    <div data-options="region:'north'" id='north' style="height: 78px;border: none">
        <div class="left-box fl">
            <div>
                <span class="text-content">布控部门：</span>
                <input class="easyui-combotree" id="LIKEroleName" >
            </div>      
            <div>
                <span class="text-content">布控号牌：</span>
                <input class="easyui-textbox" id="LIKEplateNo" >
            </div>
        </div>
        <div class="right-box fl">                
            <button id="search" onclick="doSearch();">查询</button>
        </div>
    </div>
    <div data-options="region:'center',split:false" class="easyui-layout"  style="border: none">
        <table id="chetracing-tab-grid"></table>
     </div>   

<script type="text/javascript">
$(function(){
    $.fn.pagination.defaults.beforePageText = '';
    $.fn.pagination.defaults.afterPageText = '';
    $.fn.pagination.defaults.showPageList= false;
    $.fn.pagination.defaults.showRefresh= false;
    $.fn.pagination.defaults.displayMsg = ' 共{total}条 , 显示 {from} - {to}条';
    $.fn.pagination.defaults.layout=['first','prev','next','last' ];

    initGrid();
    initRoleTree();
})
//查询
function doSearch(){    
    $('#chetracing-tab-grid').datagrid('load', getQueryParams()); 
}
//查询条件
function getQueryParams(){
    var sParam = {};
    sParam.LIKEplateNo = $('#LIKEplateNo').val();
    sParam.LIKEwholePath = $('#LIKEroleName').combotree('getValue');
    sParam.order = " order by createTime desc ";
    return sParam;
}
function initGrid(){    
    $('#chetracing-tab-grid').datagrid({
       rownumbers:true,
        url : CheTracingSetService.query_CheTracingSet,
        queryParams:getQueryParams(),
        columns : [[
            {field:'roleName',title:'布控部门',hidden:false,width:120},
            {field:'plateNo',title:'布控号牌',hidden:false,width:200}

        ]]
    });
}
//布控部门名称树获取
function initRoleTree(){
    VpUserRoleService.select_VpUserRole({},function(data){
         $('#LIKEroleName').combotree({
                checkbox:false,
                border:false,
                parentField:"fatherId",
                textFiled:"roleName",
                idFiled:"roleId",
                panelWidth:200,
                data:data,
                onLoadSuccess:function(node,data){
                    if(data){
                        $('#LIKEroleName').combotree("setValue",data[0].roleId).combotree("setText", data[0].roleName);
                        initGrid();
                    }
                }
        });
    }); 
}
</script>
</body>
</html> 
