...
|
...
|
@@ -60,29 +60,29 @@ var t = new common.tab({ |
|
|
el: "#basicTab",
|
|
|
click: function () {
|
|
|
columnname = $(this).find('a').attr('columnname');
|
|
|
g.options.columns[5].hidden = true;
|
|
|
g.options.columns[6].hidden = true;
|
|
|
g.options.columns[7].hidden = true;
|
|
|
switch (columnname) {
|
|
|
case "1":
|
|
|
{
|
|
|
g.options.columns[8].hidden = true;
|
|
|
g.options.columns[7].hidden = true;
|
|
|
}
|
|
|
break;
|
|
|
case "2":
|
|
|
{
|
|
|
g.options.columns[6].hidden = false;
|
|
|
g.options.columns[8].hidden = true;
|
|
|
g.options.columns[5].hidden = false;
|
|
|
g.options.columns[7].hidden = true;
|
|
|
}
|
|
|
break;
|
|
|
case "3":
|
|
|
{
|
|
|
g.options.columns[7].hidden = false;
|
|
|
g.options.columns[8].hidden = true;
|
|
|
g.options.columns[6].hidden = false;
|
|
|
g.options.columns[7].hidden = true;
|
|
|
}
|
|
|
break;
|
|
|
case "all":
|
|
|
{
|
|
|
g.options.columns[8].hidden = false;
|
|
|
g.options.columns[7].hidden = false;
|
|
|
}
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -143,7 +143,6 @@ var g = new common.grid({ |
|
|
}
|
|
|
},
|
|
|
{display: "优惠券说明", name: "explains"},
|
|
|
{display: "申请人", name: "proposer"},
|
|
|
{
|
|
|
display: "驳回理由", hidden: true, name: "rejectReason", render: function (item) {
|
|
|
return "<p style='color: red'>" + item.rejectReason + "</p>"
|
...
|
...
|
@@ -236,6 +235,9 @@ var Bll = { |
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
btns.push(buttons[array[i]])
|
|
|
}
|
|
|
|
|
|
// 增加查看操作记录按钮
|
|
|
btns.push('<a class="btn btn-primary btn-xs operation-records" data-coupon-id="' + id + '">操作记录</a>');
|
|
|
return btns;
|
|
|
}
|
|
|
};
|
...
|
...
|
@@ -358,4 +360,42 @@ $(document).on('click', '.coupon-info', function () { |
|
|
Bll.toastInfo(item1, '优惠券详情');
|
|
|
});
|
|
|
|
|
|
// 查看操作记录
|
|
|
$(document).on('click', '.operation-records', function() {
|
|
|
var couponId = $(this).data('coupon-id');
|
|
|
var option = {
|
|
|
title:'操作记录详情',
|
|
|
content:"<div class='historyDetail'>加载操作记录...</div>",
|
|
|
width:'70%',
|
|
|
button:[{value:"关闭", css:"btn-primary"}]
|
|
|
};
|
|
|
new common.dialog(option);
|
|
|
|
|
|
getOperationRecords(couponId);
|
|
|
});
|
|
|
|
|
|
function getOperationRecords(couponId) {
|
|
|
common.util.__ajax({
|
|
|
url: '/coupon/getOperationRecords',
|
|
|
data: {
|
|
|
couponsId: couponId
|
|
|
}
|
|
|
}, function(resp) {
|
|
|
if(resp.code == 200) {
|
|
|
var data = resp.data;
|
|
|
covertOperationRecord(data)
|
|
|
$('.historyDetail').html(common.util.__template2($('#operation-record-template').html(), {list: data}));
|
|
|
}
|
|
|
}, true);
|
|
|
}
|
|
|
|
|
|
// 转化操作类型,操作时间
|
|
|
function covertOperationRecord(data) {
|
|
|
var TYPE = {0: "新增", 1: "修改", 2: "作废"}
|
|
|
if(data && data.length > 0) {
|
|
|
$.each(data, function(index, item) {
|
|
|
item.operationType = TYPE[item.operationType];
|
|
|
item.createTime = Bll.getTime(item.createTime);
|
|
|
})
|
|
|
}
|
|
|
} |
...
|
...
|
|