yearStatsPrint.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. @page {
  8. size: A4 portrait;
  9. margin: 1.9cm 2.5cm 1.5cm 2.5cm;
  10. }
  11. .print-btn {
  12. color: white;
  13. background: #2D8CF0;
  14. border: none;
  15. border-radius: 3px;
  16. padding: 5px 10px;
  17. font-size: 10px;
  18. margin: 10px 20px;
  19. cursor: pointer;
  20. }
  21. .content-box {
  22. text-align: center;
  23. height: 1123px;
  24. width: 794px;
  25. margin: 0 auto;
  26. }
  27. table {
  28. border-collapse: collapse;
  29. border-spacing: 0;
  30. border-left: 1px solid #888;
  31. border-top: 1px solid #888;
  32. }
  33. th,
  34. td {
  35. border-right: 1px solid #888;
  36. border-bottom: 1px solid #888;
  37. word-break: break-all;
  38. }
  39. th {
  40. font-weight: bold;
  41. }
  42. .title-top {
  43. margin-top: 248px;
  44. }
  45. </style>
  46. <link rel="stylesheet" href="../../static/sa.css">
  47. <script src="../../static/kj/vue.min.js"></script>
  48. <script src="../../static/kj/element-ui/index.js"></script>
  49. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  50. <script src="../../static/print/print2.js" type="text/javascript"></script>
  51. <script src="../../static/kj/layer/layer.js"></script>
  52. <script src="../../static/sa.js"></script>
  53. </head>
  54. <body>
  55. <div>
  56. <div class="box">
  57. <button class="print-btn" @click="printFn">打印</button>
  58. <div id="myPrintArea">
  59. <div class="content-box" v-for="(item,index) in dataList" :class="index>0?'title-top':''"
  60. :key="index">
  61. <div class="header-title" style="text-align: center;">
  62. <h2 style="font-size: 20px;">东兴口岸(二桥)进口货物集散区 (A1地块)(年)统计表</h2>
  63. </div>
  64. <table style="margin-top: 20px;text-align: center;width: 790px;">
  65. <tr style="height: 60px;">
  66. <th colspan="4">单位:广西东兴北投口岸投资有限公司</th>
  67. <th colspan="3">金额单位:元</th>
  68. <th colspan="5" style="padding: 0 1px;">期间:{{item.time}}</th>
  69. </tr>
  70. <tr style="font-weight: 500;padding: 0 0.5px;">
  71. <th style="width: 60px;" rowspan="2">日期</th>
  72. <th style="width: 64px;" rowspan="2"> 收费项目</th>
  73. <th style="width: 30px;" rowspan="2">数量</th>
  74. <th style="width: 40px;" rowspan="2">总价</th>
  75. <th style="width: 55px;" rowspan="2">不含税金额</th>
  76. <th style="width: 30px;" rowspan="2">税率</th>
  77. <th style="width: 50px;" rowspan="2">税款</th>
  78. <th colspan="4">收费方式</th>
  79. </tr>
  80. <tr style="font-weight: 500;padding: 0 0.5px;">
  81. <th style="width: 50px;">微信</th>
  82. <th style="width: 35px;">支付宝</th>
  83. <th style="width: 30px;">银联</th>
  84. <th style="width: 45px;">预存金额</th>
  85. </tr>
  86. <tr v-for="cel in item.list" :key="cel.index" style="height: 60px;padding: 0 0.5px;">
  87. <td>{{cel.dayTime}}</td>
  88. <td>{{cel.feeType}}</td>
  89. <td>{{cel.num}}</td>
  90. <td>{{cel.taxMoney}}</td>
  91. <td>{{cel.noTaxMoney}}</td>
  92. <td>{{cel.taxRate}}</td>
  93. <td>{{cel.taxes}}</td>
  94. <td>{{cel.wxPrice}}</td>
  95. <td>{{cel.aliPrice}}</td>
  96. <td>{{cel.cardPrice}}</td>
  97. <td>{{cel.yuePrice}}</td>
  98. </tr>
  99. <tr style="height: 60px;padding: 0 0.5px;" v-if="index==dataList.length-1">
  100. <td colspan="2">合计</td>
  101. <td>{{total.num}}</td>
  102. <td>{{total.totalMoney}}</td>
  103. <td>{{(total.totalNoTaxMoney).toFixed(2)}}</td>
  104. <td>-</td>
  105. <td>{{(total.totalTaxes).toFixed(2)}}</td>
  106. <td>{{(total.totalWxPrice)}}</td>
  107. <td>0</td>
  108. <td>0</td>
  109. <td>{{total.totalYuePrice}}</td>
  110. </tr>
  111. </table>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <script type="text/javascript">
  117. var app = new Vue({
  118. el: '.box',
  119. data: {
  120. p: {
  121. "beginDay": sa.p('beginDay', ''),
  122. "endDay": sa.p('endDay', ''),
  123. "feeType": sa.p('feeType', ''),
  124. "beginMonth": sa.p('beginMonth', ''),
  125. "endMonth": sa.p('endMonth', ''),
  126. "year":sa.p('year','')
  127. },
  128. dataList: [],
  129. total:{
  130. totalAliPrice: 0,
  131. totalCardPrice: 0,
  132. totalMoney: 0,
  133. totalNoTaxMoney: 0,
  134. totalTaxes: 0,
  135. totalWxPrice: 0,
  136. totalYuePrice: 0,
  137. num:0
  138. }
  139. },
  140. methods: {
  141. getDataList() {
  142. let data = {
  143. isMonth: '',
  144. isYear: 1,
  145. year: this.p.year,
  146. beginMonth: '',
  147. endMonth: '',
  148. beginDay: '',
  149. endDay: '',
  150. feeType: this.p.feeType
  151. }
  152. sa.ajax('/TbFeeStatistics/prePrint', data, function(resp) {
  153. this.total=resp.data;
  154. var list = resp.data.list;
  155. let len = list.length;
  156. let child = [];
  157. let dataList = [];
  158. let wxTotal = 0;
  159. let yuePrice = 0;
  160. let totalNum = 0;
  161. let totalMoney = 0;
  162. let totalTaxMoney = 0;
  163. let totalNoTaxMoney = 0;
  164. for (i = 0; i < len; i++) {
  165. let item = list[i];
  166. wxTotal += item.wxPrice;
  167. yuePrice += item.yuePrice;
  168. totalNum += item.num;
  169. totalMoney += item.taxMoney;
  170. totalTaxMoney += item.taxes;
  171. totalNoTaxMoney += item.noTaxMoney;
  172. child.push(item);
  173. if (child.length == 18 || i == len - 1) {
  174. let title = {
  175. time: this.p.beginDay ? this.p.beginDay + '至' + this.p.endDay :
  176. '所有时间',
  177. list: child,
  178. wxTotal: wxTotal,
  179. yuePrice: yuePrice,
  180. totalNum: totalNum,
  181. totalMoney: totalMoney,
  182. totalTaxMoney: totalTaxMoney,
  183. totalNoTaxMoney: totalNoTaxMoney
  184. }
  185. dataList.push(title);
  186. child = [];
  187. }
  188. }
  189. this.total.num=totalNum;
  190. this.dataList = dataList;
  191. sa.loading("准备打印...");
  192. setTimeout(() => {
  193. this.printFn();
  194. sa.hideLoading();
  195. }, 2000)
  196. }.bind(this))
  197. },
  198. printFn() {
  199. Print('#myPrintArea', {
  200. noPrint: '.noPrint'
  201. });
  202. }
  203. },
  204. mounted() {
  205. this.getDataList();
  206. }
  207. })
  208. </script>
  209. </body>
  210. </html>