<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>
<script LANGUAGE="VBScript">
Sub window_onunload
On Error Resume Next
Set WB = nothing
End Sub
Sub vbPrintPage ( x , y , z )
OLECMDID_PRINT = 6
OLECMDEXECOPT_DODEFAULT = 0
OLECMDEXECOPT_PROMPTUSER = 1
OLECMDEXECOPT_DONTPROMPTUSER = 2
On Error Resume Next
WB.ExecWB x, y, z, 0
End Sub
</script>
<style media="screen">
body{background-color: #f5f5f5}
.contents{position: absolute;width: 416px;height: 173px;background: url("__PUBLIC__/Home/imgs/carbutton.png") no-repeat}
.showinfo{border: 0;position: relative;width: 280px;margin-left: auto;margin-right: auto;top: 30px}
.tdtitle{text-align: center;font-size: 30px;color: red;font-family: '微软雅黑';font-weight: 700;}
.paiduirenshu td{padding:12px;font-size: 22px;font-family: '微软雅黑';font-weight: 700;}
.printonly{display: none}
</style>
<style media="print">
body{background-color: #fff}
.contents{position: absolute;width: 416px;height: 173px;}
.showinfo{border: 0;position: relative;width: 280px;margin-left: auto;margin-right: auto;top: 30px}
.tdtitle{text-align: center;font-size: 30px;color:black;font-family: '微软雅黑';font-weight: 700;}
.paiduirenshu td{padding:18px;font-size: 16px;font-family: '微软雅黑';font-weight: 400;}
.printonly{display: block}
.xuhao{font-size: 26px;font-family: '微软雅黑';font-weight: 700;}
</style>
</head>
<body>
<div class="contents">
<table class="showinfo">
<tr class="printonly" style="text-align: center">
<td colspan="2">
OOXX
</td>
</tr>
<tr>
<td colspan="2" class="tdtitle">
{$item.jname}
</td>
</tr>
<tr class="paiduirenshu">
<td>
排队人数:
</td>
<td>
{$item['jtotal']-$item['jnow']}
</td>
</tr>
<tr class="printonly xuhao">
<td>
您的序号:
</td>
<td>
{$item['jtotal']+1}
</td>
</tr>
<tr>
<td colspan="2" class="printonly">
ddd提供技术支持:fff
</td>
</tr>
</table>
<input type="button" VALUE="Print" ONCLICK="vbPrintPage 6, 2, 3" />
</div>
</body>
</html>放在框架中就没法打印,不使用框架可以打印。用VBS是因为JS我没找到不显示预览直接打印的方法。
最佳答案