| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | laypage = layui.laypage, |
| | | layer = layui.layer; |
| | | |
| | | |
| | | |
| | | refreshTable(); |
| | | |
| | | function refreshTable() { |
| | | |
| | | |
| | | var no = $("#CustomerNo").val(); |
| | | var name = $("#CustomerName").val(); |
| | | var type = parseInt($("#CustomerType").val()); |
| | |
| | | LinkMan: linkman, |
| | | Phone: phone, |
| | | Type: type |
| | | }; |
| | | }; |
| | | table.render({ |
| | | elem: '#LAY-app-content-list', |
| | | url: IP + "/Basis/GetCustomerList", |
| | |
| | | where: param, |
| | | parseData: FnParseData, |
| | | contentType: 'application/json', |
| | | headers:{ToKen:$.cookie('token')}, |
| | | headers: { ToKen: $.cookie('token') }, |
| | | page: true, |
| | | limit: pageCnt, |
| | | limits: pageLimits, |
| | |
| | | // 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 == "编辑客户") { |
| | |
| | | layer.msg('获取权限信息失败', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | cols: [ |
| | | [{ |
| | | [{ |
| | | title: '序号', |
| | | type: 'numbers', |
| | | width: 65, |
| | |
| | | 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 ""; |
| | | } |
| | | }, |
| | |
| | | }, { |
| | | field: 'BankAccount', |
| | | title: '银行卡号', |
| | | width: 120, |
| | | width: 120, |
| | | align: 'center' |
| | | }, { |
| | | field: 'CreditRating', |
| | | title: '信用等级', |
| | | width: 90, |
| | | width: 90, |
| | | align: 'center' |
| | | }, { |
| | | field: 'Demo', |
| | |
| | | width: 160, |
| | | templet: function (d) { |
| | | return formatDate(d.CreateTime); |
| | | }, |
| | | }, |
| | | }, { |
| | | field: 'UpdateUserName', |
| | | title: '修改人', |
| | |
| | | width: 160, |
| | | templet: function (d) { |
| | | return formatDate(d.UpdateTime); |
| | | }, |
| | | }, |
| | | }, { |
| | | title: '操作', |
| | | fixed: 'right', |
| | |
| | | ], |
| | | }); |
| | | } |
| | | |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-contlist-search)', function (data) { |
| | | |
| | | |
| | | refreshTable(); |
| | | }); |
| | | |
| | | |
| | | var doing = true; |
| | | active = { |
| | | batchdel: function () { |
| | |
| | | var msg = []; |
| | | for (var i = 0; i < checkData.length; i++) { |
| | | msg.push(checkData[i].Id) |
| | | } |
| | | } |
| | | var param = { |
| | | Ids: msg, |
| | | }; |
| | |
| | | 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', |
| | |
| | | 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秒) |
| | |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var cusid = "0"; |
| | | table.on('tool(LAY-app-content-list)', function (obj) { |
| | |
| | | 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', |
| | |
| | | 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秒) |