activeGiftConfig.js
2.43 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
/**
* 活动规则制定
*/
var ActiveGiftConfig = function(){
return {
search : function(){
$("#data-grid").datagrid({
url : "/active/queryGiftRecord",
queryParams : App.dataGridQueryParams('search-form')
});
},
giftType : function(value, row, index) {
var status;
switch (value) {
case '0':
status = '赠送藏品';
break;
case '1':
status = '配售藏品';
break;
case '2':
status = '非藏品赠送';
break;
}
return status;
},
issueStatus : function(value, row, index) {
var status;
switch (value) {
case '0':
status = '未发放';
break;
case '1':
status = '已发放';
break;
case '2':
status = '发放失败';
break;
case '3':
status = '已回收';
break;
}
return status;
},
type : function(value, row, index) {
var status;
switch (value) {
case '0':
status = '新开户类型';
break;
case '1':
status = '推荐开户';
break;
case '2':
status = '会员升级';
break;
case '3':
status = '每月配额';
break;
case '4':
status = '持仓类型';
break;
case '5':
status = '入金';
break;
case '6':
status = '交易';
break;
case '7':
status = '账户余额';
break;
}
return status;
},
searchFunc : function(activeName){
$("#name").textbox("setText",activeName);
$("#name").textbox("setValue",activeName);
setTimeout(ActiveGiftConfig.search(), 1000);
},
giftStatus:function(){
var row = $("#data-grid").datagrid("getSelected");
if(row){
$.messager.confirm('确认', '你确定对'+row.name+'活动进行非藏品奖品发放吗?', function(ok) {
if(ok){
if(row.gift_type==2){
$.ajax({
type: 'POST',
url: '/active/updateStatus',
data: {id:row.id},
success: function(data) {
$.messager.show({
title: '信息',
msg: data.resultMsg
});
$('#data-grid').datagrid('reload');
},
error: function() {
}
});
}else{
$.messager.alert("提示","不是非配售奖品不能修改状态");
}
}
});
}else{
$.messager.alert("提示","请选择数据");
}
},
exportGiftOrder : function() {
window.open('/active/exportGiftRecord?' + $('#search-form').serialize());
}
}
}();