Authored by weiqingting

网销 预售时间

@@ -382,8 +382,18 @@ function shelveModal(title, html) { @@ -382,8 +382,18 @@ function shelveModal(title, html) {
382 var type = $(this).data('type'); 382 var type = $(this).data('type');
383 $(this).closest('.form-group').find('input').attr('required', true) 383 $(this).closest('.form-group').find('input').attr('required', true)
384 .end().siblings('.form-group').find('input').attr('required', false); 384 .end().siblings('.form-group').find('input').attr('required', false);
385 - var data={}; 385 + var data={},isValidate=false;
386 data.productSknList = JSON.stringify(productSknList); 386 data.productSknList = JSON.stringify(productSknList);
  387 + if(type=="5"){
  388 + data.advanceBeginTime=$("#advanceBeginTime").val();
  389 + data.advanceEndTime=$("#advanceEndTime").val();
  390 + if(!(data.advanceEndTime&&data.advanceEndTime)){
  391 + isValidate=true;
  392 + e.$tip("请填写预售时间");
  393 + return;
  394 + }
  395 + data.type=5;
  396 + }else{
387 if($("#shelveTime").val()){ 397 if($("#shelveTime").val()){
388 if(type=="1"){ 398 if(type=="1"){
389 data.shelveTime=$("#shelveTime").val(); 399 data.shelveTime=$("#shelveTime").val();
@@ -396,26 +406,18 @@ function shelveModal(title, html) { @@ -396,26 +406,18 @@ function shelveModal(title, html) {
396 }else{ 406 }else{
397 data.type=type; 407 data.type=type;
398 } 408 }
  409 + }
  410 + if(!isValidate){
399 common.util.__ajax({ 411 common.util.__ajax({
400 url:'/product/updateProductSknTimingInfo', 412 url:'/product/updateProductSknTimingInfo',
401 data:data 413 data:data
402 },function(res){ 414 },function(res){
403 - if (res.code == 200) {  
404 - e.$tip(res.message, function() {  
405 shelveLayer.close(); 415 shelveLayer.close();
406 loadtab(); 416 loadtab();
407 g.reload(); 417 g.reload();
408 - }, 'growl-success');  
409 - } else {  
410 - //e.$tip(res.data.message);  
411 - var html = '';  
412 - $.each(res.data, function(key, value) {  
413 - html += key + ':' + value + '<br>';  
414 }); 418 });
415 - e.$tip(html);  
416 } 419 }
417 }); 420 });
418 - });  
419 } 421 }
420 //批量skn上架 422 //批量skn上架
421 $('#onshelve').on('click', function() { 423 $('#onshelve').on('click', function() {