dayStatsPrint.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. body {
  8. left: 0px;
  9. top: 0px;
  10. right: 0px;
  11. bottom: 0px;
  12. margin: 0px;
  13. font-family: Arial, Helvetica, sans-serif;
  14. font-size: 12px;
  15. overflow: hidden;
  16. white-space: nowrap;
  17. }
  18. </style>
  19. <script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
  20. <script src="../../static/print/jquery.jPrintArea.js" type="text/javascript"></script>
  21. <script src="../../static/sa.js"></script>
  22. </head>
  23. <body>
  24. <div>
  25. <input type="button" style="height: 30;" id="print_button" value="打印"/>
  26. <fieldset align="">
  27. <legend>打印区</legend>
  28. <div id="myPrintArea" style="height: 1500;">
  29. <div align="center">
  30. <SPAN style="font-size:25px" id="headName">统计报表(日)</SPAN>
  31. <br/><br/>
  32. </div>
  33. <div style="text-align:center; font-size:15px;">
  34. <table id="dp" width="100%" style="border-collapse:collapse;border:none;">
  35. <tr height="80">
  36. <td id="company" style="border:solid #000 1px;text-align: left;" colspan="3">单位:广西东兴北投口岸投资有限公司
  37. </td>
  38. <td id="unit" style="border:solid #000 1px;text-align: center;" colspan="7">金额单位:元</td>
  39. <td id="td_time" style="border:solid #000 1px;text-align: right;" colspan="4">
  40. <div id="time" align="right"></div>
  41. </td>
  42. </tr>
  43. <tr height="80">
  44. <td style="border:solid #000 1px; " rowspan="2">日期</td>
  45. <td style="border:solid #000 1px;text-align: center;" rowspan="2">收费项目</td>
  46. <td style="border:solid #000 1px; " colspan="4">收费方式</td>
  47. <td style="border:solid #000 1px; " rowspan="2">数量</td>
  48. <td style="border:solid #000 1px; " rowspan="2">总价</td>
  49. <td style="border:solid #000 1px; " rowspan="2">税率</td>
  50. <td style="border:solid #000 1px; " rowspan="2">税款</td>
  51. <td style="border:solid #000 1px; " rowspan="2">不含税金额</td>
  52. <td id="person1" style="border:solid #000 1px; " rowspan="2">开单员</td>
  53. <td id="person2" style="border:solid #000 1px; " rowspan="2">复核员</td>
  54. <td id="person3" style="border:solid #000 1px; " rowspan="2">统计稽查员</td>
  55. </tr>
  56. <tr height="80">
  57. <td style="border:solid #000 1px; ">微信</td>
  58. <td style="border:solid #000 1px; ">支付宝</td>
  59. <td style="border:solid #000 1px; ">银联</td>
  60. <td style="border:solid #000 1px; ">预存金额</td>
  61. </tr>
  62. </table>
  63. </div>
  64. <div align="center">
  65. <br/><br/>
  66. <SPAN style=";font-size:15px">
  67. 收费统计员:
  68. &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  69. 收费核对员:
  70. &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  71. 收费员:
  72. </SPAN>
  73. <br/><br/>
  74. <SPAN id="leader" style=";font-size:15px">
  75. </SPAN>
  76. </div>
  77. </div>
  78. </fieldset>
  79. </div>
  80. <script type="text/javascript">
  81. $(function () {
  82. $("#print_button").click(function () {
  83. $("#myPrintArea").printArea();
  84. });
  85. function getUrlParam(name) {
  86. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  87. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  88. if (r != null) return unescape(r[2]);
  89. return null; //返回参数值
  90. }
  91. var isMonth = getUrlParam('isMonth');
  92. isMonth = isMonth != '' ? isMonth : null;
  93. if (isMonth != null) {
  94. $("#headName").html("统计报表(月)");
  95. $("#person1").remove();
  96. $("#person2").remove();
  97. $("#person3").remove();
  98. $("#company").attr('colspan', 3);
  99. $("#unit").attr('colspan', 5);
  100. $("#td_time").attr('colspan', 3);
  101. }
  102. var isYear = getUrlParam('isYear');
  103. isYear = isYear != '' ? isYear : null;
  104. if (isYear != null) {
  105. $("#headName").html("统计报表(年)");
  106. $("#person1").remove();
  107. $("#person2").remove();
  108. $("#person3").remove()
  109. $("#company").attr('colspan', 3);
  110. $("#unit").attr('colspan', 5);
  111. $("#td_time").attr('colspan', 3);
  112. }
  113. if (isMonth != null || isYear != null) {
  114. $("#leader").html("运营负责人:\n" +
  115. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  116. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  117. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  118. " 运营分管领导:");
  119. } else {
  120. $("#leader").html("运营负责人:\n" +
  121. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  122. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  123. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" +
  124. " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp");
  125. }
  126. var beginDay = getUrlParam('beginDay');
  127. beginDay = beginDay != '' ? beginDay : null;
  128. var endDay = getUrlParam('endDay');
  129. endDay = endDay != '' ? endDay : null;
  130. var beginMonth = getUrlParam('beginMonth');
  131. beginMonth = beginMonth != '' ? beginMonth : null;
  132. var endMonth = getUrlParam('endMonth');
  133. endMonth = endMonth != '' ? endMonth : null;
  134. var year = getUrlParam('year');
  135. year = year != '' ? year : null;
  136. var feeType = getUrlParam('feeType');
  137. feeType = feeType != '' ? feeType : null;
  138. console.log(sa.cfg.api_url);
  139. $.ajax({
  140. url: sa.cfg.api_url + '/TbFeeStatistics/prePrint',
  141. data: {
  142. isMonth: isMonth,
  143. isYear: isYear,
  144. beginDay: beginDay,
  145. endDay: endDay,
  146. beginMonth: beginMonth,
  147. endMonth: endMonth,
  148. year: year,
  149. feeType: feeType
  150. },
  151. type: 'get', // 请求类型,常用的有 GET 和 POST
  152. success: function (data) { // 接口调用成功回调函数
  153. var html = [];
  154. var list = data.data.list;
  155. for (var i = 0; i < list.length; i++) {
  156. html.push(
  157. "<tr height=\"60\"><td style=\"border:solid #000 1px; \">" + list[i]['dayTime'] +
  158. "</td><td style=\"border:solid #000 1px; \">" + list[i]['feeType'] +
  159. "</td><td style=\"border:solid #000 1px; \">" + list[i]['wxPrice'] +
  160. "</td><td style=\"border:solid #000 1px; \">" + list[i]['aliPrice'] +
  161. "</td><td style=\"border:solid #000 1px; \">" + list[i]['cardPrice'] +
  162. "</td><td style=\"border:solid #000 1px; \">" + list[i]['yuePrice'] +
  163. "</td><td style=\"border:solid #000 1px; \">" + list[i]['num'] +
  164. "</td><td style=\"border:solid #000 1px; \">" + list[i]['taxMoney'] +
  165. "</td><td style=\"border:solid #000 1px; \">" + list[i]['taxRate'] * 100 +
  166. "</td><td style=\"border:solid #000 1px; \">" + list[i]['taxes'] +
  167. "</td><td style=\"border:solid #000 1px; \">" + list[i]['noTaxMoney']
  168. )
  169. if (isMonth == null && isYear == null) {
  170. html.push(
  171. "</td><td style=\"border:solid #000 1px; \">" + list[i]['kaiDanPerson'] +
  172. "</td><td style=\"border:solid #000 1px; \">" + list[i]['diaoDuPerson'] +
  173. "</td><td style=\"border:solid #000 1px; \">" + list[i]['jiChaPerson'] + "</td></tr>"
  174. )
  175. } else {
  176. html.push("</td></tr>")
  177. }
  178. }
  179. var totalMoney = data.data.totalMoney;
  180. var totalTaxes = data.data.totalTaxes;
  181. var totalNoTaxMoney = data.data.totalNoTaxMoney;
  182. var totalWxPrice = data.data.totalWxPrice;
  183. var totalAliPrice = data.data.totalAliPrice;
  184. var totalCardPrice = data.data.totalCardPrice;
  185. var totalYuePrice = data.data.totalYuePrice;
  186. html.push(
  187. "<tr height=\"60\"><td style=\"border:solid #000 1px; \">" + "合计" +
  188. "</td><td style=\"border:solid #000 1px; \">" +
  189. "</td><td style=\"border:solid #000 1px; \">" + totalWxPrice +
  190. "</td><td style=\"border:solid #000 1px; \">" + totalAliPrice +
  191. "</td><td style=\"border:solid #000 1px; \">" + totalCardPrice +
  192. "</td><td style=\"border:solid #000 1px; \">" + totalYuePrice +
  193. "</td><td style=\"border:solid #000 1px; \">" +
  194. "</td><td style=\"border:solid #000 1px; \">" + totalMoney +
  195. "</td><td style=\"border:solid #000 1px; \">" +
  196. "</td><td style=\"border:solid #000 1px; \">" + totalTaxes +
  197. "</td><td style=\"border:solid #000 1px; \">" + totalNoTaxMoney
  198. )
  199. if (isMonth == null && isYear == null) {
  200. html.push(
  201. "</td><td style=\"border:solid #000 1px; \">" +
  202. "</td><td style=\"border:solid #000 1px; \">" +
  203. "</td><td style=\"border:solid #000 1px; \">" + "</td></tr>"
  204. )
  205. } else {
  206. html.push("</td></tr>")
  207. }
  208. $("#dp").append(html.join(''));
  209. $("#time").html("期间:" + data.data.time);
  210. // if(data.data.time != null){
  211. // $("#time").html("期间:" + data.data.time);
  212. // }else {
  213. // $("#time").html("期间:所有时间" );
  214. // }
  215. $("#myPrintArea").printArea();
  216. }
  217. });
  218. });
  219. </script>
  220. </body>
  221. </html>