You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

289 lines
8.1 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<title>企业通讯录查询</title>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.datatable.js"></script>
<script id="custom_js" type="text/javascript">
var _sessionUser = $.getSessionUser();
var _op_account_uuid = _sessionUser.account_id;
var _op_person_uuid = _sessionUser.personuuid;
var _op_manage_unit_uuid = _sessionUser.manageunituuid;
var org_attr_scode = $.getURLParam('org_attr_scode');
//grid相关
var _gridcode = "platform.uum.adressbook_01_query";
var _gridid = $.getUUID();
var _node_depart_uuid;
$(function(){
if(org_attr_scode==null || org_attr_scode==""){
alert("请检查url地址,必须传入业务组织类型!");
}else if(org_attr_scode=="01"){
$("#org_type").val('行政组织');
_gridcode = "platform.uum.adressbook_01_query";
}else if(org_attr_scode=="02"){
$("#org_type").val('业务组织');
_gridcode = "platform.uum.adressbook_01_query";
}else if(org_attr_scode=="03"){
$("#org_type").val('工业企业');
_gridcode = "platform.uum.adressbook_02_query";
}
/* $.combobox({
id:"org_type"
,multiple:false
,initvalue:''
,required:false
,editable:false
,showClear:true
,height:25
,width:100
,idField:'id'
,textField:'text'
,data : [
{id : '00', text : '行政组织' , selected : true},
{id : '01', text : '业务组织'},
{id : '02', text : '工业企业'}
]
,initvalue : "",//1,2
onSelect:function(data){
loadOrgTree(data.id);
},
onUnSelect:function(data){
loadOrgTree(data.id);
}
}); */
//加载组织树
loadOrgTree(org_attr_scode);
//表格
initGrid();
});
function loadOrgTree(org_attr_scode){
var queryMethod;
var dataJson;
if (org_attr_scode == '01'){
//组织参数
dataJson = {
op_acc: $.getSessionUser().account_id
,org_uuid : '000000000001389361288407_148_146'
,level: '-1'
,include_self: '0'
,result_fields:'org_uuid,org_code,org_name,parent_uuid,manage_unit_uuid'
,order_expr:' display_order '
};
queryMethod="queryOrgListByParentID"; //方法名
}else if (org_attr_scode == '02'){
//组织参数
dataJson = {
op_acc: $.getSessionUser().account_id
,org_uuid : '000000000001389361288407_148_146'
,org_attr_uuid : '03'
,level: '-1'
,include_self: '0'
,result_fields:'org_uuid,org_code,org_name,parent_uuid,manage_unit_uuid'
,order_expr:' display_order '
};
queryMethod="queryBizOrgListByParentID"; //方法名
}else if (org_attr_scode == '03'){
//组织参数
dataJson = {
op_acc: $.getSessionUser().account_id
,org_uuid : '000000000001389361288407_148_146'
,org_attr_uuid : '08'
,level: '-1'
,include_self: '0'
,result_fields:'org_uuid,org_code,org_name,parent_uuid,manage_unit_uuid'
,order_expr:' display_order '
};
queryMethod="queryBizOrgListByParentID"; //方法名
}
//组织请求数据集
var dataParam = {
_SRVNAME: 'service.usr.org',
_SRVMETHOD: queryMethod,
_DATA: $.json2str(dataJson),
_RSFIELD: 'resultset',//TODO:待确认
_RSTYPE: 'tree',
_RSPARAM: $.json2str({
idField: 'org_uuid'
,textField: 'org_name'
,parentField: 'parent_uuid'
,asyn:'0' //是否是异步 0:同步;1:异步
,asyn_dataField:'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
//加载树
$.tree({
id: 'listtree',
checkbox: false,
expandall: true,
cascadeCheck: false,
asyn: true,
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
onClick:function(event,treeid,node){
//刷新数据
//refreshRightPanel(node);
if(node.open){
$.tree_expand(treeid,node,false);
}else{
$.tree_expand(treeid,node);
}
_node_depart_uuid = node.id;
},
onBeforeExpand:function(treeId,node){
if(node.level==0){
var tree = $.fn.zTree.getZTreeObj(treeId);
var nodes = tree.getNodesByParam("open", 1, null);
for(var i=0;i<nodes.length;i++){
if(nodes[i].level==0){
$.tree_expand(treeId,nodes[i],false);
}
}
}
},
onExpand:function(event,treeId,node){
if(node.level==0){
var h=0;
var tree = $.fn.zTree.getZTreeObj(treeId);
var nodes = tree.getNodesByParam("level", 0, null);
for(var i=0;i<nodes.length;i++){
h+=$("#"+nodes[i].tId+"_a").outerHeight();
}
h = $("#"+treeId).height()-h;
var ul=$("#"+node.tId).find(">ul");
ul.height(h);
}
}
});
}
function initGrid() {
//var queryParams = getGridQueryParam();
$.grid({
id: _gridid,
containerid: 'layout_grid',
gridcode: _gridcode,
singleSelect : true,
fitColumns: false,
nowrap:true, //自动换行
pagination:true,
pageSize:200,
totalRowIndex:0,
formatter: {
}
})
}
//获取grid查询参数
function getGridQueryParam(){
//获取form对象值
var search_bar = $('#search_bar').val();
if(_node_depart_uuid == ""){
_node_depart_uuid = $.getSessionUser().companyuuid;
}
//组织参数
var dataParam = {
_SRVNAME:'service.usr.staff'
,_SRVMETHOD:'pagequeryStaffListByTypeAttr'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,depart_type : org_attr_scode
,depart_uuid : _node_depart_uuid
,search_bar: search_bar
,result_fields:''
})
,_RSTYPE:'grid'
,_RSFIELD:'staff_info'
,_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
function opt_query(){
//alert(_node_depart_uuid);
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
</script>
<style>
li.level0 >span.button,li.level0 >a.level0 >span.button{
display:none;
}
li.level0 >ul{
overflow:auto;
}
ul.level0{
background-image:none !important;
}
a.level0{
height: 20px !important;
color: #fff !important;
background-color: #008c6e !important;
border-color: #008c6e !important;
padding-left: 5px !important;
padding-top:5px !important;
border-bottom:1px solid #fff !important;
display:block !important;
}
a.level0>.node_name{
font-size:15px !important;
}
</style>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'west',border:false,collapsed:false" style="width: 250px;">
<form id="tree_form" >
<div id="listtree" style="width:230px; height:700px; overflow:hidden;border:1px solid #000;">
</div>
</form>
</div>
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:10 10px;overflow:hidden;" >
<form id="search_form" >
<div class="h_layout fixed">
<div>
<div class="inputgroup">
<label>组织类型</label>
<div>
<input id="org_type" name="org_type" disabled/>
</div>
</div>
<div class="inputgroup" >
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="search_bar" name="search_bar"/>
</div>
</div>
</div>
<div >
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-search'" onclick="opt_query()">查询</a>
</div>
</div>
</form>
</div>
<div data-options="region:'center',border:false,collapsed:false">
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'center',border:false,collapsed:false" id="layout_grid"></div>
</div>
</div>
</div>
</div>
</body>