12345市长热线标准版-前端

PrintPreview-1.html 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.config.js"></script>
  9. <script src="../Script/Common/huayi.http.js"></script>
  10. <script src="../js/jquery.cookie.js"></script>
  11. <script type="text/javascript">
  12. var wid = helper.request.queryString("wid");
  13. if (wid) {
  14. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', { workorderid: wid, "token": $.cookie("token") }, function (result) {
  15. if (result.state.toLowerCase() == "success") {
  16. var content = result.data;
  17. $(".gdbh").text(content.data[0].F_WorkOrderId);
  18. $(".tssj").text(content.data[0].F_RegDate);
  19. $(".tsfs").text(content.data[0].SourceName);
  20. $(".lxr").text(content.data[0].F_CusName);
  21. //$('.lxdh').text(content.data[0].F_CusPhone);
  22. //$('.dz').text(content.data[0].F_CusAddress);
  23. //$('.lxrphone').text(content.data[0].F_ConPhone);
  24. $('.qkzy').text(content.data[0].F_ComContent);
  25. if (content.data[0].F_Result) {
  26. var rt = content.data[0].F_Result.replace(/[ ]/g, "&nbsp;").replace(/\ +/g, "&nbsp;").replace(/\r\n/g, "<br />").replace(/\n/g, "<br />");
  27. $(".cljg").html(rt);
  28. }
  29. else {
  30. $(".cljg").html("");
  31. }
  32. var n=content.cpdata.length;
  33. if (n > 0) {
  34. var ldps = content.cpdata[n - 1].F_SuperOpinion;
  35. if (ldps) { ldps = ldps.replace(/[ ]/g, "&nbsp;").replace(/\ +/g, "&nbsp;").replace(/\r\n/g, "<br />").replace(/\n/g, "<br />"); }
  36. $(".ldps").html(ldps);
  37. }
  38. var m = content.jbdata.length;
  39. if (m > 0) {
  40. var ldps = content.jbdata[n - 1].F_AssignedOpinion;
  41. $(".jbyj").html(ldps);
  42. //$(".cbdw").text(content.jbdata[n - 1].DeptName);
  43. //$(".jbsj").text(content.jbdata[n - 1].F_SubmitDate);
  44. }
  45. }
  46. })
  47. }
  48. function preview(oper) {
  49. if (oper < 10) {
  50. bdhtml = window.document.body.innerHTML; //获取当前页的html代码
  51. sprnstr = "<!--startprint" + oper + "-->"; //设置打印开始区域
  52. eprnstr = "<!--endprint" + oper + "-->"; //设置打印结束区域
  53. prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
  54. prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
  55. window.document.body.innerHTML = prnhtml;
  56. window.print();
  57. window.document.body.innerHTML = bdhtml;
  58. } else {
  59. window.print();
  60. }
  61. }
  62. </script>
  63. <style>
  64. #main{
  65. width: 60%;
  66. margin: 0 auto;
  67. }
  68. .alignC{
  69. text-align: center;
  70. }
  71. .alignC h2{
  72. font-family: 宋体;
  73. font-weight: 700;
  74. }
  75. .caption{
  76. margin: 20px 0 2px 0;
  77. }
  78. .caption .headright{
  79. float: right;
  80. }
  81. #main table{
  82. margin: 0;
  83. width: 100%;
  84. border-color: #111111;
  85. border-collapse: collapse;
  86. }
  87. tbody td:nth-of-type(1),
  88. tbody td:nth-of-type(2)
  89. {
  90. width: 20%;
  91. }
  92. tbody td:nth-of-type(3),
  93. tbody td:nth-of-type(4),
  94. tbody td:nth-of-type(5),
  95. tbody td:nth-of-type(6),
  96. tbody td:nth-of-type(7),
  97. tbody td:nth-of-type(8)
  98. {
  99. width: 10%;
  100. }
  101. .dtOpinion,
  102. .ldInstructions{
  103. width: 20px;
  104. margin: 0 auto;
  105. display: block;
  106. }
  107. .btn{
  108. margin-top: 4px;
  109. }
  110. </style>
  111. </head>
  112. <body>
  113. <div id="main">
  114. <!--startprint1--><div class="alignC">
  115. <h2>
  116. 襄阳市城乡建设委员会文件处理便签
  117. </h2>
  118. </div>
  119. <div class="caption">
  120. <span class="headleft">收文 108 号</span>
  121. <span class="headright">2017年05月05日</span>
  122. </div>
  123. <table class="alignC" border="1" cellpadding="4" cellspacing="0">
  124. <tbody>
  125. <tr>
  126. <td>
  127. &nbsp;来文单位
  128. </td>
  129. <td>
  130. <span class="gdbh">dasdsdasdasd</span>
  131. </td>
  132. <td>
  133. &nbsp;文号
  134. </td>
  135. <td>
  136. <span class="tssj">dasdasd</span>&nbsp;
  137. </td>
  138. <td>
  139. &nbsp;秘密等级
  140. </td>
  141. <td>
  142. <span class="mmdj">yijie</span>&nbsp;
  143. </td>
  144. <td>
  145. &nbsp;份数
  146. </td>
  147. <td>
  148. <span class="fs">dasds</span>&nbsp;
  149. </td>
  150. </tr>
  151. <tr>
  152. <td class="style1">
  153. &nbsp;内容摘要
  154. </td>
  155. <td colspan="7">
  156. <span class="lxr">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere esse eos doloremque unde ipsa repellendus consectetur, incidunt consequatur fuga ipsum at omnis consequuntur blanditiis sed aliquid voluptate cupiditate quaerat dicta.</span>
  157. </td>
  158. </tr>
  159. <tr>
  160. <td class="style1">
  161. &nbsp;分发单位
  162. </td>
  163. <td colspan="7">
  164. <span class="tsfs">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere esse eos doloremque unde ipsa repellendus consectetur, incidunt consequatur fuga ipsum at omnis consequuntur blanditiis sed aliquid voluptate cupiditate quaerat dicta.</span>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td>
  169. <span class="dtOpinion">承办部门意见</span>
  170. </td>
  171. <td colspan="7">
  172. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  173. <span class="qkzy">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere esse eos doloremque unde ipsa repellendus consectetur, incidunt consequatur fuga ipsum at omnis consequuntur blanditiis sed aliquid voluptate cupiditate quaerat dicta.</span>
  174. <br>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td>
  179. <span class="ldInstructions">领导批示</span>
  180. </td>
  181. <td colspan="7">
  182. <span class="ldps">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere esse eos doloremque unde ipsa repellendus consectetur, incidunt consequatur fuga ipsum at omnis consequuntur blanditiis sed aliquid voluptate cupiditate quaerat dicta.</span>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td>
  187. 处理结果
  188. </td>
  189. <td class="style4" colspan="7">
  190. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  191. <span class="jbyj">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere esse eos doloremque unde ipsa repellendus consectetur, incidunt consequatur fuga ipsum at omnis consequuntur blanditiis sed aliquid voluptate cupiditate quaerat dicta.</span>
  192. &nbsp;
  193. </td>
  194. </tr>
  195. </tbody>
  196. </table>
  197. <!--endprint1-->
  198. <div class="alignC">
  199. <input type="button" value="打印" class="btn" onclick="preview(1)" />
  200. </div>
  201. </div>
  202. </body>
  203. </html>