print.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>打印申请单</title>
  6. <style type="text/css">
  7. body{left:0px;top:0px;right:0px;bottom:0px;margin:0px;font-family: Arial, Helvetica, sans-serif;font-size: 12px;overflow: hidden;white-space: nowrap;}
  8. </style>
  9. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  10. <script src="../../static/print/jquery.jPrintArea.js" type="text/javascript"></script>
  11. </head>
  12. <body>
  13. <div>
  14. <input type="button" style="height: 30;" id="print_button" value="打印" />
  15. <fieldset align="">
  16. <legend>打印区</legend>
  17. <div id="myPrintArea" style="height: 1500;">
  18. <div align="center">
  19. <SPAN style="TEXT-DECORATION: underline;font-size:25px">消毒申请单</SPAN>
  20. <br/><br/>
  21. </div>
  22. <div style="text-align:center; font-size:15px;he">
  23. <table width="100%" style="border-collapse:collapse;border:none;">
  24. <tr height="40">
  25. <td style="border:solid #000 1px; width: 25%;hei">发货人名称</td>
  26. <td style="border:solid #000 1px;" colspan="3"><div id="sendPeople"></div></td>
  27. </tr>
  28. <tr height="40">
  29. <td style="border:solid #000 1px; width: 25%;hei">收货人名称</td>
  30. <td style="border:solid #000 1px;" colspan="3">123</td>
  31. </tr>
  32. <tr height="40">
  33. <td style="border:solid #000 1px; width: 25%;hei">品名</td>
  34. <td style="border:solid #000 1px;">123</td>
  35. <td style="border:solid #000 1px; width: 25%;hei">产地</td>
  36. <td style="border:solid #000 1px;">123</td>
  37. </tr>
  38. <tr height="40">
  39. <td style="border:solid #000 1px; width: 25%;hei">数量/重量</td>
  40. <td style="border:solid #000 1px;">123</td>
  41. <td style="border:solid #000 1px; width: 25%;hei">规格</td>
  42. <td style="border:solid #000 1px;">123</td>
  43. </tr>
  44. <tr height="40">
  45. <td style="border:solid #000 1px; width: 25%;hei">包装</td>
  46. <td style="border:solid #000 1px;">123</td>
  47. <td style="border:solid #000 1px;" colspan="2">标记及号码</td>
  48. </tr>
  49. <tr height="40">
  50. <td style="border:solid #000 1px; width: 25%;hei">产品学名6</td>
  51. <td style="border:solid #000 1px;">123</td>
  52. <td style="border:solid #000 1px;" colspan="2" rowspan="4"></td>
  53. </tr>
  54. <tr height="40">
  55. <td style="border:solid #000 1px; width: 25%;hei">产品学名7</td>
  56. <td style="border:solid #000 1px;">123</td>
  57. </tr>
  58. <tr height="40">
  59. <td style="border:solid #000 1px; width: 25%;hei">产品学名8</td>
  60. <td style="border:solid #000 1px;">123</td>
  61. </tr>
  62. <tr height="40">
  63. <td style="border:solid #000 1px; width: 25%;hei">产品学名9</td>
  64. <td style="border:solid #000 1px;">123</td>
  65. </tr>
  66. <tr height="80">
  67. <td style="border:solid #000 1px; width: 25%;hei">产品学名10</td>
  68. <td style="border:solid #000 1px;" colspan="3">123</td>
  69. </tr>
  70. <tr height="80">
  71. <td style="border:solid #000 1px; width: 25%;hei">产品学名11</td>
  72. <td style="border:solid #000 1px;" colspan="3">123</td>
  73. </tr>
  74. </table>
  75. <table width="100%" style="border-collapse:collapse;border:none;">
  76. <tr height="80">
  77. <td style="border:solid #000 1px;">123</td>
  78. <td style="border:solid #000 1px;">123</td>
  79. <td style="border:solid #000 1px;">123</td>
  80. </tr>
  81. <tr height="80">
  82. <td style="border:solid #000 1px;">123</td>
  83. <td style="border:solid #000 1px;">123</td>
  84. <td style="border:solid #000 1px;">123</td>
  85. </tr>
  86. </table>
  87. </div>
  88. <div align="right">
  89. <br/><br/>
  90. <SPAN style=";font-size:15px"> &nbsp&nbsp&nbsp&nbsp 年 &nbsp&nbsp&nbsp&nbsp 月 &nbsp&nbsp&nbsp&nbsp 日</SPAN>
  91. </div>
  92. </div>
  93. </fieldset>
  94. </div>
  95. <script type="text/javascript">
  96. $(function(){
  97. $("#print_button").click(function(){
  98. $("#myPrintArea").printArea();
  99. });
  100. function getUrlParam(name)
  101. {
  102. var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  103. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  104. if (r!=null) return unescape(r[2]); return null; //返回参数值
  105. }
  106. var id = getUrlParam('id');
  107. $.ajax({
  108. url: 'http://192.168.3.74:8099/pro/TbDisinfect/getById?id=' + id,
  109. type: 'post',
  110. success: function(data) {
  111. $("#myPrintArea").printArea();
  112. }
  113. });
  114. });
  115. </script>
  116. </body>
  117. </html>