js/CangKuManage_js/QTCK.js
@@ -134,10 +134,10 @@
          }
 //      var user_id = "admin";
        $.ajax({
           url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK",
           url: app.API_URL_HEADER + "/XKYDHD/GetDBAInfoQTBARCK",
              
           data: {
           DBNO:$("#QTNO").val(),
            DBNO:$("#QTNO").val(),
            DAB001: $("#DAB001").val(),
            logID: user_id //user_id,//Admin //先写死,便于调试
              
@@ -156,16 +156,28 @@
                 });         
                 return;
              } else {
                  matterTable = data.data.matterTable;
  $("#DAB001").val("");
   $("#DAB002").val(matterTable[0]["ITEMNO"].toString());
    $("#DAB003").val(matterTable[0]["QUANTITYB"].toString() === null ? 0 : matterTable[0]["QUANTITYB"].toString());
mui.toast("扫描成功!");
         mui("#DAB001")[0].focus();
                   playerAudio("OK");
           GetInfoQTCK();
               matterTable = data.data.matterTable;
               $("#DAB002").val(matterTable[0]["ITEMNO"].toString());
               $("#DAB003").val(matterTable[0]["DBA005"].toString() === null ? 0 : matterTable[0]["DBA005"].toString());
               $("#FLSL").val(matterTable[0]["QUANTITY"].toString() === null ? 0 : matterTable[0]["QUANTITY"].toString());
               var DAB003 = parseFloat($("#DAB003").val());
               var FLSL = parseFloat($("#FLSL").val());
               var ISEXIST = parseInt(matterTable[0]["ISEXIST"].toString() === null ? 0 : matterTable[0]["ISEXIST"].toString());
               // 大于0的表示在表GS_QTWL中,不做限制
               if (DAB003 <= FLSL || ISEXIST > 0) {
                 // txtSL的值小于FLSL的值
                 //console.log("生成领料单1");
                 CreateZJDBCK();
                 GetInfoQTCK();
                 mui("#DAB001")[0].focus();
                 $("#DAB001").val("");//先清空一下数据源
                 $("#DAB002").val("");//先清空一下数据源
                 $("#DAB003").val("");//先清空一下数据源
                 $("#FLSL").val("");//先清空一下数据源
               } else{
                  mui("#FLSL")[0].focus();
               }
              }
           },
           error: function(xhr, type, errorThrown) {
@@ -174,6 +186,128 @@
        });
     }
  };
  function CreateZJDBCK() {
      //用户ID
    var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
    var user_id =currentSession.user_id; //currentSession.user_id;
   $.ajax({
      url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK",
      data: {
            DBNO:$("#QTNO").val(),
            DAB001: $("#DAB001").val(),
            logID: user_id //user_id,//Admin //先写死,便于调试
      },
      DataType: "json",
      type: "post",
      async: false,
      //timeout: 15000,
      success: function(data) {
         //console.log(JSON.stringify(data));
         if(data.status != 0) {
            playerAudio("NG");
            mui.alert(data.message,"","",function(){
               mui("#DAB001")[0].focus();
               $("#DAB001").val("");
               $("#DAB003").val("");//先清空一下数据源
            });
            return;
         } else {
            $("#DAB003").val("");//先清空一下数据源
            $("#FLSL").val("");//先清空一下数据源
            //mui("#FLSL")[0].focus();
            playerAudio("OK");
            mui.toast("出库成功");
         }
      },
      error: function(xhr, type, errorThrown) {
         alert("获取数据异常:" + JSON.stringify(errorThrown));
      }
   });
  };
  // 扫描条码处理方法
  function is_CreateSCLLD() {
    if (event.keyCode == 13) {
      var DAB003Value = parseFloat($("#DAB003").val());
      var FLSLValue = parseFloat($("#FLSL").val());
      // 比较数值大小
      if (DAB003Value <= FLSLValue) {
        // txtSL的值小于FLSL的值
       console.log("生成领料单");
       // CreateSCLLD();
       // GETGDINFO_SX();
      } else if (DAB003Value > FLSLValue) {
        // txtSL的值大于FLSL的值
        //console.log("确认是否拆分领料");
        mui.confirm('是否拆分该条码?', '请确认', ['确认', '取消'], function(e) {
          if (e.index === 0) {
           PrintSplit();
          GetInfoQTCK();
            console.log("刷新成功!");
          mui("#DAB001")[0].focus();
          $("#DAB001").val("");//先清空一下数据源
          } else {
            // 用户点击了取消按钮
          mui("#FLSL")[0].focus();
          }
        });
      }
    }
  };
  function PrintSplit() {
      //用户ID
    var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
    var user_id =currentSession.user_id; //currentSession.user_id;
   $.ajax({
      url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK_S",
      data: {
            DBNO:$("#QTNO").val(),
            DAB001: $("#DAB001").val(),
            logID: user_id, //user_id,//Admin //先写死,便于调试
          SL:$("#FLSL").val()
      },
      DataType: "json",
      type: "post",
      async: false,
      //timeout: 15000,
      success: function(data) {
         //console.log(JSON.stringify(data));
         if(data.status != 0) {
            playerAudio("NG");
            mui.alert(data.message,"","",function(){
               mui("#DAB001")[0].focus();
               $("#DAB001").val("");
               $("#DAB003").val("");//先清空一下数据源
            });
            return;
         } else {
            $("#DAB003").val("");//先清空一下数据源
            $("#FLSL").val("");//先清空一下数据源
            mui("#FLSL")[0].focus();
            playerAudio("OK");
            mui.toast("出库成功");
            //initBluetooth();
         }
      },
      error: function(xhr, type, errorThrown) {
         alert("获取数据异常:" + JSON.stringify(errorThrown));
      }
   });
  };
 function populateTable(data) {
    
    console.log(data);
@@ -202,6 +336,10 @@
    let td4 = document.createElement("td");
    td4.textContent = data[i]["已扫数量"];
    tr.appendChild(td4);
   let td5 = document.createElement("td");
   td5.textContent = data[i]["超额管理"];
   tr.appendChild(td5);
 
     tbody.appendChild(tr);
   }