delivery_allprint_order.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>团长配送清单</title>
  6. <link rel="stylesheet" href="__PUBLIC__/css/forms.css">
  7. <script src="__PUBLIC__/js/jquery-1.7.2.min.js"></script>
  8. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  9. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  10. <style>
  11. .w794{width:794px;margin: 0px auto;}
  12. .tdleft{text-align:left;width:50%;font-size:17px;}
  13. .bold{font-weight:bold;}
  14. td, th{padding:0px;font-size:15px;}
  15. @media print {
  16. .noprint{
  17. display: none;
  18. }
  19. }
  20. .PageNext{page-break-after: always;}
  21. </style>
  22. </head>
  23. <body>
  24. <div style="width:100%;margin:0px auto;">
  25. <!-- 弹窗 -->
  26. <div id="showdiv" style="width: 40%; margin: 0 auto; height: 100px; border: 1px solid #999; display: none; position: absolute; top: 40%; left: 35%; z-index: 3; background: #fff">
  27. <!-- 标题 -->
  28. <div style="background: #F8F7F7; width: 100%; height: 2rem; font-size: 0.65rem; line-height: 2rem; border: 1px solid #999; text-align: center;" >
  29. 提示
  30. </div>
  31. <!-- 内容 -->
  32. <div style="text-indent: 50px; height: 80px; font-size: 16px;color:red; line-height: 60px; " id="print_content_tip">
  33. 还剩{$count}个团长相关订单未生成,请勿刷新.....
  34. </div>
  35. <!-- 按钮 -->
  36. </div>
  37. <div class="w794 noprint">
  38. <a href="javascript:;" data-confirm='配送订单统计打印一次后,系统不再进行统计和打印配送清单,是否确认打印配送清单?' data-toggle="ajaxModal" >立即打印</a>
  39. </div>
  40. <div id="print_content">
  41. </div>
  42. <div class="w794 noprint">
  43. <a href="javascript:;" data-confirm='配送订单统计打印一次后,系统不再进行统计和打印配送清单,是否确认打印配送清单?' data-toggle="ajaxModal" >立即打印</a>
  44. </div>
  45. </div>
  46. <script src="/layuiadmin/layui/layui.js"></script>
  47. <script>
  48. layui.config({
  49. base: '/layuiadmin/' //静态资源所在路径
  50. }).extend({
  51. index: 'lib/index' //主入口模块
  52. }).use('index');
  53. </script>
  54. <script>
  55. var layer = layui.layer;
  56. var $;
  57. layui.use(['jquery', 'layer','form'], function(){
  58. $ = layui.$;
  59. var form = layui.form;
  60. $("[data-toggle='ajaxModal']").click(function () {
  61. var s_url = $(this).attr('data-href');
  62. ajax_url = s_url;
  63. //layer.confirm($(this).attr('data-confirm'), function(index){
  64. window.print();
  65. layer.closeAll('dialog');
  66. //})
  67. });
  68. });
  69. </script>
  70. <script>
  71. var s_page = 1;
  72. var s_count = {$count};
  73. function showWindow() {
  74. $('#showdiv').show(); //显示弹窗
  75. }
  76. $(function(){
  77. showWindow();
  78. load_data();
  79. })
  80. function load_data()
  81. {
  82. $.ajax({
  83. url:"{:U('Delivery/delivery_allprint_order_do', array('searchtime' => $searchtime, 'starttime' => $starttime, 'endtime' => $endtime))}",
  84. type:'get',
  85. data:{page:s_page},
  86. dataType:'json',
  87. success:function(ret){
  88. if(ret.code == 1)
  89. {
  90. alert('生成完毕,可以打印');
  91. $('#showdiv').remove();
  92. return false;
  93. }else if(ret.code == 0) {
  94. s_page++;
  95. s_count = s_count -10;
  96. if(s_count < 0)
  97. {
  98. s_count= 0;
  99. }
  100. $('#print_content_tip').html('还剩'+s_count+'个团长相关订单未生成,请勿刷新.....');
  101. $('#print_content').append(ret.html);
  102. setTimeout(load_data(), 1000 );
  103. }
  104. }
  105. })
  106. }
  107. </script>
  108. </body>
  109. </html>