useHistory.js
1.78 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
/**
* Created by ty on 2016/5/24.
*/
'use strict';
var $ = require('jquery'),
common = require('../common/common');
new common.dropDown({el: "#filter-status"});
var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
//grid
var g = new common.grid({
el: '#content-list',
hash: false,
async: false,
parms: function () {
return {
couponId: couponId,
couponCode: common.util.__input("filter-couponCode"),
orderCode: common.util.__input("filter-orderCode"),
uid: common.util.__input("filter-uid"),
status: common.util.__input("filter-status")
};
},
columns: [
{display: "单券号", name: "couponCode"},
{display: "用户ID", name: "uid"},
{display: "订单号", name: "orderCode"},
{
display: '是否使用', render: function (item) {
var status = "";
if (item.status == 0) {
status = "未使用";
} else if (item.status == 1) {
status = "已使用";
}
return '<p class="audit-time">' + status + '</p>';
}
}
]
});
g.init("/couponLogs/queryUserCouponLogsList");
$("#count").html(g.total);
$(document).on("click", "#filter-btn", function () {
g.reload(1);
});
//导出
$(document).on('click', '#export-btn', function () {
var total = g.total;
if (total <= 0) {
common.util.__tip("当前0条数据,无需导出!", "warning")
} else {
var queryConf = JSON.stringify({couponId: couponId});
window.open("/ajax/down?queryConf=" + queryConf + "&type=useCouponLogsExport");
}
});
//输入限制
$(document).on("keyup", ".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
});