Authored by chenchao

1. reject promotion list , remove current promotion

2. validate before save basic info
... ... @@ -108,6 +108,7 @@ module.exports={
title:"设置促销显示",
url:"/promotion/getActivePromotionInfoList",
params:[
{name: 'id', type: 'Number'},
{name: 'startTimeStr', type: 'string'},
{name: 'endTimeStr', type: 'string'},
{name: 'page',type: 'Number'},
... ...
... ... @@ -8,11 +8,15 @@ var baseInfoEdit={
edit:null,
actionUrl:"/promotionInfo/update",
load:function(config){
var _g=this;
var _e= new edit("#tab_body",{});
this.edit=_e;
if(config){
this.promotionId=config.promotionId
}
_e.on("validate", function () {
return _g.validate();
});
_e.init();
this.bindEvent();
},
... ... @@ -20,6 +24,27 @@ var baseInfoEdit={
var _g=this;
$(document).on('click','#save_baseinfo',function(){return _g.save()});
},
validate:function(){
var promotionParams=PromotionInfo.promotionParams;
var status=$("#form_base_info").find("input#status").val();
if(status===1 || status=='1'){
var msg="先设置好促销操作和条件后才能开启";
if(!promotionParams){
return msg;
}
if(!promotionParams.promotionType){
return msg;
}
if(!promotionParams.conditionParam){
return msg;
}
}
return true;
},
save:function(){
var _g=this;
var e=this.edit;
... ...
... ... @@ -126,7 +126,8 @@ var rejectPromotions={
this.batchIds=_config.reject || [];
var parmsData={
startTimeStr: _config.startTimeStr,
endTimeStr: _config.endTimeStr
endTimeStr: _config.endTimeStr,
id:_config.promotionId
};
var g=this,
_param=this.getParam({parmsData : parmsData});
... ...