tb-business-car-print.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "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. .footer {
  20. position: fixed;
  21. bottom: 10px;
  22. right: 20px;
  23. }
  24. .print-btn {
  25. background: #57C22A;
  26. border: 1px solid #e2e2e2;
  27. padding: 4px 20px;
  28. border-radius: 4px;
  29. color: white;
  30. cursor: pointer;
  31. }
  32. </style>
  33. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  34. <script src="../../static/print/jquery.jPrintArea.js" type="text/javascript"></script>
  35. <script src="../../static/sa.js"></script>
  36. </head>
  37. <body>
  38. <div>
  39. <fieldset align="">
  40. <div id="myPrintArea" style="height: 1500;">
  41. <div align="center">
  42. <SPAN style="font-size:15px">东兴北投A1场地业务收费单据证明</SPAN>
  43. <br /><br />
  44. </div>
  45. <div style="text-align:center; font-size:15px;">
  46. <table id="one" width="100%" style="border-collapse:collapse;border:none;">
  47. <tr height="50">
  48. <td style="border:solid #000 1px;text-align: left;" colspan="4">单位:广西东兴北投口岸投资有限公司</td>
  49. <td style="border:solid #000 1px;text-align: left;" colspan="3">单证编号:
  50. <span id="businessNo"></span>
  51. </td>
  52. </tr>
  53. <tr height="50">
  54. <td style="border:solid #000 1px;text-align: left;" colspan="4">总金额:
  55. <span id="totalMoney"></span>
  56. </td>
  57. <td style="border:solid #000 1px;text-align: left;" colspan="3">支付时间:
  58. <span id="payTime"></span>
  59. </td>
  60. </tr>
  61. </table>
  62. <table id="two" width="100%" style="border-collapse:collapse;border:none;">
  63. <tr height="50">
  64. <td style="border:solid #000 1px;text-align: left;" colspan="7"><b>车辆信息:</b></td>
  65. </tr>
  66. <tr height="50">
  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. <div id="carInfo"></div>
  74. </table>
  75. <table id="three" width="100%" style="border-collapse:collapse;border:none;">
  76. <tr height="50">
  77. <td style="border:solid #000 1px;text-align: left;" colspan="7"><b>具体业务项:</b></td>
  78. </tr>
  79. <tr height="50">
  80. <td style="border:solid #000 1px;text-align: center;">收费项</td>
  81. <td style="border:solid #000 1px;text-align: center;">收费明细项</td>
  82. <td style="border:solid #000 1px;text-align: center;">单价(元)</td>
  83. <td style="border:solid #000 1px;text-align: center;">计费标准</td>
  84. <td style="border:solid #000 1px;text-align: center;">数量</td>
  85. <td style="border:solid #000 1px;text-align: center;">合计(元)</td>
  86. </tr>
  87. </table>
  88. <table id="three" width="100%" style="border-collapse:collapse;border:none;">
  89. <tr height="40">
  90. <td style="border:solid #000 1px;text-align: left;" colspan="7">开单员:
  91. <span id="createBy"></span>
  92. </td>
  93. </tr>
  94. </table>
  95. <br /><br />
  96. </div>
  97. </div>
  98. </fieldset>
  99. <div class="footer">
  100. <input type="button" class="print-btn" id="print_button" value="打印" />
  101. <input type="button" class="print-btn" id="close_button" value="关闭" />
  102. </div>
  103. </div>
  104. <script type="text/javascript">
  105. function getItemsByCarId(businessCarId) {
  106. sa.ajaxNoLayer('/TbBusinessItem/getByBusinessCarId', {
  107. businessCarId: businessCarId
  108. }, function(resp) {
  109. let itemList = resp.data;
  110. $.each(itemList, function(index, item) {
  111. let itemTypeName = item.itemTypeName;
  112. let itemName = item.itemName;
  113. let itemPrice = item.itemPrice;
  114. let unit = item.unit;
  115. let num = item.num
  116. let total = item.total;
  117. $('#three').append(
  118. "<tr height=\"35\">" +
  119. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  120. itemTypeName + "</td>" +
  121. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  122. itemName + "</td>" +
  123. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  124. itemPrice + "</td>" +
  125. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  126. unit + "</td>" +
  127. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  128. num + "</td>" +
  129. "<td style=\"border:solid #000 1px;text-align: center;\">" +
  130. total + "</td>" +
  131. "<tr>"
  132. );
  133. })
  134. })
  135. };
  136. function getByBusinessCarId(businessCarId) {
  137. sa.ajaxNoLayer('/TbBusiness/getByBusinessCarId', {
  138. businessCarId: businessCarId
  139. }, function(resp) {
  140. let list = resp.data;
  141. let no = list.map(obj => obj.no).join('、');
  142. let itemPrice=eval(list.map(obj=>parseFloat(obj.itemPrice)).join('+'))
  143. $("#businessNo").html(no);
  144. $('#payTime').html(list.length > 0 ? list[0].payTime : '');
  145. getListByCarId(businessCarId,itemPrice);
  146. })
  147. };
  148. function getListByCarId(businessCarId,itemPrice) {
  149. sa.ajaxNoLayer('/TbBusinessCar/getListByCarId', {
  150. businessCarId: businessCarId
  151. }, function(resp) {
  152. let partPrice=0;
  153. let carList = resp.data;
  154. $.each(carList, function(index, item) {
  155. let carNo = item.carNo;
  156. let carType = item.carType;
  157. let netWeight = item.netWeight;
  158. let carSize = item.carSize;
  159. let payType = item.payType
  160. let isLock = item.isLock;
  161. let money = item.money;
  162. partPrice=parseFloat(money)+partPrice;
  163. if (isLock === 0) {
  164. isLock = "正常"
  165. } else if (isLock === 1) {
  166. isLock = "锁定"
  167. }
  168. $('#two').append(
  169. "<tr height=\"35\">" +
  170. "<td style=\"border:solid #000 1px;text-align: center;\">" + carNo + "</td>" +
  171. "<td style=\"border:solid #000 1px;text-align: center;\">" + carType + "</td>" +
  172. "<td style=\"border:solid #000 1px;text-align: center;\">" + payType + "</td>" +
  173. "<td style=\"border:solid #000 1px;text-align: center;\">" + isLock + "</td>" +
  174. "<td style=\"border:solid #000 1px;text-align: center;\">" + money + "</td>" +
  175. "<tr>"
  176. );
  177. })
  178. $('#totalMoney').html((itemPrice+partPrice).toFixed(2)+' 元');
  179. })
  180. };
  181. $(function() {
  182. $("#createBy").html(sa.$sys.getCurrUser().nickname);
  183. var id = sa.p('businessCarId', '-1');
  184. $("#print_button").click(function() {
  185. $("#myPrintArea").printArea();
  186. });
  187. $("#close_button").click(function() {
  188. sa.closeCurrIframe();
  189. });
  190. getItemsByCarId(id);
  191. getByBusinessCarId(id);
  192. });
  193. </script>
  194. </body>
  195. </html>