balance-print.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. @page {
  9. size: A4 portrait;
  10. margin: 19mm 25mm 15mm 25mm;
  11. }
  12. .print-btn {
  13. color: white;
  14. background: #2D8CF0;
  15. border: none;
  16. border-radius: 3px;
  17. padding: 5px 10px;
  18. font-size: 10px;
  19. margin: 10px 20px;
  20. cursor: pointer;
  21. }
  22. .content-box {
  23. text-align: center;
  24. height: 1123px;
  25. width: 794px;
  26. margin: 0 auto;
  27. }
  28. table {
  29. border-collapse: collapse;
  30. border-spacing: 0;
  31. border-left: 1px solid #888;
  32. border-top: 1px solid #888;
  33. }
  34. th,
  35. td {
  36. border-right: 1px solid #888;
  37. border-bottom: 1px solid #888;
  38. word-break: break-all;
  39. padding: 0 2px;
  40. }
  41. th {
  42. /* font-weight: bold; */
  43. }
  44. .title-top {
  45. margin-top: 248px;
  46. }
  47. .hide-border{
  48. border-bottom-style:none;
  49. border-left-style:none;
  50. border-right-style: none;
  51. }
  52. tr td:first-child {
  53. border-left: none;
  54. }
  55. </style>
  56. <link rel="stylesheet" href="../../static/sa.css">
  57. <script src="../../static/kj/vue.min.js"></script>
  58. <script src="../../static/kj/element-ui/index.js"></script>
  59. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  60. <script src="../../static/print/print2.js" type="text/javascript"></script>
  61. <script src="../../static/kj/layer/layer.js"></script>
  62. <script src="../../static/sa.js"></script>
  63. </head>
  64. <body>
  65. <div>
  66. <div class="box">
  67. <button class="print-btn" @click="printFn">打印</button>
  68. <div id="myPrintArea" style="position: relative;">
  69. <div class="content-box" style="position: relative;" v-for="(item,index) in dataList"
  70. :key="index" :class="index>0?'title-top':''" >
  71. <div class="header-title" style="text-align: center;" v-if="index==0">
  72. <span
  73. style="font-size: 20px;font-weight: 500;font-family: 黑体;">东兴口岸(二桥)进口货物集散区(A1地块)预存款余额表</span>
  74. </div>
  75. <table style="margin: 0 auto;text-align: center;width: 790px;" >
  76. <div
  77. style="text-align: left;width: 790px;margin: auto;padding: 5px 0;font-family: 黑体;font-weight: 500;">
  78. <span colspan="9">单位:广西东兴北投口岸投资有限公司
  79. <span style="margin-left: 10px;">期间:{{item.time}}</span>
  80. <span style="margin-left: 10px;">金额单位:元</span></span>
  81. </div>
  82. <tr style="height: 60px;font-size:10px;">
  83. <th style="min-width: 30px;">序号</th>
  84. <th style="width: 180px;">企业名称</th>
  85. <th style="min-width: 60px;"> 期初余额</th>
  86. <th style="min-width: 60px;">本期充值</th>
  87. <th style="min-width: 60px;">本期扣除</th>
  88. <th style="min-width: 60px;">余额退款</th>
  89. <th style="min-width: 60px;">异常退款</th>
  90. <th style="width: 70px;">期末余额</th>
  91. </tr>
  92. <tr v-for="(cel,i) in item.list" :key="cel.index" style="height:60px;font-size: 10px;">
  93. <td>{{i+1}}</td>
  94. <td>{{cel.customerName}}</td>
  95. <td>{{cel.beginMoney}}</td>
  96. <td>{{cel.chargeMoney}}</td>
  97. <td>{{cel.deuctionMoney}}</td>
  98. <td>{{cel.balanceRefundMoney}}</td>
  99. <td>{{cel.errorRefundMoney}}</td>
  100. <td>{{cel.endMoney}}</td>
  101. </tr>
  102. <tr style="height: 40px;padding: 0 0.5px;" v-if="index==dataList.length-1">
  103. <td></td>
  104. <td>合计</td>
  105. <td>{{totalInit}}</td>
  106. <td>{{totalCharge}}</td>
  107. <td>{{totalDeuctionMoney}}</td>
  108. <td>{{totalRefundMoney}}</td>
  109. <td>{{totalErrorRefund}}</td>
  110. <td>{{totalEnd}}</td>
  111. </tr>
  112. </table>
  113. <div>
  114. <div style="display: flex;margin-top: 15px;">
  115. <div style="flex: 2;text-align: right;margin-right: 50px;">统计稽核员:</div>
  116. <div style="flex: 1;">复核员:</div>
  117. <div style="flex: 1;margin-right: 20px;">开单员:</div>
  118. </div>
  119. </div>
  120. <span style="position: absolute;top: 1250px;left: 750px">{{index+1}}/{{dataList.length}}</span>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <script type="text/javascript">
  126. var app = new Vue({
  127. el: '.box',
  128. data: {
  129. p: {
  130. "beginTime": sa.p('bDay', ''),
  131. "endTime": sa.p('eDay', ''),
  132. "customerName": sa.p('customerName', '')
  133. },
  134. dataList: [],
  135. allDayFee: 0,
  136. allDayTaxes: 0,
  137. allDayNoTaxFee: 0,
  138. totalCharge:0,
  139. totalInit:0,
  140. totalDeuctionMoney:0,
  141. totalRefundMoney:0,
  142. totalErrorRefund:0,
  143. totalEnd:0
  144. },
  145. methods: {
  146. getDataList() {
  147. sa.ajax('/TbAccount/getBalance/list', this.p, function(resp) {
  148. var list = resp.data;
  149. let len = list.length;
  150. let child = [];
  151. let dataList = [];
  152. let totalCharge=0;
  153. let totalInit=0;
  154. let totalDeuctionMoney=0;
  155. let totalRefundMoney=0;
  156. let totalErrorRefund=0;
  157. let totalEnd=0;
  158. for (i = 0; i < len; i++) {
  159. let item = list[i];
  160. child.push(item);
  161. totalInit+=item.beginMoney;
  162. totalCharge+=totalCharge;
  163. totalDeuctionMoney+=item.deuctionMoney;
  164. totalRefundMoney+=item.balanceRefundMoney;
  165. totalErrorRefund+=item.errorRefundMoney;
  166. totalEnd+=item.endMoney;
  167. if (child.length == 18 || i == len - 1) {
  168. let title = {
  169. time: this.p.beginTime + '至' + this.p.endTime,
  170. list: child
  171. }
  172. dataList.push(title);
  173. child = [];
  174. }
  175. }
  176. this.dataList = dataList;
  177. this.totalCharge=parseFloat(totalCharge).toFixed(2);
  178. this.totalInit=parseFloat(totalInit).toFixed(2);
  179. this.totalDeuctionMoney=parseFloat(totalDeuctionMoney).toFixed(2);
  180. this.totalErrorRefund=parseFloat(totalErrorRefund).toFixed(2);
  181. this.totalRefundMoney=parseFloat(totalRefundMoney).toFixed(2);
  182. this.totalEnd=parseFloat(totalEnd).toFixed(2);
  183. // sa.loading("准备打印...");
  184. // setTimeout(() => {
  185. // this.printFn();
  186. // sa.hideLoading();
  187. // }, 2000)
  188. }.bind(this))
  189. },
  190. printFn() {
  191. Print('#myPrintArea', {
  192. noPrint: '.noPrint'
  193. });
  194. }
  195. },
  196. mounted() {
  197. this.getDataList();
  198. }
  199. })
  200. </script>
  201. </body>
  202. </html>