Aucune description

PrintPreviewKeyWords.html 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>打印预览</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="../js/jquery.min.js?v=2.1.4"></script>
  8. <script src="../Script/Common/huayi.load.js"></script>
  9. <script src="../Script/Common/huayi.config.js"></script>
  10. <script src="../js/jquery.cookie.js"></script>
  11. <!--</METAHTTP-EQUIV="Pragma" CONTENT="no-cache">
  12. </METAHTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  13. </METAHTTP-EQUIV="Expires" CONTENT="0">-->
  14. <style>
  15. #main1 {
  16. width: 788.8px;
  17. margin: 0 auto;
  18. -webkit-box-shadow: 1px 1px 9px 2px #D2D2D2;
  19. box-shadow: 1px 1px 9px 2px #D2D2D2;
  20. background-color: #fff;
  21. padding: 30px 60px 80px 60px;
  22. }
  23. .alignC {
  24. text-align: center;
  25. }
  26. .alignC h2 {
  27. font-family: "宋体";
  28. font-weight: bold;
  29. font-size: 22pt;
  30. letter-spacing: -1px;
  31. }
  32. .headerAlign h3 div:nth-of-type(1) {
  33. font-size: 14pt;
  34. padding-top: 20px;
  35. text-align: left;
  36. font-weight: normal;
  37. margin-left: 48px;
  38. }
  39. #main1 table {
  40. margin: 0 auto;
  41. width: 600px;
  42. border-collapse: collapse;
  43. font-size: 13pt;
  44. font-family: "仿宋";
  45. }
  46. #main1 table tr {
  47. min-height: 49px;
  48. }
  49. tbody td {
  50. min-width: 10%;
  51. padding: 6px 0 6px 0;
  52. }
  53. .alignC .tableHead {
  54. font-weight: 600;
  55. }
  56. .btn {
  57. margin-top: 4px;
  58. margin-bottom: 4px;
  59. background: #00a1cb;
  60. color: #fff;
  61. }
  62. .datehide {
  63. display: none;
  64. }
  65. </style>
  66. <style media="print">
  67. /*设置打印样式 标题宋体加黑二号*/
  68. .headerAlign h2 {
  69. font-family: "宋体" !important;
  70. font-weight: bold !important;
  71. font-size: 22pt !important;
  72. letter-spacing: -1px !important;
  73. }
  74. .headerAlign h3 div:nth-of-type(1) {
  75. font-size: 14pt !important;
  76. font-family: "宋体" !important;
  77. font-weight: normal !important;
  78. margin-left: 108px !important;
  79. }
  80. #main1 {
  81. padding: 40px 0 0 0 !important;
  82. }
  83. #main1 table {
  84. font-size: 13pt !important;
  85. font-family: "仿宋" !important;
  86. border-color: #000;
  87. color: #000;
  88. width: 600px !important;
  89. /*page-break-after:avoid !important;*/
  90. }
  91. #main1 table tr {
  92. min-height: 49px;
  93. }
  94. tbody td {
  95. padding: 6px 0 6px 0 !important;
  96. }
  97. @page {
  98. size: A4 portrait;
  99. }
  100. </style>
  101. </head>
  102. <body>
  103. <!--startprint1-->
  104. <div id="main1">
  105. <div class="alignC headerAlign">
  106. <br />
  107. <h2 style="margin-bottom: 15px;">
  108. 安阳市12345政务服务热线关键词统计
  109. </h2>
  110. <h3>
  111. <div>时间:
  112. <span class="startTimeKW">-</span>
  113. <span class="datehide">至</span>
  114. <span class="endTimeKW datehide">-</span>
  115. </div>
  116. </h3>
  117. </div>
  118. <table class="alignC" border="1" cellpadding="4" cellspacing="0" bordercolor="#cbcbcb">
  119. <tbody id="KeyWordsStatistics">
  120. <!--关键词统计情况-->
  121. <tr>
  122. <td width="40%" class="tableHead">
  123. 关键词
  124. </td>
  125. <td width="40%" class="tableHead">
  126. 统计数量
  127. </td>
  128. <td width="20%" class="tableHead">
  129. 排名
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. </div>
  135. <!--endprint1-->
  136. <div class="alignC">
  137. <input type="button" value="打印" class="btn" id="printBtn1" />
  138. </div>
  139. <script type="text/javascript">
  140. var sdate = helper.request.queryString("sdate");
  141. var edate = helper.request.queryString("edate");
  142. //console.log(date);
  143. $(document).ready(function () {
  144. $.getJSON(huayi.config.callcenter_url + 'DataAnalysis/GetKeyReport_1', {
  145. date: kWdate,
  146. sdate: sdate,
  147. edate: edate,
  148. "token": $.cookie("token")
  149. }, function (result) {
  150. if (result.state.toLowerCase() == "success") {
  151. var content = result.data;
  152. if (content) {
  153. var keyReports = content;
  154. //日统计
  155. for (var i = 0; i < keyReports.length; i++) {
  156. //debugger;
  157. var html = '<tr>' +
  158. '<td><span>' + keyReports[i].keyname + '</span></td>' +
  159. '<td><span>' + keyReports[i].keycount + '</span></td>' +
  160. '<td><span>' + (i+1) + '</span></td>' +
  161. '</tr>';
  162. $('#KeyWordsStatistics').append(html);
  163. }
  164. }
  165. }
  166. })
  167. })
  168. /*打印*/
  169. $(document).on('click', '#printBtn1', {
  170. printPage: 1
  171. }, preview);
  172. function preview(e) {
  173. var oper = e.data.printPage;
  174. if (oper < 5) {
  175. bdhtml = window.document.body.innerHTML; //获取当前页的html代码
  176. sprnstr = "<!--startprint" + oper + "-->"; //设置打印开始区域
  177. eprnstr = "<!--endprint" + oper + "-->"; //设置打印结束区域
  178. prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
  179. print.portrait = true; //纵向打印
  180. prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
  181. window.document.body.innerHTML = prnhtml;
  182. window.print();
  183. window.document.body.innerHTML = bdhtml;
  184. } else {
  185. window.print();
  186. }
  187. }
  188. </script>
  189. </body>
  190. </html>