No Description

PrintPreviewKeyWords.html 6.9KB

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><!--endprint1-->
  135. <div class="alignC">
  136. <input type="button" value="打印" class="btn" id="printBtn1"/>
  137. </div>
  138. <script type="text/javascript">
  139. var kWI = helper.request.queryString("kWIndex");
  140. var kWdate = helper.request.queryString("Qdate");
  141. //console.log(date);
  142. $(document).ready(function(){
  143. $.getJSON(huayi.config.callcenter_url + 'DataAnalysis/GetKeyReport', {
  144. date: kWdate,
  145. "token": $.cookie("token")
  146. }, function (result) {
  147. if (result.state.toLowerCase() == "success") {
  148. var content = result.data;
  149. if(content){
  150. if(kWI==1){
  151. if($('.datehide').show()){
  152. $('.datehide').hide();
  153. }
  154. $('#main1 .startTimeKW').html(content.KeyReport[0].date);
  155. }else if(kWI==2){
  156. $('.datehide').show();
  157. $('#main1 .startTimeKW').html(content.KeyReport[0].weeksdate);
  158. $('#main1 .endTimeKW').html(content.KeyReport[0].weekedte);
  159. }else if(kWI==3){
  160. $('.datehide').show();
  161. $('#main1 .startTimeKW').html(content.KeyReport[0].monthsdate);
  162. $('#main1 .endTimeKW').html(content.KeyReport[0].monthedate);
  163. }else if(kWI==4){
  164. $('#main1 h3').hide();
  165. $('#main1 h2').css({'margin-bottom':'55px'});
  166. }
  167. var keyReports = content["KeyReport"+kWI+""];
  168. //日统计
  169. for(var i = 0; i < keyReports.length; i++){
  170. //debugger;
  171. var html = '<tr>'+
  172. '<td><span>'+ keyReports[i].keyname +'</span></td>'+
  173. '<td><span>'+ keyReports[i].count +'</span></td>'+
  174. '<td><span>'+ keyReports[i].sort +'</span></td>'+
  175. '</tr>';
  176. $('#KeyWordsStatistics').append(html);
  177. }
  178. }
  179. }
  180. })
  181. })
  182. /*打印*/
  183. $(document).on('click','#printBtn1',{printPage: 1},preview);
  184. function preview(e) {
  185. var oper = e.data.printPage;
  186. if (oper < 5) {
  187. bdhtml = window.document.body.innerHTML; //获取当前页的html代码
  188. sprnstr = "<!--startprint" + oper + "-->"; //设置打印开始区域
  189. eprnstr = "<!--endprint" + oper + "-->"; //设置打印结束区域
  190. prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
  191. print.portrait = true ;//纵向打印
  192. prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
  193. window.document.body.innerHTML = prnhtml;
  194. window.print();
  195. window.document.body.innerHTML = bdhtml;
  196. } else {
  197. window.print();
  198. }
  199. }
  200. </script>
  201. </body>
  202. </html>