Authored by ping

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

@@ -7,7 +7,17 @@ var tabTree=new common.tabTree("#tree"); @@ -7,7 +7,17 @@ var tabTree=new common.tabTree("#tree");
7 tabTree.init(); 7 tabTree.init();
8 8
9 var ENUM={ 9 var ENUM={
10 - goodsSizeList:{"factoryCode":"","sizeId":"","salePrice":""} 10 + /*
  11 + *marketPrice 市场价
  12 + *salePrice 销售价
  13 + *factoryCode 厂家编号
  14 + *storageNum 库存量
  15 + *sizeId 尺码
  16 + *sizeName 尺码名称
  17 + *isSuppled 能否补货,'N','Y'
  18 + *barCode 条形码
  19 + */
  20 + goodsSizeList:{"sizeId":"","salePrice":"","barCode":"","isSuppled":""}
11 } 21 }
12 //baseTable 22 //baseTable
13 var g=new common.grid({ 23 var g=new common.grid({
@@ -29,7 +39,7 @@ var g=new common.grid({ @@ -29,7 +39,7 @@ var g=new common.grid({
29 var html=[]; 39 var html=[];
30 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>"); 40 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>");
31 html.push('<div class="rows" id="rows__'+item.__index+'">'); 41 html.push('<div class="rows" id="rows__'+item.__index+'">');
32 - item.goodsSizeList=item.goodsSizeList||[{"factoryCode":"","sizeId":"","salePrice":""}]; 42 + item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
33 html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList})); 43 html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList}));
34 html.push('</div>'); 44 html.push('</div>');
35 return html.join(''); 45 return html.join('');
@@ -59,7 +69,7 @@ $(document).on("click",".sortadd",function(){ @@ -59,7 +69,7 @@ $(document).on("click",".sortadd",function(){
59 "goodsColorImage": "", 69 "goodsColorImage": "",
60 goodsName: $(this).text(), 70 goodsName: $(this).text(),
61 colorId: (+$(this).data("id")), 71 colorId: (+$(this).data("id")),
62 - goodsSizeList: [{"factoryCode":"","sizeId":"","salePrice":""}] 72 + goodsSizeList: [$.extend({},ENUM.goodsSizeList)]
63 }); 73 });
64 g.reload(); 74 g.reload();
65 g.__e.init(); 75 g.__e.init();
@@ -77,7 +87,7 @@ $(document).on("change",".factoryCode",function(){ @@ -77,7 +87,7 @@ $(document).on("change",".factoryCode",function(){
77 }); 87 });
78 $(document).on("click",".btn-sort-add",function(){ 88 $(document).on("click",".btn-sort-add",function(){
79 var item=g.__rows[$(this).data("index")]; 89 var item=g.__rows[$(this).data("index")];
80 - item.goodsSizeList.push({"factoryCode":"","sizeId":"","salePrice":""}); 90 + item.goodsSizeList.push($.extend({},ENUM.goodsSizeList));
81 g.reload(); 91 g.reload();
82 g.__e.init(); 92 g.__e.init();
83 }); 93 });
@@ -105,14 +115,13 @@ $(document).on("change",".btn-sort-tiaoma",function(){ @@ -105,14 +115,13 @@ $(document).on("change",".btn-sort-tiaoma",function(){
105 var _index=$(this).data("index"); 115 var _index=$(this).data("index");
106 var _eq=$(this).data("eq"); 116 var _eq=$(this).data("eq");
107 var item=g.__rows[_index].goodsSizeList[_eq]; 117 var item=g.__rows[_index].goodsSizeList[_eq];
108 - item.factoryCode=$(this).val();  
109 - 118 + item.barCode=$(this).val();
110 }); 119 });
111 $(document).on("change",".btn-sort-kebu",function(){ 120 $(document).on("change",".btn-sort-kebu",function(){
112 var _index=$(this).data("index"); 121 var _index=$(this).data("index");
113 var _eq=$(this).data("eq"); 122 var _eq=$(this).data("eq");
114 var item=g.__rows[_index].goodsSizeList[_eq]; 123 var item=g.__rows[_index].goodsSizeList[_eq];
115 - item.buhuo=$(this).val(); 124 + item.isSuppled=$(this).val();
116 }); 125 });
117 var e=new common.edit("#basicInfo"); 126 var e=new common.edit("#basicInfo");
118 e.on("validate",function(){ 127 e.on("validate",function(){
@@ -128,7 +137,7 @@ $(document).on("click","#btnReview",function(){ @@ -128,7 +137,7 @@ $(document).on("click","#btnReview",function(){
128 res = res.data; 137 res = res.data;
129 if(res.code == "200") { 138 if(res.code == "200") {
130 e.$tip("提交成功", function() { 139 e.$tip("提交成功", function() {
131 - location.href="/activity/drawline/index" 140 + location.href="/supplier/baseproduct/index"
132 }, 'growl-success'); 141 }, 'growl-success');
133 }else{ 142 }else{
134 e.$tip(res.message); 143 e.$tip(res.message);
@@ -139,4 +148,12 @@ $(document).on("click","#btnReview",function(){ @@ -139,4 +148,12 @@ $(document).on("click","#btnReview",function(){
139 } 148 }
140 }); 149 });
141 return false; 150 return false;
142 -});  
  151 +});
  152 +
  153 +/*
  154 +* 分类id怎么传
  155 +*
  156 +*
  157 +*
  158 +*
  159 +**/
@@ -69,13 +69,7 @@ tabTree.prototype= { @@ -69,13 +69,7 @@ tabTree.prototype= {
69 p = this.options; 69 p = this.options;
70 g.dom["cityboxbtn"].click(function(event) { 70 g.dom["cityboxbtn"].click(function(event) {
71 g.dom["cityboxbtn"].addClass("select"); 71 g.dom["cityboxbtn"].addClass("select");
72 - g.dom["citybox"].show().css("top", g.inputHeight + "px");  
73 - if ($("iframe", g.element).length > 0) {  
74 - $("iframe", g.element).css({  
75 - top: g.inputHeight + "px",  
76 - height: g.dom["citybox"].height()  
77 - })  
78 - } 72 + g.dom["citybox"].show().css("top", (g.inputHeight-10) + "px");
79 g.dom["chooseArea"].children("p").each(function() { 73 g.dom["chooseArea"].children("p").each(function() {
80 if ($(this).hasClass("disable") && $(this).hasClass("cur")) { 74 if ($(this).hasClass("disable") && $(this).hasClass("cur")) {
81 g.active_count = 0; 75 g.active_count = 0;
@@ -284,11 +278,6 @@ tabTree.prototype= { @@ -284,11 +278,6 @@ tabTree.prototype= {
284 p = this.options; 278 p = this.options;
285 g.dom["cityboxbtn"].removeClass("select"); 279 g.dom["cityboxbtn"].removeClass("select");
286 g.dom["citybox"].hide(); 280 g.dom["citybox"].hide();
287 - if ($("iframe", g.element).length > 0) {  
288 - $("iframe", g.element).css({  
289 - height: 0 + "px"  
290 - })  
291 - }  
292 }, 281 },
293 select: function(rp) { 282 select: function(rp) {
294 var g = this, 283 var g = this,
@@ -346,7 +335,7 @@ tabTree.prototype= { @@ -346,7 +335,7 @@ tabTree.prototype= {
346 var g = this, 335 var g = this,
347 p = this.options; 336 p = this.options;
348 g.dom["cityboxbtn"].addClass("select"); 337 g.dom["cityboxbtn"].addClass("select");
349 - g.dom["citybox"].show().css("top", g.inputHeight + "px"); 338 + g.dom["citybox"].show().css("top", (g.inputHeight-10) + "px");
350 if (g.selected.length - parseInt(rp) >= 0) { 339 if (g.selected.length - parseInt(rp) >= 0) {
351 g.active_count = parseInt(rp); 340 g.active_count = parseInt(rp);
352 g.getData(g._getParam(g.active_count)) 341 g.getData(g._getParam(g.active_count))
@@ -21,7 +21,8 @@ var util={ @@ -21,7 +21,8 @@ var util={
21 return false; 21 return false;
22 } 22 }
23 }, 23 },
24 - error:function(){ 24 + error:function(err){
  25 + console.log("ajax.ERROR",err);
25 return false; 26 return false;
26 } 27 }
27 }); 28 });
@@ -424,6 +424,14 @@ $('#sure-change').on('click', function() { @@ -424,6 +424,14 @@ $('#sure-change').on('click', function() {
424 arr.push(value.newProductPriceBo); 424 arr.push(value.newProductPriceBo);
425 }); 425 });
426 426
  427 + // var count=Math.ceil(arr.length/200);
  428 + // for(var i=0;i<count;i++){
  429 + // item=arr.slice(i*200,(i+1)*200);
  430 + // }
  431 + // while(item=arr.slice(2,4)){
  432 +
  433 + // }
  434 +
427 data = JSON.stringify(arr); 435 data = JSON.stringify(arr);
428 console.log(data); 436 console.log(data);
429 common.util.__ajax({ 437 common.util.__ajax({
@@ -437,6 +445,7 @@ $('#sure-change').on('click', function() { @@ -437,6 +445,7 @@ $('#sure-change').on('click', function() {
437 path = res.data; 445 path = res.data;
438 successList.length = 0; 446 successList.length = 0;
439 }); 447 });
  448 +
440 }); 449 });
441 450
442 $('#download-btn').on('click', function() { 451 $('#download-btn').on('click', function() {
@@ -389,9 +389,8 @@ ul { @@ -389,9 +389,8 @@ ul {
389 .citySelect { 389 .citySelect {
390 position: relative; 390 position: relative;
391 z-index: 99; 391 z-index: 99;
392 - height: 38px;  
393 - line-height: 38px;  
394 - border-radius: 3px; 392 + height: 30px;
  393 + line-height: 30px
395 } 394 }
396 395
397 .citySelect b { 396 .citySelect b {
@@ -415,9 +414,10 @@ ul { @@ -415,9 +414,10 @@ ul {
415 position: relative; 414 position: relative;
416 float: left; 415 float: left;
417 border: 1px solid #ccc; 416 border: 1px solid #ccc;
418 - height: 27px;  
419 - line-height: 27px;  
420 - padding: 0 38px 0 5px; 417 + height: 37px;
  418 + line-height: 37px;
  419 + border-radius:3px;
  420 + padding: 0 38px 0 10px;
421 color: #333; 421 color: #333;
422 z-index: 99; 422 z-index: 99;
423 white-space: nowrap 423 white-space: nowrap
@@ -46,7 +46,8 @@ exports.res = [ @@ -46,7 +46,8 @@ exports.res = [
46 method:'GET', 46 method:'GET',
47 view:'pages/basegoods/edit', 47 view:'pages/basegoods/edit',
48 data:{ 48 data:{
49 - data:{} 49 + data:{},
  50 + action:"/base/goods/ajax/add"
50 }, 51 },
51 src:'/basegoods/edit' 52 src:'/basegoods/edit'
52 }, 53 },
@@ -255,10 +255,10 @@ @@ -255,10 +255,10 @@
255 <input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required></input> 255 <input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required></input>
256 </div> 256 </div>
257 <div class="col-sm-2"> 257 <div class="col-sm-2">
258 - <input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input> 258 + <input class="form-control btn-sort-tiaoma" value="[[item.barCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
259 </div> 259 </div>
260 <div class="col-sm-2"> 260 <div class="col-sm-2">
261 - <select class="form-control btn-sort-kebu" value="[[item.buhuo]]" data-index=[[index]] data-eq=[[__index]]> 261 + <select class="form-control btn-sort-kebu" value="[[item.isSuppled]]" data-index=[[index]] data-eq=[[__index]]>
262 <option value="-1">能否补货</option> 262 <option value="-1">能否补货</option>
263 <option value="1">可补货</option> 263 <option value="1">可补货</option>
264 <option value="2">不可补货</option> 264 <option value="2">不可补货</option>