Authored by ZhongW

变价

@@ -144,7 +144,8 @@ module.exports={ @@ -144,7 +144,8 @@ module.exports={
144 params: [ 144 params: [
145 {name: "brandId", type: "Number"}, 145 {name: "brandId", type: "Number"},
146 {name: "sortId", type: "Number"}, 146 {name: "sortId", type: "Number"},
147 - {name: "supplierId", type: "Number"} 147 + {name: "supplierId", type: "Number"},
  148 + {name: "shopId", type: "Number"}
148 ] 149 ]
149 }, 150 },
150 queryAllMaxSortList:{ 151 queryAllMaxSortList:{
@@ -227,7 +227,7 @@ @@ -227,7 +227,7 @@
227 <td style="border-bottom: 0"></td> 227 <td style="border-bottom: 0"></td>
228 <td style="border-bottom: 0; border-right: 0;width:5%"> 228 <td style="border-bottom: 0; border-right: 0;width:5%">
229 <a href="javascript:;" class="btn btn-success btn-xs sure-modify" style="margin-bottom:10px;">提交</a> 229 <a href="javascript:;" class="btn btn-success btn-xs sure-modify" style="margin-bottom:10px;">提交</a>
230 - <a href="javascript:;" class="btn btn-success btn-xs sure-modify">取消</a> 230 + <a href="javascript:;" class="btn btn-success btn-xs cancel-modify" >取消</a>
231 </td> 231 </td>
232 </tr> 232 </tr>
233 </table> 233 </table>
@@ -270,6 +270,9 @@ var g = new common.grid({ @@ -270,6 +270,9 @@ var g = new common.grid({
270 return html; 270 return html;
271 }}, 271 }},
272 {display: '库存成本价', name: ''}, 272 {display: '库存成本价', name: ''},
  273 + {display: '状态', render: function(item) {
  274 + return ENUM.vipType[item.vip_discount_type];
  275 + }},
273 {display: '操作信息', render: function(item) { 276 {display: '操作信息', render: function(item) {
274 var html = ''; 277 var html = '';
275 if (item.founder_name) {html += '<p>' + item.founder_name + '</p>';} 278 if (item.founder_name) {html += '<p>' + item.founder_name + '</p>';}
@@ -307,16 +310,17 @@ function getHistoryList(skn) { @@ -307,16 +310,17 @@ function getHistoryList(skn) {
307 310
308 //单个变价修改 311 //单个变价修改
309 $(document).on('click', '.modify-btn', function() { 312 $(document).on('click', '.modify-btn', function() {
310 -  
311 - if($(this).hasClass('open')){  
312 - return false;  
313 - } 313 +
  314 +
314 315
315 var skn = $(this).data('skn'), 316 var skn = $(this).data('skn'),
316 parentTr = $(this).parent().parent(), 317 parentTr = $(this).parent().parent(),
317 sknTd = parentTr.find('td').eq(0); 318 sknTd = parentTr.find('td').eq(0);
318 - $(this).addClass('open');  
319 - $(this).text('修改'); 319 +
  320 + if(parentTr.next().hasClass('product-detail')){
  321 + return false;
  322 + }
  323 +
320 parentTr.after('<tr class="product-detail"><td colspan="15">加载中...若长时间加载不出来,请重新刷新页面!</td>' + 324 parentTr.after('<tr class="product-detail"><td colspan="15">加载中...若长时间加载不出来,请重新刷新页面!</td>' +
321 '</tr><tr class="extraTr"></tr>'); 325 '</tr><tr class="extraTr"></tr>');
322 326
@@ -375,7 +379,9 @@ $(document).on('click', '.modify-btn', function() { @@ -375,7 +379,9 @@ $(document).on('click', '.modify-btn', function() {
375 } 379 }
376 }); 380 });
377 },true); 381 },true);
378 - } 382 +
  383 +
  384 +
379 385
380 function vipPrice($wrap) { 386 function vipPrice($wrap) {
381 var $price = $wrap.find('.sale-price'), 387 var $price = $wrap.find('.sale-price'),
@@ -406,6 +412,13 @@ $(document).on('click', '.modify-btn', function() { @@ -406,6 +412,13 @@ $(document).on('click', '.modify-btn', function() {
406 } 412 }
407 } 413 }
408 }); 414 });
  415 +
  416 +//关闭变价框
  417 +$(document).on('click', '.cancel-modify', function () {
  418 + $(this).parents(".product-detail").remove();
  419 + $(this).parents(".extraTr").remove();
  420 +})
  421 +
409 //变价记录 422 //变价记录
410 $(document).on('click', '.history-btn', function () { 423 $(document).on('click', '.history-btn', function () {
411 var skn = $(this).data('skn'); 424 var skn = $(this).data('skn');