Demo
2024-03-07 e7864a4dcecba72ccbb06dfb6a3d4a77c65f2a3c
HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -55,6 +55,7 @@
               <option value="4">车间余料退回入库</option>
               <option value="5">其它入库</option>
               <option value="6">代储入库</option>
               <option value="7">寄存入库</option>
               <!-- JC08 -->
               <!-- <option value="0">成品入库</option>
               <option value="1">原料入库</option>
@@ -62,7 +63,7 @@
            </select>
         </div>
         <label class="layui-form-label" style="width: 70px;"><p id="CustomerNamep">客户名称</p></label>
         <label class="layui-form-label" style="width: 70px;"><p id="CustomerNamep">客户</p></label>
         <div class="layui-input-inline">
            <select name="CustomerName" id="CustomerName" lay-verify="" lay-search>
               <option value=""></option>
@@ -115,7 +116,15 @@
               </script>
               <script type="text/html" id="table-content-list">
                     <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"> <i class="layui-icon layui-icon-delete"></i>删除</a>
                  </script>
               </script>
               <script type="text/html" id="table-content-Packlist">
                  {{#
                     function GetPack(d){
                        return d.PackagNo + '-' + d.PackagName;
                     }
                  }}
                  {{ GetPack(d) }}
               </script>
            </div>
         </div>
      </div>
@@ -144,10 +153,6 @@
         var arr = [];
         var TypeValue=$("#Type").val();
         var type0 = [3]; //客户
         var type1 = [1,5]; //供应商
         var type2 = [0,2,4,6]; //货主
         // 加载下拉信息
         getCustomerList();
@@ -164,7 +169,7 @@
                  {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},
                  {field: 'PackagNo',title: '包装名称',width: 160, templet: "#table-content-Packlist"},
                  {field: 'Price',title: '单价',align: 'center',width: 80}, 
                  {field: 'Money',title: '金额',align: 'center',width: 100}, 
                  {field: 'UDF1',title: '自定义列1',align: 'center',edit: 'text',width: 140}, 
@@ -434,6 +439,7 @@
            active = {
               add: function () {
                  var typeValue = $("#Type").val();
                  console.log(typeValue)
                  layer.open({
                     type: 2,
                     title: '添加明细',
@@ -561,6 +567,19 @@
               });
               return;
            }
            var type= $("#Type").val();
            if(type=='6'){
               var customerName=$("#CustomerName").val();
               if(customerName==''){
                  layer.msg("代储单据请选择货主!", {
                     icon: 2,
                     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                  }, function () {
                  });
                  return;
               }
            }
            SetArrivalNotice();
         });
@@ -605,45 +624,52 @@
                  $("#CustomerName").empty();
                  $("#CustomerName").append('<option value =""></option>');
                  for (var i = 0; i < res.data.length; i++) {
                     //判断单据类型
                     if (type0[0] == $("#Type").val())
                     var TypeNum = 0;
                     switch($("#Type").val())
                     {
                        /*
                           0:客户
                           退货入库
                           3
                        */
                        case "3": //退货入库
                           TypeNum = 0;
                           console.log(TypeNum)
                           break;
                        case "1": //采购入库
                        case "5": //其它入库
                           TypeNum = 1;
                           console.log(TypeNum)
                           break;
                        case "0": //成品入库
                        case "2": //中间品入库
                        case "4": //车间余料入库
                        case "6": //代储入库
                        case "7": //寄存入库
                           TypeNum = 2;
                           console.log(TypeNum)
                           break;
                     }
                     //判断单据类型
                     if (TypeNum == 0)
                     {
                        if (res.data[i].Type == 0)
                        {
                           $("#CustomerNamep").html("客户选择");
                           $("#CustomerNamep").html("客户");
                           $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
                           res.data[i].CustomerName + '</option>');
                        }
                     }
                     else if (type1[0] == $("#Type").val() || type1[1] == $("#Type").val())
                     else if (TypeNum == 1)
                     {
                        /*
                           1:供应商
                           采购入库、其它入库
                           1、5
                        */
                        if (res.data[i].Type == 1)
                        {
                           $("#CustomerNamep").html("供应商选择");
                           $("#CustomerNamep").html("供应商");
                           $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
                           res.data[i].CustomerName + '</option>');
                        }
                     }
                     else if (type2[0] == $("#Type").val() || type2[1] == $("#Type").val() || type2[2] == $("#Type").val() || type2[3] == $("#Type").val())
                     else if (TypeNum == 2)
                     {
                        /*
                           2:货主
                           成品入库、中间品入库、车间余料入库、代储入库
                           0、2、4、6
                        */
                        if (res.data[i].Type == 2)
                        {
                           $("#CustomerNamep").html("货主选择");
                           $("#CustomerNamep").html("货主");
                           $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
                           res.data[i].CustomerName + '</option>');
                        }
@@ -677,12 +703,14 @@
               }
               arr.push(data[i]); //属性
            }
            $.extend(infoOptions, {
               data: arr
            });
            infoOptions.page = {
               curr: 1
            }
            console.log(infoOptions)
            table.render(infoOptions);
         }
         
@@ -762,11 +790,32 @@
                  return -1;
               }
               if (arr[i].LotNo == "" || arr[i].LotNo ==undefined) {
                  layer.msg("请输入批次!", {
                     icon: 2,
                     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                  });
                  return -1;
                  //判断是否为对应不需要批次的单据
                  var TypeNum = 0;
                  switch($("#Type").val())
                  {
                     //1:采购入库 2:中间品入库 5:其它入库 6:代储入库 7:寄存入库
                     case "1" :
                     case "2" :
                     case "5" :
                     case "6" :
                     case "7" :
                        console.log($("#Type").val())
                        TypeNum = 1;
                        break;
                  }
                  console.log(TypeNum)
                  if (TypeNum == 0)
                  {
                     layer.msg("请输入批次!1", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                     });
                     return -1;
                  }
               }
               
               if (!reg.test(arr[i].Qty)) {