marketing.CouponSend.Index.js
4.67 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
webpackJsonp([66],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by ty on 2016/5/23.
*/
'use strict';
var $ = __webpack_require__(1),
common=__webpack_require__(2);
var departments =[
"渠道二部", "渠道一部", "零售部", "品牌资源部", "店铺运营部", "类目运营部", "营销部", "市场部", "会员部 ", "客服部", "内容营销部",
"", "", "", "", "", "", "", "",
"资源发展部", "广告部", "招商部", "男生媒体部", "女生媒体部 ", "流程运营部", "发行设计部", "设计部", "商品一部(羊头+轻奢)",
"商品二部(男装)", "商品三部(女装)", "商品四部(户外运动)", "商品五部(自主)", "商品六部(明星/KOL)",
"商品七部(童装)", "商品八部(创意生活+玩具)", "商品九部(彩妆", "商品十部(全球购", "运营支持部", "类目及活动运营部",
"内容运营部", "营销策划部", "设计部", "售后服务部", "客户关系部 ", "运营部", "泛渠道部", "运营统筹部", "南京艾尚店",
"仓储部", "物流部", "运营部 ", "公关部", "运营部", "生产部", "商品部", "销售部", "市场部", "运营部", "人事部", "财务部",
"陈列部", "会员数据部", "会员营销部", "会员运营部", "品牌营销部", "效果营销部", "PR营销部", "设计部", "零售产品部",
"媒体产品部", "设计部", "前端系统部", "核心系统部", "后台系统部", "测试部", "研究发展部", "大数据部", "运维部", "财务部",
"内审部", "行政部", "数据部", "公共关系部", "人力资源部", "总裁办", "火星项目部 "
];
var couponTypes = ["A券", "B券", "公开券", "生日券", "免邮券"];
var startTimeObj;
var endTimeObj;
startTimeObj = $("#filter-startTimeStr").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
endTimeObj = $("#filter-endTimeStr").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
//下拉框
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-1] + '</p>';
}},
{display: '优惠券类型', render: function(item) {
return '<p class="audit-time">' + couponTypes[item.couponType-1] + '</p>';
}},
{display: '数量', name: "couponNum"},
{display: '面额', name: "couponAmount"},
{display: '开始时间', render: function(item) {
return Bll.getTime(item.startTime);
}},
{display: '结束时间', render: function(item) {
return Bll.getTime(item.endTime);
}},
{display:"操作",name:"operate",render:function(item){
var HtmArr=[];
HtmArr.push('<a href="/market/couponSend/send/'+ item.id +'" class="btn btn-success btn-xs sendCoupon" data-index="'+ item.__index+'" href="javascript:;">发券</a>');
HtmArr.push('<a href="/market/couponSend/sendHistory/'+ item.id +'" class="btn btn-info 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>');
if(item.couponType==3){
HtmArr.push('<a href="/market/couponSend/pCouponSn/'+ item.id +'" class="btn btn-warning btn-xs pCouponSn" data-index="'+ item.__index+'" href="javascript:;">公开券码查看</a>');
}
return HtmArr.join('');
}}
]
});
g.init("/coupon/querySendCouponList");
$(document).on("click", "#filter-btn", function() {
g.reload(1);
});
var Bll={
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
};
/***/ }
]);