index_p.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <style type="text/css" media=print>
  2. .noprint{display : none}
  3. .inside-header{ height: auto}
  4. html, body{
  5. height: auto!important;
  6. min-height: auto!important;
  7. }
  8. </style>
  9. <div class="widget-body no-padding" style=" width:100%; ">
  10. <!--startprint-->
  11. {if $row.village_id eq '7' or $row.village_id eq '10'}
  12. <div style=" width: 88%; float: left; ">
  13. {else}
  14. <div style=" width:99%; text-align: center; margin: 0 auto">
  15. {/if}
  16. <div class="toolbar" style=" font-size: 15px;text-align: center; width: 100%">
  17. 收费凭证
  18. </div>
  19. <div id="toolbar" class="toolbar" style=" font-size: 10px; padding:5px 0px;">
  20. 缴费日期:{$row.pay_date}
  21. &nbsp; &nbsp; &nbsp; &nbsp;
  22. 业主:{$row.hu.usesr_name}
  23. &nbsp; &nbsp; &nbsp;
  24. 房产:{$row.village.name}{$row.hu.name}
  25. &nbsp; &nbsp; &nbsp; &nbsp;
  26. 应缴金额:{$row.true_price}元
  27. &nbsp; &nbsp; &nbsp; &nbsp;
  28. <span style="float: right">凭证编号:{$row.order_number}</span>
  29. </div>
  30. <table id="table" border="1" cellspacing="0" cellpadding="0" class=" table-striped table-bordered table-hover " width="100%" style="border: 0.5px solid #0d0d0d;text-align: center">
  31. <tr style=" font-size: 14px;">
  32. <td style="width: 30px; text-align: center">序号</td>
  33. <td>项目</td>
  34. <td>交费周期</td>
  35. <td>数量</td>
  36. <td>单位</td>
  37. <td>单价</td>
  38. <td>金额</td>
  39. <td>折扣</td>
  40. <td>实收</td>
  41. </tr>
  42. {foreach $get as $k=>$vo}
  43. <tr style=" font-size: 12px;">
  44. <td>{$k+1}</td>
  45. <td style="width: 100px;" >
  46. {if $vo.item_id eq '1'}
  47. 水费
  48. {elseif $vo.item_id eq '2'}
  49. 电费
  50. {elseif $vo.item_id eq '999999999'}
  51. 车位服务费
  52. {else}
  53. {if $vo.item.item eq '1'}
  54. 物业费
  55. {else}
  56. 生活垃圾处理费
  57. {/if}
  58. {/if}
  59. </td>
  60. <td>{$vo.start_time_text}~{$vo.end_time_text}</td>
  61. <td>
  62. {if $vo.item_id neq '1' && $vo.item_id neq '2' && $vo.item_id neq '999999999' }
  63. {$vo.hu.big_area}
  64. {else}
  65. {$vo.yongliang}
  66. {/if}
  67. </td>
  68. <td>
  69. {if $vo.item_id neq '1' && $vo.item_id neq '2' && $vo.item_id neq '999999999' }
  70. {if $vo.item.method eq 1}
  71. 元/每平方/月
  72. {else}
  73. 元/每户/月
  74. {/if}
  75. {else}
  76. {$vo.danwei}
  77. {/if}
  78. </td>
  79. <td>{if $vo.item_id neq '1' && $vo.item_id neq '2' && $vo.item_id neq '999999999' }
  80. {$vo.item.price}
  81. {else}
  82. {$vo.danjia}
  83. {/if}
  84. </td>
  85. <td>{$vo.price}</td>
  86. <td>{$vo.zhekou}</td>
  87. <td>{$vo.true_price}</td>
  88. </tr>
  89. {/foreach}
  90. <tr >
  91. <td colspan="9">
  92. <div style="width: 100%; text-align:center;font-size: 12px;" >
  93. 实际账单期:{$row.mark}
  94. </div>
  95. </td>
  96. </tr>
  97. <tr style="font-size: 14px;" >
  98. <td colspan="9">
  99. <div style=" float:left;margin-left: 20px">
  100. 合计(大写):{$row.true_price_zhongwen}
  101. </div>
  102. <div style="float: right; margin-right: 20px">
  103. ¥{$row.true_price}元 &nbsp;&nbsp;&nbsp;&nbsp;{$row.pay_type}
  104. </div>
  105. </td>
  106. </tr>
  107. </table>
  108. <div class="toolbar" style=" font-size: 10px;float: right">
  109. 打印时间:{$row.time}
  110. </div>
  111. </div>
  112. <!--endprint-->
  113. </div>
  114. <p class="noprint" style="width: 100%; float: left">
  115. <!--<input id="btnPrint" type="button" value="打印"onclick="javascript:window.print();" />-->
  116. <input id="btnPrint" type="button" value="打印预览" onclick="preview(1)"/>
  117. </p>
  118. <script>
  119. window.onload=function()//用window的onload事件,窗体加载完毕的时候
  120. {
  121. var oFrame = document.getElementById("layui-layer-iframe1");
  122. oFrame.height = '200px';
  123. }
  124. function preview(oper)
  125. {
  126. if (oper <10)
  127. {
  128. bdhtml=window.document.body.innerHTML;
  129. sprnstr="<!--startprint-->"; //开始打印标识字符串有17个字符
  130. eprnstr="<!--endprint-->"; //结束打印标识字符串
  131. prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); //从开始打印标识之后的内容
  132. prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); //截取开始标识和结束标识之间的内容
  133. // alert(prnhtml);
  134. window.document.body.innerHTML=prnhtml; //把需要打印的指定内容赋给body.innerHTML
  135. console.log(prnhtml);
  136. window.print(); //调用浏览器的打印功能打印指定区域
  137. window.document.body.innerHTML=bdhtml; // 最后还原页面
  138. // bdhtml=window.document.body.innerHTML;//获取当前页的html代码
  139. //
  140. // sprnstr="<!–-startprint"+oper+"-–>";//设置打印開始区域
  141. // eprnstr="<!–-endprint"+oper+"-–>";//设置打印结束区域
  142. // prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr));//从開始代码向后取html
  143. // alert(prnhtml) ;
  144. // prnhtmlprnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
  145. // window.document.body.innerHTML=prnhtml;
  146. // window.print();
  147. // window.document.body.innerHTML=bdhtml;
  148. } else {
  149. window.print();
  150. }
  151. }
  152. </script>