Authored by chenchao

品牌支持搜索

... ... @@ -105,6 +105,7 @@ var conditionEdit={
promotionFlagList:null,
sortTree:{},
brands:{},
toJsonArray:function(_params){
var result={};
var one_form_data= _params.one_form_data;
... ... @@ -516,14 +517,30 @@ var conditionEdit={
caption :'品牌'
},*/
if("condition_product_brand"===_type_l3){
_g.setFormElementVal({pObj: _parent, type: "select", name: "operator", data: _data_level_3});
_g.setFormElementVal({pObj: _parent, type: "select", name: "value", data: _data_level_3});
var brand_id=_data_level_3["value"];
if(brand_id){
var suffixIndex = _key_level_2 + _g.base_conf.splitor + _level_3_index;
var brand = {};
$.each(_g.brandList,function(_index,_brand){
if(_brand.id == brand_id){
brand=_brand;
return false;
}
});
_g.brands[suffixIndex].setValue(brand);
}
}
/*
{
name:'condition_promotion_flag',
caption :'促销标记'
},*/
if("condition_product_brand"===_type_l3 || "condition_promotion_flag" === _type_l3){
if("condition_promotion_flag" === _type_l3){
_g.setFormElementVal({pObj: _parent, type: "select", name: "operator", data: _data_level_3});
_g.setFormElementVal({pObj: _parent, type: "select", name: "value", data: _data_level_3});
}
... ... @@ -670,6 +687,16 @@ var conditionEdit={
html_id:"fm_condition_product_brand"
});
var suffixIndex=pNodeIndex+"_"+curNodeIndex;
var brand = new common.dropDown({
el: '#brands_' + suffixIndex,
ajax: 'queryBrand',
hash: true,
params:function(){
return {userLimitFlag:false};
}
});
_g.brands[suffixIndex]=brand;
break;
case condition_type_list[0].child[_g.base_conf.productIndex].child[_g.base_conf.promotion_flag_index].name||'condition_promotion_flag':
... ... @@ -735,9 +762,10 @@ var conditionEdit={
nodeIndex:_params.pNodeIndex,
curnodeIndex:_params.curNodeIndex
};
/*
if(_g.brandList && _g.brandList.length>0){
_data.brandList=_g.brandList;
}
}*/
if(_g.promotionFlagList && _g.promotionFlagList.length>0){
_data.promotionFlagList=_g.promotionFlagList;
}
... ... @@ -757,10 +785,25 @@ var conditionEdit={
* @param liDomId
*/
delCondition : function(pnodeIndex,nodeIndex) {
var _g=this;
if(pnodeIndex===0){
$('div[pnodeIndex="' + nodeIndex+'"]').remove();
}
$('div[pnodeIndex="' + pnodeIndex+'"][nodeIndex="'+ nodeIndex +'"]').remove();
var suffixIndex=pnodeIndex+"_"+nodeIndex;
for(var _name in _g.sortTree){
if(_name == suffixIndex){
delete _g.sortTree[_name];
break;
}
}
for(var _name in _g.brands){
if(_name == suffixIndex){
delete _g.brands[_name];
break;
}
}
},
findSortById:function(_sortId,_productSortList){
var _g=this;
... ...