liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<%@ page language="java" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
<title>批量打印</title>
<link href="css/<%=request.getParameter("cssName") %>.css" type="text/css" rel="stylesheet" />
<link href='css/printpaper.css' type='text/css' rel='stylesheet' />
 <script type="text/javascript">
     $(function(){
         var flag = <%=request.getParameter("flag")%>;
          $("#printTableTd").html(printViewPageContent);
          
          
          $("#printBtn").click(function(){
          //直接预览打印
              var strStyleCSS ="";
              if(flag =="3" ){
                  strStyleCSS ="<link href='css/printdb.css' type='text/css' rel='stylesheet' />";
              }else if(flag == "1"){
                  strStyleCSS ="<link href='css/tprint.css' type='text/css' rel='stylesheet' />";
              }else{
                  strStyleCSS ="<link href='css/print.css' type='text/css' rel='stylesheet' />";
              }
              LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));  
              LODOP.PRINT_INIT("打印");
              if(flag == 0){
                  var print_pageWidth="210mm";
                  var print_pageHeight="297mm";
                  strStyleCSS ="<link href='css/printpaper.css' type='text/css' rel='stylesheet' />";
                  //LODOP.SET_PRINT_PAGESIZE(1,print_dianzi_pageWidth,print_pageHeight,"");
                   var strFormHtml=strStyleCSS+'<body><table class="printTable" cellpadding="0" cellspacing="0" style="width: 92%;">'
                       +'<tr>'
                       +    '<td >'+printViewPageContent+'</td></tr></table></body>';
                   LODOP.ADD_PRINT_HTM(10,30,"100%","100%",strFormHtml);
              }else{
                  LODOP.SET_PRINT_PAGESIZE(1,print_dianzi_pageWidth,print_dianzi_pageHeight,"");
                   var strFormHtml=strStyleCSS+'<body><table class="printTable" cellpadding="0" cellspacing="0" style="width: 92%;">'
                       +'<tr>'
                       +    '<td >'+printViewPageContent+'</td></tr></table></body>';
                   LODOP.ADD_PRINT_HTM(10,10,print_dianzi_pageWidth,print_dianzi_pageHeight,strFormHtml);
              }
              
              LODOP.PREVIEW();
          })
     })
     
 </script>
 
</head>
<body onload="printLoad()">
     
    <table class="printTable" id="buttonPrint">
           <tr height="32px" id="t_span">
            <td style="text-align:left" class="buttonright">
                <input type="button" id="printBtn" class="upbutton"  value="打印"></input>
                <input type="button" onclick="javascript: apTabs.closeTab('apTabs','PrintTabls');" value="返回" class="upbutton"></input>
            </td>
           </tr>
       </table>
    <div id="div" style="height:95%">
    <table class="printTable" cellpadding="0" cellspacing="0" style="width: 92%;">
        <tr>
            <td id="printTableTd">
                 
            </td>
        </tr>
    </table>
    </div> 
</body>
</html>