monthStatsPrint.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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;">
  100. <td colspan="2">合计</td>
  101. <td>{{item.totalNum}}</td>
  102. <td>{{item.totalMoney}}</td>
  103. <td>{{(item.totalNoTaxMoney).toFixed(2)}}</td>
  104. <td>-</td>
  105. <td>{{(item.totalTaxMoney).toFixed(2)}}</td>
  106. <td>{{(item.wxTotal)}}</td>
  107. <td>0</td>
  108. <td>0</td>
  109. <td>{{item.yuePrice}}</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. },
  127. dataList: []
  128. },
  129. methods: {
  130. getDataList() {
  131. let data = {
  132. isMonth: 1,
  133. isYear: '',
  134. year: '',
  135. beginMonth: this.p.beginMonth,
  136. endMonth: this.p.endMonth,
  137. beginDay: '',
  138. endDay: '',
  139. feeType: this.p.feeType
  140. }
  141. sa.ajax('/TbFeeStatistics/prePrint', data, function(resp) {
  142. var list = resp.data.list;
  143. let len = list.length;
  144. let child = [];
  145. let dataList = [];
  146. let wxTotal = 0;
  147. let yuePrice = 0;
  148. let totalNum = 0;
  149. let totalMoney = 0;
  150. let totalTaxMoney = 0;
  151. let totalNoTaxMoney = 0;
  152. for (i = 0; i < len; i++) {
  153. let item = list[i];
  154. wxTotal += item.wxPrice;
  155. yuePrice += item.yuePrice;
  156. totalNum += item.num;
  157. totalMoney += item.taxMoney;
  158. totalTaxMoney += item.taxes;
  159. totalNoTaxMoney += item.noTaxMoney;
  160. child.push(item);
  161. if (child.length == 17 || i == len - 1) {
  162. let title = {
  163. time: this.p.beginMonth ? this.p.beginMonth + '至' + this.p.endMonth :
  164. '所有时间',
  165. list: child,
  166. wxTotal: wxTotal,
  167. yuePrice: yuePrice,
  168. totalNum: totalNum,
  169. totalMoney: totalMoney,
  170. totalTaxMoney: totalTaxMoney,
  171. totalNoTaxMoney: totalNoTaxMoney
  172. }
  173. dataList.push(title);
  174. child = [];
  175. wxTotal = 0;
  176. yuePrice = 0;
  177. totalNum = 0;
  178. totalMoney = 0;
  179. totalTaxMoney = 0;
  180. totalNoTaxMoney = 0;
  181. }
  182. }
  183. this.dataList = dataList;
  184. sa.loading("准备打印...");
  185. setTimeout(() => {
  186. this.printFn();
  187. sa.hideLoading();
  188. }, 2000)
  189. }.bind(this))
  190. },
  191. printFn() {
  192. Print('#myPrintArea', {
  193. noPrint: '.noPrint'
  194. });
  195. }
  196. },
  197. mounted() {
  198. this.getDataList();
  199. }
  200. })
  201. </script>
  202. </body>
  203. </html>