delivery_allprint_order_2.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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:16px;}
  13. .bold{font-weight:bold;}
  14. .pd2{padding-left:0px;}
  15. td, th{padding:0px;font-size:15px;}
  16. @media print {
  17. .noprint{
  18. display: none;
  19. }
  20. }
  21. .tpinfo {
  22. min-height: 62px;
  23. border-bottom: 1px solid #000;
  24. word-break: break-all;
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. }
  29. .tpinfo.last {
  30. border-bottom: 0 none;
  31. }
  32. .tDiv {
  33. padding: 10px;
  34. text-align: center;
  35. word-break: break-all;
  36. }
  37. .PageNext{page-break-after: always;}
  38. </style>
  39. <style media="print">
  40. @page {
  41. size: auto; /* auto is the initial value */
  42. margin: 0mm; /* this affects the margin in the printer settings */
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div style="width:100%;margin:0px auto;">
  48. <!-- 弹窗 -->
  49. <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">
  50. <!-- 标题 -->
  51. <div style="background: #F8F7F7; width: 100%; height: 2rem; font-size: 0.65rem; line-height: 2rem; border: 1px solid #999; text-align: center;" >
  52. 提示
  53. </div>
  54. <!-- 内容 -->
  55. <div style="text-indent: 50px; height: 80px; font-size: 16px;color:red; line-height: 60px; " id="print_content_tip">
  56. 还剩{$count}个团长相关订单未生成,请勿刷新.....
  57. </div>
  58. <!-- 按钮 -->
  59. </div>
  60. <div class="w794 noprint">
  61. <a href="javascript:;" data-confirm='配送订单统计打印一次后,系统不再进行统计和打印配送清单,是否确认打印配送清单?' data-toggle="ajaxModal" >立即打印</a>
  62. </div>
  63. <div id="print_content">
  64. </div>
  65. <div class="w794 noprint">
  66. <a href="javascript:;" data-confirm='配送订单统计打印一次后,系统不再进行统计和打印配送清单,是否确认打印配送清单?' data-toggle="ajaxModal" >立即打印</a>
  67. </div>
  68. </div>
  69. <script src="/layuiadmin/layui/layui.js"></script>
  70. <script>
  71. layui.config({
  72. base: '/layuiadmin/' //静态资源所在路径
  73. }).extend({
  74. index: 'lib/index' //主入口模块
  75. }).use('index');
  76. </script>
  77. <script>
  78. var layer = layui.layer;
  79. var $;
  80. layui.use(['jquery', 'layer','form'], function(){
  81. $ = layui.$;
  82. var form = layui.form;
  83. $("[data-toggle='ajaxModal']").click(function () {
  84. var s_url = $(this).attr('data-href');
  85. ajax_url = s_url;
  86. //layer.confirm($(this).attr('data-confirm'), function(index){
  87. window.print();
  88. layer.closeAll('dialog');
  89. //})
  90. });
  91. });
  92. </script>
  93. <script>
  94. var s_page = 1;
  95. var s_count = {$count};
  96. function showWindow() {
  97. $('#showdiv').show(); //显示弹窗
  98. }
  99. $(function(){
  100. showWindow();
  101. load_data();
  102. })
  103. function load_data()
  104. {
  105. $.ajax({
  106. url:"{:U('Delivery/delivery_allprint_order_do', array('searchtime' => $searchtime, 'starttime' => $starttime, 'endtime' => $endtime ,'type' => $type))}",
  107. type:'get',
  108. data:{page:s_page},
  109. dataType:'json',
  110. success:function(ret){
  111. if(ret.code == 1)
  112. {
  113. alert('生成完毕,可以打印');
  114. $('#showdiv').remove();
  115. return false;
  116. }else if(ret.code == 0) {
  117. s_page++;
  118. s_count = s_count -10;
  119. if(s_count < 0)
  120. {
  121. s_count= 0;
  122. }
  123. $('#print_content_tip').html('还剩'+s_count+'个团长相关订单未生成,请勿刷新.....');
  124. //$('#print_content').append(ret.html);
  125. $("#print_content").append(ret.html);
  126. setTimeout(load_data(), 1000 );
  127. }
  128. }
  129. })
  130. }
  131. </script>
  132. </body>
  133. </html>