Merge branch 'release/1.6' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into release/1.6
Showing
6 changed files
with
73 additions
and
37 deletions
@@ -341,6 +341,7 @@ grid.prototype = { | @@ -341,6 +341,7 @@ grid.prototype = { | ||
341 | reload: function(param) { | 341 | reload: function(param) { |
342 | var g = this, | 342 | var g = this, |
343 | p = this.options; | 343 | p = this.options; |
344 | + | ||
344 | if (param == 1) { | 345 | if (param == 1) { |
345 | p.page = 1; | 346 | p.page = 1; |
346 | } | 347 | } |
@@ -41,7 +41,7 @@ var util = { | @@ -41,7 +41,7 @@ var util = { | ||
41 | success: function(res) { | 41 | success: function(res) { |
42 | res = res.data; | 42 | res = res.data; |
43 | if (res.code != 200) { | 43 | if (res.code != 200) { |
44 | - util.__tip(res.message, "danger"); | 44 | + util.__tip(res.message, "warning"); |
45 | } else { | 45 | } else { |
46 | return callback.bind(this, res)(); | 46 | return callback.bind(this, res)(); |
47 | } | 47 | } |
@@ -382,31 +382,8 @@ $('#export-btn').on('click', function() { | @@ -382,31 +382,8 @@ $('#export-btn').on('click', function() { | ||
382 | window.open("/ajax/down?queryConf=" + JSON.stringify(data) + "&type=netSale"); | 382 | window.open("/ajax/down?queryConf=" + JSON.stringify(data) + "&type=netSale"); |
383 | }); | 383 | }); |
384 | 384 | ||
385 | -//单个sku,skc上下架 | ||
386 | -$('#basicTable').on('click', '.shelve-btn', function() { | ||
387 | - var that = this, | ||
388 | - skn = $(this).data('skn'), | ||
389 | - shelveModalHtml = '', | ||
390 | - shelveLayer = null; | ||
391 | - | ||
392 | - $(that).addClass('disabled'); | ||
393 | - | ||
394 | - common.util.__ajax({ | ||
395 | - url: '/goods/netsale/getdata', | ||
396 | - data: { | ||
397 | - param: skn | ||
398 | - } | ||
399 | - }, function(res) { | ||
400 | - shelveModalHtml = common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct); | ||
401 | - shelveLayer = common.dialog.open({ | ||
402 | - title: '上/下架', | ||
403 | - width: 900, | ||
404 | - content: shelveModalHtml | ||
405 | - }); | ||
406 | - | ||
407 | - $(that).removeClass('disabled'); | ||
408 | - | ||
409 | - var shelveTable = new common.grid({ | 385 | +//sku skc上架表格 |
386 | +var shelveTable = new common.grid({ | ||
410 | el: "#shelve-table", | 387 | el: "#shelve-table", |
411 | secondIndex: 2, | 388 | secondIndex: 2, |
412 | columns: [{ | 389 | columns: [{ |
@@ -453,7 +430,32 @@ $('#basicTable').on('click', '.shelve-btn', function() { | @@ -453,7 +430,32 @@ $('#basicTable').on('click', '.shelve-btn', function() { | ||
453 | } | 430 | } |
454 | } | 431 | } |
455 | }] | 432 | }] |
433 | +}); | ||
434 | + | ||
435 | +//单个sku,skc上下架 | ||
436 | +$('#basicTable').on('click', '.shelve-btn', function() { | ||
437 | + var that = this, | ||
438 | + skn = $(this).data('skn'), | ||
439 | + shelveModalHtml = '', | ||
440 | + shelveLayer = null; | ||
441 | + | ||
442 | + $(that).addClass('disabled'); | ||
443 | + | ||
444 | + common.util.__ajax({ | ||
445 | + url: '/goods/netsale/getdata', | ||
446 | + data: { | ||
447 | + param: skn | ||
448 | + } | ||
449 | + }, function(res) { | ||
450 | + shelveModalHtml = common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct); | ||
451 | + shelveLayer = common.dialog.open({ | ||
452 | + title: '上/下架', | ||
453 | + width: 900, | ||
454 | + content: shelveModalHtml | ||
456 | }); | 455 | }); |
456 | + | ||
457 | + $(that).removeClass('disabled'); | ||
458 | + | ||
457 | shelveTable.init(res.data.goodsList, 'goodsSizeList'); | 459 | shelveTable.init(res.data.goodsList, 'goodsSizeList'); |
458 | 460 | ||
459 | $('#shelve-table').on('click', '.btn', function() { | 461 | $('#shelve-table').on('click', '.btn', function() { |
@@ -2,6 +2,12 @@ var $ = require('jquery'), | @@ -2,6 +2,12 @@ var $ = require('jquery'), | ||
2 | common = require('../../common/common'); | 2 | common = require('../../common/common'); |
3 | 3 | ||
4 | var basicInfohtml = '', | 4 | var basicInfohtml = '', |
5 | + ENUM = { | ||
6 | + isSuppled: { | ||
7 | + 'Y': '是', | ||
8 | + 'N': '否' | ||
9 | + } | ||
10 | + }, | ||
5 | convertObj = { | 11 | convertObj = { |
6 | ageLevel: { | 12 | ageLevel: { |
7 | '1': '成人', | 13 | '1': '成人', |
@@ -91,17 +97,34 @@ basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData); | @@ -91,17 +97,34 @@ basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData); | ||
91 | $('#basic-info').html(basicInfohtml); | 97 | $('#basic-info').html(basicInfohtml); |
92 | 98 | ||
93 | //能否补货 | 99 | //能否补货 |
94 | -$('#goods-table').html(common.util.__template2($('#goodsList').html(), { | ||
95 | - goodsList: NETSALEDATA.goodsList | ||
96 | -})); | 100 | +var suppledTable = new common.grid({ |
101 | + el: '#suppled-table', | ||
102 | + hash: false, | ||
103 | + secondIndex: 1, | ||
104 | + columns: [{ | ||
105 | + display: 'SKC(厂家颜色)', | ||
106 | + render: function(item) { | ||
107 | + return item.productSkc + '(' + item.goodsName + ')'; | ||
108 | + } | ||
109 | + }, { | ||
110 | + display: 'SKU(尺码)', | ||
111 | + render: function(item) { | ||
112 | + return item.productSku + '(' + item.sizeName + ')'; | ||
113 | + } | ||
114 | + }, { | ||
115 | + display: '能否补货', | ||
116 | + render: function(item) { | ||
117 | + return ENUM.isSuppled[item.isSuppled]; | ||
118 | + } | ||
119 | + }] | ||
120 | +}); | ||
121 | +suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList') | ||
97 | 122 | ||
98 | //上架必填 | 123 | //上架必填 |
99 | productExtBo.renderType = $('.contentpanel').data('type'); | 124 | productExtBo.renderType = $('.contentpanel').data('type'); |
100 | productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : ''; | 125 | productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : ''; |
101 | productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : ''; | 126 | productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : ''; |
102 | //productExtBo.shopList = | 127 | //productExtBo.shopList = |
103 | - | ||
104 | - | ||
105 | common.util.__ajax({ | 128 | common.util.__ajax({ |
106 | url: '/goods/ShopsRest/queryShopsByBrandId', | 129 | url: '/goods/ShopsRest/queryShopsByBrandId', |
107 | data: { | 130 | data: { |
@@ -112,7 +135,6 @@ common.util.__ajax({ | @@ -112,7 +135,6 @@ common.util.__ajax({ | ||
112 | $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); | 135 | $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); |
113 | e.init(); | 136 | e.init(); |
114 | }, true); | 137 | }, true); |
115 | - | ||
116 | $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); | 138 | $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); |
117 | 139 | ||
118 | 140 |
@@ -138,6 +138,7 @@ var Bll = { | @@ -138,6 +138,7 @@ var Bll = { | ||
138 | button: [{ | 138 | button: [{ |
139 | value: "提交", | 139 | value: "提交", |
140 | callback: function() { | 140 | callback: function() { |
141 | + | ||
141 | e.submit(url, function(option) { | 142 | e.submit(url, function(option) { |
142 | option.data.id = item.id; | 143 | option.data.id = item.id; |
143 | option.data.productSkn = productSkn; | 144 | option.data.productSkn = productSkn; |
@@ -197,6 +198,10 @@ $(document).on("click", ".poseditimg .close", function(e) { | @@ -197,6 +198,10 @@ $(document).on("click", ".poseditimg .close", function(e) { | ||
197 | }); | 198 | }); |
198 | $(document).on("change", ".poseditimg .pos-text", function() { | 199 | $(document).on("change", ".poseditimg .pos-text", function() { |
199 | var item = Bll.posData[$(this).data("index")]; | 200 | var item = Bll.posData[$(this).data("index")]; |
201 | + /*if ($.trim($(this).val()).length > 8) { | ||
202 | + common.util.__tip('skn不能超过8位', 'warning'); | ||
203 | + return; | ||
204 | + };*/ | ||
200 | item.id = $(this).val(); | 205 | item.id = $(this).val(); |
201 | }); | 206 | }); |
202 | 207 | ||
@@ -225,14 +230,14 @@ $(document).on("click", "#dapeiTable .delete", function() { | @@ -225,14 +230,14 @@ $(document).on("click", "#dapeiTable .delete", function() { | ||
225 | //修改 | 230 | //修改 |
226 | $(document).on("click", "#dapeiTable .edit", function() { | 231 | $(document).on("click", "#dapeiTable .edit", function() { |
227 | var item = g.rows[$(this).data("index")]; | 232 | var item = g.rows[$(this).data("index")]; |
228 | - common.util.__ajax({ | 233 | + common.util.__ajax2({ |
229 | url: '/netSale/selectCollocationById', | 234 | url: '/netSale/selectCollocationById', |
230 | data: { | 235 | data: { |
231 | param: item.id | 236 | param: item.id |
232 | } | 237 | } |
233 | }, function(data) { | 238 | }, function(data) { |
234 | Bll.toast("添加搭配", data.data, "/netSale/updateCollocation"); | 239 | Bll.toast("添加搭配", data.data, "/netSale/updateCollocation"); |
235 | - }, true); | 240 | + }); |
236 | // item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}]; | 241 | // item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}]; |
237 | // Bll.toast("添加搭配",item,"/netSale/updateCollocation"); | 242 | // Bll.toast("添加搭配",item,"/netSale/updateCollocation"); |
238 | }); | 243 | }); |
@@ -8,7 +8,13 @@ | @@ -8,7 +8,13 @@ | ||
8 | </div> | 8 | </div> |
9 | <div id="basicInfoWrap" class="panel-body nopadding"> | 9 | <div id="basicInfoWrap" class="panel-body nopadding"> |
10 | <div id="basic-info"></div> | 10 | <div id="basic-info"></div> |
11 | - <div id="goods-table"></div> | 11 | + <div id="goods-table"> |
12 | + <div class="form-group"> | ||
13 | + <h5>能否补货</h5> | ||
14 | + <div id="suppled-table" class="dataTables_wrapper no-footer"> | ||
15 | + </div> | ||
16 | + </div> | ||
17 | + </div> | ||
12 | <div id="product-ext"></div> | 18 | <div id="product-ext"></div> |
13 | </div> | 19 | </div> |
14 | <div class="panel-footer"> | 20 | <div class="panel-footer"> |
@@ -89,7 +95,7 @@ | @@ -89,7 +95,7 @@ | ||
89 | </div> | 95 | </div> |
90 | </script> | 96 | </script> |
91 | 97 | ||
92 | -<script type="text/template" id="goodsList"> | 98 | +<!-- <script type="text/template" id="goodsList"> |
93 | <div class="form-group"> | 99 | <div class="form-group"> |
94 | <h5>能否补货</h5> | 100 | <h5>能否补货</h5> |
95 | <table class="table table-bordered"> | 101 | <table class="table table-bordered"> |
@@ -119,7 +125,7 @@ | @@ -119,7 +125,7 @@ | ||
119 | </tbody> | 125 | </tbody> |
120 | </table> | 126 | </table> |
121 | </div> | 127 | </div> |
122 | -</script> | 128 | +</script> --> |
123 | 129 | ||
124 | <script type="text/template" id="productExtBoTemp"> | 130 | <script type="text/template" id="productExtBoTemp"> |
125 | <div class="form-group"> | 131 | <div class="form-group"> |
-
Please register or login to post a comment