123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- {Template header}
- <body>
- <div class="warp">
- <div class="fixed">
- <div class="orderyz" style="padding:30px 0;">
- <p><input value="" name="number" id="number" placeholder="点此处扫发货单条码" type="text"></p>
- <div><input value="" name="yz" id="yz" placeholder="扫货物标签" type="text"> <font class="orderyzgb" style="padding-left:30px;color:#fff">关 闭</font></div></div>
- </div>
- <table class="datatitle data" border="0" style="border-collapse:collapse;">
- <tr>
- <td>SKU</td>
- <td>品名</td>
- <td>操作</td>
- </tr>
- </table>
- <table class="datatext data" border="0" style="border-collapse:collapse;">
- </table>
- </div>
- <div class="print none"></div>
- <div class="ts"><p class="tsn"></p></div>
- <div class="systemwindow">
- <div>
- <p></p>
- <p><font class="button">确 定</font><font class="esc">取 消</font></p>
- </div>
- </div>
- <div class="boundtj">
- <div>
- <p></p>
- <p><font class="button">确 定</font><font class="esc">取 消</font></p>
- </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>
- <input value="{date('Y-m-d h:i:s',time())}" name="tjtime" type="hidden">
- <input value="" name="z" type="hidden">
- <input value="" name="x" type="hidden">
- <input value="" name="wz" type="hidden">
- <input value="" name="fk" type="hidden">
- <script>
- var sysprint = 1;var systembound = 1;
- var dataurl = "/api/orderyz/";var fdataurl = "/api/orderyz/";
- var customon = 1;
- function custom(){
- $(".data tr").each(function() {
- $(this).find('td:eq(0)').css("width","30%");
- $(this).find('td:eq(1)').css("width","55%");
- });}
- $(document).ready(function() {
- $("#number").focus();
- });
- $(document).keyup(function(event){
- if(event.keyCode ==13){
- if($("input:focus").attr("name") == 'number')
- {
- n();
- }
- else if($("input:focus").attr("name") == 'tjid')
- {
- t();
- }
- else
- {
- y();
- }
- }});
- function n(){
- $.ajax({
- url: dataurl,
- data: "number=" + $("input[name='number']").val(),
- type: "POST",
- dataType: "json",
- success: function(c) {
- $(".systemwindow").hide();
- if (c && c.success) {
- $("#music_d")[0].play();
- $(".orderyz div").show();
- $("#yz").val("");
- $("#yz").focus();
- $("input[name='z']").val(c.z)
- $("input[name='x']").val(c.z)
- for (i = 0; i < c.rows.length; i++) {
- $(".datatext").append("<tr style='color:"+c.rows[i]['color']+"' data-y='"+c.rows[i]['c']+"' data-id='"+c.rows[i]['id']+"'><td>" + c.rows[i]['sku'] + "</td><td>" + c.rows[i]['zh'] + "</td><td>" + c.rows[i]['t'] + "</td>");
- $(".datatext").append("</tr>");//append后面增加
- }
- } else {
- $("input[name='number']").val("");
- $("input[name='number']").focus();
- $("#tmsku").blur();
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html(c.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- $("#tmsku").val("");
- }
- datasort();
- }
- });
- }
-
- function y(){
- $.ajax({
- url: dataurl,
- data: "yz=" + $("input[name='yz']").val()+"&number=" + $("input[name='number']").val(),
- type: "POST",
- dataType: "json",
- success: function(c) {
- $(".systemwindow").hide();
- $("#yz").val("");
- $("#yz").focus();
- if (c && c.success) {
- var qr = 0;
- $(".datatext tr").each(function(){
- var ad = $(this).data('id');
- var y = $(this).data('y');
- if(ad == c.number && y == 1)
- {
- qr = 1;
- $("#music_d")[0].play();
- $("input[name='x']").val($("input[name='x']").val()*1-1);
- $(this).css("color","red");
- $(this).data("y",0);
- }
- });
- if(qr < 1)
- {
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html("相关货物已验证,请检查是否重复!");
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- return false;
- }
- if($("input[name='x']").val() == '0')
- {
- $(".orderyzgb").click();
- }
- } else {
- $("#tmsku").blur();
- $("#music_c")[0].play();
- $(".systemwindow div p:eq(0)").html(c.msg);
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- $("#yz").val("");
- $("#yz").focus();
- }
- datasort();
- }
- });
- }
- $(".systemwindow").on('click', ".wcoutbound", function() {
- $(".systemwindow").hide();
- if($(".datatext tr:eq(0)").length > 0)
- {
- $("#yz").focus();
- }
- else
- {
- $("#number").focus();
- }
- });
- $(".systemwindow").on('click', ".xyd", function() {
- $(".systemwindow").hide();
- $(".orderyzgb").click();
- });
- $(".systemwindow").on('click', ".jixu", function() {
- $(".systemwindow").hide();
- $("#yz").focus();
- });
- //$("#tmsku").val("");
- //$("#tmsku").focus();
- $(".orderyzgb").click(function() {
- var yzs = true;
- $.ajax({
- url: dataurl,
- async:false,
- data: "yhs=" + $("input[name='number']").val(),
- type: "POST",
- dataType: "json",
- success: function(c) {
- if (c && c.success)
- {
- }
- else
- {
- yzs = false;
- }}});
- if(!yzs)
- {
- $(".systemwindow div p:eq(0)").html("自动关闭窗口失败,请点击关闭重试");
- $(".systemwindow div p:eq(1)").html("<font class='wcoutbound'>确 定</font>");
- $(".systemwindow").show();
- return false;
- }
- $(".datatext").html("");
- $("#yz").val("");
- $("#number").val("");
- $("#number").focus();
- $(".orderyz div").hide();
- });
- $(".datatext").on('click',"span",function() {
- $("input[name=wz]").val($(this).parent().parent().index());
- var id = $(this).data("id");
- $(".tyrows p:eq(0)").html("替换的条码:<input value='' name='tjid' type='text'>");
- $(".tyrows p:eq(1)").html("<font data-id='"+id+"' class='esckn'>关 闭</font>");
- $(".tyrows").show();
- $("input[name=tjid]").focus();
- });
-
- function t(){
- if($("input[name='tjid']").val() == '')
- {
- $("#music_c")[0].play();
- $(".tyrows .esckn").click();
- $(".systemwindow div p:eq(0)").html("条码不正确!");
- $(".systemwindow div p:eq(1)").html("<font class='jixu'>确 定</font>");
- $(".systemwindow").show();
- $("input[name='tjid']").val("");
- return false;
- }
- $.ajax({
- url: dataurl,
- data: "tid=" + $("input[name='tjid']").val()+"&id=" + $(".tyrows p:eq(1) font:eq(0)").data("id")+"&n=" + $("input[name='number']").val(),
- type: "POST",
- dataType: "json",
- success: function(c) {
- $(".systemwindow").hide();
- var wz = $("input[name=wz]").val();
- if (c && c.success) {
- if($(".datatext tr:eq("+wz+")").data("y") == '1')
- {
- $("input[name='x']").val($("input[name='x']").val()*1-1);
- }
- $("#music_d")[0].play();
- if($("input[name='x']").val() == '0')
- {
- $(".systemwindow div p:eq(0)").html("已完成全部验证,是否开始下一单?");
- $(".systemwindow div p:eq(1)").html("<font class='xyd'>下一单</font><font class='jixu'>继续验证</font>");
- $(".systemwindow").show();
- }
- $(".tyrows p:eq(1) font:eq(0)").click();
- $("input[name='tjid']").val("");
- $(".datatext tr:eq("+wz+")").css("color","red");
- $(".datatext tr:eq("+wz+")").data("y","0");
- $(".datatext tr:eq("+wz+")").data("id",c.id);
- $(".datatext tr:eq("+wz+")").find("td:eq(0)").html(c.sku);
- $(".datatext tr:eq("+wz+")").find("td:eq(1)").html(c.title);
- $(".datatext tr:eq("+wz+")").find("td:eq(2) span").data("id",c.id);
- $(".datatext tr:eq("+wz+")").find("td:eq(2) span").removeAttr("style");
- $(".datatext tr:eq("+wz+")").find("td:eq(2) span").html("替换现货");
- $("input[name=wz]").val("");
- } else {
- $("#music_c")[0].play();
- $(".tyrows .esckn").click();
- $(".systemwindow div p:eq(0)").html(c.msg);
- $(".systemwindow div p:eq(1)").html("<font class='jixu'>确 定</font>");
- $(".systemwindow").show();
- $("input[name='tjid']").val("");
- }
- }
- });
- }
- </script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|