js局部打印
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox-content">
<div class="row">
<!--startprint-->
要打印的内容
<!--endprint-->
<div class="text-center">
<div class="ibox-content" style="border-width:0px">
<button type="button" class="btn btn-w-m btn-success" onclick="doPrint()">打印采购单</button>
</div>
</div>
</div>
</div>
</div>
@section scripts
{
<script type="text/javascript">
function doPrint() {
bdhtml = window.document.body.innerHTML;
sprnstr = "<!--startprint-->";
eprnstr = "<!--endprint-->";
prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
window.print();
打印完成执行的方法
}
</script>
}