delivery_allprint.html 3.9 KB

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