Authored by liuyue

Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop

@@ -15,7 +15,9 @@ if(param){ @@ -15,7 +15,9 @@ if(param){
15 },true); 15 },true);
16 } 16 }
17 /*审核*/ 17 /*审核*/
18 -// RESPONSEDATA.shenghe=true; 18 +if($("#isShenHe").val()){
  19 + RESPONSEDATA.shenghe=true;
  20 +}
19 21
20 22
21 $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA)); 23 $("#basicInfo").html(common.util.__template2($("#template2").html(),RESPONSEDATA));
@@ -57,13 +59,14 @@ var e=new common.edit("#basicInfo"); @@ -57,13 +59,14 @@ var e=new common.edit("#basicInfo");
57 e.init(); 59 e.init();
58 60
59 //baseTable 61 //baseTable
  62 +
60 var g=new common.grid({ 63 var g=new common.grid({
61 el:"#basicTable", 64 el:"#basicTable",
62 columns:[ 65 columns:[
63 {display:"分类名称",render:function(item){ 66 {display:"分类名称",render:function(item){
64 var html=[]; 67 var html=[];
65 var txt=item.factoryGoodsName?item.factoryGoodsName:""; 68 var txt=item.factoryGoodsName?item.factoryGoodsName:"";
66 - html.push("<p>名称:<input type='text' class='w-goods-text' data-index="+item.__index+" value="+txt+" /><p>"); 69 + html.push("<p>名称:<input type='text' class='w-goods-text' data-index="+item.__index+" value='"+txt+"' placeholder='分类名称' required/><p>");
67 70
68 html.push("<p>色系:"+item.goodsName+"<p>"); 71 html.push("<p>色系:"+item.goodsName+"<p>");
69 html.push('<button type="button" data-index='+item.__index+' class="sortdelete btn btn-danger btn-xs">删除</button>'); 72 html.push('<button type="button" data-index='+item.__index+' class="sortdelete btn btn-danger btn-xs">删除</button>');
@@ -76,7 +79,7 @@ var g=new common.grid({ @@ -76,7 +79,7 @@ var g=new common.grid({
76 } 79 }
77 }, 80 },
78 { 81 {
79 - display:"<label class='red'>款型编码,xxx,xxx必填</label>",render:function(item){ 82 + display:"<label class='red'>分类名称,款型编码,选择尺码,默认销售价必填</label>",render:function(item){
80 var html=[]; 83 var html=[];
81 html.push("<div class='form-group'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='factoryCode form-control' placeholder='款型编码' required/></div></div>"); 84 html.push("<div class='form-group'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='factoryCode form-control' placeholder='款型编码' required/></div></div>");
82 html.push('<div class="rows" id="rows__'+item.__index+'">'); 85 html.push('<div class="rows" id="rows__'+item.__index+'">');
@@ -88,6 +91,7 @@ var g=new common.grid({ @@ -88,6 +91,7 @@ var g=new common.grid({
88 } 91 }
89 ], 92 ],
90 complete:function(){ 93 complete:function(){
  94 +
91 new common.dropDown({ 95 new common.dropDown({
92 el: ".btn-sort-chima", 96 el: ".btn-sort-chima",
93 ajax: "sortsize", 97 ajax: "sortsize",
@@ -95,13 +99,14 @@ var g=new common.grid({ @@ -95,13 +99,14 @@ var g=new common.grid({
95 "sortId" : tabTree.selected[0]?tabTree.selected[0].id:"" 99 "sortId" : tabTree.selected[0]?tabTree.selected[0].id:""
96 } 100 }
97 }); 101 });
  102 + g.__e.init();
98 } 103 }
99 }); 104 });
100 g.__rows=RESPONSEDATA.baseGoodList||[]; 105 g.__rows=RESPONSEDATA.baseGoodList||[];
101 g.__e=new common.edit("#basicTable",{bucket:"goodsimg"}); 106 g.__e=new common.edit("#basicTable",{bucket:"goodsimg"});
102 107
103 g.init(g.__rows); 108 g.init(g.__rows);
104 -g.__e.init(); 109 +
105 110
106 g.__e.on("callback", function(obj) { 111 g.__e.on("callback", function(obj) {
107 console.log(obj); 112 console.log(obj);
@@ -123,14 +128,14 @@ $(document).on("click",".sortadd",function(){ @@ -123,14 +128,14 @@ $(document).on("click",".sortadd",function(){
123 goodsSizeList: [$.extend({},ENUM.goodsSizeList)] 128 goodsSizeList: [$.extend({},ENUM.goodsSizeList)]
124 }); 129 });
125 g.reload(); 130 g.reload();
126 - g.__e.init(); 131 + // g.__e.init();
127 } 132 }
128 }); 133 });
129 $(document).on("click",".sortdelete",function(){ 134 $(document).on("click",".sortdelete",function(){
130 var index=$(this).data("index"); 135 var index=$(this).data("index");
131 [].splice.call(g.__rows,index,1); 136 [].splice.call(g.__rows,index,1);
132 g.reload(); 137 g.reload();
133 - g.__e.init(); 138 + // g.__e.init();
134 }); 139 });
135 $(document).on("change",".factoryCode",function(){ 140 $(document).on("change",".factoryCode",function(){
136 var item=g.__rows[$(this).data("index")]; 141 var item=g.__rows[$(this).data("index")];
@@ -140,14 +145,14 @@ $(document).on("click",".btn-sort-add",function(){ @@ -140,14 +145,14 @@ $(document).on("click",".btn-sort-add",function(){
140 var item=g.__rows[$(this).data("index")]; 145 var item=g.__rows[$(this).data("index")];
141 item.goodsSizeList.push($.extend({},ENUM.goodsSizeList)); 146 item.goodsSizeList.push($.extend({},ENUM.goodsSizeList));
142 g.reload(); 147 g.reload();
143 - g.__e.init(); 148 + // g.__e.init();
144 }); 149 });
145 $(document).on("click",".btn-sort-remove",function(){ 150 $(document).on("click",".btn-sort-remove",function(){
146 var item=g.__rows[$(this).data("index")]; 151 var item=g.__rows[$(this).data("index")];
147 var __index=$(this).data("eq"); 152 var __index=$(this).data("eq");
148 [].splice.call(item.goodsSizeList,__index,1); 153 [].splice.call(item.goodsSizeList,__index,1);
149 g.reload(); 154 g.reload();
150 - g.__e.init(); 155 + // g.__e.init();
151 }); 156 });
152 $(document).on("change",".btn-sort-chima",function(){ 157 $(document).on("change",".btn-sort-chima",function(){
153 var _index=$(this).data("index"); 158 var _index=$(this).data("index");
@@ -221,8 +221,13 @@ var g = new common.grid({ @@ -221,8 +221,13 @@ var g = new common.grid({
221 {display:"操作",render:function(item){ 221 {display:"操作",render:function(item){
222 var html=[]; 222 var html=[];
223 223
  224 + if(item.isAuditing==200){
  225 + //审核
  226 + html.push('<a data-index="'+ item.__index+ '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update2/'+item.productSkn+'">修改</a>');
  227 + }else{
  228 + html.push('<a data-index="'+ item.__index+ '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/'+item.productSkn+'">修改</a>');
  229 + }
224 230
225 - html.push('<a data-index="'+ item.__index+ '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/'+item.productSkn+'">修改</a>');  
226 if (item.isAuditing!=200) { // 200 审核通过 231 if (item.isAuditing!=200) { // 200 审核通过
227 html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn apply-success">通过</a>'); 232 html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn apply-success">通过</a>');
228 } 233 }
@@ -100,7 +100,7 @@ exports.res = [ @@ -100,7 +100,7 @@ exports.res = [
100 {name:'isLimitbuy',type:'String'}, 100 {name:'isLimitbuy',type:'String'},
101 {name:'isLimited',type:'String'}, 101 {name:'isLimited',type:'String'},
102 {name:'isPromotionalGifts',type:'String'}, 102 {name:'isPromotionalGifts',type:'String'},
103 - {name:'productName',type:'Number'}, 103 + {name:'productName',type:'String'},
104 {name:'productTag',type:'Number'}, 104 {name:'productTag',type:'Number'},
105 {name:'retailPriceStr',type:'String'}, 105 {name:'retailPriceStr',type:'String'},
106 {name:'salesPriceStr',type:'String'}, 106 {name:'salesPriceStr',type:'String'},
@@ -131,6 +131,18 @@ exports.res = [ @@ -131,6 +131,18 @@ exports.res = [
131 action:"/base/goods/ajax/update" 131 action:"/base/goods/ajax/update"
132 } 132 }
133 }, 133 },
  134 + {//审核修改页面
  135 + route:'/base/goods/update2/:productSkn',
  136 + method:'GET',
  137 + view:'pages/basegoods/edit',
  138 + url:'/productColor/queryProductColors',
  139 + src:'/basegoods/edit',
  140 + data:{
  141 + pageTitle:"审核基础商品",
  142 + isShenHe:"true",
  143 + action:""
  144 + }
  145 + },
134 {//修改接口 146 {//修改接口
135 route:'/base/goods/ajax/update', 147 route:'/base/goods/ajax/update',
136 method:'POST', 148 method:'POST',
@@ -147,7 +159,7 @@ exports.res = [ @@ -147,7 +159,7 @@ exports.res = [
147 {name:'isLimitbuy',type:'String'}, 159 {name:'isLimitbuy',type:'String'},
148 {name:'isLimited',type:'String'}, 160 {name:'isLimited',type:'String'},
149 {name:'isPromotionalGifts',type:'String'}, 161 {name:'isPromotionalGifts',type:'String'},
150 - {name:'productName',type:'Number'}, 162 + {name:'productName',type:'String'},
151 {name:'productTag',type:'Number'}, 163 {name:'productTag',type:'Number'},
152 {name:'retailPriceStr',type:'String'}, 164 {name:'retailPriceStr',type:'String'},
153 {name:'salesPriceStr',type:'String'}, 165 {name:'salesPriceStr',type:'String'},
@@ -50,13 +50,12 @@ @@ -50,13 +50,12 @@
50 </div> 50 </div>
51 </div> 51 </div>
52 52
  53 + <input type="hidden" id="isShenHe" value="{{isShenHe}}" />
  54 +
53 <div class="panel-footer"> 55 <div class="panel-footer">
54 <div class="row"> 56 <div class="row">
55 <div class="col-sm-8 col-sm-offset-2"> 57 <div class="col-sm-8 col-sm-offset-2">
56 <a href="javascript:;" class="btn btn-default" onclick="javascript:history.go(-1);">取消</a> 58 <a href="javascript:;" class="btn btn-default" onclick="javascript:history.go(-1);">取消</a>
57 - {{# add}}  
58 - <button type="submit" class="btn btn-info" data-loading-text="暂存中..." id="btnTemporary">暂存</button>  
59 - {{/ add}}  
60 <button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button> 59 <button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button>
61 </div> 60 </div>
62 </div> 61 </div>
@@ -84,7 +83,7 @@ @@ -84,7 +83,7 @@
84 <input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input> 83 <input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
85 </div> 84 </div>
86 <div class="col-sm-2"> 85 <div class="col-sm-2">
87 - <select class="form-control btn-sort-kebu" value="[[item.isSuppled]]" data-index=[[index]] data-eq=[[__index]]> 86 + <select class="form-control btn-sort-kebu" value="[[item.isSuppled||'N']]" data-index=[[index]] data-eq=[[__index]]>
88 <option value="N">不可补货</option> 87 <option value="N">不可补货</option>
89 <option value="Y">可补货</option> 88 <option value="Y">可补货</option>
90 </select> 89 </select>
@@ -206,12 +205,12 @@ @@ -206,12 +205,12 @@
206 <label class="col-sm-2 control-label">适销季<span class="red">*</span></label> 205 <label class="col-sm-2 control-label">适销季<span class="red">*</span></label>
207 <div class="col-sm-2"> 206 <div class="col-sm-2">
208 <label class="radio-inline"> 207 <label class="radio-inline">
209 - <input type="checkbox" name="ooooo" value="1"></label> 208 + <input type="checkbox" name="seasons" value="1"></label>
210 <label class="radio-inline"> 209 <label class="radio-inline">
211 - <input type="checkbox" name="ooooo" value="2"></label> 210 + <input type="checkbox" name="seasons" value="2"></label>
212 <label class="radio-inline"> 211 <label class="radio-inline">
213 - <input type="checkbox" name="ooooo" value="3">四季</label>  
214 - <input type="hidden" id="ooooo" name="ooooo" value="[[ooooo||'1']]" for="checkbox" placeholder="年龄层" /> 212 + <input type="checkbox" name="seasons" value="3">四季</label>
  213 + <input type="hidden" id="seasons" name="seasons" value="[[seasons||'1']]" for="checkbox" placeholder="年龄层" />
215 </div> 214 </div>
216 [[else]] 215 [[else]]
217 <div class="col-sm-4"></div> 216 <div class="col-sm-4"></div>
@@ -259,10 +258,10 @@ @@ -259,10 +258,10 @@
259 <label class="col-sm-2 control-label">是否预购</label> 258 <label class="col-sm-2 control-label">是否预购</label>
260 <div class="col-sm-2"> 259 <div class="col-sm-2">
261 <label class="radio-inline"> 260 <label class="radio-inline">
262 - <input type="radio" name="ooooo" value="Y"></label> 261 + <input type="radio" name="isAdvance" value="Y"></label>
263 <label class="radio-inline"> 262 <label class="radio-inline">
264 - <input type="radio" name="ooooo" value="N"></label>  
265 - <input type="hidden" id="ooooo" value="[[ooooo]]" for="radio" /> 263 + <input type="radio" name="isAdvance" value="N"></label>
  264 + <input type="hidden" id="isAdvance" value="[[isAdvance]]" for="radio" />
266 </div> 265 </div>
267 [[/if]] 266 [[/if]]
268 </div> 267 </div>
@@ -271,22 +270,15 @@ @@ -271,22 +270,15 @@
271 <label class="col-sm-2 control-label">是否奥莱</label> 270 <label class="col-sm-2 control-label">是否奥莱</label>
272 <div class="col-sm-2"> 271 <div class="col-sm-2">
273 <label class="radio-inline"> 272 <label class="radio-inline">
274 - <input type="radio" name="oooo" value="1">品牌设置</label> 273 + <input type="radio" name="outletsSetting " value="B">品牌设置</label>
275 <label class="radio-inline"> 274 <label class="radio-inline">
276 - <input type="radio" name="oooo" value="Y"></label> 275 + <input type="radio" name="outletsSetting " value="Y"></label>
277 <label class="radio-inline"> 276 <label class="radio-inline">
278 - <input type="radio" name="oooo" value="N"></label>  
279 - <input type="hidden" id="oooo" value="[[oooo]]" for="radio" /> 277 + <input type="radio" name="outletsSetting " value="N"></label>
  278 + <input type="hidden" id="outletsSetting " value="[[outletsSetting ]]" for="radio" />
280 </div> 279 </div>
281 280
282 - <label class="col-sm-2 control-label">是否预购</label>  
283 - <div class="col-sm-2">  
284 - <label class="radio-inline">  
285 - <input type="radio" name="ooooo" value="Y"></label>  
286 - <label class="radio-inline">  
287 - <input type="radio" name="ooooo" value="N"></label>  
288 - <input type="hidden" id="ooooo" value="[[ooooo]]" for="radio" />  
289 - </div> 281 +
290 </div> 282 </div>
291 [[/if]] 283 [[/if]]
292 284
@@ -295,17 +287,15 @@ @@ -295,17 +287,15 @@
295 <label class="col-sm-2 control-label">是否VIP</label> 287 <label class="col-sm-2 control-label">是否VIP</label>
296 <div class="col-sm-2"> 288 <div class="col-sm-2">
297 <label class="radio-inline"> 289 <label class="radio-inline">
298 - <input type="radio" name="oooo" value="1">品牌设置</label>  
299 - <label class="radio-inline">  
300 - <input type="radio" name="oooo" value="Y">开启</label> 290 + <input type="radio" name="isVip" value="Y">开启</label>
301 <label class="radio-inline"> 291 <label class="radio-inline">
302 - <input type="radio" name="oooo" value="N">关闭</label>  
303 - <input type="hidden" id="oooo" value="[[oooo]]" for="radio" /> 292 + <input type="radio" name="isVip" value="N">关闭</label>
  293 + <input type="hidden" id="isVip" value="[[isVip]]" for="radio" />
304 </div> 294 </div>
305 295
306 <label class="col-sm-2 control-label">预售库存</label> 296 <label class="col-sm-2 control-label">预售库存</label>
307 <div class="col-sm-2"> 297 <div class="col-sm-2">
308 - <input type="number" id="oooo" class="form-control" value="[[oooo]]" /> 298 + <input type="number" id="stock" class="form-control" value="[[stock]]" />
309 </div> 299 </div>
310 </div> 300 </div>
311 [[/if]] 301 [[/if]]