wxw
2025-10-27 a38b3f2411652d37d56e863dfb08d72dc19c0b8b
HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -99,11 +99,11 @@
                  <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list">
                  </table>
                  <!-- #region 自定义表头 -->
                  <div class="headerSetIcon">
                  <!-- <div class="headerSetIcon">
                     <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
                        <i class="layui-icon">&#xe610;</i>
                     </button>
                  </div>
                  </div> -->
                  <!-- #endregion -->
                  <!-- #region 自定义表头-->
@@ -122,7 +122,23 @@
                     {{ GetBtn(d) }}
                  </script>
                  <script type="text/html" id="templetProductionTime">
                     {{# function GetBtn12(d){
                           return formatDate2(d.Lot1);
                        }
                     }}
                     {{ GetBtn12(d) }}
                  </script>
                  <script type="text/html" id="templetExpirationTime">
                     {{# function GetBtn13(d){
                           return formatDate2(d.Lot2);
                        }
                     }}
                     {{ GetBtn13(d) }}
                  </script>
                  <!-- #endregion -->
               </div>
@@ -161,11 +177,11 @@
         var $ = layui.$, form = layui.form, laydate = layui.laydate,
            table = layui.table, layer = layui.layer;
         laydate.render({
            elem: '#ProductionDate'
            elem: '#Lot1'
            , format: 'yyyy-MM-dd' //可任意组合
         });
         laydate.render({
            elem: '#ExpirationDate'
            elem: '#Lot2'
            , format: 'yyyy-MM-dd' //可任意组合
         });
         var arr = [];
@@ -181,15 +197,15 @@
            { field: 'Id', title: '入库单明细ID', width: 120, align: 'center', fixed: 'left', hide: true, "disabled": true },
            { field: 'SkuNo', title: '物料编码', minWidth: 100, align: 'center', fixed: 'left', "disabled": true },
            { field: 'SkuName', title: '物料名称', minWidth: 180, align: 'center', fixed: 'left', "disabled": true },
            { field: 'LotNo', title: '批次号', align: 'center', edit: 'text',event: 'setlot', width: 130, fixed: 'left', "disabled": true },
            { field: 'LotNo', title: '批次号', align: 'center', edit: 'text', event: 'setlot', width: 130, fixed: 'left', "disabled": true },
            { field: 'SupplierLot', title: '供货批次', align: 'center', width: 130, edit: 'text', event: 'setSign', fixed: 'left', "disabled": true },
            { field: 'Qty', title: '数量', align: 'center', width: 80, edit: 'number', event: 'dataNumber', fixed: 'left', "disabled": true },
            { field: 'UnitName', title: '计量单位', align: 'center', width: 70 },
            { field: 'Standard', title: '规格', width: 160, align: 'center' },
            { field: 'LotText', title: '批次描述', align: 'center', edit: 'text', width: 160 },
            { field: 'PackagNo', title: '包装名称', width: 160, templet: "#table-content-Packlist" },
            { field: 'Lot1', title: '生产日期', align: 'center', edit: 'text', width: 140 },
            { field: 'Lot2', title: '过期日期', align: 'center', edit: 'text', width: 140 },
            { field: 'PackagNo', title: '包装名称', templet: "#table-content-Packlist" },
            { field: 'Lot1', title: '生产日期', align: 'center', event: 'DateC', edit: 'text', width: 140, templet: '#templetProductionTime' },
            { field: 'Lot2', title: '过期日期', align: 'center', event: 'DateC', edit: 'text', width: 140, templet: '#templetExpirationTime' },
            // { field: 'Price', title: '单价', align: 'center', width: 80 },
            // { field: 'Money', title: '金额', align: 'center', width: 100 },
@@ -220,7 +236,7 @@
               colsJson = TotalColsArr
            }
            console.log(colsJson);
            infoOptions = {
               elem: '#LAY-app-content-list',
               height: 'full-110',
@@ -239,7 +255,7 @@
                  });
                  form.render();
                  //自定义列宽
                  SetTableColW('LAY-app-content-list', 'BllAsn/GetArrivalNoticeDetailList2', TotalColsSysArr);
                  //SetTableColW('LAY-app-content-list', 'BllAsn/GetArrivalNoticeDetailList2', TotalColsSysArr);
               },
               cols: colsJson
            };
@@ -405,6 +421,23 @@
                  }
               });
            }
            //生产日期和到期日期
            var data = obj.data;
            if (obj.event == "DateC") {
               var field = $(this).data('field');
               laydate.render({
                  elem: this.firstChild,
                  show: true,
                  //type:'datetime',
                  format: 'yyyy-MM-dd',
                  closeStop: this,
                  done: function (value, date) {
                     data[field] = value;
                     obj.update(data);
                  }
               })
            }
         });
         // 保存入库单
@@ -542,9 +575,9 @@
            for (var i in data) {
               var isHave = false;
               for (var j in arr) {
                  if (arr[j].SkuNo == data[i].SkuNo)
                     // 注释 liudl 若存在同一物料不同批次物料 放开此注释,后端已验证是否重复
                     //&& arr[j].LotNo == data[i].LotNo
                  if (arr[j].SkuNo == data[i].SkuNo)
                  // 注释 liudl 若存在同一物料不同批次物料 放开此注释,后端已验证是否重复
                  //&& arr[j].LotNo == data[i].LotNo
                  {
                     isHave = true;
                     break;
@@ -553,6 +586,8 @@
               if (isHave) {
                  continue;
               }
               data[i].Lot1='';
               data[i].Lot2='';
               arr.push(data[i]); //属性
            }
@@ -580,7 +615,7 @@
                        if (res.code == 0) { //成功
                           layer.msg(res.msg, {
                              icon: 1,
                              time: 2000 //2秒关闭(如果不配置,默认是3秒)
                              time: 2000 //2秒关闭(如果不配置,默认是3秒)
                           }, function () {
                              parent.location.reload();
                              parent.layer.close(layer.index);
@@ -647,7 +682,7 @@
                  switch ($("#Type").val()) {
                     //1:采购入库 2:中间品入库 5:其它入库 6:代储入库 7:寄存入库
                     case "2":
                     case "5":
                     case "6":
@@ -668,13 +703,25 @@
               }
               if (!reg.test(arr[i].Qty)) {
                  layer.msg("入库数量必须是大于0的整数", {
               var qtyValue = arr[i].Qty;
               // 尝试将值转换为数字
               var num = Number(qtyValue);
               // 验证规则:必须是有效数字、大于0、小数位数不超过4位
               if (
                  isNaN(num) ||  // 不是有效数字   T2500009   地码 B010109
                  num <= 0 ||    // 小于等于0
                  // 检查小数位数(先转为字符串处理)
                  (qtyValue.toString().indexOf('.') !== -1 &&
                     qtyValue.toString().split('.')[1].length > 4)
               ) {
                  layer.msg("入库数量必须是大于0的数", {
                     icon: 2,
                     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                     time: 2000
                  });
                  return -1;
               }
               var item = {
                  Id: arr[i].Id,
@@ -683,7 +730,7 @@
                  Standard: arr[i].Standard,
                  LotNo: arr[i].LotNo,
                  LotText: arr[i].LotText,
                  Qty: parseInt(arr[i].Qty),
                  Qty: Number(qtyValue),////decimal
                  PackagNo: arr[i].PackagNo,
                  Price: arr[i].Price,
                  IsBale: arr[i].IsBale,