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.
186 lines
7.7 KiB
186 lines
7.7 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script>
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
$gridList.dataGrid({
|
|
url: "/SystemManage/User/GetGridJson",
|
|
height: $(window).height() - 128,
|
|
colModel: [
|
|
{ label: '主键', name: 'F_Id', hidden: true },
|
|
{ label: '账户', name: 'F_Account', width: 80, align: 'left' },
|
|
{ label: '姓名', name: 'F_RealName', width: 120, align: 'left' },
|
|
{
|
|
label: '角色', name: 'F_RoleId', width: 120, align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
return top.clients.role[cellvalue] == null ? "" : top.clients.role[cellvalue].fullname;
|
|
}
|
|
},
|
|
{ label: '供应商编码', name: 'F_VenCode', width: 100, align: 'left' },
|
|
{ label: '手机', name: 'F_MobilePhone', width: 100, align: 'left' },
|
|
{ label: '邮箱', name: 'F_Email', width: 150, align: 'left' },
|
|
{ label: '站点', name: 'F_Location', width: 50, 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, options, rowObject) {
|
|
if (cellvalue == 1) {
|
|
return '<span class=\"label label-success\">正常</span>';
|
|
} else if (cellvalue == 0) {
|
|
return '<span class=\"label label-default\">禁用</span>';
|
|
}
|
|
}
|
|
},
|
|
{ label: '备注', name: 'F_Description', width: 200, align: 'left' }
|
|
],
|
|
pager: "#gridPager",
|
|
sortname: 'F_DepartmentId asc,F_CreatorTime desc',
|
|
viewrecords: true
|
|
});
|
|
$("#btn_search").click(function () {
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { keyword: $("#txt_keyword").val() },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
function btn_add() {
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "新增用户",
|
|
url: "/SystemManage/User/Form",
|
|
width: "700px",
|
|
height: "450px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
function btn_edit() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "修改用户",
|
|
url: "/SystemManage/User/Form?keyValue=" + keyValue,
|
|
width: "700px",
|
|
height: "450px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
function btn_delete() {
|
|
$.deleteForm({
|
|
url: "/SystemManage/User/DeleteForm",
|
|
param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
function btn_details() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalOpen({
|
|
id: "Details",
|
|
title: "查看用户",
|
|
url: "/SystemManage/User/Details?keyValue=" + keyValue,
|
|
width: "700px",
|
|
height: "400px",
|
|
btn: null,
|
|
});
|
|
}
|
|
function btn_revisepassword() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
var Account = $("#gridList").jqGridRowValue().F_Account;
|
|
var RealName = $("#gridList").jqGridRowValue().F_RealName;
|
|
$.modalOpen({
|
|
id: "RevisePassword",
|
|
title: '重置密码',
|
|
url: '/SystemManage/User/RevisePassword?keyValue=' + keyValue + "&account=" + escape(Account) + '&realName=' + escape(RealName),
|
|
width: "450px",
|
|
height: "260px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
function btn_disabled() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalConfirm("注:您确定要【禁用】该项账户吗?", function (r) {
|
|
if (r) {
|
|
$.submitForm({
|
|
url: "/SystemManage/User/DisabledAccount",
|
|
param: { keyValue: keyValue },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
});
|
|
}
|
|
function btn_enabled() {
|
|
var keyValue = $("#gridList").jqGridRowValue().F_Id;
|
|
$.modalConfirm("注:您确定要【启用】该项账户吗?", function (r) {
|
|
if (r) {
|
|
$.submitForm({
|
|
url: "/SystemManage/User/EnabledAccount",
|
|
param: { keyValue: keyValue },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
});
|
|
}
|
|
</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>
|
|
<li class="split"></li>
|
|
<li><a id="NF-revisepassword" authorize="yes" onclick="btn_revisepassword()"><i class="fa fa-key"></i>密码重置</a></li>
|
|
<li class="split"></li>
|
|
<li><a id="NF-disabled" authorize="yes" onclick="btn_disabled()"><i class="fa fa-stop-circle"></i>禁用</a></li>
|
|
<li><a id="NF-enabled" authorize="yes" onclick="btn_enabled()"><i class="fa fa-play-circle"></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 id="gridPager"></div>
|
|
</div>
|