sysUser.js
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* staff page
*/
function onAddAction() {
location.href = CONTEXT_PATH + "/sysUser/edit"
}
$("#searchInput").keydown(function(event) {
if (event.which == 13) {
onSearchAction();
}
});
function onSearchAction() {
var searchKey = $("#searchInput").val();
search(searchKey, 1);
}
// 页面切换
function onGoToPage() {
var page = $("#inputPage").val();
try {
page = parseInt(page);
} catch (e) {
}
var searchKey = $("#searchInput").val();
search(searchKey, page);
}
function search(key, page) {
var params = "page=" + page + "&pageNum=10";
if (!isEmpty(key)) {
params += "&key=" + key;
}
location.href = CONTEXT_PATH + "/sysUser/list?" + params;
}
function onModifyAction(staffId) {
location.href = CONTEXT_PATH + "/sysUser/edit?staffId=" + staffId;
}
function onDeleteAction(staffId) {
$('#deleteId').val(staffId);
$('#delModal').modal('show');
}
function onDeleteFromModal() {
$('#delModal').modal('hide');
location.href = CONTEXT_PATH + "/sysUser/delete?staffId="
+ $("#deleteId").val();
}
// 根据管理员选择的角色,动态的显示或者隐藏是否选择货站名称或者货代公司
function onChangeRole() {
var roleLevel = getSelectedValue("roleList");
if (roleLevel == 2 || roleLevel == 3) {
// 创建货站管理员或者操作员
// 显示货站选择框
document.getElementById("agentTr").style.display = "none";
document.getElementById("agentList").disabled = true;
document.getElementById("stationTr").style.display = "";
document.getElementById("stationList").disabled = false;
} else if (roleLevel == 4) {
// 创建货代账号
// 显示货代公司选择框
document.getElementById("agentTr").style.display = "";
document.getElementById("agentList").disabled = false;
document.getElementById("stationTr").style.display = "none";
document.getElementById("stationList").disabled = true;
}
}