monthStatsPrint.html 6.3 KB

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