| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 | 
							- {Template header}
 
- <body>
 
- <div class="warp">
 
- <div class="fixed">
 
- <ul class="search">
 
- <li>条码:<input value="" name="number" type="text"></li>
 
- <li>标签:<input value="" name="label" type="text" style="width:250px;"></li>
 
- <li>打印状态:<select name="print" class="select">
 
- <option value="">全部</option>
 
- <option value="0">未打印</option>
 
- <option value="1">已打印</option>
 
- </select></li>
 
- <li>
 
- 时间筛选:<select name="xztime" class="select">
 
- <option value="addtime">导入时间</option>
 
- <option value="time">打印时间</option>
 
- </select>
 
- </li>
 
- <li><input id="timetk" value="{date('Y-m-d',time()-30*24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" readonly>
 
- 至     <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" readonly></li>
 
- <li><span>确 定</span></li>
 
- </ul>
 
- <div class="control zjcz">
 
- <div class="tabprint">
 
- <select name="printer" class="select" style="width:220px;">
 
- <option value="">选择打印机</option>
 
- </select>
 
- </div>
 
- <!-- <a href="javascript:void(0);" class="bbprint">打 印</a>-->
 
- </div>
 
- <table class="datatitle data" border="0" style="border-collapse:collapse;">
 
- <tr>
 
- <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
 
- <td>条码</td>
 
- <td>标签</td>
 
- <td>标签2</td>
 
- <td>数量</td>
 
- <td>打印时间</td>
 
- <td>导入时间</td>
 
- <td>操作</td>
 
- </tr>
 
- </table>
 
- </div>
 
- <table class="datatext data" border="0" style="border-collapse:collapse;">
 
- </table>
 
- <div class="bomf"></div>
 
- </div>
 
- <div class="print none"></div>
 
- <div class="ts"><p class="tsn"></p></div>
 
- <div class="wigprintk">
 
- <div>
 
- <p></p>
 
- <p><font class="wigprintqd">确 定</font></p>
 
- </div>
 
- </div>
 
- <div class="tyrows"><div><p></p><p></p></div></div>
 
- <div class="list"><div><p>操作配置</p><ul class="fj"></ul><em></em></div></div>
 
- <audio id="music_d">
 
- <source src="{$theme}music/d.mp3" type="audio/mpeg">
 
- </audio>
 
- <audio id="music_c">
 
- <source src="{$theme}music/c.mp3" type="audio/mpeg">
 
- </audio>
 
- <audio id="music_print">
 
- <source src="{$theme}music/print.mp3" type="audio/mpeg">
 
- </audio>
 
- <audio id="music_print_error">
 
- <source src="{$theme}music/print_error.mp3" type="audio/mpeg">
 
- </audio>
 
- <audio id="music_print_ok">
 
- <source src="{$theme}music/print_ok.mp3" type="audio/mpeg">
 
- </audio>
 
- <span id="job" class="none"></span>
 
- <span id="site" class="none"></span>
 
- <span class="none">
 
- <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
 
- </span>
 
- <script>
 
- var dataurl = "/amazonbarcode/see";var fdataurl = "/amazonbarcode/see";var printurl = "/amazonbarcode/print/"; var jcprint = 1;//是否检测打印1检测2不检测
 
- function dyfs(data)
 
- {
 
- 	wprinter.amazonbarcode(data);//打印方式
 
- }
 
- var sysprint = 1;
 
- var customon = 1;
 
- function custom(){
 
- $(".data tr").each(function() {
 
- $(this).find('td:eq(0)').css("width","1%");
 
- $(this).find('td:eq(2)').css("width","8%");
 
- $(this).find('td:eq(4)').css("width","4%");
 
- $(this).find('td:eq(5)').css("width","8%");
 
- $(this).find('td:eq(6)').css("width","8%");
 
- $(this).find('td:eq(7)').css("width","8%");
 
- $(this).find('td:eq(8)').css("width","5%");
 
- });}
 
- window.onload = function() { 
 
- if(typeof $("select[name='printer']").length < 1) return;
 
- setTimeout(function(){ wprinter.printer()},1000);};
 
