Showing
1 changed file
with
10 additions
and
91 deletions
@@ -85,12 +85,16 @@ var conditionEdit={ | @@ -85,12 +85,16 @@ var conditionEdit={ | ||
85 | var curnodeIndex=one_form_data[formDataKey.curnodeIndex.name]; | 85 | var curnodeIndex=one_form_data[formDataKey.curnodeIndex.name]; |
86 | if(Number(pnodeIndex)===0){//第二级 | 86 | if(Number(pnodeIndex)===0){//第二级 |
87 | conditions_l1[curnodeIndex]= obj_data; | 87 | conditions_l1[curnodeIndex]= obj_data; |
88 | + //支付方式没有第三级,没必要创建第三节点 | ||
89 | + if(condition_type_list[0].child[_g.base_conf.paymentIndex].name === obj_data["type"]){ | ||
90 | + continue; | ||
91 | + } | ||
88 | /* | 92 | /* |
89 | var form_data_l2 = one_form_data[formDataKey.data.name]; | 93 | var form_data_l2 = one_form_data[formDataKey.data.name]; |
90 | for(var key2 in form_data_l2){ | 94 | for(var key2 in form_data_l2){ |
91 | result[form_data_l2[key2][formSerializeArrayKey.name]]=form_data_l2[key2][formSerializeArrayKey.value]; | 95 | result[form_data_l2[key2][formSerializeArrayKey.name]]=form_data_l2[key2][formSerializeArrayKey.value]; |
92 | }*/ | 96 | }*/ |
93 | - | 97 | + //创建第三节点 |
94 | if(!conditions_l1[curnodeIndex]["conditions"]){ | 98 | if(!conditions_l1[curnodeIndex]["conditions"]){ |
95 | conditions_l1[curnodeIndex]["conditions"]=[]; | 99 | conditions_l1[curnodeIndex]["conditions"]=[]; |
96 | } | 100 | } |
@@ -111,34 +115,7 @@ var conditionEdit={ | @@ -111,34 +115,7 @@ var conditionEdit={ | ||
111 | result["conditions"] = conditions_l1; | 115 | result["conditions"] = conditions_l1; |
112 | return result; | 116 | return result; |
113 | 117 | ||
114 | - }, | ||
115 | - /* | ||
116 | - getSortId:function(_params){ | ||
117 | - var _g=this; | ||
118 | - var pNodeIndex=_params.pNodeIndex, | ||
119 | - curNodeIndex=_params.curNodeIndex, | ||
120 | - form_data =_params.form_data; | ||
121 | - var suffixIndex=pNodeIndex+"_"+curNodeIndex; | ||
122 | - var _sortTres = _g.sortTree[suffixIndex]; | ||
123 | - var selectedSort; | ||
124 | - var sortId; | ||
125 | - //condition_product_sort | ||
126 | - var _row; | ||
127 | - for(var key in form_data){ | ||
128 | - _row=form_data[key]; | ||
129 | - if(_row[formSerializeArrayKey.name]==="type" | ||
130 | - && _row[formSerializeArrayKey.value] === condition_type_list[0].child[_g.base_conf.productIndex].child[_g.base_conf.product_sort_index].name){ | ||
131 | - for(var i=3;i>=0;i--){ | ||
132 | - selectedSort=_sortTres.selected[i] | ||
133 | - if(selectedSort){ | ||
134 | - sortId=selectedSort.id; | ||
135 | - break; | ||
136 | - } | ||
137 | - } | ||
138 | - } | ||
139 | - } | ||
140 | - return sortId; | ||
141 | - },*/ | 118 | + }, |
142 | bindEvent : function(){ | 119 | bindEvent : function(){ |
143 | var _g=this; | 120 | var _g=this; |
144 | $("#save_condition").off(); | 121 | $("#save_condition").off(); |
@@ -201,17 +178,14 @@ var conditionEdit={ | @@ -201,17 +178,14 @@ var conditionEdit={ | ||
201 | 178 | ||
202 | common.util.__ajax2({url : "/promotion/setCondition", data:reqData},function(rs){ | 179 | common.util.__ajax2({url : "/promotion/setCondition", data:reqData},function(rs){ |
203 | if(rs.code == 200){ | 180 | if(rs.code == 200){ |
204 | - common.util.__tip("保存成功!", "success"); | ||
205 | - //location.href = "/promotionInfo/edit/"+_g.promotionId; | 181 | + common.util.__tip("保存成功!", "success"); |
206 | promotionInfoRefresh.refresh({ | 182 | promotionInfoRefresh.refresh({ |
207 | tabLoader:_g.tabLoader, | 183 | tabLoader:_g.tabLoader, |
208 | columnName:_g.columnName, | 184 | columnName:_g.columnName, |
209 | promotionId:_g.promotionId | 185 | promotionId:_g.promotionId |
210 | }); | 186 | }); |
211 | }else{ | 187 | }else{ |
212 | - common.util.__tip(rs.message || rs.data.message); | ||
213 | - //location.reload(); | ||
214 | - | 188 | + common.util.__tip(rs.message || rs.data.message); |
215 | } | 189 | } |
216 | return false; | 190 | return false; |
217 | },function(rs){ | 191 | },function(rs){ |
@@ -563,8 +537,7 @@ var conditionEdit={ | @@ -563,8 +537,7 @@ var conditionEdit={ | ||
563 | //nodeindex | 537 | //nodeindex |
564 | _form_group.attr("nodeIndex",_nextNodeIndex2); | 538 | _form_group.attr("nodeIndex",_nextNodeIndex2); |
565 | var _content=$("<div></div>"); | 539 | var _content=$("<div></div>"); |
566 | - _content.attr("class","col-sm-6"); | ||
567 | - //<button class="btn btn-primary" onclick="PromotionEditor.loadTypeSel('condition_combine', 0, 1);">新增</button> | 540 | + _content.attr("class","col-sm-6"); |
568 | var _click_function ="PromotionEditor.loadTypeSel(\""+ _typeText +"\"," + _curNodeIndex + ',' + _nextNodeIndex2 + ");" | 541 | var _click_function ="PromotionEditor.loadTypeSel(\""+ _typeText +"\"," + _curNodeIndex + ',' + _nextNodeIndex2 + ");" |
569 | var _add_btn=$("<button class=\"btn btn-primary\">新增</button>"); | 542 | var _add_btn=$("<button class=\"btn btn-primary\">新增</button>"); |
570 | _add_btn.attr("onclick",_click_function); | 543 | _add_btn.attr("onclick",_click_function); |
@@ -762,61 +735,7 @@ var conditionEdit={ | @@ -762,61 +735,7 @@ var conditionEdit={ | ||
762 | break; | 735 | break; |
763 | } | 736 | } |
764 | } | 737 | } |
765 | - }, | ||
766 | - /* | ||
767 | - findSortById:function(_sortId,_productSortList){ | ||
768 | - var _g=this; | ||
769 | - | ||
770 | - | ||
771 | - if(_sortId){ | ||
772 | - if(!_productSortList|| _productSortList===null){ | ||
773 | - return; | ||
774 | - } | ||
775 | - var _sort_list = _productSortList; | ||
776 | - var _c_sort; | ||
777 | - var _subList; | ||
778 | - for(var sortId in _sort_list){ | ||
779 | - _c_sort=null; | ||
780 | - if(_sort_list[sortId].id===_sortId){ | ||
781 | - _c_sort=_sort_list[sortId]; | ||
782 | - | ||
783 | - }else{ | ||
784 | - if(!_sort_list[sortId].subList){ | ||
785 | - continue; | ||
786 | - } | ||
787 | - _c_sort = _g.findSortById(_sortId, _sort_list[sortId].subList); | ||
788 | - } | ||
789 | - if(_c_sort){ | ||
790 | - return _c_sort; | ||
791 | - } | ||
792 | - | ||
793 | - } | ||
794 | - | ||
795 | - | ||
796 | - } | ||
797 | - }, | ||
798 | - buildSortDataById:function(_sortId,_productSortList){ | ||
799 | - | ||
800 | - var _g=this, sortsData=[]; | ||
801 | - | ||
802 | - var _c_sort = _g.findSortById(_sortId,_productSortList); | ||
803 | - if(_c_sort){ | ||
804 | - sortsData[_c_sort.sortLevel-1]=_c_sort; | ||
805 | - if(_c_sort.sortLevel > 1 && _c_sort.sortCode.indexOf(",")>0){ | ||
806 | - var _len = _c_sort.sortLevel-1; | ||
807 | - var _sortIds = _c_sort.sortCode.split(",", _len); | ||
808 | - | ||
809 | - for(var _id in _sortIds){ | ||
810 | - var _sort = _g.findSortById(Number(_sortIds[_id]),_productSortList); | ||
811 | - if(_sort){ | ||
812 | - sortsData[_sort.sortLevel-1]=_sort; | ||
813 | - } | ||
814 | - } | ||
815 | - } | ||
816 | - } | ||
817 | - return sortsData; | ||
818 | - | ||
819 | - }*/ | 738 | + } |
820 | } | 739 | } |
821 | 740 | ||
822 | module.exports = conditionEdit; | 741 | module.exports = conditionEdit; |
-
Please register or login to post a comment