safesite/safesite/templates/getuser.html

86 lines
2.8 KiB
HTML

<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'west',split:true,border:false" style="width:30%;height:100%;">
<ul id="ddpartree"></ul>
</div>
<div data-options="region:'center',split:true,border:false" style="height:100%">
<div id="usersearchbar" style="padding:5px;height:auto">
<label>姓名</label><input name='name' id="sname" style="width:auto;" class="easyui-textbox" />
<a id="usersearch" onclick="usersearch()" class="easyui-linkbutton" iconCls='fa-search' plain=true>查询</a>
</div>
<table id="ddusertable" style="width:100%;height:100%;" data-options="
rownumbers:true,
singleSelect:true,
striped: true,
url:'getuser?a=datagrid',
method:'get',
fitColumns:true,
toolbar:'#usersearchbar'">
<thead>
<tr>
<th data-options="field:'userid',hidden:true">用户ID</th>
<th data-options="field:'empid',width:'20%',align:'right'">工号</th>
<th data-options="field:'name',width:'20%',align:'right'">姓名</th>
<th data-options="field:'ubelongpart__partname',width:'30%',align:'right'">所属部门</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$('#ddpartree').tree({
url: 'parthandle?a=tree',
animate: true,
ansyc: false,
lines: true,
loadFilter: function (rows) {
return convert(rows);
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},
onSelect: function (row) {
$("#ddusertable").datagrid({
url: 'getuser?partid=' + row.id + '&a=datagrid',
});
}
});
function GetUsersChecked() {
var a = GetQueryString2("a");
var userids = [];
var usernames = [];
$(".auser").each(function () {
userids.push($(this).attr("id"));
usernames.push($(this).attr("name"));
});
top.$('#in').attr('value', userids);
top.$('#in').attr('show', usernames);
top.$('#in').attr('total', userids.length);
top.$('#in').attr('target', a);
//top.$('#getb').click();
aaa(a);
$('#userdd').dialog("close");
}
$("#ddusertable").datagrid({
onClickRow: function (index, item) {
var userid = item.userid;
var name = item.name;
var a = GetQueryString2("a");
top.$('#in').attr('value', userid);
top.$('#in').attr('show', name);
top.$('#in').attr('target', a);
aaa(a);
$('#userdd').dialog("close");
},
});
function usersearch() {
$('#ddusertable').datagrid({url:'getuser?a=datagrid&name='+$('#sname').val()});
}
</script>
</div>