89 lines
3.5 KiB
Plaintext
89 lines
3.5 KiB
Plaintext
@using WX.CRM.WebHelper;
|
|
@{
|
|
ViewBag.Title = "bas_innerDepartment";
|
|
Layout = "~/Views/Shared/_EasyUI_Layout.cshtml";
|
|
}
|
|
<style>
|
|
.panel-body {
|
|
border:none;
|
|
}
|
|
</style>
|
|
<div data-options="region:'north',border:false" style="height:53px;">
|
|
<div class="mvctool">
|
|
@*@Html.ToolButtonPlain("btnQuery", "icon-search", "查询", false, "")*@
|
|
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
|
</div>
|
|
</div>
|
|
<div data-options="region:'center',split:true" style="width:100%; border-left:none; padding:10px; border-right:none;">
|
|
<ul id="tt"></ul>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$('#tt').tree({
|
|
url: "/Base/InnerDepartment/GetTreeJson?type=1"
|
|
});
|
|
|
|
});
|
|
function frameReturnByReload(flag) {
|
|
$("#tt").tree('reload');
|
|
}
|
|
</script>
|
|
<script type="text/javascript">
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
function Create_Click() {
|
|
var fid = 0;
|
|
var selected = $("#tt").tree("getSelected");
|
|
if (selected != null) {
|
|
fid = selected.id
|
|
} else {
|
|
fid = $("#tt").tree("getRoot").id;
|
|
}
|
|
$("#modalwindow").html(GetIframeHtml("/Base/InnerDepartment/Edit?fid=" + fid));
|
|
$("#modalwindow").window({ title: '新增', width: 500, height: 300, iconCls: 'icon-add' }).window('open');
|
|
}
|
|
function Edit_Click() {
|
|
var row = $('#tt').tree('getSelected');
|
|
if (row != null) {
|
|
var notId = "[" + row.id + "]";//不准许选的ID
|
|
if (!$("#tt").tree("isLeaf", row.target)) {
|
|
var childnode = $('#tt').tree('getChildren', row.target);//获取所有的子部门
|
|
$(childnode).each(function (i, node) {
|
|
notId = notId + "[" + node.id + "]";
|
|
});
|
|
}
|
|
$("#modalwindow").html(GetIframeHtml("/Base/InnerDepartment/Edit?id=" + row.id + "&Ieguid=" + GetGuid() + "¬Id=" + notId));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: 430, iconCls: 'icon-edit' }).window('open');
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function Details_Click() {
|
|
var row = $('#tt').tree('getSelected');
|
|
if (row != null) {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/InnerDepartment/Details?id=" + row.id + "&Ieguid=" + GetGuid()));
|
|
$("#modalwindow").window({ title: '详细', width: 500, height: 300, iconCls: 'icon-details' }).window('open');
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function Delete_Click() {
|
|
var row = $('#tt').tree('getSelected');
|
|
if (row != null) {
|
|
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
|
|
if (r) {
|
|
$.r_post("/Base/InnerDepartment/Delete?id=" + row.id, function (data) {
|
|
if (data.type == 1) {
|
|
$("#tt").tree('reload');
|
|
}
|
|
$.messageBox5s('提示', data.message);
|
|
}, "json");
|
|
}
|
|
});
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function ExpandAll_Click() {
|
|
$("#tt").tree("expandAll");
|
|
}
|
|
function CollapseAll_Click() {
|
|
$("#tt").tree("collapseAll");
|
|
}
|
|
</script>
|