Administrator
2024-02-04 719ef250e88b8628ba5cbaeb4973b7c693e01694
HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -62,7 +62,7 @@
            </select>
         </div>
         <label class="layui-form-label">客户名称</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>
@@ -143,6 +143,10 @@
         });
         var arr = [];
         var TypeValue=$("#Type").val();
         var type0 = [3]; //客户
         var type1 = [1,5]; //供应商
         var type2 = [0,2,4,6]; //货主
         // 加载下拉信息
         getCustomerList();
@@ -463,6 +467,7 @@
            var value = data.value;
            if(value!=TypeValue){
               console.log(value);
               getCustomerList();
               arr = [];
               // 渲染Table
               refreshTable(null);
@@ -584,14 +589,66 @@
         // 绑定下拉信息
         function getCustomerList() {
            /*
            0:客户
               退货入库
               3
            1:供应商
               采购入库、其它入库
               1、5
            2:货主
               成品入库、中间品入库、车间余料入库、代储入库
               0、2、4、6
            */
            sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function (res) {
               if (res.code == 0) { //成功
                  $("#CustomerName").empty();
                  $("#CustomerName").append('<option value =""></option>');
                  for (var i = 0; i < res.data.length; i++) {
                     //判断单据类型
                     if (type0[0] == $("#Type").val())
                     {
                        /*
                           0:客户
                           退货入库
                           3
                        */
                        if (res.data[i].Type == 0)
                        {
                           $("#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())
                     {
                        /*
                           1:供应商
                           采购入库、其它入库
                           1、5
                        */
                        if (res.data[i].Type == 1)
                        {
                           $("#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())
                     {
                        /*
                           2:货主
                           成品入库、中间品入库、车间余料入库、代储入库
                           0、2、4、6
                        */
                        if (res.data[i].Type == 2)
                        {
                           $("#CustomerNamep").html("货主选择");
                           $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
                           res.data[i].CustomerName + '</option>');
                        }
                     }
                  }
                  form.render('select');
               } else { //不成功
                  layer.msg(res.msg, {