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.
140 lines
5.5 KiB
140 lines
5.5 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script>
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
$gridList.dataGrid({
|
|
treeGrid: true,
|
|
treeGridModel: "adjacency",
|
|
ExpandColumn: "F_EnCode",
|
|
url: "/SystemManage/Organize/GetTreeGridJson",
|
|
height: $(window).height() - 96,
|
|
colModel: [
|
|
{ label: "主键", name: "F_Id", hidden: true, key: true },
|
|
{ label: '名称', name: 'F_FullName', width: 200, align: 'left' },
|
|
{ label: '编号', name: 'F_EnCode', width: 150, align: 'left' },
|
|
{
|
|
label: '分类', name: 'F_CategoryId', width: 80, align: 'left'
|
|
//,
|
|
//formatter: function (cellvalue) {
|
|
// if (cellvalue == "Group") {
|
|
// return "集团";
|
|
// } else if (cellvalue == "Company") {
|
|
// return "公司";
|
|
// } else if (cellvalue == "Department") {
|
|
// return "部门";
|
|
// } else if (cellvalue == "WorkGroup") {
|
|
// return "小组";
|
|
// }
|
|
//}
|
|
},
|
|
{ label: '负责人', name: 'F_CategoryId', width: 90, align: 'left' },
|
|
{
|
|
label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
|
|
formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
|
|
},
|
|
{
|
|
label: "有效", name: "F_EnabledMark", width: 60, align: "center",
|
|
formatter: function (cellvalue) {
|
|
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
|
|
}
|
|
},
|
|
{ label: '备注', name: 'F_Description', width: 300, align: 'left' }
|
|
]
|
|
});
|
|
$("#btn_search").click(function () {
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { keyword: $("#txt_keyword").val() },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
function btn_add() {
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "新增机构",
|
|
url: "/SystemManage/Organize/Form",
|
|
width: "700px",
|
|
height: "520px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
function btn_edit() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "修改机构",
|
|
url: "/SystemManage/Organize/Form?keyValue=" + keyValue,
|
|
width: "700px",
|
|
height: "520px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
function btn_delete() {
|
|
$.deleteForm({
|
|
url: "/SystemManage/Organize/DeleteForm",
|
|
param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").resetSelection();
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
function btn_details() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalOpen({
|
|
id: "Details",
|
|
title: "查看机构",
|
|
url: "/SystemManage/Organize/Details?keyValue=" + keyValue,
|
|
width: "700px",
|
|
height: "560px",
|
|
btn: null,
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<div class="topPanel">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
<div class="btn-group">
|
|
<a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建机构</a>
|
|
</div>
|
|
<div class="operate">
|
|
<ul class="nav nav-pills">
|
|
<li class="first">已选中<span>1</span>项</li>
|
|
<li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改机构</a></li>
|
|
<li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除机构</a></li>
|
|
<li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看机构</a></li>
|
|
</ul>
|
|
<a href="javascript:;" class="close"></a>
|
|
</div>
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
</div>
|