- $(".amazondrexcel").click(function() {
 
- var dr = $(this);
 
- $("#upload-file").click();
 
- $("#upload-file").unbind("change");
 
- $("#upload-file").bind("change",function(){
 
- amazondrexcel(dr);
 
- 	layx.load('loadId','导入中,请稍后',{shadable:0.6});
 
- });
 
- });
 
- function amazondrexcel(dr){
 
- var file = document.getElementById("upload-file").files[0];
 
- var data = new FormData();
 
- data.append("userfile",file);
 
- $.ajax({
 
- data : data,
 
- type : "POST",
 
- url : "/amazonbarcode/addexcel/",
 
- cache : false,
 
- contentType : false,
 
- processData : false,
 
- dataType:"json",
 
- success: function(a) {
 
- 	 layx.destroy('loadId');
 
-             if (a && a.success) {
 
- 				 if(a.error == 1)
 
- 				 {
 
- 					 errora(a);
 
- 				 }
 
- 				 else
 
- 				 {
 
- 					  errorb(a);
 
- 				 }
 
-             } else {
 
- 				errorc(a);
 
-             }
 
-         }
 
- });
 
- }
 
- $(".datatext").on('click', ".amazonbarprint", function() {
 
-         if ($("select[name='printer']").children("option:selected").val() == "") {
 
-             $(".ts p").html("请选择打印机!");
 
-             $(".ts").show();
 
-             setTimeout('$(".ts").fadeOut()', 1000);
 
-         } else {
 
- 			var id = $(this).data("id");
 
- 			var num = $(this).data("num");
 
-             $(".wigprintk div p:eq(0)").html('选择打印数量:<input value="'+num+'" name="sl" type="text" style="width:50px;height: 26px;color: #333;border: 1px #ccc solid;font-size: 13px;text-align: center;border-radius: 5px;">');
 
-             $(".wigprintk div p:eq(1)").html("<p><font id='amazonbarprinton' data-id='"+id+"'>确 定</font><font class='esc'>取 消</font></p>");
 
-             $(".wigprintk").show();
 
-         }
 
- });
 
- $(".wigprintk").on('click', "#amazonbarprinton", function() {
 
- 	var sl = $(".wigprintk div p:eq(0) input").val();
 
-     $(".wigprintk").hide();
 
-     $(".wigprintk div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i>   正在处理打印信息,请稍后...");
 
-     $(".wigprintk div p:eq(1)").html("");
 
-     $(".wigprintk").show();
 
- 	var tf = $("select[name='print']").children("option:selected").val();
 
- 	var list = $(this).data("id");
 
-     $.ajax({
 
-         url: printurl,
 
-         data: "s=" + list + "&n=" + 0 + "&sl=" + sl,
 
-         type: "POST",
 
-         dataType: "json",
 
-         timeout: 60001,
 
-         success: function(c) {
 
-             if (c.success) {
 
- 				dyfs(c.rows);
 
-                 if (c.rows['n'] > -1) {
 
-                     azsite(c.rows['n'],c.rows['data'], c.rows['number'], 1, 0);
 
-                 } else {
 
-                         azsite(1, 1, c.rows['number'], 0, 0);
 
-                 }
 
-             } else {
 
-                 $(".wigprintk").hide();
 
-                 layx.alert('错误', c.msg, function(id, button) {
 
-                     $(".search span").click();
 
-                 }, { dialogIcon: 'error' });
 
-             }
 
-         },
 
-         error: function(textStatus) {
 
-             wprinter.sound("错误,请求数据超时!请重试")
 
-             $(".wigprintk").hide();
 
-             layx.alert('错误', '请求数据超时!请重试', function(id, button) {
 
-                 $(".search span").click();
 
-             }, { dialogIcon: 'error' });
 
-         },
 
-     });
 
- });
 
- // 美仓打印  
 
