pages/CangKuManage/CK_XSCK_DFQ.html
@@ -38,12 +38,6 @@
   <body>
      <div class="mui-input-group mui-content" >
         <!-- <div class="mui-input-row  ">
            <div style=" float: left; ">
               <label class="row-title">人员</label>
               <input class="row-content-split" type="text" name="txtBillNo" id="txtBillNo" placeholder="请选择报工人员"readonly="readonly">
            </div>
         </div> -->
         <div class="mui-input-row" id="row001">
            <label>人员编码</label>
            <input id="txtBillNoN" type="text" value="" class="mui-input-clear text-color" placeholder="请扫描人员码" onkeypress="GetBarInfoT()" />
@@ -104,7 +98,7 @@
            </div>
            <div style="width: 40%;float: left;">
               <input id="MBA001" type="text" value="" class="text-color" placeholder="请扫描库位"
                  style="width: 100%;float: left;" onkeypress="GetStoreTAA()" />
                  style="width: 100%;float: left;" onkeypress="GetStore()" />
            </div>
            <div style="width: 29%;float: left;" class="mui-checkbox mui-left">
               <label style="width: 100%;float: left;">默认</label>
@@ -165,23 +159,13 @@
<script>
         
          mui.init(); // 初始化 MUI
         //app.init();
         //初始化
          mui.plusReady(function() {
            app.init();
            fetchData();
            fetchCYSData();
             //   console.log("1111");
            //app.init();
            //fetchData();
            //fetchCYSData();
          });
         // window.onload = function(){
         //    fetchData();
         //    fetchCYSData();
         // }
         var is_DY =false;
         
         // 当确定按钮被点击时,执行的回调函数
