chengsc
2024-10-18 1e26a7575d9969e728b0aa01466f490409cb173c
Pda/View/HouseDataSetting/stockCheck.html
@@ -7,7 +7,7 @@
   <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> -->
   <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665" /> -->
   <meta http-equiv="X-UA-Compatible" content="ie=edge" />
   <title>Boxline PDA</title>
   <title>库存盘点</title>
   <link rel="stylesheet" href="/layui/css/layui.css" />
   <link rel="stylesheet" href="/css/style.css" />
@@ -158,16 +158,20 @@
      .cut-line {
         margin-top: 10px;
      }
      .show{
      .show {
         display: block;
      }
      .noshow{
      .noshow {
         display: none;
      }
      td {
         word-break: break-all;
         word-wrap: break-word;
      }
      .layui-form-switch {
         margin-top: 0;
      }
@@ -221,27 +225,27 @@
                        autocomplete="off" class="layui-input">
                  </div>
               </div>
               <div class="layout-tab-page">
                  <div id="" class="layui-form-item layout-input"  >
                  <div id="" class="layui-form-item layout-input">
                     <label class="layui-form-label">是否数量盘点:</label>
                     <div class="layui-input-block" style="position: absolute;top: 100;">
                        <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="是|否"
                           lay-filter="IsZhengTuo" class="layui-input" >
                        <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch"
                           lay-text="是|否" lay-filter="IsZhengTuo" class="layui-input">
                     </div>
                  </div>
                  <div id="boxno1" class="layui-form-item layout-input" style="margin-top: 10px;">
                     <label class="layui-form-label">箱码:</label>
                     <div class="layui-input-block">
                        <input id="boxNo" type="text" lay-verify="boxNo" placeholder="请扫描外箱条码"
                        autocomplete="off" class="layui-input">
                           autocomplete="off" class="layui-input">
                     </div>
                  </div>
                  <div id="boxno3" class="layui-form-item layout-input noshow" style="margin-top: 10px;">
                     <label class="layui-form-label">支码:</label>
                     <div class="layui-input-block">
                        <input id="boxNo3" type="text" lay-verify="boxNo3" placeholder="请扫描支码"
                        autocomplete="off" class="layui-input">
                           autocomplete="off" class="layui-input">
                     </div>
                  </div>
                  <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
@@ -286,13 +290,21 @@
            </form>
         </div>
         <div id="tableid" class="layout-tbl-paging">
         <div id="tableid" class="layout-tbl-paging">
            <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
               <tr>
                  <th style="width: 40%;"><p id="a">箱码</p></th>
                  <th style="width: 30%;"><p id="b">支码</p></th>
                  <th style="width: 15%;"><p id="c">箱内数量</p></th>
                  <th style="width: 15%;"><p id="d">结果</p></th>
                  <th style="width: 40%;">
                     <p id="a">箱码</p>
                  </th>
                  <th style="width: 30%;">
                     <p id="b">支码</p>
                  </th>
                  <th style="width: 15%;">
                     <p id="c">箱内数量</p>
                  </th>
                  <th style="width: 15%;">
                     <p id="d">结果</p>
                  </th>
               </tr>
               <tr id="boxCell" style="display: none;">
                  <td name="boxNo"></td>
@@ -301,7 +313,7 @@
                  <td name="result"></td>
               </tr>
            </table>
         </div>
      </div>
   </div>
@@ -315,7 +327,7 @@
      layui.use(['form', 'jquery'], function () {
         var form = layui.form
         var tableData = null;
         var canPickBox = true;
         $("#palletNo").focus();
@@ -327,20 +339,20 @@
            $("#a").html('');
            $("#b").html('');
            $("#c").html('');
            if (obj.elem.checked) {
               $('#boxno1').attr("style", "display:none")
               $('#boxno3').attr("style", "display:none")
               isContinue="1";
               isContinue = "1";
               $("#a").html('物料编码');
               $("#b").html('托盘条码');
               $("#c").html('托盘数量');
            } else {
            } else {
               $('#boxno1').attr("style", "display:block")
               $('#boxno3').attr("style", "display:block")
               isContinue="0";
               isContinue = "0";
               $("#a").html('箱码');
               $("#b").html('支码');
@@ -349,15 +361,15 @@
               if ($("#Result").val() != "0") {
                  $('#boxno3').addClass("show");
                  $('#boxno3').removeClass("noshow");
               }else{
               } else {
                  $('#boxno3').addClass("noshow");
                  $('#boxno3').removeClass("show");
               }
               if($("#Result").val() == "2"){
               if ($("#Result").val() == "2") {
                  $('#factNum').removeAttr("disabled");
               }
               else{
                  $('#factNum').attr("disabled","disabled");
               else {
                  $('#factNum').attr("disabled", "disabled");
               }
            }
            $('#boxNo').val("");
@@ -390,7 +402,7 @@
         //    checkPalletState()
         // })
         //当托盘条码输入库回车时         
         $("#palletNo").keydown(function(e) {
         $("#palletNo").keydown(function (e) {
            if (e.keyCode === 13) {
               //检查托盘状态
               checkPalletState();
@@ -419,7 +431,7 @@
               if (res.code == 0) { //成功
                  updateBillList();
                  updateGoodList();
                  updateGoodList();
                  GetOutInfo();
               } else { //不成功
                  layer.msg("无效托盘", {
@@ -430,9 +442,9 @@
            });
         }
         //更新盘点单
         function updateBillList() {
         function updateBillList() {
            $("#bar").empty()
            $("#bar").append('<option value =>' + '</option>');
            form.render('select');
@@ -441,7 +453,7 @@
               PalletNo: $("#palletNo").val(),
            };
            synData(IP + "/PdaCr/GetStockCheckNoList", param, 'post', function (res) {
               if (res.code == 0) { //成功
                  for (var i = 0; i < res.data.length; i++) {
                     if (i == 0) {
@@ -452,7 +464,7 @@
                           + res.data[i] + '</option>');
                     }
                  }
                  form.render('select');
                  form.render('select');
               } else { //不成功
                  layer.msg(res.msg, {
                     icon: 2,
@@ -463,7 +475,7 @@
         }
         //初始化渲染物料
         function updateGoodList() {
            $("#skuLotNo").empty()
            $("#skuLotNo").append('<option value =>' + '</option>');
            form.render('select');
@@ -475,16 +487,16 @@
            synData(IP + "/PdaCr/GetStockCheckDetailList", param, 'post', function (res) {
               if (res.code == 0) { //成功
                  for (var i = 0; i < res.data.length; i++) {
                     var vl = res.data[i].SkuNo+'-'+ res.data[i].LotNo;
                     var vl2 = res.data[i].SkuName+'-'+ res.data[i].LotNo;
                     var vl = res.data[i].SkuNo + '-' + res.data[i].LotNo;
                     var vl2 = res.data[i].SkuName + '-' + res.data[i].LotNo;
                     if (i == 0) {
                        $("#skuLotNo").append('<option value =' + vl + ' selected>'+ vl2 + '</option>');
                        $("#skuLotNo").append('<option value =' + vl + ' selected>' + vl2 + '</option>');
                     } else {
                        $("#skuLotNo").append('<option value =' + vl + '>'+ vl2 + '</option>');
                        $("#skuLotNo").append('<option value =' + vl + '>' + vl2 + '</option>');
                     }
                  }
                  form.render('select');
               } else { //不成功
                  // layer.msg(res.msg, {
                  //    icon: 2,
@@ -540,14 +552,14 @@
               return
            }
            if ($("#Result").val() == "2" && isContinue == "0") {
               if ($("#boxNo").val() == "" ||$("#boxNo3").val() == "") {
               if ($("#boxNo").val() == "" || $("#boxNo3").val() == "") {
                  layer.msg("请扫描外箱条码和支码", {
                     icon: 2,
                     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                  });
                  return;
               }
               if($("#factNum").val()<=0){
               }
               if ($("#factNum").val() <= 0) {
                  layer.msg("盘盈时数量不能为空且需大于0", {
                     icon: 2,
                     time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -555,9 +567,9 @@
                  return;
               }
            }
            if (canPickBox == true) {
               canPickBox = false;
               canPickBox = false;
               var param = {
                  "CrNo": $("#bar").val(),
                  "CrDetail": $("#skuLotNo").val(),
@@ -569,7 +581,7 @@
                  "isContinue": isContinue,
               }
               sendData(IP + "/PdaCr/CrSetCheck", param, 'post', function (res) {
                  if (res.code == 0) { //成功
                     layer.msg(res.msg, {
                        icon: 1,
@@ -600,21 +612,21 @@
            }
            return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
         });
         //选中结果下拉事件
         form.on('select(Result)', function (data) {
            if (data.value != "0") {
               $('#boxno3').addClass("show");
               $('#boxno3').removeClass("noshow");
            }else{
            } else {
               $('#boxno3').addClass("noshow");
               $('#boxno3').removeClass("show");
            }
            if(data.value == "2" || isContinue == "1"){
            if (data.value == "2" || isContinue == "1") {
               $('#factNum').removeAttr("disabled");
            }
            else if(isContinue != "1"){
               $('#factNum').attr("disabled","disabled");
            else if (isContinue != "1") {
               $('#factNum').attr("disabled", "disabled");
            }
            $('#boxNo3').val("");
         });
@@ -623,7 +635,7 @@
            let data = tableData
            //先清空一下箱子列表
            let trs = $("#tableBoxList tr")
            let len = trs.length ;
            let len = trs.length;
            for (i = len - 1; i >= 2; i--) {
               trs[i].remove();
            }
@@ -646,29 +658,28 @@
                  idx++;
                  tr.attr('index', idx)
                  //判断是否为数量
                  if(isContinue == "1")
                  {
                  if (isContinue == "1") {
                     tr.find("td[name='boxNo']").html(list[i].SkuNo);
                     tr.find("td[name='boxNo3']").html(list[i].PalletNo);
                  }
                  else{
                  else {
                     tr.find("td[name='boxNo']").html(list[i].BoxNo);
                     tr.find("td[name='boxNo3']").html(list[i].BoxNo3);
                  }
                  tr.find("td[name='qty']").html(list[i].Qty);
                  var CheckResultStr='';
                  if(list[i].CheckResult=='0'){
                     CheckResultStr='正常';
                  } else if(list[i].CheckResult=='1'){
                     CheckResultStr='盘亏';
                  }else if(list[i].CheckResult=='2'){
                     CheckResultStr='盘盈';
                  }else if(list[i].CheckResult=='3'){
                     CheckResultStr='实物不符';
                  }else if(list[i].CheckResult=='4'){
                     CheckResultStr='数量盘点';
                  var CheckResultStr = '';
                  if (list[i].CheckResult == '0') {
                     CheckResultStr = '正常';
                  } else if (list[i].CheckResult == '1') {
                     CheckResultStr = '盘亏';
                  } else if (list[i].CheckResult == '2') {
                     CheckResultStr = '盘盈';
                  } else if (list[i].CheckResult == '3') {
                     CheckResultStr = '实物不符';
                  } else if (list[i].CheckResult == '4') {
                     CheckResultStr = '数量盘点';
                  }
                  tr.find("td[name='result']").html(CheckResultStr);