...
|
...
|
@@ -71,6 +71,18 @@ var g = new common.grid({ |
|
|
return name;
|
|
|
}
|
|
|
}, {
|
|
|
display: '是否启用预告',
|
|
|
name: "noticeStatus",
|
|
|
render: function(item) {
|
|
|
var name;
|
|
|
if(item.noticeStatus===1){
|
|
|
name ="已启用" ;
|
|
|
}else {
|
|
|
name ="未启用" ;
|
|
|
}
|
|
|
return name;
|
|
|
}
|
|
|
},{
|
|
|
display: '优惠券限制使用',
|
|
|
name: "status",
|
|
|
render: function(item) {
|
...
|
...
|
@@ -98,7 +110,10 @@ var g = new common.grid({ |
|
|
HtmArr.push('<a target="_blank" href="/promotionInfo/edit/' + items.id + '"" class="btn btn-info btn-xs">编辑</a>');
|
|
|
if(items.isDel==="N"){
|
|
|
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-promotion">删除</a>');
|
|
|
}
|
|
|
}
|
|
|
if(items.noticeStatus===0){
|
|
|
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs open-promotion">开启预告</a>');
|
|
|
}
|
|
|
return HtmArr.join('');
|
|
|
}
|
|
|
}]
|
...
|
...
|
@@ -130,3 +145,25 @@ $('tbody').on('click', '.del-promotion', function() { |
|
|
}, true);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//开启预告
|
|
|
$('tbody').on('click', '.open-promotion', function() {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
|
|
|
common.dialog.confirm("温馨提示", "你确定要开启预告吗?", function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/promotionInfo/updatePromotionNoticeStatus',
|
|
|
data: {
|
|
|
id: item.id,
|
|
|
noticeStatus: 1
|
|
|
}
|
|
|
}, function(res) {
|
|
|
if (res.code == 200) {
|
|
|
common.util.__tip('开启成功', 'success');
|
|
|
g.reload();
|
|
|
} else {
|
|
|
common.util.__tip(res.message);
|
|
|
}
|
|
|
}, true);
|
|
|
});
|
|
|
}); |
...
|
...
|
|