marketing.CouponSend.SendHistory.js
3.01 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
webpackJsonp([59],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by ty on 2016/5/23.
*/
'use strict';
var $ = __webpack_require__(1),
common = __webpack_require__(2);
var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
var isSent = 1;
//下拉框
new common.dropDown({el: '#isSent'});
var Bll = {
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
};
//grid
var g = new common.grid({
el: '#content-list',
hash: false,
async: false,
parms: function () {
return {
couponId: couponId
//status:common.util.__input("filter-status")
};
},
columns: [
{display: "单券号", name: "couponCode"},
{display: "用户ID", name: "uid"},
{
display: '发放时间', render: function (item) {
return Bll.getTime(item.createTime);
}
}
]
});
var g1 = new common.grid({
el: '#content-list',
hash: false,
async: false,
parms: function () {
return {
couponId: couponId
//status:common.util.__input("filter-status")
};
},
columns: [
{display: "用户ID", name: "uid"},
{display: "异常原因", name: "errMsg"},
{display: "操作", render: function (item) {
return '<a class="btn btn-primary btn-xs reSend" data-index="'+ item.__index+'" href="javascript:;">重发</a>';
}},
]
});
g.init("/couponLogs/queryUserCouponLogsList");
$("#count").html(g.total);
$(document).on("click", "#filter-btn", function () {
isSent = $("#isSent").val();
if(isSent == 2) {
g1.init("/couponSendError/query");
$("#count").html(g1.total);
} else {
g.init("/couponLogs/queryUserCouponLogsList");
$("#count").html(g.total);
}
});
//导出
$(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});
if(isSent == 1) {
window.open("/ajax/down?queryConf=" + queryConf + "&type=couponLogsExport");
} else if(isSent == 2) {
window.open("/ajax/down?queryConf=" + queryConf + "&type=couponSendErrorExport");
}
}
});
//输入限制
$(document).on("keyup", ".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
});
//重发
$(document).on("click", ".reSend", function () {
var item = g1.rows[$(this).data("index")];
common.dialog.confirm("重发确认","是否确认重发?",function() {
common.util.__ajax({
url: '/couponSendError/retrySend',
data: {
id: item.id
}
},function() {
g1.reload();
});
});
});
/***/ }
]);