Showing
7 changed files
with
177 additions
and
25 deletions
@@ -145,7 +145,13 @@ module.exports={ | @@ -145,7 +145,13 @@ module.exports={ | ||
145 | {name: 'sellChannels',type: 'string'}, | 145 | {name: 'sellChannels',type: 'string'}, |
146 | {name: 'phrase',type: 'string'}, | 146 | {name: 'phrase',type: 'string'}, |
147 | {name: 'outSaleTime',type: 'number'}, | 147 | {name: 'outSaleTime',type: 'number'}, |
148 | - {name: 'shopIds',type: 'string'} | 148 | + {name: 'shopIds',type: 'string'}, |
149 | + {name: 'ageLevel',type: 'string'}, | ||
150 | + {name: 'gender',type: 'Number'}, | ||
151 | + {name: 'grade',type: 'string'}, | ||
152 | + {name: 'isLimited',type: 'string'}, | ||
153 | + {name: 'isOutlets',type: 'string'}, | ||
154 | + {name: 'seasons',type: 'string'} | ||
149 | ] | 155 | ] |
150 | }, | 156 | }, |
151 | saveAfterSaleInfo:{ | 157 | saveAfterSaleInfo:{ |
@@ -143,7 +143,7 @@ | @@ -143,7 +143,7 @@ | ||
143 | </div> | 143 | </div> |
144 | 144 | ||
145 | <input type="hidden" id="shopId" value="<%shopId%>"> | 145 | <input type="hidden" id="shopId" value="<%shopId%>"> |
146 | -<script type="text/template" id="onshelve-template"> | 146 | +<!--<script type="text/template" id="onshelve-template"> |
147 | <form class="shelve-form form-horizontal "> | 147 | <form class="shelve-form form-horizontal "> |
148 | <div class="panel panel-default"> | 148 | <div class="panel panel-default"> |
149 | <div class="panel-body nopadding"> | 149 | <div class="panel-body nopadding"> |
@@ -167,8 +167,52 @@ | @@ -167,8 +167,52 @@ | ||
167 | </div> | 167 | </div> |
168 | </div> | 168 | </div> |
169 | </form> | 169 | </form> |
170 | +</script>--> | ||
171 | + | ||
172 | +<script type="text/template" id="common-onshelve-template"> | ||
173 | + <form class="shelve-form form-horizontal form-bordered"> | ||
174 | + <div class="panel panel-default"> | ||
175 | + <div class="panel-body nopadding"> | ||
176 | + <div class="form-group"> | ||
177 | + <span class="label label-success">共选中{num}个skn</span> | ||
178 | + </div> | ||
179 | + <div class="form-group"> | ||
180 | + <div class="col-sm-3 height40">预上架时间:</div> | ||
181 | + <div class="col-sm-6"><input id="shelveTime" class="form-control" jsaction="time" type="text" placeholder="预上架时间" readonly> | ||
182 | + <span class="red">预上架请填写上架时间</span> | ||
183 | + </div> | ||
184 | + </div> | ||
185 | + <div class="form-group"> | ||
186 | + <a class="btn btn-info" data-type="2" href="javascript:;">上架上新</a> | ||
187 | + <a class="btn btn-info" data-type="1" href="javascript:;">上架不上新</a> | ||
188 | + </div> | ||
189 | + </div> | ||
190 | + </div> | ||
191 | + </form> | ||
170 | </script> | 192 | </script> |
171 | 193 | ||
194 | + | ||
195 | +<script type="text/template" id="presell-onshelve-template"> | ||
196 | + <form class="shelve-form form-horizontal form-bordered"> | ||
197 | + <div class="panel panel-default"> | ||
198 | + <div class="panel-body nopadding"> | ||
199 | + <div class="form-group"> | ||
200 | + <span class="label label-success">共选中{num}个skn</span> | ||
201 | + </div> | ||
202 | + <div class="form-group"> | ||
203 | + <div class="col-sm-3 height40">预售时间:</div> | ||
204 | + <div class="col-sm-4"><input id="advanceBeginTime" class="form-control" jsaction="time:end:advanceEndTime" type="text" placeholder="预售上架时间" readonly></div> | ||
205 | + <div class="col-sm-4"><input id="advanceEndTime" class="form-control" jsaction="time:start:advanceBeginTime" type="text" placeholder="预售下架时间" readonly></div> | ||
206 | + <div class="panel-col" style="margin-top: 6px;"><a class="btn btn-info" data-type="5" href="javascript:;">确定</a> | ||
207 | + <button id="cancelShelve" type="button" data-id="cancel" class="modal-cancel btn btn-default">取消</button> | ||
208 | + </div> | ||
209 | + </div> | ||
210 | + </div> | ||
211 | + </div> | ||
212 | + </form> | ||
213 | +</script> | ||
214 | + | ||
215 | + | ||
172 | <script type="text/template" id="offshelve-template"> | 216 | <script type="text/template" id="offshelve-template"> |
173 | <form class="shelve-form form-horizontal"> | 217 | <form class="shelve-form form-horizontal"> |
174 | <div class="panel panel-default"> | 218 | <div class="panel panel-default"> |
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | </div> | 12 | </div> |
13 | <div class="panel-footer"> | 13 | <div class="panel-footer"> |
14 | <a id="saveAddInfo" href="javascript:;" class="btn btn-primary">保存</a> | 14 | <a id="saveAddInfo" href="javascript:;" class="btn btn-primary">保存</a> |
15 | + <a id="clearAddInfo" href="javascript:;" class="btn btn-primary">清空</a> | ||
15 | </div> | 16 | </div> |
16 | </div> | 17 | </div> |
17 | 18 |
@@ -63,16 +63,78 @@ | @@ -63,16 +63,78 @@ | ||
63 | <div class="form-group"> | 63 | <div class="form-group"> |
64 | <div class="col-sm-12">商品话题:[[productTag]]</div> | 64 | <div class="col-sm-12">商品话题:[[productTag]]</div> |
65 | </div> | 65 | </div> |
66 | + | ||
66 | <div class="form-group"> | 67 | <div class="form-group"> |
67 | - <div class="col-sm-3">年龄层:[[ageLevel]]</div> | ||
68 | - <div class="col-sm-3">性别:[[gender]]</div> | ||
69 | - <div class="col-sm-3">重点款:[[grade]]</div> | 68 | + <div class="col-sm-3"> |
69 | + <label>性别<span class="red">*:</span> | ||
70 | + <label> | ||
71 | + <input type="radio" name="gender" value="1">男</label> | ||
72 | + <label > | ||
73 | + <input type="radio" name="gender" value="2">女</label> | ||
74 | + <label> | ||
75 | + <input type="radio" name="gender" value="3">通用</label> | ||
76 | + <input type="hidden" id="gender" name="gender" value="[[gender||'1']]" for="radio" required /> | ||
77 | + </label> | ||
78 | + </div> | ||
79 | + | ||
80 | + <div class="col-sm-3"> | ||
81 | + <label>年龄层<span class="red">*:</span></label> | ||
82 | + <label> | ||
83 | + <input type="checkbox" name="ageLevel" value="1">成人</label> | ||
84 | + <label > | ||
85 | + <input type="checkbox" name="ageLevel" value="2">大童</label> | ||
86 | + <label > | ||
87 | + <input type="checkbox" name="ageLevel" value="3">小童</label> | ||
88 | + <label > | ||
89 | + <input type="checkbox" name="ageLevel" value="4">中童</label> | ||
90 | + <label > | ||
91 | + <input type="checkbox" name="ageLevel" value="5">幼童</label> | ||
92 | + <input type="hidden" id="ageLevel" name="ageLevel" value="[[ageLevel]]" for="checkbox" placeholder="年龄层" required /> | ||
93 | + </div> | ||
94 | + <div class="col-sm-3"> | ||
95 | + <label>重点款<span class="red">*:</span></label> | ||
96 | + <label > | ||
97 | + <input type="radio" name="grade" value="1">是</label> | ||
98 | + <label > | ||
99 | + <input type="radio" name="grade" value="0">否</label> | ||
100 | + </div> | ||
101 | + <input type="hidden" id="grade" value="[[grade||'0']]" for="radio" required/> | ||
70 | </div> | 102 | </div> |
71 | <div class="form-group"> | 103 | <div class="form-group"> |
72 | - <div class="col-sm-3">是否奥莱:[[isOutLets]]</div> | ||
73 | - <div class="col-sm-3">限量款:[[isLimited]]</div> | ||
74 | - <div class="col-sm-3">适销季:[[seasons]]</div> | 104 | + <div class="col-sm-3"> |
105 | + <label>适销季<span class="red">*:</span></label> | ||
106 | + <label> | ||
107 | + <input type="checkbox" name="seasons" value="spring">春</label> | ||
108 | + <label > | ||
109 | + <input type="checkbox" name="seasons" value="summer">夏</label> | ||
110 | + <label > | ||
111 | + <input type="checkbox" name="seasons" value="autumn">秋</label> | ||
112 | + <label > | ||
113 | + <input type="checkbox" name="seasons" value="winter">冬</label> | ||
114 | + <label > | ||
115 | + <input type="checkbox" name="seasons" value="seasons">四季</label> | ||
116 | + <input type="hidden" id="seasons" name="seasons" value="[[seasons||'seasons']]" for="checkbox" placeholder="年龄层" /> | ||
117 | + </div> | ||
118 | + | ||
119 | + <div class="col-sm-3"> | ||
120 | + <label>限量款:</label> | ||
121 | + <label > | ||
122 | + <input type="radio" name="isLimited" value="Y">是</label> | ||
123 | + <label > | ||
124 | + <input type="radio" name="isLimited" value="N">否</label> | ||
125 | + </div> | ||
126 | + <input id="isLimited" type="hidden" value="[[isLimited||'N']]" for="radio" /> | ||
127 | + | ||
128 | + <div class="col-sm-3"> | ||
129 | + <label>是否奥莱:</label> | ||
130 | + <label > | ||
131 | + <input type="radio" name="isOutLets" value="Y">是</label> | ||
132 | + <label > | ||
133 | + <input type="radio" name="isOutLets" value="N">否</label> | ||
134 | + <input type="hidden" id="isOutlets" value="[[isOutLets||'N']]" for="radio" /> | ||
135 | + </div> | ||
75 | </div> | 136 | </div> |
137 | + | ||
76 | <div class="form-group"> | 138 | <div class="form-group"> |
77 | <div class="col-sm-3">是否预售:[[isAdvance]]</div> | 139 | <div class="col-sm-3">是否预售:[[isAdvance]]</div> |
78 | [[if isAdvance=='是']] | 140 | [[if isAdvance=='是']] |
@@ -106,15 +168,15 @@ | @@ -106,15 +168,15 @@ | ||
106 | <div class="form-group"> | 168 | <div class="form-group"> |
107 | <label class="col-sm-1 control-label">是否新品:</label> | 169 | <label class="col-sm-1 control-label">是否新品:</label> |
108 | <div class="col-sm-4"> | 170 | <div class="col-sm-4"> |
109 | - <label class="radio-inline"><input type="radio" name="isNew" value="Y">是</label> | ||
110 | - <label class="radio-inline"><input type="radio" name="isNew" value="N">否</label> | 171 | + <label ><input type="radio" name="isNew" value="Y">是</label> |
172 | + <label ><input type="radio" name="isNew" value="N">否</label> | ||
111 | <input id="isNew" type="hidden" value="[[isNew||'Y']]" for="radio"> | 173 | <input id="isNew" type="hidden" value="[[isNew||'Y']]" for="radio"> |
112 | </div> | 174 | </div> |
113 | <label class="col-sm-1 control-label">上架渠道:</label> | 175 | <label class="col-sm-1 control-label">上架渠道:</label> |
114 | <div class="col-sm-4"> | 176 | <div class="col-sm-4"> |
115 | - <label class="radio-inline"><input type="checkbox" name="sellChannels" value="1">网站</label> | ||
116 | - <label class="radio-inline"><input type="checkbox" name="sellChannels" value="2">手机</label> | ||
117 | - <label class="radio-inline"><input type="checkbox" name="sellChannels" value="3">场地</label> | 177 | + <label ><input type="checkbox" name="sellChannels" value="1">网站</label> |
178 | + <label ><input type="checkbox" name="sellChannels" value="2">手机</label> | ||
179 | + <label ><input type="checkbox" name="sellChannels" value="3">场地</label> | ||
118 | <input id="sellChannels" value="[[sellChannels||'1|2']]" type="hidden" for="checkbox"> | 180 | <input id="sellChannels" value="[[sellChannels||'1|2']]" type="hidden" for="checkbox"> |
119 | </div> | 181 | </div> |
120 | </div> | 182 | </div> |
@@ -136,7 +198,7 @@ | @@ -136,7 +198,7 @@ | ||
136 | <label class="col-sm-1 control-label">展示店铺:</label> | 198 | <label class="col-sm-1 control-label">展示店铺:</label> |
137 | <div class="col-sm-4"> | 199 | <div class="col-sm-4"> |
138 | [[each shopList as a index]] | 200 | [[each shopList as a index]] |
139 | - <label class="radio-inline"><input type="checkbox" name="shopIds" value="[[a.shopsId]]">[[a.shopName]]</label> | 201 | + <label ><input type="checkbox" name="shopIds" value="[[a.shopsId]]">[[a.shopName]]</label> |
140 | [[/each]] | 202 | [[/each]] |
141 | </div> | 203 | </div> |
142 | </div> | 204 | </div> |
@@ -105,9 +105,10 @@ $(document).on("click", "#saveAllInfo", function() { | @@ -105,9 +105,10 @@ $(document).on("click", "#saveAllInfo", function() { | ||
105 | } | 105 | } |
106 | $.extend(data, value, true); | 106 | $.extend(data, value, true); |
107 | }); | 107 | }); |
108 | - | ||
109 | - if (error !== '') { | 108 | +// alert(error); |
109 | + if (error != '') { | ||
110 | common.util.__tip(error, 'warning'); | 110 | common.util.__tip(error, 'warning'); |
111 | + return false; | ||
111 | } else { | 112 | } else { |
112 | e.submit('/product/saveNetSaleAllInfo', function(option) { | 113 | e.submit('/product/saveNetSaleAllInfo', function(option) { |
113 | option.data = data; | 114 | option.data = data; |
@@ -353,7 +353,7 @@ var g = new common.grid({ | @@ -353,7 +353,7 @@ var g = new common.grid({ | ||
353 | }else{ | 353 | }else{ |
354 | intValue=item.productSearch.intValue; | 354 | intValue=item.productSearch.intValue; |
355 | } | 355 | } |
356 | - HtmArr.push('<br><br><input type="text" style="width:100px" name="brandSort" class="brandSortText" data-index="' + item.__index + '" value='+intValue+'>'); | 356 | + HtmArr.push('<br><br><input type="text" style="width:100px" id="brandSortId" name="brandSort" class="brandSortText" data-index="' + item.__index + '" value='+intValue+'>'); |
357 | HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs brandSort-btn" data-index="' + item.__index + '" >品牌排序</a>'); | 357 | HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs brandSort-btn" data-index="' + item.__index + '" >品牌排序</a>'); |
358 | 358 | ||
359 | if(typeof(item.shopsSearchSort) == "undefined"){ | 359 | if(typeof(item.shopsSearchSort) == "undefined"){ |
@@ -361,7 +361,7 @@ var g = new common.grid({ | @@ -361,7 +361,7 @@ var g = new common.grid({ | ||
361 | }else{ | 361 | }else{ |
362 | intVal_shopsSearchSort = item.shopsSearchSort.intValue; | 362 | intVal_shopsSearchSort = item.shopsSearchSort.intValue; |
363 | } | 363 | } |
364 | - HtmArr.push('<br><br><input type="text" style="width:100px" name="shopsSort" class="brandSortText" data-index="' + item.__index + '" value='+ intVal_shopsSearchSort+'>'); | 364 | + HtmArr.push('<br><br><input type="text" style="width:100px" id="shopsSortId" name="shopsSort" class="brandSortText" data-index="' + item.__index + '" value='+ intVal_shopsSearchSort+'>'); |
365 | HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shopsSort-btn" data-index="' + item.__index + '" >店铺排序</a>'); | 365 | HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shopsSort-btn" data-index="' + item.__index + '" >店铺排序</a>'); |
366 | 366 | ||
367 | return HtmArr.join(''); | 367 | return HtmArr.join(''); |
@@ -405,20 +405,23 @@ function shelveModal(title, html) { | @@ -405,20 +405,23 @@ function shelveModal(title, html) { | ||
405 | var selectedArr = g.selected, | 405 | var selectedArr = g.selected, |
406 | len = selectedArr.length, | 406 | len = selectedArr.length, |
407 | productSknList = [], | 407 | productSknList = [], |
408 | - shelveLayer = null; | 408 | + shelveLayer = null, |
409 | + shelveData = {}; | ||
409 | 410 | ||
410 | if (len <= 0) { | 411 | if (len <= 0) { |
411 | common.util.__tip('请选择要' + title + '的商品', 'warning'); | 412 | common.util.__tip('请选择要' + title + '的商品', 'warning'); |
412 | return; | 413 | return; |
413 | } | 414 | } |
414 | 415 | ||
415 | - $.each(selectedArr, function(i, value) { | 416 | + shelveData.num=selectedArr.length; |
417 | + | ||
418 | + $.each(selectedArr, function(i, value) { | ||
416 | productSknList.push(value['productSkn']); | 419 | productSknList.push(value['productSkn']); |
417 | }); | 420 | }); |
418 | 421 | ||
419 | shelveLayer = common.dialog.open({ | 422 | shelveLayer = common.dialog.open({ |
420 | title: title, | 423 | title: title, |
421 | - content: html | 424 | + content: common.util.__template(html, shelveData), |
422 | }); | 425 | }); |
423 | 426 | ||
424 | 427 | ||
@@ -434,7 +437,14 @@ function shelveModal(title, html) { | @@ -434,7 +437,14 @@ function shelveModal(title, html) { | ||
434 | var e = new common.edit('.shelve-form'); | 437 | var e = new common.edit('.shelve-form'); |
435 | e.init(); | 438 | e.init(); |
436 | 439 | ||
437 | - $('.shelve-form').on('click', '.btn', function() { | 440 | + //取消 |
441 | + var nocancel=true; | ||
442 | + $('#cancelShelve').on('click', function () { | ||
443 | + nocancel=false; | ||
444 | + }); | ||
445 | + | ||
446 | + | ||
447 | + $('.shelve-form').on('click', '.btn', function() { | ||
438 | var type = $(this).data('type'); | 448 | var type = $(this).data('type'); |
439 | $(this).closest('.form-group').find('input').attr('required', true) | 449 | $(this).closest('.form-group').find('input').attr('required', true) |
440 | .end().siblings('.form-group').find('input').attr('required', false); | 450 | .end().siblings('.form-group').find('input').attr('required', false); |
@@ -463,7 +473,7 @@ function shelveModal(title, html) { | @@ -463,7 +473,7 @@ function shelveModal(title, html) { | ||
463 | data.type=type; | 473 | data.type=type; |
464 | } | 474 | } |
465 | } | 475 | } |
466 | - if(!isValidate){ | 476 | + if(!isValidate&&nocancel){ |
467 | common.util.__ajax({ | 477 | common.util.__ajax({ |
468 | url:'/product/updateProductSknTimingInfo', | 478 | url:'/product/updateProductSknTimingInfo', |
469 | data:data | 479 | data:data |
@@ -477,7 +487,17 @@ function shelveModal(title, html) { | @@ -477,7 +487,17 @@ function shelveModal(title, html) { | ||
477 | } | 487 | } |
478 | //批量skn上架 | 488 | //批量skn上架 |
479 | $('#onshelve').on('click', function() { | 489 | $('#onshelve').on('click', function() { |
480 | - shelveModal('上架', $('#onshelve-template').html()); | 490 | + var selectedArr = g.selected; |
491 | + if (selectedArr.length == 0) { | ||
492 | + common.util.__tip("未选中任何SKN, 请核实!", 'warning'); | ||
493 | + return false; | ||
494 | + } else { | ||
495 | + if (selectedArr[0].isAdvance === 'N') { | ||
496 | + shelveModal('普通商品上架', $('#common-onshelve-template').html()); | ||
497 | + } else { | ||
498 | + shelveModal('预售商品上架', $('#presell-onshelve-template').html()); | ||
499 | + } | ||
500 | + } | ||
481 | }); | 501 | }); |
482 | //批量skn下架 | 502 | //批量skn下架 |
483 | $('#offshelve').on('click', function() { | 503 | $('#offshelve').on('click', function() { |
@@ -694,6 +714,12 @@ $(document).on("click", ".chima-btn", function () { | @@ -694,6 +714,12 @@ $(document).on("click", ".chima-btn", function () { | ||
694 | /** | 714 | /** |
695 | *品牌排序 | 715 | *品牌排序 |
696 | */ | 716 | */ |
717 | +/*验证 hack*/ | ||
718 | +$(document).on('keyup', '#brandSortId', function() { | ||
719 | + $(this).val($(this).val().replace(/\D/g, '')); | ||
720 | +}); | ||
721 | + | ||
722 | + | ||
697 | $(document).on("click", ".brandSort-btn", function () { | 723 | $(document).on("click", ".brandSort-btn", function () { |
698 | var item = g.rows[$(this).data("index")]; | 724 | var item = g.rows[$(this).data("index")]; |
699 | var num = $("input:text[name='brandSort']").eq($(this).data("index")).val(); | 725 | var num = $("input:text[name='brandSort']").eq($(this).data("index")).val(); |
@@ -717,6 +743,12 @@ $(document).on("click", ".brandSort-btn", function () { | @@ -717,6 +743,12 @@ $(document).on("click", ".brandSort-btn", function () { | ||
717 | /** | 743 | /** |
718 | *店铺商品排序 | 744 | *店铺商品排序 |
719 | */ | 745 | */ |
746 | +/*验证 hack*/ | ||
747 | +$(document).on('keyup', '#shopsSortId', function() { | ||
748 | + $(this).val($(this).val().replace(/\D/g, '')); | ||
749 | +}); | ||
750 | + | ||
751 | + | ||
720 | $(document).on("click", ".shopsSort-btn", function () { | 752 | $(document).on("click", ".shopsSort-btn", function () { |
721 | var item = g.rows[$(this).data("index")]; | 753 | var item = g.rows[$(this).data("index")]; |
722 | var num = $("input:text[name='shopsSort']").eq($(this).data("index")).val(); | 754 | var num = $("input:text[name='shopsSort']").eq($(this).data("index")).val(); |
@@ -7,7 +7,13 @@ var e = new common.edit('#addinfo-wrap'), | @@ -7,7 +7,13 @@ var e = new common.edit('#addinfo-wrap'), | ||
7 | productExtBo = NETSALEDATA.productExtBo || '', | 7 | productExtBo = NETSALEDATA.productExtBo || '', |
8 | comfort = NETSALEDATA.specialAttrBo ? NETSALEDATA.specialAttrBo.wearSenses : ""; | 8 | comfort = NETSALEDATA.specialAttrBo ? NETSALEDATA.specialAttrBo.wearSenses : ""; |
9 | 9 | ||
10 | - | 10 | +$('#clearAddInfo').on('click', function() { |
11 | + $("#addinfo-wrap").find("input[type='checkbox']").removeAttr('checked') | ||
12 | + $('.attribute-group').each(function() { | ||
13 | + var id=$(this).find('[id]').attr('id'); | ||
14 | + common.util.__setInput(id,""); | ||
15 | + }); | ||
16 | +}); | ||
11 | 17 | ||
12 | /*上架补全信息*/ | 18 | /*上架补全信息*/ |
13 | $('#saveAddInfo').on('click', function() { | 19 | $('#saveAddInfo').on('click', function() { |
-
Please register or login to post a comment