couponSend.js
2.63 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
/**
* Created by ty on 2016/5/23.
*/
'use strict';
var $ = require('jquery'),
common=require('../common/common');
var departments = ["渠道二部", "渠道一部", "零售部", "品牌资源部", "店铺运营部", "类目运营部", "营销部", "市场部", "会员部 ", "客服部", "内容营销部"];
var couponTypes = ["A券", "B券", "公开券", "生日券", "免邮券"];
//下拉框
new common.dropDown({el: '#filter-couponType'});
new common.dropDown({el: '#filter-department'});
//grid
var g = new common.grid({
el: '#basicTable',
parms:function(){
return {
couponType: common.util.__input("filter-couponType"),
couponId: common.util.__input("filter-couponId"),
couponName:common.util.__input("filter-couponName"),
department:common.util.__input("filter-department"),
startTimeStr:common.util.__input("filter-startTimeStr"),
endTimeStr:common.util.__input("filter-endTimeStr"),
};
},
columns:[
{display:"优惠券ID", name:"id"},
{display:"优惠券名称",name:"couponName"},
{display: '申请部门', render: function(item) {
return '<p class="audit-time">' + departments[item.department] + '</p>';
}},
{display: '优惠券类型', render: function(item) {
return '<p class="audit-time">' + couponTypes[item.couponType] + '</p>';
}},
{display: '数量', name: "couponNum"},
{display: '面额', name: "couponAmount"},
{display: '开始时间', render: function(item) {
return common.util.__dateFormat(new Date(item.startTime), "yyyy-MM-dd hh:mm:ss");;
}},
{display: '结束时间', render: function(item) {
return common.util.__dateFormat(new Date(item.endTime), "yyyy-MM-dd hh:mm:ss");;
}},
{display:"操作",name:"operate",render:function(item){
var HtmArr=[];
HtmArr.push('<a href="/market/couponSend/send/'+ item.id +'" class="btn btn-primary btn-xs sendCoupon" data-index="'+ item.__index+'" href="javascript:;">发券</a>');
HtmArr.push('<a href="/market/couponSend/sendHistory/'+ item.id +'" class="btn btn-primary btn-xs sendHistory" data-index="'+ item.__index+'" href="javascript:;">发放记录</a>');
HtmArr.push('<a href="/market/couponSend/useHistory/'+ item.id +'" class="btn btn-primary btn-xs useHistory" data-index="'+ item.__index+'" href="javascript:;">使用记录</a>');
return HtmArr.join('');
}}
]
});
g.init("/coupon/querySendCouponList");
$(document).on("click", "#filter-btn", function() {
g.reload(1);
});