ComplianceServer/oldcode/WEB/Views/Base/Company/OrganizationMap.cshtml

77 lines
3.0 KiB
Plaintext

@using WX.CRM.WebHelper
@{
ViewBag.Title = "公司结构图";
Layout = "~/Views/Shared/_EasyUI_Layout.cshtml";
}
@*<div data-options="region:'north',border:false" style="height:30px;">
@Html.Action("ToolBar", "Base", ViewBag.ToolBar as ToolBar)
</div>*@
<div data-options="region:'west',split:true" style="width:200px;border-left:none;border-bottom:none;border-top:none;">
<div class="easyui-accordion" data-options="fit:true" style="border:none">
<input id="searchText" style="width:97%;height:20px" oninput="SearchInput(event)"/>
<div title="业务部门" style="overflow:auto;">
<ul id="ultree"></ul>
</div>
</div>
</div>
<div data-options="region:'center'" style="border-right: none; border-bottom: none; ">
<iframe id="ifUser" frameborder="0" style="width:100%; height:100%;" scrolling="no"></iframe>
</div>
<script type="text/javascript">
$(function () {
$('#ultree').tree({
onClick: function (node) {
var url = "/Base/InnerUser/OrganizationMapUser?urlTitle=" + node.text + "&";
@* if (node.id.toString().indexOf("sale_") > -1) {
departments = GetNewGroups(1);
url += "type=g&fid=" + departments;
} else {
departments = GetNewGroups(2)
url += "type=u&fid=" + departments;
}*@
url += "type=u&fid=" + GetNewGroups();
$("#ifUser").attr("src", url)
},
url: "/Base/InnerGroup/GetTreeList?type=2&hasuser=true"
});
});
function SearchInput(e) {
var searchVal = $('#searchText').val();
$('#ultree').tree({
url: "/Base/InnerGroup/GetTreeList?type=2&hasuser=true&filterStr=" + searchVal
});
}
function GetNewGroups() {
var node = $("#ultree").tree("getSelected");
var tree = $("#ultree").tree;
var isLeaf = tree('isLeaf', node.target);
var gorupidvalues = "";
gorupidvalues = node.id.toString().replace("sale_", "") + ",";
@*if (!isLeaf) {//不是最底层
var child = $("#ultree").tree("getChildren", node.target);
if (node.id != 0 && child != null) {
for (var i = 0; i < child.length; i++) {
if (filterType == 1) {
if (child[i].id.toString().indexOf("sale_") == -1) {
continue;
}
gorupidvalues += child[i].id.replace("sale_", "") + ","
} else {
if (child[i].id.toString().indexOf("com_") == -1 && child[i].id.toString().indexOf("sale_") == -1)
gorupidvalues += child[i].id + ","
}
}
}
}*@
if (gorupidvalues.length > 0)
return gorupidvalues.substr(0, gorupidvalues.length - 1);
else
return "-1";
}
</script>