| | |
| | | <html> |
| | | <head> |
| | | <title>Title</title> |
| | | |
| | | <style> |
| | | .layui-btn-disabled { |
| | | pointer-events: none; /* 使按钮不可点击 */ |
| | | opacity: 0.6; /* 降低不透明度以显示禁用状态 */ |
| | | } |
| | | .panbox{ |
| | | width: 540px; |
| | | height: 130px; |
| | | float: left; |
| | | margin-left: 20px; |
| | | margin-top: 10px; |
| | | color: white; |
| | | font-size: 22px; |
| | | } |
| | | </style> |
| | | <link href="/HxzkFlow/images/favicon.ico" rel="icon" type="image/x-icon"/> |
| | | <link rel="stylesheet" href="/HxzkFlow/css/layui.css" media="all"> |
| | | |
| | | </head> |
| | | <body style="overflow-x: hidden"> |
| | | <div style="height: 0px"> |
| | | <form class="layui-form layui-row layui-col-space16" style="position: relative;top: 113px;z-index: 999;left: 200px"> |
| | | <div class="layui-form-item" style="display: inline-block;width: 500px;"> |
| | | <label class="layui-form-label" style="color: white"></label> |
| | | <div class="layui-input-block" style="position: relative;top: -100px;left: 100px"> |
| | | <input type="text" style="width: 396px;border-radius: 8px;" name="companyname" lay-verify="title" autocomplete="off" placeholder="请输入公司名称或简称" class="layui-input"> |
| | | <button style="position: relative;top: -38px;left: 330px;border-radius: 8px;border-bottom-left-radius: 0px;border-top-left-radius: 0px" class="layui-btn layui-btn-normal" id="chaxun" lay-submit lay-filter="demo-table-search">查询</button> |
| | | </div> |
| | | <button style="position: relative;top: -176px;left: 90px" class="layui-btn layui-btn-normal" lay-filter="demo-table-search1" id="relo">刷新</button> |
| | | <body> |
| | | <%--<div >--%> |
| | | <form class="layui-form layui-row layui-col-space16" style="width: 1672px;margin-left: 12px;padding-bottom: -60px"> |
| | | <%-- <div class="layui-col-md4" style="position: relative;top: 18px;z-index: 999;width: 150px;left: 500px" id="cardnum">--%> |
| | | <div class="layui-col-md4" style="position: relative;top: 18px;z-index: 999;width: 150px;left: 500px" id="cardnum"> |
| | | <div class="layui-input-wrap"> |
| | | <input type="text" name="companyname" style="width: 220px" value="" placeholder="请输入用户名称" |
| | | class="layui-input" lay-affix="clear"> |
| | | </div> |
| | | </div> |
| | | <button style="position: relative;top: 25px;z-index: 999;width: 70px;left: 95px" id="relo" |
| | | class="layui-btn layui-btn-normal" lay-filter="demo-table-search1">刷新 |
| | | </button> |
| | | <button style="position: relative;top: 25px;z-index: 999;width: 80px;left: 500px" class="layui-btn layui-btn-normal" |
| | | lay-submit lay-filter="demo-table-search" lay-event="getselect" id="select">查询 |
| | | </button> |
| | | </form> |
| | | |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div style="margin-left: 35px;"> |
| | | <button class="layui-btn" lay-event="getadd" id="xinGs">新增</button> |
| | | <button class="layui-btn layui-btn-warm" lay-event="getUpdate">修改</button> |
| | | <button class="layui-btn layui-btn-danger" id="shanGs" lay-event="getDelete">删除</button> |
| | | <script type="text/html" > |
| | | <div style="margin-left: 0px;" id="toolbarDemo"> |
| | | <button class="layui-btn " id="btn-add" lay-event="getadd">新增</button> |
| | | <button class="layui-btn layui-btn-warm" id="btn-update" lay-event="getUpdate">修改</button> |
| | | <button class="layui-btn layui-btn-danger" id="btndelete" lay-event="getDelete">删除</button> |
| | | |
| | | |
| | | </div> |
| | |
| | | <button class="layui-btn layui-btn-warm" lay-event="getUpdate">修改</button> |
| | | </div> |
| | | </script> |
| | | </div> |
| | | <div style="display: inline-block;"> |
| | | <%--</div>--%> |
| | | <div style="display: inline-block;margin-top: -80px"> |
| | | <table id="demo" lay-filter="demo"></table> |
| | | </div> |
| | | <div class="heimu" style="display: none;width: 100%;height: 100%;position: fixed;top: 0px;left: 0px;z-index: 9999;background-color: black;opacity: 0.8"></div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">登录电话:</label> |
| | | <div class="layui-input-block"> |
| | | <input lay-verify="required|phone" type="text" name="loginphone" id="loginphoneup" lay-verify="title" autocomplete="off" placeholder="请输入登录电话" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">税号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="shuinum" id="shuinumup" lay-verify="title" autocomplete="off" placeholder="请输入税号" class="layui-input"> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">电话:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="phone" id="phoneup" lay-verify="title" autocomplete="off" placeholder="请输入电话" class="layui-input"> |
| | | <input lay-verify="required" type="text" name="phone" id="phoneup" lay-verify="title" autocomplete="off" placeholder="请输入电话" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">登录电话:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="loginphone" id="loginphoneadd" lay-verify="title" autocomplete="off" placeholder="请输入登录电话" class="layui-input"> |
| | | <input lay-verify="required|phone" type="text" name="loginphone" id="loginphoneadd" lay-verify="title" autocomplete="off" placeholder="请输入登录电话" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">电话:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="phone" lay-verify="title" id="phoneadd" autocomplete="off" placeholder="请输入电话" class="layui-input"> |
| | | <input lay-verify="required" type="text" name="phone" lay-verify="title" id="phoneadd" autocomplete="off" placeholder="请输入电话" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | <script src="/HxzkFlow/js/layui.js" charset="utf-8"></script> |
| | | <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> |
| | | <script> |
| | | var qb = localStorage.getItem("gsjc") |
| | | var getUserName = localStorage.getItem("getUserName") |
| | | if(qb === "华星智控"){ |
| | | var add1 = localStorage.getItem("getadd") |
| | | var up = localStorage.getItem("getup") |
| | | var getde = localStorage.getItem("getde") |
| | | |
| | | if (add1==1){ |
| | | var button = document.getElementById('btn-add'); |
| | | // 设置样式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | | } |
| | | if (up==1){ |
| | | var button = document.getElementById('btn-update'); |
| | | |
| | | // 设置式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | | } |
| | | if (getde==1){ |
| | | var button = document.getElementById('btn-delete'); |
| | | // 设置样式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | | } |
| | | |
| | | $.get("/HxzkFlow/hxzk/chawu",function (data){ |
| | | $(".zk").text(data[0]) |
| | | $(".by").text(data[1]) |
| | | $(".cy").text(data[2]) |
| | | $(".dw").text(data[3]) |
| | | $(".jjdl").text(data[4]) |
| | | }) |
| | | setInterval(function() { |
| | | $.get("/HxzkFlow/hxzk/chawu",function (data){ |
| | | $(".zk").text(data[0]) |
| | | $(".by").text(data[1]) |
| | | $(".cy").text(data[2]) |
| | | $(".dw").text(data[3]) |
| | | $(".jjdl").text(data[4]) |
| | | }) |
| | | }, 60000); |
| | | }else{ |
| | | |
| | | |
| | | } |
| | | /** |
| | | * 判断用户在规定的时间内没有操作系统,则刷新浏览器 |
| | | * 参数:时间(单位分钟) |
| | |
| | | var table = layui.table; |
| | | |
| | | |
| | | |
| | | var Zong = localStorage.getItem("gsjc") |
| | | var data ="Zong="+Zong |
| | | if(Zong == null){ |
| | |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , height: 780 |
| | | |
| | | , height: 850 |
| | | ,width: 1700 |
| | | , url: '/HxzkFlow/hxzk/FindCompany' //数据接口 |
| | | , page: true //开启分页 |
| | | , toolbar: '#toolbarDemo' |
| | |
| | | , cols: [[ //表头 |
| | | {type: 'checkbox', sort: true, fixed: "left"} |
| | | , {field: 'companyid', title: '序号', sort: true ,width:'4%'} |
| | | , {field: 'companyname', title: '公司名称',width:'10%'} |
| | | , {field: 'companyname', title: '公司名称'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true,width:'10%'} |
| | | , {field: 'loginphone', title: '登录电话',width:'10%'} |
| | | , {field: 'loginphone', title: '登录电话',width:'7%'} |
| | | , {field: 'shuinum', title: '税号',width:'10%'} |
| | | , {field: 'address', title: '地址', sort: true,width:'10%'} |
| | | , {field: 'phone', title: '电话', sort: true,width:'10%'} |
| | | , {field: 'accountbank', title: '开户行',width:'10%'} |
| | | , {field: 'phone', title: '电话', sort: true,width:'8%'} |
| | | , {field: 'accountbank', title: '开户行'} |
| | | , {field: 'account', title: '账号', sort: true,width:'10%'} |
| | | |
| | | ]], |
| | |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , height: 780 |
| | | , height: 850 |
| | | |
| | | , url: '/HxzkFlow/hxzk/FindCompanyZi?Zong='+jc //数据接口 |
| | | |
| | |
| | | //头工具栏事件 |
| | | table.on('toolbar(demo)', function(obj){ |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var add1 = localStorage.getItem("getadd") |
| | | var up = localStorage.getItem("getup") |
| | | var getde = localStorage.getItem("getde") |
| | | switch(obj.event) { |
| | | case 'getDelete': |
| | | var data = checkStatus.data; |
| | | if(data.length == 0){ |
| | | layer.alert("请选中一条数据") |
| | | }else{ |
| | | var nums = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | nums.push(JSON.stringify(data[i].companyid)) |
| | | var datas = "companyId="+JSON.stringify(data[i].companyid) |
| | | $.post("/HxzkFlow/hxzk/DeleteCompany",datas,function (data){ |
| | | |
| | | }); |
| | | if (data.length == 0) { |
| | | layer.alert("请选中一条数据") |
| | | } else { |
| | | var nums = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | nums.push(JSON.stringify(data[i].companyid)) |
| | | var datas = "companyId=" + JSON.stringify(data[i].companyid)+"&caozuoname="+getUserName |
| | | $.post("/HxzkFlow/hxzk/DeleteCompany", datas, function (data) { |
| | | |
| | | }); |
| | | } |
| | | layer.alert("删除成功") |
| | | } |
| | | layer.alert("删除成功") |
| | | } |
| | | |
| | | layui.table.reload('demo') |
| | | break; |
| | | case 'getUpdate': |
| | | var data = checkStatus.data; |
| | | if(data.length>1){ |
| | | layer.alert("一次只能选中一个进行修改") |
| | | }else if(data.length == 0){ |
| | | layer.alert("请选中一条数据") |
| | | }else{ |
| | | $("#companynameup").val(data[0].companyname) |
| | | $("#companyabbnameup").val(data[0].companyabbname) |
| | | $("#loginphoneup").val(data[0].loginphone) |
| | | $("#shuinumup").val(data[0].shuinum); |
| | | $("#addressup").val(data[0].address); |
| | | $("#phoneup").val(data[0].phone) |
| | | $("#accountbankup").val(data[0].accountbank) |
| | | $("#accountup").val(data[0].account) |
| | | $(".update").show(); |
| | | $(".heimu").show(); |
| | | $(".gongsiid").val(data[0].companyid); |
| | | $("#companyidup").val(data[0].companyid); |
| | | } |
| | | |
| | | if (data.length > 1) { |
| | | layer.alert("一次只能选中一个进行修改") |
| | | } else if (data.length == 0) { |
| | | layer.alert("请选中一条数据") |
| | | } else { |
| | | $("#companynameup").val(data[0].companyname) |
| | | $("#companyabbnameup").val(data[0].companyabbname) |
| | | $("#loginphoneup").val(data[0].loginphone) |
| | | $("#shuinumup").val(data[0].shuinum); |
| | | $("#addressup").val(data[0].address); |
| | | $("#phoneup").val(data[0].phone) |
| | | $("#accountbankup").val(data[0].accountbank) |
| | | $("#accountup").val(data[0].account) |
| | | $(".update").show(); |
| | | $(".heimu").show(); |
| | | $(".gongsiid").val(data[0].companyid); |
| | | $("#companyidup").val(data[0].companyid); |
| | | } |
| | | |
| | | break; |
| | | case 'getadd': |
| | | var data = checkStatus.data; |
| | | add(); |
| | | var data = checkStatus.data; |
| | | add(); |
| | | |
| | | break; |
| | | }; |
| | | layui.table.reload('demo') |
| | |
| | | }else if(add9 == "1"){ |
| | | return false; |
| | | }else{ |
| | | console.log(add1) |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/ifGongSi", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function(data) { |
| | | console.log(data) |
| | | if(data != ""){ |
| | | alert("该公司名称或简称已存在!") |
| | | add9 = "1"; |
| | | }else{ |
| | | console.log("33333332") |
| | | var upp = "companyname="+add1+"&companyabbname="+add2+"&loginphone="+add3+"&shuinum="+add4+"&address="+add5+"&phone="+add6+"&accountbank="+add7+"&account="+add8+"&caozuoname="+getUserName |
| | | $.post("/HxzkFlow/hxzk/addGongSi",upp,function (data){ |
| | | |
| | | }) |
| | | add9 = "0"; |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } |
| | | console.log(add1) |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/ifGongSi", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function(data) { |
| | | console.log(data) |
| | | if(data != ""){ |
| | | alert("该公司名称或简称已存在!") |
| | | add9 = "1"; |
| | | }else{ |
| | | console.log("33333332") |
| | | var upp = "companyname="+add1+"&companyabbname="+add2+"&loginphone="+add3+"&shuinum="+add4+"&address="+add5+"&phone="+add6+"&accountbank="+add7+"&account="+add8 |
| | | $.post("/HxzkFlow/hxzk/addGongSi",upp,function (data){ |
| | | |
| | | }) |
| | | add9 = "0"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | |
| | | var up6 = $("#phoneup").val(); |
| | | var up7 = $("#accountbankup").val(); |
| | | var up8 = $("#accountup").val(); |
| | | console.log(up3) |
| | | if(up1 == null || up1 == ""){ |
| | | layer.alert("公司名称不能为空") |
| | | return false; |
| | |
| | | layer.alert("账号不能为空") |
| | | return false; |
| | | }else { |
| | | var upp = "companyid="+up0+"&companyname="+up1+"&companyabbname="+up2+"&loginphone="+up3+"&shuinum="+up4+"&address="+up5+"&phone="+up6+"&accountbank="+up7+"&account="+up8 |
| | | var upp = "companyid="+up0+"&companyname="+up1+"&companyabbname="+up2+"&loginphone="+up3+"&shuinum="+up4+"&address="+up5+"&phone="+up6+"&accountbank="+up7+"&account="+up8+"&caozuoname="+getUserName |
| | | console.log(upp) |
| | | $.post("/HxzkFlow/hxzk/UpdateGongSi",upp,function (data){ |
| | | |