bklLiudl
2024-07-11 452ec2a2e75264515a9b315d1965db3069433d82
HTML/views/BaseSetting/Customer.html
@@ -12,12 +12,12 @@
   <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
   <script>
      // 这里是需要在页面渲染之前执行的代码
      document.addEventListener("DOMContentLoaded", function() {
      document.addEventListener("DOMContentLoaded", function () {
         //获取table默认显示数
         pageCntFirst();
      });
     </script>
   </script>
</head>
<body>
@@ -28,9 +28,8 @@
               <div class="layui-inline">
                  <label class="layui-form-label" style="width: 56px;">客户编码</label>
                  <div class="layui-input-inline">
                     <input type="text" id="CustomerNo" name="CustomerNo" placeholder="客户编码"
                        autocomplete="off" class="layui-input"
                        onkeyup="this.value=this.value.replace(/[, ]/g,'')">
                     <input type="text" id="CustomerNo" name="CustomerNo" placeholder="客户编码" autocomplete="off"
                        class="layui-input" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
                  </div>
               </div>
               <div class="layui-inline">
@@ -108,11 +107,11 @@
            laypage = layui.laypage,
            layer = layui.layer;
         refreshTable();
         function refreshTable() {
            var no = $("#CustomerNo").val();
            var name = $("#CustomerName").val();
            var type = parseInt($("#CustomerType").val());
@@ -125,7 +124,7 @@
               LinkMan: linkman,
               Phone: phone,
               Type: type
            };
            };
            table.render({
               elem: '#LAY-app-content-list',
               url: IP + "/Basis/GetCustomerList",
@@ -135,7 +134,7 @@
               where: param,
               parseData: FnParseData,
               contentType: 'application/json',
               headers:{ToKen:$.cookie('token')},
               headers: { ToKen: $.cookie('token') },
               page: true,
               limit: pageCnt,
               limits: pageLimits,
@@ -144,13 +143,14 @@
               // response:{
               //    statusCode: 0 
               // },
               done: function () {
                  $(function() {
               done: function (ref) {
                  console.log(ref);
                  $(function () {
                     $(".editClass").hide();
                     $(".delClass").hide();
                     $(".addClass").hide();
                  });
                  sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) {
                  sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) {
                     if (res.code == 200) { //成功 
                        for (var k = 0; k < res.data.length; k++) {
                           if (res.data[k].MenuName == "编辑客户") {
@@ -167,13 +167,13 @@
                        layer.msg('获取权限信息失败', {
                           icon: 2,
                           time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                        }, function () { });
                     }
                  });
                  });
               },
               cols: [
                  [{
                  [{
                     title: '序号',
                     type: 'numbers',
                     width: 65,
@@ -195,13 +195,13 @@
                     width: 100,
                     align: 'center',
                     templet: function (d) {
                        if (d.Type ==0) {
                        if (d.Type == 0) {
                           return "客户";
                        } else if(d.Type ==1){
                        } else if (d.Type == 1) {
                           return "供货商";
                        } else if(d.Type ==2){
                        } else if (d.Type == 2) {
                           return "货主";
                        }else{
                        } else {
                           return "";
                        }
                     },
@@ -223,12 +223,12 @@
                  }, {
                     field: 'BankAccount',
                     title: '银行卡号',
                     width: 120,
                     width: 120,
                     align: 'center'
                  }, {
                     field: 'CreditRating',
                     title: '信用等级',
                     width: 90,
                     width: 90,
                     align: 'center'
                  }, {
                     field: 'Demo',
@@ -246,7 +246,7 @@
                     width: 160,
                     templet: function (d) {
                        return formatDate(d.CreateTime);
                     },
                     },
                  }, {
                     field: 'UpdateUserName',
                     title: '修改人',
@@ -259,7 +259,7 @@
                     width: 160,
                     templet: function (d) {
                        return formatDate(d.UpdateTime);
                     },
                     },
                  }, {
                     title: '操作',
                     fixed: 'right',
@@ -270,13 +270,13 @@
               ],
            });
         }
         //监听搜索
         form.on('submit(LAY-app-contlist-search)', function (data) {
            refreshTable();
         });
         var doing = true;
         active = {
            batchdel: function () {
@@ -294,7 +294,7 @@
                     var msg = [];
                     for (var i = 0; i < checkData.length; i++) {
                        msg.push(checkData[i].Id)
                     }
                     }
                     var param = {
                        Ids: msg,
                     };
@@ -339,15 +339,15 @@
                           var field = data.field; //获取提交的字段
                           console.log(field);
                           //提交 Ajax 成功后,静态更新表格中的数据
                           var param = {
                           var param = {
                              CustomerNo: field.CustomerNo,
                              CustomerName: field.CustomerName,
                              Address: field.Address,
                              LinkMan: field.LinkMan,
                              Phone: field.Phone,
                              Type: parseInt(field.Type),
                              BankAccount:field.BankAccount,
                              CreditRating:field.CreditRating,
                              BankAccount: field.BankAccount,
                              CreditRating: field.CreditRating,
                              Demo: field.Demo,
                           };
                           sendData(IP + "/Basis/AddCustomer", param, 'post',
@@ -358,11 +358,11 @@
                                       icon: 1,
                                       time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () {
                                       refreshTable();
                                       refreshTable();
                                       layer.close(index); //关闭弹层
                                       doing = true;
                                    });
                                 } else if(res.code == 1){
                                 } else if (res.code == 1) {
                                    layer.msg(res.msg, {
                                       icon: 2,
                                       time: 2000 //2秒关闭(如果不配置,默认是3秒)
@@ -386,8 +386,8 @@
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
         });
         var cusid = "0";
         table.on('tool(LAY-app-content-list)', function (obj) {
@@ -450,8 +450,8 @@
                              LinkMan: field.LinkMan,
                              Phone: field.Phone,
                              Type: parseInt(field.Type),
                              BankAccount:field.BankAccount,
                              CreditRating:field.CreditRating,
                              BankAccount: field.BankAccount,
                              CreditRating: field.CreditRating,
                              Demo: field.Demo,
                           };
                           sendData(IP + "/Basis/EditCustomer", param, 'post',
@@ -466,7 +466,7 @@
                                       layer.close(index); //关闭弹层
                                       doing = true;
                                    });
                                 } else if(res.code == 1){
                                 } else if (res.code == 1) {
                                    layer.msg(res.msg, {
                                       icon: 2,
                                       time: 2000 //2秒关闭(如果不配置,默认是3秒)