93 lines
3.5 KiB
Plaintext
93 lines
3.5 KiB
Plaintext
@{
|
|
ViewBag.Title = "簿记账户组";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
var pageObj = new
|
|
{
|
|
canEdit = CurUser.系统管理.簿记账户修改
|
|
};
|
|
}
|
|
<style>
|
|
</style>
|
|
@section JS{
|
|
<script type="text/javascript">
|
|
var page = @Json.Serialize(pageObj);
|
|
var g_grid = {};
|
|
$(function () {
|
|
@Html.Raw(JqGridSimple.OutGrid("/assetunit/assetunitgroupQuery"));
|
|
g_grid = jQuery('#listGrid');
|
|
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
(e.keyCode == 13)&&SearchClick(true);
|
|
} catch (e) {}
|
|
}
|
|
document.onkeydown = keyEnter;
|
|
});
|
|
|
|
function rowdblclick(id) {
|
|
var encryptId = g_grid.getRowData(id).EncryptId;
|
|
startassetunitgroupEdit(encryptId);
|
|
}
|
|
|
|
var colModelGrid = [{ name: '', label: '操作', index: '', width: 150, formatter: showToolName, sortable: false, hidden: !page.canEdit, optionHide: !page.canEdit
|
|
}, { name: 'id', label: 'id', index: 'id', width: 1, hidden: true, optionHide: true
|
|
}, { name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', width: 0, hidden: true, optionHide: true
|
|
}, { name: 'Name', label: '分组名称', index: 'Name', width: 150
|
|
}, { name: 'OptName', label: '操作人名', index: 'OptName', width: 90 },
|
|
{ name: 'OptDate', label: '操作时间', index: 'OptDate', width: 90, formatter: 'date' }];
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
if (page.canEdit) {
|
|
var html = "<input type=\"button\" class=\"wentiEdit\" title='编辑簿记账户组' onclick=\"startassetunitgroupEdit('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "编辑");
|
|
html += "<input type=\"button\" class=\"wentiEdit\" title='删除簿记账户组' onclick=\"startassetunitgroupDel('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "删除");
|
|
return html;
|
|
}
|
|
else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
function startAddassetunitgroup() {
|
|
var newUrl = "/assetunit/assetunitgroupEdit/0";
|
|
main.infopage("簿记账户组新增", newUrl, { area: ['550px', '50%'] });
|
|
}
|
|
|
|
function startassetunitgroupEdit(id) {
|
|
var url = "/assetunit/assetunitgroupEdit/?enid=" + id;
|
|
main.infopage("簿记账户组修改", url, { area: ['550px', '55%'] });
|
|
}
|
|
|
|
function startassetunitgroupDel(id) {
|
|
main.confirmPost("确定删除吗?", "/assetunit/assetunitgroupDel", { id: id }).done(function (resp) {
|
|
SearchClick();
|
|
});
|
|
}
|
|
|
|
function reloadassetunitgroup() {
|
|
//重新加载
|
|
SearchClick();
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
listGrid.appendPostData({ Name: $("#Name").val() });
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam', {page: 1});
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
</script>
|
|
}
|
|
|
|
<div class="searchdiv">
|
|
@Html.ShortInput("Name", "分组名称")
|
|
@MyControls.SearchBtn()
|
|
@if (CurUser.系统管理.簿记账户新增)
|
|
{
|
|
@MyControls.Btn("新增", "startAddassetunitgroup()")
|
|
}
|
|
</div>
|
|
@Html.Raw(JqGridSimple.OutTable())
|