- $(".datatext").on('click', ".usaamazonbarprint", function() {
 
-         if ($("select[name='printer']").children("option:selected").val() == "") {
 
-             $(".ts p").html("请选择打印机!");
 
-             $(".ts").show();
 
-             setTimeout('$(".ts").fadeOut()', 1000);
 
-         } else {
 
- 			var id = $(this).data("id");
 
- 			var num = $(this).data("num");
 
-             $(".wigprintk div p:eq(0)").html('选择美仓打印数量:<input value="'+num+'" name="sl" type="text" style="width:50px;height: 26px;color: #333;border: 1px #ccc solid;font-size: 13px;text-align: center;border-radius: 5px;">');
 
-             $(".wigprintk div p:eq(1)").html("<p><font id='usaamazonbarprinton' data-id='"+id+"'>确 定</font><font class='esc'>取 消</font></p>");
 
-             $(".wigprintk").show();
 
-         }
 
- });
 
- $(".wigprintk").on('click', "#usaamazonbarprinton", function() {
 
- 	var sl = $(".wigprintk div p:eq(0) input").val();
 
-     $(".wigprintk").hide();
 
-     $(".wigprintk div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i>   正在处理打印信息,请稍后...");
 
-     $(".wigprintk div p:eq(1)").html("");
 
-     $(".wigprintk").show();
 
- 	var tf = $("select[name='print']").children("option:selected").val();
 
- 	var list = $(this).data("id");
 
-     $.ajax({
 
-         url: '/amazonbarcode/usaprint/',
 
-         data: "s=" + list + "&n=" + 0 + "&sl=" + sl,
 
-         type: "POST",
 
-         dataType: "json",
 
-         timeout: 60001,
 
-         success: function(c) {
 
-             if (c.success) {
 
- 				wprinter.usaamazonbarcode(c.rows);
 
-                 if (c.rows['n'] > -1) {
 
-                     azsite(c.rows['n'],c.rows['data'], c.rows['number'], 1, 0);
 
-                 } else {
 
-                         azsite(1, 1, c.rows['number'], 0, 0);
 
-                 }
 
-             } else {
 
-                 $(".wigprintk").hide();
 
-                 layx.alert('错误', c.msg, function(id, button) {
 
-                     $(".search span").click();
 
-                 }, { dialogIcon: 'error' });
 
-             }
 
-         },
 
-         error: function(textStatus) {
 
-             wprinter.sound("错误,请求数据超时!请重试")
 
-             $(".wigprintk").hide();
 
-             layx.alert('错误', '请求数据超时!请重试', function(id, button) {
 
-                 $(".search span").click();
 
-             }, { dialogIcon: 'error' });
 
-         },
 
-     });
 
- });
 
- //美仓打印结束
 
- $(".wigprintk").on('click', ".esc", function() {
 
-     $(".wigprintk").hide();
 
- });
 
- function azsite(num, list, number, data, i) {
 
-     var jobsite = $("#site").html();
 
-     if (jobsite == '0') {
 
-         $("#job").html("");
 
-         $("#site").html("");
 
-         if (data == '1') {
 
- 			var tf = $("select[name='print']").children("option:selected").val();
 
-             wpajax(num, list, tf);
 
-             return;
 
-         } else {
 
-             //wprinter.sound("打印完成")
 
-             $(".wigprintk div p:eq(0)").html("打印完成!");
 
-             $(".wigprintk div p:eq(1)").html("<font class='esc'>确 定</font>");
 
-             $(".wigprintk").show();
 
-             return;
 
-         }
 
-     } else {
 
-         if (i < '71') {
 
-             if ($("#job").html() != '') {
 
-                 wprinter.getStatusValue();
 
-             }
 
-             setTimeout(function() {
 
-                 azsite(num, list, number, data, i + 1);
 
-             }, 300);
 
-             return;
 
-         } else {
 
-             wprinter.sound("打印机异常")
 
-             $(".wigprintk div p:eq(0)").html("订单:" + number + " 打印失败!系统已停止打印,请检查打印机!如未出此单,请再次打印");
 
-             $(".wigprintk div p:eq(1)").html("<font class='printok'>确 定</font>");
 
-             $(".wigprintk").show();
 
-             $("#job").html("");
 
-             $("#site").html("");
 
-             $(".tyrowsout").hide();
 
-             $("#orderinfo").val("");
 
-             $("#orderinfo").focus();
 
-             return;
 
-         }
 
-     }
 
- }
 
- </script>
 
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 
- <script type="text/javascript" src="{$theme}js/print.js?v=202208010002"></script>
 
- {Template footer}
 
 
  |