master
cody 2 years ago
parent cb59910baf
commit 9f1ca982ef

@ -23,11 +23,10 @@
<option value="{{$mm}}" @if($mm == $month) {{ "selected" }}@endif>{{$mm}}</option> <option value="{{$mm}}" @if($mm == $month) {{ "selected" }}@endif>{{$mm}}</option>
@endforeach @endforeach
</select> </select>
<button class="btn btn-primary ml-1" type="button" onclick="window.print();">打印</button> <button class="btn btn-primary ml-1" type="button" onclick="PageBodyPrint()">打印</button>
{{--<button class="btn btn-primary ml-1" type="button" onclick="doExport(this)">导出</button>--}}
</form> </form>
</div> </div>
<!--start print-->
<table class="table table-bordered mb-0 table-datatable"> <table class="table table-bordered mb-0 table-datatable">
<thead> <thead>
<tr> <tr>
@ -89,6 +88,7 @@
填报人:{{ $admin->name }} 填报人:{{ $admin->name }}
</div> </div>
</div> </div>
<!--end print-->
</div> </div>
</div> </div>
</div> </div>
@ -103,12 +103,15 @@
window.open(url); window.open(url);
} }
function dayin(ele) { function PageBodyPrint() {
var url = "{{ url("admin/statistics/income") }}"; var bdhtml = window.document.body.innerHTML; //获取当前页的html代码
url += "?is_export=1"; var sprnstr = "<!--start print-->"; //设置打印开始区域
var params = $(ele).closest("form").serialize(); var eprnstr = "<!--end print-->"; //设置打印结束区域
url += "&" + params; var prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18);
window.open(url); prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
window.print();
window.document.body.innerHTML = bdhtml;
} }
</script> </script>
@endsection @endsection

Loading…
Cancel
Save