...
|
...
|
@@ -81,6 +81,21 @@ var $ = require('jquery'), |
|
|
return "开始时间和结束时间必须同时存在";
|
|
|
}
|
|
|
});
|
|
|
e.on("validate", function() {
|
|
|
var temp = $("#productPoolId").val();
|
|
|
if(!temp || temp == -1) {
|
|
|
return "请填写商品池";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
e.on("validate", function() {
|
|
|
if(($("#promotion1").is(":checked") && !$("#promotionName1").val())
|
|
|
|| ($("#promotion2").is(":checked") && (!$("#promotionName2").val() || !$("#promotionName3").val()))
|
|
|
|| ($("#promotion4").is(":checked") && !$("#promotionName4").val())
|
|
|
|| ($("#promotion5").is(":checked") && !$("#promotionName5").val())) {
|
|
|
return "请将折扣形式填写完整";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
common.dialog.confirm(hint,
|
|
|
common.util.__template($("#template").html(), item),
|
...
|
...
|
@@ -90,22 +105,18 @@ var $ = require('jquery'), |
|
|
if(typeof option.data.startTime == "string") {
|
|
|
option.data.startTime=new Date(option.data.startTime).getTime() / 1000;
|
|
|
option.data.endTime=new Date(option.data.endTime).getTime() / 1000;
|
|
|
// console.log(option.data.startTime);
|
|
|
}
|
|
|
var arr;
|
|
|
try {
|
|
|
arr=option.data.promotionName.split(":")//"promotionName1:折起";
|
|
|
option.data.promotionName = "";
|
|
|
for(var i = 0; i < arr.length; i++) {
|
|
|
var value = "";
|
|
|
try {
|
|
|
value = $("#" + arr[i]).val();
|
|
|
} catch(e) {
|
|
|
value = arr[i];
|
|
|
}
|
|
|
option.data.promotionName += value ? value : arr[i];
|
|
|
|
|
|
var val=$('input:radio[name="promotionName"]:checked').val();
|
|
|
if(val == 1) {
|
|
|
option.data.promotionName = $("#promotionName1").val() + "折起";
|
|
|
}else if(val == 2) {
|
|
|
option.data.promotionName = $("#promotionName2").val() + "~" + $("#promotionName3").val() + "折";
|
|
|
}else if(val == 4) {
|
|
|
option.data.promotionName = $("#promotionName4").val() + "元起";
|
|
|
}else if(val == 5) {
|
|
|
option.data.promotionName = $("#promotionName5").val() + "%Off";
|
|
|
}
|
|
|
}catch(e){}
|
|
|
|
|
|
option.success=function(){
|
|
|
g.reload();
|
...
|
...
|
@@ -134,6 +145,7 @@ var $ = require('jquery'), |
|
|
$("#promotion5").attr("checked","checked");
|
|
|
}
|
|
|
}
|
|
|
console.log($("#promotion1").val());
|
|
|
|
|
|
e.init();
|
|
|
new common.dropDown({el: "#productPoolId","ajax":"productPool"});
|
...
|
...
|
@@ -143,11 +155,8 @@ var $ = require('jquery'), |
|
|
url:'/runManage/subjectManage/queryBaseProductPoolListById',
|
|
|
data:{id:item.productPoolId}
|
|
|
},function(res) {
|
|
|
// console.log(res);
|
|
|
$("#select2-productPoolId-container").html(res.data[0].text);
|
|
|
},true);
|
|
|
} else {
|
|
|
$("#select2-productPoolId-container").html("选择商品池");
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|