Authored by 匡佳华

促销活动:参数校验

... ... @@ -250,7 +250,13 @@
$("#promotionEditForm").form("submit", {
url: url,
onSubmit: function (param) {
if (!$("#promotionEditForm").form("validate")) {
var initStatus = $("#promotionEditForm #initStatus").combobox("getValue");
if( initStatus == ""){
$.messager.alert("提示", "请选择活动是否开启", "error");
return false;
}
if($("#promotionEditForm #productScopeType").combobox("getValue") == ""){
$.messager.alert("提示", "请选择商品使用范围", "error");
return false;
}
//组装商品范围
... ... @@ -317,27 +323,6 @@
$.messager.alert("提示", "请填写完成促销参数!", "error");
return false;
}
//组装适用范围商品skns
/*if($("#promotionEditForm #productScopeType").combobox("getValue") == "skn" && $("#promotionEditForm #limitValues").textbox("getValue") == ""){
//上传skn
var input = $('#promotionEditForm input[name="sknFile"]')[0];
if(!input){
window.self.$.messager.alert("提示消息","请选择需要上传的文件!");
return false;
}
var files = input.files;
if(files.length == 0){
window.self.$.messager.alert("提示消息","请选择需要上传的文件!");
return false;
}
var filename = files[0].name;
//文件的后缀名
var extension = filename.substr(filename.lastIndexOf(".")).toLowerCase();
if(extension != ".xlsx"){
window.self.$.messager.alert("提示消息","请选择xlsx类型文件!");
return false;
}
}*/
//组装购买渠道
var businessClient = "";
... ... @@ -352,7 +337,6 @@
return false;
}
//组装可用订单类型
var productLimitType = "";
if($("#promotionEditForm #isAll").prop('checked') == true){
... ... @@ -373,12 +357,16 @@
$.messager.alert("提示", "请选择可用订单类型!", "error");
return false;
}
if (!$("#promotionEditForm").form("validate")) {
return false;
}
param.id = id;
param.promotionAmountConditions = promotionTypeParamses;
param.productTypeLimitList = productLimitType.substring(0,productLimitType.length - 1);
param.promotionProductScopes = productScope;
param.joinLimitType= 1;
param.initStatus = $("#promotionEditForm #initStatus").combobox("getValue");
param.initStatus = initStatus;
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后..."
... ...