常用的打印设置:使用C-Lodop插件实现常用单据打印功能;以常用订货单和调拨单为例设置打印功能;
需要下载Lodop 打印的插件:http://www.lodop.net/download.html
1、常用订货单设置:
//引入:
<link rel="stylesheet" href="/layui/css/layui.css" media="all" />
<script src="/js/jquery.js"></script>
<script charset="utf-8" async="true" src="/js/LodopFuncs.js"></script>
//html:
<p class="mt-3 text-center">
<button type="button" onclick="print_preview2('0','201mm','93mm')" class="layui-btn layui-btn-sm layui-btn-primary">三等分纸打印</button>
<button type="button" onclick="print_preview2('0','201mm','140mm')" class="layui-btn layui-btn-sm layui-btn-primary">二等分纸打印</button>
<button type="button" onclick="print_preview2('20','190mm','277mm')" class="layui-btn layui-btn-sm layui-btn-primary">A4纸打印</button>
<button type="button" onclick="CheckIsInstall()" class="layui-btn layui-btn-sm">验证控件</button>
</p>
<div class="print-content" id="print-content2" style="margin:10px auto;width:730px;">
<table id="print-table2" style="width:100%;" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th colspan="8" bgcolor="#ccc" style="text-align: center;font-size: 18px;font-weight: bold;background-color:#ccc;border:1px solid #333;height: 30px;line-height: 30px;"> <?=$top_name?>订货单 </th>
</tr>
<tr>
<td style="text-align: left; font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;" colspan="4">订单编号:<?=$data['order_sn']?> </td>
<td style="text-align: left; font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;" colspan="4">下单日期:<?=$data['created_time']?></td>
</tr>
<tr>
<td width="8%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">序号</td>
<td width="12%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">商品编码</td>
<td width="23%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">商品名称</td>
<td width="15%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">商品规格</td>
<td width="8%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">计量单位</td>
<td width="10%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">数量</td>
<td width="10%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">单价价(元)</td>
<td width="16%" style="font-size: 14px;border:1px solid #333;height: 30px;line-height: 30px;">小计(元)</td>
</tr>
</thead>