Authored by weiqingting

网销 预售时间

@@ -365,7 +365,7 @@ function shelveModal(title, html) { @@ -365,7 +365,7 @@ function shelveModal(title, html) {
365 // $('#shelveTime').parents('.form-group').next(".form-group").find('.btn').addClass('disabled'); 365 // $('#shelveTime').parents('.form-group').next(".form-group").find('.btn').addClass('disabled');
366 // } 366 // }
367 // } 367 // }
368 - 368 +
369 g.selected.forEach(function(item){ 369 g.selected.forEach(function(item){
370 if(item.isAdvance === 'N'){ 370 if(item.isAdvance === 'N'){
371 $('#advanceBeginTime, #advanceEndTime').prop('disabled', true); 371 $('#advanceBeginTime, #advanceEndTime').prop('disabled', true);
@@ -379,39 +379,41 @@ function shelveModal(title, html) { @@ -379,39 +379,41 @@ function shelveModal(title, html) {
379 var type = $(this).data('type'); 379 var type = $(this).data('type');
380 $(this).closest('.form-group').find('input').attr('required', true) 380 $(this).closest('.form-group').find('input').attr('required', true)
381 .end().siblings('.form-group').find('input').attr('required', false); 381 .end().siblings('.form-group').find('input').attr('required', false);
382 - var data={}; 382 + var data={},isValidate=false;
383 data.productSknList = JSON.stringify(productSknList); 383 data.productSknList = JSON.stringify(productSknList);
384 - if($("#shelveTime").val()){  
385 - if(type=="1"){  
386 - data.shelveTime=$("#shelveTime").val();  
387 - data.type=3;  
388 - }else{  
389 - data.onNewTime=$("#shelveTime").val();  
390 - data.type=4; 384 + if(type=="5"){
  385 + data.advanceBeginTime=$("#advanceBeginTime").val();
  386 + data.advanceEndTime=$("#advanceEndTime").val();
  387 + if(!(data.advanceEndTime&&data.advanceEndTime)){
  388 + isValidate=true;
  389 + e.$tip("请填写预售时间");
  390 + return;
391 } 391 }
392 - 392 + data.type=5;
393 }else{ 393 }else{
394 - data.type=type;  
395 - }  
396 - common.util.__ajax({  
397 - url:'/goods/product/updateProductSknTimingInfo',  
398 - data:data  
399 - },function(res){  
400 - if (res.code == 200) {  
401 - e.$tip(res.message, function() {  
402 - shelveLayer.close();  
403 - loadtab();  
404 - g.reload();  
405 - }, 'growl-success');  
406 - } else {  
407 - //e.$tip(res.data.message);  
408 - var html = '';  
409 - $.each(res.data, function(key, value) {  
410 - html += key + ':' + value + '<br>';  
411 - });  
412 - e.$tip(html); 394 + if($("#shelveTime").val()){
  395 + if(type=="1"){
  396 + data.shelveTime=$("#shelveTime").val();
  397 + data.type=3;
  398 + }else{
  399 + data.onNewTime=$("#shelveTime").val();
  400 + data.type=4;
  401 + }
  402 +
  403 + }else{
  404 + data.type=type;
413 } 405 }
414 - }); 406 + }
  407 + if(!isValidate){
  408 + common.util.__ajax({
  409 + url:'/goods/product/updateProductSknTimingInfo',
  410 + data:data
  411 + },function(res){
  412 + shelveLayer.close();
  413 + loadtab();
  414 + g.reload();
  415 + });
  416 + }
415 }); 417 });
416 } 418 }
417 //批量skn上架 419 //批量skn上架