| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>打印预览</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="../js/jquery.min.js?v=2.1.4"></script>
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <script src="../js/jquery.cookie.js"></script>
- <!--</METAHTTP-EQUIV="Pragma" CONTENT="no-cache">
- </METAHTTP-EQUIV="Cache-Control" CONTENT="no-cache">
- </METAHTTP-EQUIV="Expires" CONTENT="0">-->
- <style>
- #main1{
- width: 788.8px;
- margin: 0 auto;
- -webkit-box-shadow: 1px 1px 9px 2px #D2D2D2;
- box-shadow: 1px 1px 9px 2px #D2D2D2;
- background-color: #fff;
- padding: 30px 60px 80px 60px;
- }
- .alignC{
- text-align: center;
- }
- .alignC h2{
- font-family: "宋体";
- font-weight: bold;
- font-size: 22pt;
- letter-spacing: -1px;
- }
- .headerAlign h3 div:nth-of-type(1){
- font-size: 14pt;
- padding-top: 20px;
- text-align: left;
- font-weight: normal;
- margin-left: 48px;
- }
- #main1 table{
- margin: 0 auto;
- width: 600px;
- border-collapse: collapse;
- font-size: 13pt;
- font-family: "仿宋";
- }
- #main1 table tr{
- min-height: 49px;
- }
- tbody td{
- min-width: 10%;
- padding: 6px 0 6px 0;
- }
-
- .alignC .tableHead{
- font-weight: 600;
- }
-
- .btn{
- margin-top: 4px;
- margin-bottom: 4px ;
- background: #00a1cb;
- color: #fff;
- }
- .datehide{
- display: none;
- }
-
- </style>
-
- <style media="print">
- /*设置打印样式 标题宋体加黑二号*/
- .headerAlign h2{
- font-family: "宋体" !important;
- font-weight: bold !important;
- font-size: 22pt !important;
- letter-spacing: -1px !important;
- }
- .headerAlign h3 div:nth-of-type(1){
- font-size: 14pt !important;
- font-family: "宋体" !important;
- font-weight: normal !important;
- margin-left: 108px !important;
- }
- #main1{
- padding: 40px 0 0 0 !important;
- }
- #main1 table{
- font-size: 13pt !important;
- font-family: "仿宋" !important;
- border-color: #000;
- color: #000;
- width: 600px !important;
- /*page-break-after:avoid !important;*/
- }
- #main1 table tr{
- min-height: 49px;
- }
- tbody td{
- padding: 6px 0 6px 0 !important;
- }
- @page {
- size: A4 portrait;
- }
- </style>
-
- </head>
- <body>
- <!--startprint1-->
- <div id="main1">
- <div class="alignC headerAlign">
- <br />
- <h2 style="margin-bottom: 15px;">
- 商丘市12345政府服务热线关键词统计
- </h2>
- <h3>
- <div>时间:
- <span class="startTimeKW">-</span>
- <span class="datehide">至</span>
- <span class="endTimeKW datehide">-</span>
- </div>
- </h3>
-
- </div>
- <table class="alignC" border="1" cellpadding="4" cellspacing="0" bordercolor="#cbcbcb">
- <tbody id="KeyWordsStatistics">
- <!--关键词统计情况-->
- <tr>
- <td width="40%" class="tableHead">
- 关键词
- </td>
- <td width="40%" class="tableHead">
- 统计数量
- </td>
- <td width="20%" class="tableHead">
- 排名
- </td>
- </tr>
- </tbody>
- </table>
- </div><!--endprint1-->
- <div class="alignC">
- <input type="button" value="打印" class="btn" id="printBtn1"/>
- </div>
-
- <script type="text/javascript">
- var kWI = helper.request.queryString("kWIndex");
- var kWdate = helper.request.queryString("Qdate");
- //console.log(date);
- $(document).ready(function(){
- $.getJSON(huayi.config.callcenter_url + 'DataAnalysis/GetKeyReport', {
- date: kWdate,
- "token": $.cookie("token")
- }, function (result) {
- if (result.state.toLowerCase() == "success") {
- var content = result.data;
- if(content){
- if(kWI==1){
- if($('.datehide').show()){
- $('.datehide').hide();
- }
- $('#main1 .startTimeKW').html(content.KeyReport[0].date);
- }else if(kWI==2){
- $('.datehide').show();
- $('#main1 .startTimeKW').html(content.KeyReport[0].weeksdate);
- $('#main1 .endTimeKW').html(content.KeyReport[0].weekedte);
- }else if(kWI==3){
- $('.datehide').show();
- $('#main1 .startTimeKW').html(content.KeyReport[0].monthsdate);
- $('#main1 .endTimeKW').html(content.KeyReport[0].monthedate);
- }else if(kWI==4){
- $('#main1 h3').hide();
- $('#main1 h2').css({'margin-bottom':'55px'});
- }
- var keyReports = content["KeyReport"+kWI+""];
- //日统计
- for(var i = 0; i < keyReports.length; i++){
- //debugger;
- var html = '<tr>'+
- '<td><span>'+ keyReports[i].keyname +'</span></td>'+
- '<td><span>'+ keyReports[i].count +'</span></td>'+
- '<td><span>'+ keyReports[i].sort +'</span></td>'+
- '</tr>';
- $('#KeyWordsStatistics').append(html);
- }
- }
- }
- })
- })
-
- /*打印*/
- $(document).on('click','#printBtn1',{printPage: 1},preview);
- function preview(e) {
- var oper = e.data.printPage;
- if (oper < 5) {
- bdhtml = window.document.body.innerHTML; //获取当前页的html代码
- sprnstr = "<!--startprint" + oper + "-->"; //设置打印开始区域
- eprnstr = "<!--endprint" + oper + "-->"; //设置打印结束区域
- prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
- print.portrait = true ;//纵向打印
- prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
- window.document.body.innerHTML = prnhtml;
- window.print();
- window.document.body.innerHTML = bdhtml;
- } else {
- window.print();
- }
- }
-
- </script>
- </body>
- </html>
|