| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <style>
- table{
- table-layout: fixed;
- }
- th{
- text-align: center;
- }
- </style>
- <div class="panel panel-default panel-intro">
- <div class="panel-body">
- <div id="myTabContent" class="tab-content">
- <div class="tab-pane fade active in" id="one">
- <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
- width="100%">
- <tr>
- <th></th>
- <th>产品名称</th>
- <!--<th>产品编号</th>-->
- <th>专色墨批次号</th>
- <th>专色墨颜色</th>
- <!--<th>是否下机墨</th>-->
- <!--<th>是否报废</th>-->
- <th>重量(g)</th>
- <!--<th>库位</th>-->
- <!--<th>保质期(m)</th>-->
- <th>入库时间</th>
- </tr>
- {volist name="result" id="vo" key="key"}
- <tr align="center">
- <td>
- <a href="javascript:small_v2_print()" data-id="{$vo.id}" class="btn btn-primary btn-refresh print" title="打印条码">打印条码</a>
- </td>
- <td style=" white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{$vo.product_name}</td>
- <td>{$vo.bach_number}</td>
- <td>{$vo.color}</td>
- <td>{$vo.weight}</td>
- <td>{$vo.create}</td>
- </tr>
- {/volist}
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>-->
- <script src="__CDN__/assets/js/jquery.min.js"></script>
- <script language="javascript" src="__CDN__/assets/js/LodopFuncs.js"></script>
- <!--<script src='http://20.0.3.164:18000/CLodopfuncs.js'></script>-->
- <script language="javascript" src="__CDN__/assets/js/tg_small_v2.js"></script>
- <script language="javascript" src="__CDN__/assets/js/template.js"></script>
- <script language="javascript" type="text/javascript">
- var LODOP; //声明为全局变量
- function prn1_print(html,barcode) {
- CreateOneFormPage(html,barcode);
- console.log(html);
- LODOP.PRINT();
- };
- function prn1_preview(html,barcode) {
- CreateOneFormPage(html,barcode);
- LODOP.PREVIEW();
- };
- function CreateOneFormPage(html,barcode){
- LODOP.SET_LICENSES("","152A06E8F6CBD6AC1F213ABFCB0D8604","C94CEE276DB2187AE6B65D56B3FC2848","");
- LODOP=getLodop();
- LODOP.PRINT_INIT("专色墨库存二维码打码");
- //LODOP.SET_PRINT_STYLE("FontSize",8);
- LODOP.SET_PRINT_STYLE("Bold",0);
- LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
- //LODOP.ADD_PRINT_TEXT(30,40,350,45,"浙江美浓世纪集团有限公司");
- LODOP.ADD_PRINT_HTM(12,10,350,500,html);
- LODOP.SET_PRINT_STYLEA(1,"AngleOfPageInside",270);
- LODOP.SET_PRINT_STYLEA(0,"QRCodeErrorLevel","L");
- LODOP.ADD_PRINT_BARCODE(56,18,'180mm','30mm',"QRCode",barcode);
- };
- // function dateFamite(date) {
- // return '20'+date.substr(0, 2)+'/'+date.substr(2, 2)+'/'+date.substr(4, 2);
- // }
- // function changetime(time) {
- // var gtime=20000000;
- // var times=parseInt(time)+parseInt(gtime);
- // return times;
- // }
- // function getBathINo(code_cp1,bath_id) {
- // var bath_no;
- // if(bath_id.length<6){
- // bath_no=code_cp1.substr(0, 6);
- // for(i=0;i<(6-bath_id.length);i++){
- // bath_no=bath_no+'0';
- // }
- // }
- // bath_no= bath_no+bath_id;
- // return bath_no;
- //
- // }
- //小件云打印数据处理
- function small_v2_print(result) {
- $('.print').click(function () {
- var bach = $(this).parent().siblings(':first').next().text();
- // console.log(bach);return false;
- var product_number = bach.substring(0,9);
- var bach_number = bach.substring(9);
- // console.log($(this).parent().siblings(':first').text());
- // console.log($(this).parent().siblings(':first').next().next().next().text());
- // console.log($(this).parent().siblings(':first').next().next().text());
- // return false;
- var html = template(document.getElementById('tpl').innerHTML, {
- product_name:$(this).parent().siblings(':first').text(),
- product_number:product_number,
- color:$(this).parent().siblings(':first').next().next().text(),
- bach_number:bach_number,
- });
- var barcode=bach;
- // var barcode='1904119-149-001';
- for(i=0;i<1;i++){
- if(false){
- //为测试服务器,预览
- prn1_preview(html,barcode);//预览
- }else if(window.location.host=="ink.7in6.com"){
- //为正式服务器,打印
- prn1_print(html,barcode);//打印
- }else{
- prn1_preview(html,barcode);//打印
- }
- }
- })
- }
- // function toSubmit(){
- // console.log('ok');
- // //请求接口
- // $.ajax({
- // type:"POST",
- // url:"2.php",
- // success: function(result){
- // //判断返回值,弹出用户提示
- // small_v2_print(result);
- // },
- // error: function(e){
- // swal("","网络延迟,稍后操作.");
- // }
- // })
- // };
- </script>
- <script id="tpl" type="text/html">
- <style type="text/css">
- .tg {width:320px;margin-top:38px;position: absolute;}
- .tg td{text-align:left;font-family:"方正俊黑简体_粗";font-size:12px;padding:5px 2px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
- .tg th{font-family:"方正俊黑简体_粗";font-size:12px;font-weight:normal;padding:5px 2px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
- .tg .tg-s6z2{ font-size:13px;width: 200px;}
- .tg .tg-s6z1{ width:60px;}
- .tg .code{font-size:12px;}
- .tg .tg-031e{text-align:left;}
- .tg .tg-s6z2 img{}
- .tg .font_bold{ font-size: 75px; }
- </style>
- <table class="tg" cellpadding='0' cellspacing="0" width="100%" style="border:1px solid #000000;">
- <tr>
- <td class="tg-s6z1" rowspan="4" colspan="2">
- </td>
- <td class="tg-s6z2 " colspan="4" ><%=product_name%></td>
- </tr>
- <tr>
- <td class="tg-s6z2" colspan="2"><%=product_number%></td>
- </tr>
- <tr>
- <td class="tg-s6z2" colspan="2"><%=bach_number%></td>
- </tr>
- <tr>
- <td class="tg-s6z2" colspan="2"><%=color%></td>
- </tr>
- </table>
- </script>
|