@@ -231,11 +215,7 @@
                   var DFA001 = splitValues[0]; // 第一个值存入 DFA001
                   var DFB002 = splitValues[1]; // 第二个值存入 DFB002
                  }
                //用户ID
               //    var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
                  // var user_id =currentSession.user_id; //currentSession.user_id;
         //      var user_id = "admin";
               //console.log("4");
                $.ajax({
                  
                   url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoXSCK",
@@ -273,9 +253,7 @@
                        //$("#FLSL").val(data.data.FLSL);//填入发料数量
                        //$("#DAB020").val(data.data.DAB020);//填入物料编码
                        
                        if (parseFloat(txtSL.value) <= parseFloat(FLSL.value)) {
                        if (parseFloat(txtSL.value) <= parseFloat(FLSL.value) && $("#MBA001").val() != '') {
                          
                          // txtSL的值小于FLSL的值
                          console.log("生成出库单");
@@ -283,6 +261,10 @@
                          txtSL.value = "";
                          FLSL.value = "";
                          document.getElementById("DAB020").value = "";
                          if(!document.getElementById('checkdefault').checked)
                          {
                             $("#MBA001").val("");
                          }
                        }else
                        {
                           FLSL.focus();
@@ -326,31 +308,32 @@
                  var DFB002 = splitValues[1]; // 第二个值存入 DFB002
                 }
             // 比较数值大小
               if (txtSLValue <= FLSLValue) {
                 // txtSL的值小于FLSL的值
                 console.log("生成出库单1");
                 // CreateXSCKD();
                 // txtSL.value = "";
                 // FLSL.value = "";
                 // document.getElementById("DAB020").value = "";
                 CreateXSCKD();
                 txtSL.value = "";
                 FLSL.value = "";
                 document.getElementById("DAB020").value = "";
                 if(!document.getElementById('checkdefault').checked)
                 {
                    $("#MBA001").val("");
                 }
               } else if (txtSLValue > FLSLValue) {
                 // txtSL的值大于FLSL的值
                 //console.log("确认是否拆分领料");
                 mui.confirm('是否拆分该条码?', '请确认', ['确认', '取消'], function(e) {
                   if (e.index === 0) {
                     //PrintSplit();
                     if(is_DY)
                     {
                        PrintSplit_XSCK();   
                        SX_FHTZD();
                        txtSL.value = "";
                        FLSL.value = "";
                        document.getElementById("DAB020").value = "";
                        if(!document.getElementById('checkdefault').checked)
                        {
                          $("#MBA001").val("");
                        }
                        console.log("刷新成功!");
                        is_DY = false;
                     }
                   } else {
@@ -363,6 +346,55 @@
               }
           }
         };
         function GetStore() {
            //用户ID
            if($("#txtSL").val() == "" || $("#FLSL").val() == ""){
               return;
            }
            var txtSL = document.getElementById("txtSL");
            var FLSL = document.getElementById("FLSL");
            var txtSLValue = parseFloat(txtSL.value);
            var FLSLValue = parseFloat(FLSL.value);
            if (txtSLValue <= FLSLValue) {
              CreateXSCKD();
              txtSL.value = "";
              FLSL.value = "";
              document.getElementById("DAB020").value = "";
              if(!document.getElementById('checkdefault').checked)
              {
                 $("#MBA001").val("");
              }
            } else if (txtSLValue > FLSLValue) {
              mui.confirm('是否拆分该条码?', '请确认', ['确认', '取消'], function(e) {
                if (e.index === 0) {
                  //PrintSplit();
                  if(is_DY)
                  {
                     PrintSplit_XSCK();
                     SX_FHTZD();
                     txtSL.value = "";
                     FLSL.value = "";
                     document.getElementById("DAB020").value = "";
                     if(!document.getElementById('checkdefault').checked)
                     {
                       $("#MBA001").val("");
                     }
                     console.log("刷新成功!");
                     is_DY = false;
                  }
                } else {
                  // 用户点击了取消按钮
                  console.log("取消拆分!");
                  FLSL.focus();
                }
              });
            }
         }
         
         //刷新按钮
         function confirmQuantity() {
@@ -476,20 +508,8 @@
            //获取车牌号,校验。
            var cpinfo = document.getElementById("cpinfo");
            var cpinfoValue = cpinfo.value;
            var CKB002 = $("#MBA001").val();
            
            // if (cpinfoValue === '') {
            //     alert("请输入车牌号!!!");
            //     return;
            // }
            // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
            // var user_id = currentSession.user_id;
            // var user_id = app.userid
            // if(app.userid === undefined)
            // {
            //    user_id = document.getElementById('txtBillNo').value;
            // }
                   var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
                      //var user_id = currentSession.user_id;
                      if($("#txtBillNo").val() == ""){
@@ -500,7 +520,7 @@
            
            console.log(user_id);
                     
             $.ajax(app.API_URL_HEADER + "/WARBABChag/PrintSplit_XSCK", {
             $.ajax(app.API_URL_HEADER + "/WARBABChag/PrintSplit_XSCK_DFQ", {
                 data: {
                     DAB001: barcodeValue,
                     user_id: user_id,
@@ -513,6 +533,7 @@
                  orderTypeBill: orderTypeBill,
                  orderTypeName: orderTypeName,
                  FLSL:document.getElementById("FLSL").value,
                  CKB002: CKB002,
                 },
                 dataType: "json",
                 type: "post",
@@ -544,9 +565,6 @@
                     SX_FHTZD();
                     playerAudio("OK");
                     //printByIds(str);
                     }
                 },
                 error: function(xhr, type, errorThrown) {
@@ -788,16 +806,17 @@
         function CreateXSCKD() {
           var barcodeInput = document.getElementById("DAB001");
           var barcodeValue = barcodeInput.value;
             // 如果未输入条码,跳出方法
             if (barcodeValue === '') {
                 alert("请扫描条码!!!");
                 return;
             }
            if ($("#MBA001").val() === '') {
                alert("请扫描库位!!!");
                return;
            }
            
            //获取发货通知单,校验
            var COMDFA = document.getElementById("order");
@@ -817,6 +836,7 @@
            //获取业务类型,校验。
            var ywlx = document.getElementById("base");
            var ywlxValue = ywlx.value;
            var CKB002 = $("#MBA001").val();
            
            if (ywlxValue === '') {
                alert("请选择业务类型!!!");
@@ -856,20 +876,7 @@
            //获取车牌号,校验。
            var cpinfo = document.getElementById("cpinfo");
            var cpinfoValue = cpinfo.value;
            // if (cpinfoValue === '') {
            //     alert("请输入车牌号!!!");
            //     return;
            // }
            // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
            // var user_id = currentSession.user_id;
            // var user_id = app.userid
            // if(app.userid === undefined)
            // {
            //    user_id = document.getElementById('txtBillNo').value;
            // }
            
              var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
                      //var user_id = currentSession.user_id;
@@ -881,7 +888,7 @@
            
            console.log(user_id);
                     
             $.ajax(app.API_URL_HEADER + "/WARBABChag/CreateXSCK", {
             $.ajax(app.API_URL_HEADER + "/WARBABChag/CreateXSCK_DFQ", {
                 data: {
                     DAB001: barcodeValue,
                     user_id: user_id,
@@ -893,6 +900,7 @@
                  cpinfo: cpinfoValue,
                  orderTypeBill: orderTypeBill,
                  orderTypeName: orderTypeName,
                  CKB002: CKB002,
                 },
                 dataType: "json",
                 type: "post",