...
|
...
|
@@ -85,12 +85,16 @@ var conditionEdit={ |
|
|
var curnodeIndex=one_form_data[formDataKey.curnodeIndex.name];
|
|
|
if(Number(pnodeIndex)===0){//第二级
|
|
|
conditions_l1[curnodeIndex]= obj_data;
|
|
|
//支付方式没有第三级,没必要创建第三节点
|
|
|
if(condition_type_list[0].child[_g.base_conf.paymentIndex].name === obj_data["type"]){
|
|
|
continue;
|
|
|
}
|
|
|
/*
|
|
|
var form_data_l2 = one_form_data[formDataKey.data.name];
|
|
|
for(var key2 in form_data_l2){
|
|
|
result[form_data_l2[key2][formSerializeArrayKey.name]]=form_data_l2[key2][formSerializeArrayKey.value];
|
|
|
}*/
|
|
|
|
|
|
//创建第三节点
|
|
|
if(!conditions_l1[curnodeIndex]["conditions"]){
|
|
|
conditions_l1[curnodeIndex]["conditions"]=[];
|
|
|
}
|
...
|
...
|
@@ -111,34 +115,7 @@ var conditionEdit={ |
|
|
result["conditions"] = conditions_l1;
|
|
|
return result;
|
|
|
|
|
|
},
|
|
|
/*
|
|
|
getSortId:function(_params){
|
|
|
var _g=this;
|
|
|
var pNodeIndex=_params.pNodeIndex,
|
|
|
curNodeIndex=_params.curNodeIndex,
|
|
|
form_data =_params.form_data;
|
|
|
var suffixIndex=pNodeIndex+"_"+curNodeIndex;
|
|
|
var _sortTres = _g.sortTree[suffixIndex];
|
|
|
var selectedSort;
|
|
|
var sortId;
|
|
|
//condition_product_sort
|
|
|
var _row;
|
|
|
for(var key in form_data){
|
|
|
_row=form_data[key];
|
|
|
if(_row[formSerializeArrayKey.name]==="type"
|
|
|
&& _row[formSerializeArrayKey.value] === condition_type_list[0].child[_g.base_conf.productIndex].child[_g.base_conf.product_sort_index].name){
|
|
|
for(var i=3;i>=0;i--){
|
|
|
selectedSort=_sortTres.selected[i]
|
|
|
if(selectedSort){
|
|
|
sortId=selectedSort.id;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return sortId;
|
|
|
},*/
|
|
|
},
|
|
|
bindEvent : function(){
|
|
|
var _g=this;
|
|
|
$("#save_condition").off();
|
...
|
...
|
@@ -201,17 +178,14 @@ var conditionEdit={ |
|
|
|
|
|
common.util.__ajax2({url : "/promotion/setCondition", data:reqData},function(rs){
|
|
|
if(rs.code == 200){
|
|
|
common.util.__tip("保存成功!", "success");
|
|
|
//location.href = "/promotionInfo/edit/"+_g.promotionId;
|
|
|
common.util.__tip("保存成功!", "success");
|
|
|
promotionInfoRefresh.refresh({
|
|
|
tabLoader:_g.tabLoader,
|
|
|
columnName:_g.columnName,
|
|
|
promotionId:_g.promotionId
|
|
|
});
|
|
|
}else{
|
|
|
common.util.__tip(rs.message || rs.data.message);
|
|
|
//location.reload();
|
|
|
|
|
|
common.util.__tip(rs.message || rs.data.message);
|
|
|
}
|
|
|
return false;
|
|
|
},function(rs){
|
...
|
...
|
@@ -563,8 +537,7 @@ var conditionEdit={ |
|
|
//nodeindex
|
|
|
_form_group.attr("nodeIndex",_nextNodeIndex2);
|
|
|
var _content=$("<div></div>");
|
|
|
_content.attr("class","col-sm-6");
|
|
|
//<button class="btn btn-primary" onclick="PromotionEditor.loadTypeSel('condition_combine', 0, 1);">新增</button>
|
|
|
_content.attr("class","col-sm-6");
|
|
|
var _click_function ="PromotionEditor.loadTypeSel(\""+ _typeText +"\"," + _curNodeIndex + ',' + _nextNodeIndex2 + ");"
|
|
|
var _add_btn=$("<button class=\"btn btn-primary\">新增</button>");
|
|
|
_add_btn.attr("onclick",_click_function);
|
...
|
...
|
@@ -762,61 +735,7 @@ var conditionEdit={ |
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
/*
|
|
|
findSortById:function(_sortId,_productSortList){
|
|
|
var _g=this;
|
|
|
|
|
|
|
|
|
if(_sortId){
|
|
|
if(!_productSortList|| _productSortList===null){
|
|
|
return;
|
|
|
}
|
|
|
var _sort_list = _productSortList;
|
|
|
var _c_sort;
|
|
|
var _subList;
|
|
|
for(var sortId in _sort_list){
|
|
|
_c_sort=null;
|
|
|
if(_sort_list[sortId].id===_sortId){
|
|
|
_c_sort=_sort_list[sortId];
|
|
|
|
|
|
}else{
|
|
|
if(!_sort_list[sortId].subList){
|
|
|
continue;
|
|
|
}
|
|
|
_c_sort = _g.findSortById(_sortId, _sort_list[sortId].subList);
|
|
|
}
|
|
|
if(_c_sort){
|
|
|
return _c_sort;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
},
|
|
|
buildSortDataById:function(_sortId,_productSortList){
|
|
|
|
|
|
var _g=this, sortsData=[];
|
|
|
|
|
|
var _c_sort = _g.findSortById(_sortId,_productSortList);
|
|
|
if(_c_sort){
|
|
|
sortsData[_c_sort.sortLevel-1]=_c_sort;
|
|
|
if(_c_sort.sortLevel > 1 && _c_sort.sortCode.indexOf(",")>0){
|
|
|
var _len = _c_sort.sortLevel-1;
|
|
|
var _sortIds = _c_sort.sortCode.split(",", _len);
|
|
|
|
|
|
for(var _id in _sortIds){
|
|
|
var _sort = _g.findSortById(Number(_sortIds[_id]),_productSortList);
|
|
|
if(_sort){
|
|
|
sortsData[_sort.sortLevel-1]=_sort;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return sortsData;
|
|
|
|
|
|
}*/
|
|
|
}
|
|
|
}
|
|
|
|
|
|
module.exports = conditionEdit; |
|
|
\ No newline at end of file |
...
|
...
|
|