pointRecord.js
1.57 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
/**
* 积分商城
*/
var pointRecord = function() {
return {
search : function() {
$('#data-grid').datagrid({
url : '/point/searchPointRecord',
queryParams : App.dataGridQueryParams('search-form')
});
},
formatStatus : 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;
},
goodStatus:function(goodStatus){
var row = $("#data-grid").datagrid("getSelected");
if(row){
$.ajax({
type: 'POST',
url: '/user/goods/updateStatus',
data: {id:row.id, goodsStatus:goodStatus},
success: function(data) {
if(data==0){
$.messager.show({
title: '信息',
msg: '操作成功'
});
$('#data-grid').datagrid('reload');
}else{
$.messager.alert("操作失败");
}
},
error: function() {
}
});
}else{
$.messager.alert("提示","请选择数据");
}
},
/** 根据藏品代码查询藏品名称 */
otcCodeChange : function(newValue, oldValue) {
if (newValue.length == 6) {
$.ajax({
url : '/quota/config/getOtcName',
type : 'post',
dataType : 'json',
data : {
otcCode : newValue
},
success : function(data) {
$("#otcName").textbox('setValue', data.otcName);
}
});
}
},
}
}();