...
|
...
|
@@ -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;
|
...
|
...
|
|