Authored by wangshusheng

修改

... ... @@ -34,6 +34,8 @@ module.exports = function (app){
app.post("/promotionInfo/update","promotion_updatePromotionInfo");
//删除促销信息
app.post("/promotionInfo/delete","promotion_deletePromotionInfo");
//开启促销预告
app.post("/promotionInfo/updatePromotionNoticeStatus","promotion_updatePromotionNoticeStatus");
//参数-促销条件
app.post("/promotion/setCondition","promotion_setCondition");
... ...
... ... @@ -52,6 +52,14 @@ module.exports={
{name: 'param', type: 'Number'}
]
},
updatePromotionNoticeStatus:{
title:"开启促销预告",
url:"/promotion/updatePromotionNoticeStatus",
params:[
{name: 'id', type: 'Number'},
{name: 'noticeStatus', type: 'Number'}
]
},
getPromotionInfoList:{
title:"查询列表",
url:"/promotion/getPromotionInfoList",
... ...
... ... @@ -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);
});
});
... ...