print-zxbusiness.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>打印业务确认单</title>
  7. <style type="text/css">
  8. body {
  9. left: 0px;
  10. top: 0px;
  11. right: 0px;
  12. bottom: 0px;
  13. margin: 0px;
  14. font-family: Arial, Helvetica, sans-serif;
  15. font-size: 12px;
  16. overflow: hidden;
  17. white-space: nowrap;
  18. }
  19. </style>
  20. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  21. <script src="../../static/print/jquery.jPrintArea.js" type="text/javascript"></script>
  22. <script src="../../static/sa.js"></script>
  23. </head>
  24. <body>
  25. <div>
  26. <input type="button" style="height: 30;" id="print_button" value="打印"/>
  27. <fieldset align="">
  28. <legend>打印区</legend>
  29. <div id="myPrintArea" style="height: 1500;">
  30. <div align="center">
  31. <SPAN style="font-size:15px">东兴二桥口岸疫情防控进口接驳区业务确认单</SPAN>
  32. <br/><br/>
  33. </div>
  34. <div style="text-align:center; font-size:15px;">
  35. <table id="one" width="100%" style="border-collapse:collapse;border:none;">
  36. <tr height="50">
  37. <td style="border:solid #000 1px;text-align: left;" colspan="4">单位:广西东兴北投口岸投资有限公司</td>
  38. <td style="border:solid #000 1px;text-align: left;" colspan="3">单证编号:
  39. <span id="businessNo"></span>
  40. </td>
  41. </tr>
  42. <tr height="50">
  43. <td style="border:solid #000 1px;text-align: left;" colspan="7">支付时间:
  44. <span id="operateTime"></span>
  45. </td>
  46. </tr>
  47. <tr height="50">
  48. <td style="border:solid #000 1px;text-align: left;" colspan="7"><b>车辆信息:</b></td>
  49. </tr>
  50. <tr height="50">
  51. <td style="border:solid #000 1px;text-align: center;">车牌号</td>
  52. <td style="border:solid #000 1px;text-align: center;">类型</td>
  53. <td style="border:solid #000 1px;text-align: center;">载重(kg)</td>
  54. <td style="border:solid #000 1px;text-align: center;">规格(米)</td>
  55. <td style="border:solid #000 1px;text-align: center;">支付状态</td>
  56. <td style="border:solid #000 1px;text-align: center;">车辆状态</td>
  57. <td style="border:solid #000 1px;text-align: center;">停车费</td>
  58. </tr>
  59. </table>
  60. <!-- <table id="two" width="100%" style="border-collapse:collapse;border:none;">-->
  61. <!-- <tr height="80">-->
  62. <!-- <td style="border:solid #000 1px;text-align: left;" colspan="7"><b>具体业务项:</b></td>-->
  63. <!-- </tr>-->
  64. <!-- <tr height="80">-->
  65. <!-- <td style="border:solid #000 1px;text-align: center;">收费项</td>-->
  66. <!-- <td style="border:solid #000 1px;text-align: center;">收费明细项</td>-->
  67. <!-- <td style="border:solid #000 1px;text-align: center;">单价</td>-->
  68. <!-- <td style="border:solid #000 1px;text-align: center;">计费标准</td>-->
  69. <!-- <td style="border:solid #000 1px;text-align: center;">数量</td>-->
  70. <!-- <td style="border:solid #000 1px;text-align: center;">合计</td>-->
  71. <!-- <td style="border:solid #000 1px;text-align: center;">支付状态</td>-->
  72. <!-- </tr>-->
  73. <!-- </table>-->
  74. <br/><br/>
  75. </div>
  76. <!-- <div align="right">-->
  77. <!-- <br/><br/>-->
  78. <!-- <SPAN style=";font-size:15px"> &nbsp&nbsp&nbsp&nbsp 年 &nbsp&nbsp&nbsp&nbsp 月 &nbsp&nbsp&nbsp&nbsp 日</SPAN>-->
  79. <!-- </div>-->
  80. </div>
  81. </fieldset>
  82. </div>
  83. <script type="text/javascript">
  84. $(function () {
  85. $("#print_button").click(function () {
  86. $("#myPrintArea").printArea();
  87. });
  88. function getUrlParam(name) {
  89. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  90. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  91. if (r != null) return unescape(r[2]);
  92. return null; //返回参数值
  93. }
  94. var id = getUrlParam('id');
  95. $.ajax({
  96. url: sa.cfg.api_url + '/TbBusiness/getZxBusinessById?id=' + id,
  97. type: 'post',
  98. success: function (data) {
  99. $("#businessNo").html(data.data.no)
  100. $("#operateTime").html(data.data.payTime);
  101. var carList = data.data.cars;
  102. var html = [];
  103. $.each(carList, function (index, item) {
  104. let carNo = item.carNo;
  105. let carType = item.carType;
  106. let netWeight = item.netWeight;
  107. let carSize = item.carSize;
  108. let payType = item.payType
  109. let isLock = item.isLock;
  110. let money = item.money;
  111. if(isLock === 0){
  112. isLock = "正常"
  113. }else if(isLock === 1) {
  114. isLock = "锁定"
  115. }
  116. html.push(
  117. "<tr height=\"50\">"
  118. + "<td style=\"border:solid #000 1px;text-align: center;\">" + carNo + "</td>"
  119. + "<td style=\"border:solid #000 1px;text-align: center;\">" + carType + "</td>"
  120. + "<td style=\"border:solid #000 1px;text-align: center;\">" + netWeight + "</td>"
  121. + "<td style=\"border:solid #000 1px;text-align: center;\">" + carSize + "</td>"
  122. + "<td style=\"border:solid #000 1px;text-align: center;\">" + payType + "</td>"
  123. + "<td style=\"border:solid #000 1px;text-align: center;\">" + isLock + "</td>"
  124. + "<td style=\"border:solid #000 1px;text-align: center;\">" + money + "</td>"
  125. + "<tr>"
  126. );
  127. })
  128. html.push(
  129. "<tr height=\"50\">"
  130. + "<td style=\"border:solid #000 1px;text-align: left;\" colspan=\"7\"><b>具体业务项:</b></td>"
  131. + "<tr>"
  132. );
  133. html.push(
  134. "<tr height=\"50\">"
  135. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "收费项" + "</td>"
  136. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "收费明细项" + "</td>"
  137. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "单价" + "</td>"
  138. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "计费标准" + "</td>"
  139. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "数量" + "</td>"
  140. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "合计" + "</td>"
  141. + "<td style=\"border:solid #000 1px;text-align: center;\">" + "支付状态" + "</td>"
  142. + "<tr>"
  143. );
  144. var pickCustomerName = '';
  145. var itemList = data.data.items;
  146. $.each(itemList, function (index, item) {
  147. pickCustomerName = pickCustomerName + item.pickBy + ',';
  148. let itemTypeName = item.itemTypeName;
  149. let itemName = item.itemName;
  150. let itemPrice = item.itemPrice;
  151. let unit = item.unit;
  152. let num = item.num
  153. let total = item.total;
  154. let payStatus = item.payStatus;
  155. if(payStatus === 0){
  156. payStatus = "未支付"
  157. }else if(payStatus === 1) {
  158. payStatus = "已支付"
  159. }
  160. html.push(
  161. "<tr height=\"50\">"
  162. + "<td style=\"border:solid #000 1px;text-align: center;\">" + itemTypeName + "</td>"
  163. + "<td style=\"border:solid #000 1px;text-align: center;\">" + itemName + "</td>"
  164. + "<td style=\"border:solid #000 1px;text-align: center;\">" + itemPrice + "</td>"
  165. + "<td style=\"border:solid #000 1px;text-align: center;\">" + unit + "</td>"
  166. + "<td style=\"border:solid #000 1px;text-align: center;\">" + num + "</td>"
  167. + "<td style=\"border:solid #000 1px;text-align: center;\">" + total + "</td>"
  168. + "<td style=\"border:solid #000 1px;text-align: center;\">" + payStatus + "</td>"
  169. + "<tr>"
  170. );
  171. })
  172. pickCustomerName = pickCustomerName.substr(0, pickCustomerName.length-1);
  173. if(pickCustomerName === "null" || pickCustomerName == null){
  174. pickCustomerName = '';
  175. }
  176. var customerName = data.data.createBy;
  177. var kaiDanPeople = data.data.confirmBy;
  178. if(kaiDanPeople === "null" || kaiDanPeople == null){
  179. kaiDanPeople = '';
  180. }
  181. html.push(
  182. "<tr height=\"50\">"
  183. + "<td style=\"border:solid #000 1px;text-align: center;\">"+ "客户" +"</td>"
  184. + "<td style=\"border:solid #000 1px;text-align: center;\">"+ customerName +"</td>"
  185. + "<td style=\"border:solid #000 1px;text-align: center;\">"+ "开单员" +"</td>"
  186. + "<td style=\"border:solid #000 1px;text-align: center;\">"+ kaiDanPeople +"</td>"
  187. + "<td style=\"border:solid #000 1px;text-align: center;\">"+ "装卸公司" +"</td>"
  188. + "<td style=\"border:solid #000 1px;text-align: center;\" colspan=\"2\">"+ pickCustomerName +"</td>"
  189. + "<tr>"
  190. );
  191. $("#one").append(html.join(''));
  192. $("#myPrintArea").printArea();
  193. }
  194. });
  195. });
  196. </script>
  197. </body>
  198. </html>