blackList.html
6.69 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/union/js/include.js"></script>
<script src="/union/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div id="search" region="north" style="padding-bottom: 35px;">
<!--<script>-->
<!--document.write(addHead('市场管理', '泛渠道用户管理'));-->
<!--</script>-->
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
</style>
<div style="margin-left: 30px;" class="div_search">
<input type="text" id="phone"/>
<a id="searchBlack" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
<a id="addBlack" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height: 500px;">
<table id="blackListTalbe"></table>
</div>
</div>
<script>
$(function () {
$("#phone").textbox({
prompt: "手机号",
width: 180
});
$("#blackListTalbe").myDatagrid({
fit: true,
fitColumns: true,
//queryParams: param,
nowrap: false,
url: contextPath + "/channel/queryBlackList",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "ID",
field: "id",
width: 70,
align: "center"
}, {
title: "手机号",
field: "mobile",
width: 170,
align: "center"
}, {
title: "创建时间",
field: "createTime",
width: 170,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 200,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "<a role='delete' dataId='" + rowData.id + "' style='margin-left:10px'>删除</a>";
return str;
}
}
]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function (data) {
$(this).myDatagrid("getPanel").find("a[role='delete']").linkbutton({
iconCls: "icon-more",
onClick: function () {
deleteBlack($(this).attr("dataId"));
}
});
}
});
$("#searchBlack").linkbutton({
iconCls: "icon-search",
text: "查询",
onClick: function () {
var param = {};
if ($("#phone").val() != '') {
param.mobile = $("#phone").val();
}
$("#blackListTalbe").myDatagrid("load", param);
}
});
$("#addBlack").linkbutton({
iconCls: "icon-search",
text: "增加",
onClick: function () {
var param = {};
var div = $("<div>").appendTo($(window.self.document.body));
window.self.$(div).myDialog({
modal : true,
collapsible : true,
cache : false,
title : "短信列表",
width: 600,
height: 600,
href: contextPath + "/html/channel/blackAdd.html",
buttons : [{
text : "保存",
iconCls : "icon-save",
handler : function() {
var param = getParams();
var mobile = $.trim($("#mobile").val());
if (mobile.length == 0) {
window.self.$.messager.alert("提示消息", "请输入手机号");
return;
}
param['mobile'] = mobile ;
$.ajax({
type: "POST",
contentType: "application/json",
url: contextPath + '/channel/addBlack',
data: JSON.stringify(param),
dataType: 'json',
success: function(result) {
window.self.$.messager.alert("提示消息",result.message, "", function () {
window.location.href = contextPath + "/html/channel/channelGroupList.html";
});
window.self.$(div).dialog('close');
}
});
}
},{
id : "closeBtn",
text : "关闭",
iconCls : "icon-cancel",
handler : function() {
window.self.$(div).dialog('close');
}
}]
});
}
});
});
function deleteBlack(id) {
$.messager.confirm("确认", "确认删除该黑名单吗?", function (flag) {
if (flag) {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/channel/deleteBlack", {id: id}, function (data) {
$.messager.progress("close");
if (data.code == 200) {
$("#blackListTalbe").myDatagrid("reload");
$.messager.show({
title: "提示",
msg: "删除黑名单成功!",
height: 120
});
} else {
$.messager.alert("失败", data.message, "error");
}
}, "json");
}
});
}
</script>
</body>
</html>