couponsend_do.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <div class="layui-fluid">
  2. <div class="layui-card">
  3. <div class="layui-card-header layui-elem-quote">当前位置:
  4. <span class="line-text">队列批量处理配送单</span>
  5. </div>
  6. <div class="layui-card-body" style="padding:15px;">
  7. <div class="layui-form-item">
  8. <label class="layui-form-label">批量处理配送单</label>
  9. <div class="col-sm-10">
  10. <div id='count' class="alert alert-info" style="line-height:20px;">
  11. <div id="update_content" style="height:400px;overflow-y:auto;">
  12. <p>批量处理马上开始....批量处理结束前请勿关闭该页面</p>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. <script type="text/javascript">
  21. var a;
  22. $(function(){
  23. setTimeout( function() {
  24. load_next_updata();
  25. },300);
  26. })
  27. function load_next_updata()
  28. {
  29. $.post('<?php echo U("marketing/do_coupon_quene", array('cache_key' => $cache_key,'voucher_id' =>$voucher_id ,'send_count' => $send_count) ); ?>', function (ret) {
  30. if( ret.code == 0)
  31. {
  32. //msg update_content
  33. $('#update_content').prepend("<p>"+ret.msg+"</p>");
  34. $('#update_content').scrollTop(0);
  35. setTimeout( function() {
  36. load_next_updata();
  37. },300);
  38. }else if(ret.code ==2){
  39. layer.msg('批量处理完成!',{time: 1000,
  40. end:function(){
  41. location.href = "<?php echo U("marketing/couponsend" ); ?>";
  42. }
  43. });
  44. }else{
  45. alert(ret.msg);
  46. }
  47. }, 'json');
  48. }
  49. </script>