print_all.blade.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>成本审计汇总表</title>
  7. <meta name="description" content="">
  8. <meta name="keywords" content="">
  9. <style type="text/css">
  10. .heads_tr td {
  11. font-size: 11pt;
  12. font-weight: 700;
  13. line-height: 26px;
  14. }
  15. body {
  16. font-family: font-family: Micosoft YaHei, simsun, WenQuanYi MicoHei;
  17. }
  18. .btn {
  19. margin-top: 15px;
  20. }
  21. .print_button {
  22. height: 40px;
  23. background: #369 none repeat scroll 0 0;
  24. border: 2px solid #efefef;
  25. border-radius: 5px;
  26. width: 100px;
  27. color: #fff;
  28. font-size: 13px;
  29. font-weight: 700;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <div id="vue">
  35. <div id="print">
  36. <table cellspacing="0" cellpadding="0" width="990" align="center">
  37. <tbody>
  38. <tr>
  39. <td colspan="4">
  40. <table cellspacing="0" cellpadding="0" width="900" align="center">
  41. <tbody>
  42. <tr>
  43. <td>
  44. <h2 class="orderTitle1">
  45. <center>街坊项目拆迁成本统计表</center>
  46. </h2>
  47. </td>
  48. <td>
  49. <span style="float:right"><h2 class="orderTitle1"></h2></span>
  50. </td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. <table cellspacing="0" cellpadding="0" width="900" align="center">
  59. <tbody>
  60. <tr>
  61. <td width="79" align="right" valign="top"></td>
  62. <td width="185" valign="top"></td>
  63. <td colspan="2"></td>
  64. </tr>
  65. <tr>
  66. <td align="right" valign="top"></td>
  67. <td valign="top"></td>
  68. <td align="right" valign="top"> 单位:㎡、元、套</td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <table id="page_one" border="1" cellspacing="0" cellpadding="0" width="990" align="center"
  73. class="t1" style="font-size:14px; margin-top:15px;min-height:600px">
  74. <tbody>
  75. <tr class="heads_tr">
  76. @for($i=1;$i<12;$i++)
  77. <td width="90" align="center">{{ $i }}</td>
  78. @endfor
  79. </tr>
  80. <tr class="heads_tr">
  81. @foreach($th as $value)
  82. <td width="90" align="center">{{ $value }}</td>
  83. @endforeach
  84. </tr>
  85. <template v-for="value of list">
  86. <tr>
  87. <td width="100" align="center">@{{ value.num }}</td>
  88. <td width="100" align="center">@{{ value.bzc_name }}</td>
  89. <td width="100" align="center">@{{ value.bzc_addr }}</td>
  90. <td width="100" align="center">@{{ value.bzc_cardid }}</td>
  91. <td width="100" align="center">@{{ value.bzc_tel }}</td>
  92. <td width="100" align="center">@{{ value.youzheng_area }}</td>
  93. <td width="100" align="center">@{{ value.wuzheng_area }}</td>
  94. <td width="100" align="center">@{{ value.fangbu }}</td>
  95. <td width="100" align="center"></td>
  96. <td width="100" align="center">@{{ value.tingyuan | isNaN + value.kongyuan | isNaN }}</td>
  97. <td width="100" align="center">@{{ value.zhuangxiu }}</td>
  98. </tr>
  99. </template>
  100. </tbody>
  101. </table>
  102. <table id="page_two" border="1" cellspacing="0" cellpadding="0" width="990" align="center" class="t1"
  103. style="font-size:14px; margin-top: 97px;min-height: 700px;">
  104. <tbody>
  105. <tr class="heads_tr">
  106. @for($k=12;$k<23;$k++)
  107. <td width="90" align="center">{{ $k }}</td>
  108. @endfor
  109. </tr>
  110. <tr class="heads_tr">
  111. @foreach($th1 as $value)
  112. <td width="90" align="center">{{$value}}</td>
  113. @endforeach
  114. </tr>
  115. <template v-for="value of list">
  116. <tr>
  117. <td width="100" align="center">@{{ value.gouzhu}}</td>
  118. <td width="100" align="center">@{{ value.tingchan | isNaN + value.tingye | isNaN }}</td>
  119. <td width="100" align="center">@{{ value.linshibu |isNaN + value.anzhi | isNaN }}</td>
  120. <td width="100" align="center">@{{ value.banqianbu |isNaN + value.anzhi | isNaN}}</td>
  121. <td width="100" align="center">@{{ value.dibu }}</td>
  122. <td width="100" align="center">@{{ value.quanj }}</td>
  123. <td width="100" align="center">@{{ value.chaj }}</td>
  124. <td width="100" align="center">@{{ value.chaichuje }}</td>
  125. <td width="100" align="center">@{{ value.canbu |isNaN+ value.other| isNaN}} </td>
  126. <td width="100"
  127. align="center">@{{ value.total_money | isNaN + value.total | isNaN + value.zongj | isNaN + value.yuqij | isNaN+ value.chaiqian | isNaN}}</td>
  128. <td width="100" align="center">@{{ value.hours }}</td>
  129. </tr>
  130. </template>
  131. </tbody>
  132. </table>
  133. <table id="page_three" border="1" cellspacing="0" cellpadding="0" width="990" align="center" class="t1"
  134. style="font-size:14px; margin-top: 97px;min-height: 700px;">
  135. <tbody>
  136. <tr class="heads_tr">
  137. @for($j=23;$j<32;$j++)
  138. <td width="90" align="center">{{ $j }}</td>
  139. @endfor
  140. </tr>
  141. <tr class="heads_tr">
  142. @foreach($th2 as $value)
  143. <td width="90" align="center">{{ $value }}</td>
  144. @endforeach
  145. </tr>
  146. <template v-for="value of list">
  147. <tr>
  148. <td width="100" align="center">@{{ value.huiqian_area }}</td>
  149. <td width="100" align="center">@{{ value.huiqian_home_area }}</td>
  150. <td width="100" align="center">@{{ value.huiqian_shang_area }}</td>
  151. <td width="100" align="center">@{{ value.huiqian }}</td>
  152. <td width="100" align="center">@{{ value.money_home_jchae |isNaN + value.yingjiao | isNaN }}</td>
  153. <td width="100" align="center">@{{ value.money_home_tchae |isNaN + value.yingtui | isNaN}}</td>
  154. <td width="100" align="center">@{{ value.created_at }}</td>
  155. <td width="100" align="center"></td>
  156. <td width="100" align="center">@{{ value.sub_description }}</td>
  157. </tr>
  158. </template>
  159. </tbody>
  160. </table>
  161. </div>
  162. <div align="center" class="btn">
  163. <input class="print_button" type="button" value="上一页" v-on:click="prev()" v-if="has_prev">
  164. <input class="print_button" type="button" id="datasubmit" value="确认打印" name="submit" onclick="printed()">
  165. <input class="print_button" type="button" value="下一页" v-on:click="next()" v-if="has_next">
  166. </div>
  167. </div>
  168. <iframe id="print_frame" style="display: none"></iframe>
  169. <script type="text/javascript">
  170. function printed() {
  171. var head = "<html><head><title></title></head><body>";
  172. var foot = "</body>";
  173. var news = document.all.item('print').innerHTML;
  174. document.getElementById('print_frame').contentWindow.document.body.innerHTML = head + news + foot;
  175. document.getElementById('print_frame').contentWindow.print();
  176. return false;
  177. }
  178. </script>
  179. <script src="{{ asset('js/vue.min.js') }}"></script>
  180. <script>
  181. var table = JSON.parse('{!! json_encode($table) !!}');
  182. var count_list = [], show_list = [], state = 0;
  183. var count_length = 0;
  184. //数组合并
  185. for (var t in table)
  186. for (var v in table[t]) {
  187. if (typeof (count_list[table[t][v].num]) != 'undefined') count_list[table[t][v].num] = Object.assign(count_list[table[t][v].num], table[t][v]);
  188. else {
  189. count_list[table[t][v].num] = table[t][v];
  190. count_length++;
  191. }
  192. }
  193. //数组重排
  194. var tmp_arr = [];
  195. for (var key in count_list)
  196. tmp_arr.push(count_list[key]);
  197. count_list = tmp_arr;
  198. var vm = new Vue({
  199. el: '#vue',
  200. data: {
  201. list: show_list,
  202. has_prev: false,
  203. has_next: false
  204. },
  205. methods: {
  206. next: function () {
  207. for (var key in count_list)
  208. show_list.push(count_list[key]);
  209. if (state % 20 == 0 && state != 0) {
  210. show_list.splice(0, show_list.length);
  211. vm.has_prev = true;
  212. }
  213. for (var i = 0; i < 20 && state < count_list.length - 1; i++) {
  214. state++;
  215. show_list.push(count_list[state]);
  216. }
  217. if (count_list.length > 20)vm.has_next = true;
  218. },
  219. prev: function () {
  220. if (state <= 20)return;
  221. show_list.splice(0, show_list.length);
  222. for (var i = 0; i < 20 && state >= 0; i++) {
  223. state--;
  224. show_list.push(count_list[state]);
  225. }
  226. }
  227. },
  228. filters: {
  229. isNaN: function (value) {
  230. if (!value) return 0;
  231. return value;
  232. }
  233. }
  234. });
  235. vm.next();
  236. </script>
  237. </body>
  238. </html>