channelUserList.html
14.9 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!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 region="north" style="padding-bottom: 35px; height: auto;">
<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">
<form id="searchForm" method="post" accept-charset="utf-8">
<input id="channelSourceCombobox" name="channelSource" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
multiple: true,
textField: 'text',
prompt:'选择泛渠道来源',
data: [
{ id: '5', text: '淘宝B店订单' },
{ id: '8', text: '淘宝C店订单' },
{ id: '9', text: '淘宝LAL店订单' },
{ id: '10', text: '一号店订单' },
{ id: '11', text: '京东订单' },
{ id: '12', text: '京东闪购店' },
{ id: '13', text: '京东LAL闪购店' },
{ id: '14', text: '物色' },
{ id: '15', text: 'bj天猫店' },
{ id: '16', text: 'intotherainbow旗舰店' },
{ id: '23', text: '苏宁' }
]"/>
<input id="channelOrderCodeText" name="channelOrderCode" class="easyui-textbox" data-options="prompt:'泛渠道订单号'"/>
<input name="beginChannelOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'泛渠道订单开始时间'">
<input name="endChannelOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'泛渠道订单结束时间'">
<input name="uid" class="easyui-textbox" data-options="prompt:'有货 UID'"/>
<input name="hasUid" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
textField: 'text',
data: [
{ id: '', text: '是否有货会员' },
{ id: '1', text: '是' },
{ id: '0', text: '否' }
]"/>
<input name="hasYHOrder" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
textField: 'text',
data: [
{ id: '', text: '是否存在有货订单' },
{ id: '1', text: '是' },
{ id: '0', text: '否' }
]"/>
<input name="yhOrderCode" class="easyui-textbox" data-options="prompt:'有货订单号'"/>
<input name="beginYHOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'有货订单开始时间'">
<input name="endYHOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'有货订单结束时间'">
<input name="unionCode" class="easyui-textbox" data-options="prompt:'渠道号'"/>
<input name="userChannel" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
textField: 'text',
data: [
{ id: '', text: '注册终端' },
{ id: '0', text: 'PC' },
{ id: '1', text: 'WAP' },
{ id: '3', text: 'IOS' },
{ id: '4', text: 'Android' }
]"/>
<input name="beginRegisterTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'注册开始时间'">
<input name="endRegisterTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'注册结束时间'">
<input name="beginSmsTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'短信发送开始时间'">
<input name="endSmsTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'短信发送结束时间'">
<a id="searchButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">查询</a>
<a id="allButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">全部</a>
<a id="exportButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">导出</a>
<a id="exportAllButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">全部导出</a>
<a id="createGroupButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">创建分组</a>
</div>
</form>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height: 500px;">
<table id="consultTable"></table>
</div>
</div>
<script type="text/javascript">
var checkedItems = [];
var smsId;
$(function () {
// 列表
var grid = $("#consultTable");
grid.myDatagrid({
fit: true,
fitColumns: false,
nowrap: false,
url: contextPath + "/channel/user_list",
method: 'POST',
queryParams: getParams(),
rownumbers: true,
idField: "id",
view: fileview,
onCheckAll: addcheckItem,
onCheck: addcheckItem,
onUncheckAll: removeAllItem,
onUncheck: removeSingleItem,
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "全选",
field: "id",
idField:"id",
width: 10,
align: "center",
checkbox: true
}, {
title: "手机号",
field: "mobile",
width: 100,
align: "center"
}, {
title: "渠道来源",
field: "channelSource",
width: 100,
align: "center"
}, {
title: "泛渠道购买次数",
field: "channelPurchasesNumber",
width: 120,
align: "center"
}, {
title: "泛渠道最近订单",
field: "channelOrderCode",
width: 170,
align: "center"
}, {
title: "泛渠道最近订单创建时间",
field: "channelOrderTime",
width: 165,
align: "center"
}, {
title: "泛渠道订单金额",
field: "channelOrderAmount",
width: 120,
align: "center"
}, {
title: "有货 UID",
field: "uid",
width: 120,
align: "center"
}, {
title: "有货购买次数",
field: "yhPurchasesNumber",
width: 120,
align: "center"
}, {
title: "有货最近订单",
field: "yhOrderCode",
width: 120,
align: "center"
}, {
title: "有货最近订单金额",
field: "yhOrderAmount",
width: 120,
align: "center"
}, {
title: "有货最近订单创建时间",
field: "yhOrderTime",
width: 165,
align: "center"
}, {
title: "渠道号",
field: "unionCode",
width: 100,
align: "center"
}, {
title: "注册终端",
field: "userChannel",
width: 80,
align: "center"
}, {
title: "注册时间",
field: "registerTime",
width: 80,
align: "center"
}, {
title: "短信次数",
field: "smsNumber",
width: 80,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(value > 0){
var str = "<a id='" + rowData.id + "' name='id' style='margin-left:10px'>"+value+"</a>";
return str;
}else{
return "-"
}
}
}, {
title: "最近一次短信时间",
field: "smsTime",
width: 165,
align: "center"
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function (data) {
$("a[name='id']").click(function () {
showMessageDetails(this.id);
return false;
});
}
});
function getParams() {
var paramsArray = $("#searchForm").serializeArray();
var params = {};
var channelSource = "";
for (var i = 0; i < paramsArray.length; i++ ) {
if (paramsArray[i].name == "channelSource") {
channelSource += paramsArray[i].value + ",";
} else {
params[paramsArray[i].name] = paramsArray[i].value;
}
}
if (channelSource.length != 0) {
params["channelSource"] = channelSource.substring(0, channelSource.length -1);
}
return params;
}
$("#searchButton").linkbutton({
onClick: function () {
grid.datagrid('reload', getParams());
}
});
$("#allButton").linkbutton({
onClick: function () {
window.location.reload();
}
});
$("#exportButton").linkbutton({
onClick : function() {
if (checkedItems.length == 0) {
$.messager.alert('提示','请选择要导出的数据');
return;
}
var params = {"ids": checkedItems.toString() };
window.open(contextPath + "/batch/export.do?type=channelUserServiceImpl&queryConf=" + JSON.stringify(params));
}
});
$("#exportAllButton").linkbutton({
onClick : function() {
window.open(contextPath + "/batch/export.do?type=channelUserServiceImpl&queryConf=" + JSON.stringify(getParams()));
}
});
$("#createGroupButton").linkbutton({
onClick: function () {
var div = $("<div>").appendTo($(window.self.document.body));
window.self.$(div).myDialog({
modal : true,
collapsible : true,
cache : false,
title : "创建分组",
width: 400,
height: 200,
href: contextPath + "/html/channel/createGroup.html",
buttons : [{
text : "保存",
id : "saveUserBtn",
iconCls : "icon-save",
handler : function() {
var param = getParams();
var groupName = $.trim($("#groupName").val());
if (groupName.length == 0) {
window.self.$.messager.alert("提示消息", "请输入分组名称");
return;
}
param['groupName'] = groupName;
$.ajax({
type: "POST",
contentType: "application/json",
url: contextPath + '/channel/addGroup',
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 showMessageDetails(id) {
smsId = id;
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/messageDetails.html?mobile="+id,
buttons : [{
id : "closeBtn",
text : "关闭",
iconCls : "icon-cancel",
handler : function() {
window.self.$(div).dialog('close');
}
}]
});
}
var fileview = $.extend({}, $.fn.datagrid.defaults.view, { onAfterRender: function (target) { isCheckItem(); } });
function isCheckItem() {
for (var i = 0; i < checkedItems.length; i++) {
$("input[type='checkbox'][name='id'][value='"+checkedItems[i]+"']").attr("checked", "checked");
}
}
function findCheckedItem(ID) {
for (var i = 0; i < checkedItems.length; i++) {
if (checkedItems[i] == ID) return i;
}
return -1;
}
function addcheckItem() {
$("input[type='checkbox'][name='id']:checked").each(function () {
var k = findCheckedItem($(this).val());
if (k == -1) {
checkedItems.push($(this).val());
}
});
}
function removeAllItem(rows) {
$("input[type='checkbox'][name='id']").each(function () {
if (!this.checked) {
var k = findCheckedItem($(this).val());
if (k != -1) {
checkedItems.splice(k, 1);
}
}
});
}
function removeSingleItem(rowIndex, rowData) {
var k = findCheckedItem(rowData.id);
if (k != -1) {
checkedItems.splice(k, 1);
}
}
</script>
</body>
</html>