Web 系统打印插件——jqprint

目前所做的web系统开发当中,有着明确的需求需要打印,需要与设备相结合。

团队使用的是jquery中的jqprint插件


 $("#print").click(function(){
 				
 				$("#loadAllPurchaseCommodityDetails").jqprint({debug : true});
 			});


代码就这么一点点,贴上

loadAllPurchaseCommodityDetails
的一些代码


 <!-- 以下是like 的模态框 -->         
                            <div class="modal fade" id="cusModal-like" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                              <div class="modal-dialog" role="dialog">
                                <form class="form-horizontal" id="#form-cusLike">
                                <div class="modal-content">
                                  
                                  <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                  </div>
                                  <div class="modal-body">
                                     <table class="table table-hover" id="loadAllPurchaseCommodityDetails">
                                            <thead>
                                              <tr>
                                                <th  data-field="sodDetailId" data-visible="false" data-sortable="true">
                                                   申购单明细ID
                                                </th>
                                                <th  data-field="name">
                                                   商品名称
                                                </th>
                                                <th  data-field="number">
                                                   商品数量
                                                </th>
                                                <th  data-field="code">
                                                   商品条形码
                                                </th>
                                                <th  data-field="soSupplier">
                                                   供应商姓名
                                                </th>
                                                <th  data-field="remark">
                                                   商品备注
                                                </th>
                                               </tr>
                                            </thead>
                                        </table>
                                  </div>
                                  <div class="modal-footer">
                                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                    <button type="button" class="btn btn-primary"   id="print">打印</button>
                                  </div>
                                </div>
                                </form>
                              </div>
                            </div>
                            


大概就这样,实际的效果



还是挺ok的,在使用期间可能会遇到一些问题比如说点击打印按钮没反应,这时候打开开发者工具会看到一些jqprint is not a function 或是cannot read property ‘opera’ of 

undefined 之类的问题,导入这俩js文件

<script src="js/plugins/jquery.jqprint-0.3.js"></script>
  <script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>


以上


有一些小问题,比如点击打印的时候,界面会出现一小块区域浮现打印的数据,而且取消不了,还有一个是需要跳转到新界面点击打印才行。

这块已经交给队伍里的前端工程师,希望能尽早修改源码达成想要的效果。

这个插件是开源

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值