Showing
1 changed file
with
31 additions
and
29 deletions
@@ -382,39 +382,41 @@ function shelveModal(title, html) { | @@ -382,39 +382,41 @@ 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($("#shelveTime").val()){ | ||
388 | - if(type=="1"){ | ||
389 | - data.shelveTime=$("#shelveTime").val(); | ||
390 | - data.type=3; | ||
391 | - }else{ | ||
392 | - data.onNewTime=$("#shelveTime").val(); | ||
393 | - data.type=4; | 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 | } | 394 | } |
395 | - | 395 | + data.type=5; |
396 | }else{ | 396 | }else{ |
397 | - data.type=type; | ||
398 | - } | ||
399 | - common.util.__ajax({ | ||
400 | - url:'/product/updateProductSknTimingInfo', | ||
401 | - data:data | ||
402 | - },function(res){ | ||
403 | - if (res.code == 200) { | ||
404 | - e.$tip(res.message, function() { | ||
405 | - shelveLayer.close(); | ||
406 | - loadtab(); | ||
407 | - 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 | - }); | ||
415 | - e.$tip(html); | 397 | + if($("#shelveTime").val()){ |
398 | + if(type=="1"){ | ||
399 | + data.shelveTime=$("#shelveTime").val(); | ||
400 | + data.type=3; | ||
401 | + }else{ | ||
402 | + data.onNewTime=$("#shelveTime").val(); | ||
403 | + data.type=4; | ||
404 | + } | ||
405 | + | ||
406 | + }else{ | ||
407 | + data.type=type; | ||
416 | } | 408 | } |
417 | - }); | 409 | + } |
410 | + if(!isValidate){ | ||
411 | + common.util.__ajax({ | ||
412 | + url:'/product/updateProductSknTimingInfo', | ||
413 | + data:data | ||
414 | + },function(res){ | ||
415 | + shelveLayer.close(); | ||
416 | + loadtab(); | ||
417 | + g.reload(); | ||
418 | + }); | ||
419 | + } | ||
418 | }); | 420 | }); |
419 | } | 421 | } |
420 | //批量skn上架 | 422 | //批量skn上架 |
-
Please register or login to post a comment