userCoupon.html
3.82 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 230px">
<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 id="couponCode" type="text">
<input id="uid" type="text">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
<table id="couponTable"></table>
</div>
</div>
<script type="text/javascript">
$(function () {
$("#uid").textbox({
prompt: "UID"
});
$("#couponCode").textbox({
prompt: "单券号"
});
$("#couponTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/coupon/queryUserCouponList",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp; //couponAmount
},
columns: [[{
title: "UID",
field: "uid",
width: 40,
align: "center"
},{
title: "优惠券ID",
field: "couponId",
width: 40,
align: "center"
},{
title: "单券号",
field: "couponCode",
width: 100,
align: "center"
},{
title: "订单号",
field: "orderCode",
width: 80,
align: "center"
}, {
title: "优惠券名称",
field: "couponName",
width: 40,
align: "center"
},{
title: "使用期限",
field: "limitTime",
width: 80,
align: "center"
}, {
title: "状态",
field: "statusValue",
width: 50,
align: "center",
formatter: function (value, rowData) {
return value == 1 ? '已使用' : '未使用';
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {}
});
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
var param = getParams();
$("#couponTable").myDatagrid("load", param);
}
});
/**
* 提取出搜索参数
*/
function getParams() {
var uid = $('#uid').textbox('getText');
var couponCode = $('#couponCode').textbox('getText');
var param = {};
if (undefined !== uid && null !== uid && "" !== uid) {
param.uid = uid;
}
if (undefined !== couponCode && null !== couponCode && "" !== couponCode) {
param.couponCode = couponCode;
}
return param;
}
});
</script>
</body>
</html>