| | |
| | | pointer-events: none; /* 使按钮不可点击 */ |
| | | opacity: 0.6; /* 降低不透明度以显示禁用状态 */ |
| | | } |
| | | .panbox{ |
| | | |
| | | .panbox { |
| | | width: 540px; |
| | | height: 130px; |
| | | float: left; |
| | |
| | | </head> |
| | | <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">--%> |
| | | <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="请输入用户名称" |
| | |
| | | <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> |
| | | </form> |
| | | |
| | | <%-- <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 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> |
| | | </div> |
| | | <%-- </script>--%> |
| | | <script type="text/html" id="toolbarDemo1"> |
| | | <div style="margin-left: 35px;"> |
| | | <button class="layui-btn layui-btn-warm" lay-event="getUpdate">修改</button> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="toolbarDemo1"> |
| | | <div style="margin-left: 35px;"> |
| | | <button class="layui-btn layui-btn-warm" lay-event="getUpdate">修改</button> |
| | | </div> |
| | | </script> |
| | | <%--</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 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 class="update" style="width: 500px;border: 1px solid #ccc;padding: 50px;border-radius: 20px;position: fixed;top: 150px;left: 500px;z-index: 99999;background-color: white;display: none"> |
| | | <div class="update" |
| | | style="width: 500px;border: 1px solid #ccc;padding: 50px;border-radius: 20px;position: fixed;top: 150px;left: 500px;z-index: 99999;background-color: white;display: none"> |
| | | <form class="layui-form" method="post" lay-filter="example" onsubmit="return checkup()"> |
| | | <input type="" style="display:none" name="companyid" id="companyidup" class="gongsiid" /> |
| | | <input type="" style="display:none" name="companyid" id="companyidup" class="gongsiid"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">公司名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="companyname" disabled id="companynameup" lay-verify="title" autocomplete="off" placeholder="请输入公司名称" class="layui-input"> |
| | | <input type="text" name="companyname" disabled id="companynameup" 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="companyabbname" disabled id="companyabbnameup" lay-verify="title" autocomplete="off" placeholder="请输入公司简称" class="layui-input"> |
| | | <input type="text" name="companyabbname" disabled id="companyabbnameup" 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 lay-verify="required|phone" type="text" name="loginphone" id="loginphoneup" lay-verify="title" autocomplete="off" placeholder="请输入登录电话" class="layui-input"> |
| | | <input 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="password" id="passwordup" 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"> |
| | | <input type="text" name="shuinum" id="shuinumup" 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="address" id="addressup" lay-verify="title" autocomplete="off" placeholder="请输入地址" class="layui-input"> |
| | | <input type="text" name="address" id="addressup" 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 lay-verify="required" 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"> |
| | | <label class="layui-form-label">开户行:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="accountbank" id="accountbankup" lay-verify="title" autocomplete="off" placeholder="请输入开户行" class="layui-input"> |
| | | <input type="text" name="accountbank" id="accountbankup" 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="account" id="accountup" lay-verify="title" autocomplete="off" placeholder="请输入账号" class="layui-input"> |
| | | <input type="text" name="account" id="accountup" lay-verify="title" autocomplete="off" |
| | | placeholder="请输入账号" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-input-block"> |
| | | <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即保存</button> |
| | | <button type="button" class="layui-btn layui-btn-normal" lay-filter="demo1" onclick="canselupdate()" style="margin-left: 200px">取消</button> |
| | | <button type="button" class="layui-btn layui-btn-normal" lay-filter="demo1" onclick="canselupdate()" |
| | | style="margin-left: 200px">取消 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <div class="add" style="display: none;width: 600px;background-color: white;border: 1px solid #cccccc;padding: 50px;border-radius: 20px;position: fixed;top: 50px;left: 450px;z-index: 99999"> |
| | | <form class="layui-form" method="post" lay-filter="example" onsubmit="return checkadd()"> |
| | | <div class="add" |
| | | style="display: none;width: 600px;background-color: white;border: 1px solid #cccccc;padding: 50px;border-radius: 20px;position: fixed;top: 50px;left: 450px;z-index: 99999"> |
| | | <form class="layui-form" method="post" lay-filter="example" onsubmit="return checkadd()"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">公司名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="companyname" id="companynameadd" lay-verify="title" autocomplete="off" placeholder="请输入公司名称" class="layui-input"> |
| | | <input type="text" name="companyname" id="companynameadd" 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="companyabbname" id="companyabbnameadd" lay-verify="title" autocomplete="off" placeholder="请输入公司简称" class="layui-input"> |
| | | <input type="text" name="companyabbname" id="companyabbnameadd" 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 lay-verify="required|phone" type="text" name="loginphone" id="loginphoneadd" lay-verify="title" autocomplete="off" placeholder="请输入登录电话" class="layui-input"> |
| | | <input 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="password" id="passwordadd" 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" lay-verify="title" id="shuinumadd" autocomplete="off" placeholder="请输入税号" class="layui-input"> |
| | | <input type="text" name="shuinum" lay-verify="title" id="shuinumadd" 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="address" lay-verify="title" autocomplete="off" id="addressadd" placeholder="请输入地址" class="layui-input"> |
| | | <input type="text" name="address" lay-verify="title" autocomplete="off" id="addressadd" |
| | | placeholder="请输入地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">电话:</label> |
| | | <div class="layui-input-block"> |
| | | <input lay-verify="required" 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"> |
| | | <label class="layui-form-label">开户行:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="accountbank" lay-verify="title" id="accountbankadd" autocomplete="off" placeholder="请输入开户行" class="layui-input"> |
| | | <input type="text" name="accountbank" lay-verify="title" id="accountbankadd" 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="account" lay-verify="title" autocomplete="off" id="accountadd" placeholder="请输入账号" class="layui-input"> |
| | | <input type="text" name="account" lay-verify="title" autocomplete="off" id="accountadd" |
| | | placeholder="请输入账号" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-input-block"> |
| | | <button type="submit" class="layui-btn" lay-submit="" lay-filter="demoadd">立即保存</button> |
| | | <button type="button" class="layui-btn layui-btn-normal" lay-filter="demo1" onclick="canseladd()" style="margin-left: 200px">取消</button> |
| | | <button type="button" class="layui-btn layui-btn-normal" lay-filter="demo1" onclick="canseladd()" |
| | | style="margin-left: 200px">取消 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | |
| | | <script> |
| | | var qb = localStorage.getItem("gsjc") |
| | | var getUserName = localStorage.getItem("getUserName") |
| | | if(qb === "华星智控"){ |
| | | var getjuese = localStorage.getItem("getjuese") |
| | | |
| | | if (qb === "华星智控") { |
| | | var add1 = localStorage.getItem("getadd") |
| | | var up = localStorage.getItem("getup") |
| | | var getde = localStorage.getItem("getde") |
| | | |
| | | if (add1==1){ |
| | | if (add1 == 1) { |
| | | var button = document.getElementById('btn-add'); |
| | | // 设置样式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | | } |
| | | if (up==1){ |
| | | if (up == 1) { |
| | | var button = document.getElementById('btn-update'); |
| | | |
| | | // 设置式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | | } |
| | | if (getde==1){ |
| | | if (getde == 1) { |
| | | var button = document.getElementById('btndelete'); |
| | | // 设置样式属性来隐藏按钮 |
| | | button.classList.add('layui-btn-disabled'); |
| | |
| | | // $("#btndelete").hide(); |
| | | // |
| | | // } |
| | | $.get("/HxzkFlow/hxzk/chawu",function (data){ |
| | | $.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){ |
| | | setInterval(function () { |
| | | $.get("/HxzkFlow/hxzk/chawu", function (data) { |
| | | $(".zk").text(data[0]) |
| | | $(".by").text(data[1]) |
| | | $(".cy").text(data[2]) |
| | |
| | | $(".jjdl").text(data[4]) |
| | | }) |
| | | }, 60000); |
| | | }else{ |
| | | } else { |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 判断用户在规定的时间内没有操作系统,则刷新浏览器 |
| | | * 参数:时间(单位分钟) |
| | | * */ |
| | | function timeUserFun(time){ |
| | | function timeUserFun(time) { |
| | | var time = time || 2; |
| | | var userTime = 3600; |
| | | var objTime = { |
| | | init:0, |
| | | time:function(){ |
| | | init: 0, |
| | | time: function () { |
| | | objTime.init += 1; |
| | | if(objTime.init === userTime){// 达到限制时间时,用户未操作事件,则刷新整个页面 |
| | | if (objTime.init === userTime) {// 达到限制时间时,用户未操作事件,则刷新整个页面 |
| | | localStorage.removeItem("gsjc") |
| | | sessionStorage.removeItem("admin") |
| | | alert("您长时间未操作当前页面,请重新登录") |
| | | var data = "Zong="+sessionStorage.getItem("admin"); |
| | | var data = "Zong=" + sessionStorage.getItem("admin"); |
| | | //获取该用户最新时间 |
| | | $.post("/HxzkFlow/hxzk/userdate",data,function (data){ |
| | | $.post("/HxzkFlow/hxzk/userdate", data, function (data) { |
| | | |
| | | }) |
| | | parent.location.reload() |
| | | //达到限制时间没操作,所要执行的动作 |
| | | } |
| | | }, |
| | | eventFun:function(){ |
| | | eventFun: function () { |
| | | //清除上次监听,重新开始新的监听 |
| | | clearInterval(testUser); |
| | | objTime.init = 0; |
| | | testUser = setInterval(objTime.time,1000); |
| | | testUser = setInterval(objTime.time, 1000); |
| | | } |
| | | }; |
| | | //监听当前时间流动 |
| | | var testUser = setInterval(objTime.time,1000); |
| | | var testUser = setInterval(objTime.time, 1000); |
| | | |
| | | //监听相应事件 |
| | | var body = document.querySelector('html'); |
| | | body.addEventListener("click",objTime.eventFun); |
| | | body.addEventListener("keydown",objTime.eventFun); |
| | | body.addEventListener("mousemove",objTime.eventFun); |
| | | body.addEventListener("mousewheel",objTime.eventFun); |
| | | body.addEventListener("click", objTime.eventFun); |
| | | body.addEventListener("keydown", objTime.eventFun); |
| | | body.addEventListener("mousemove", objTime.eventFun); |
| | | body.addEventListener("mousewheel", objTime.eventFun); |
| | | } |
| | | |
| | | (function () { |
| | | timeUserFun(1); |
| | | |
| | | }(0)); |
| | | |
| | | |
| | | layui.use(['layer', 'form'], function(){ |
| | | layui.use(['layer', 'form'], function () { |
| | | var layer = layui.layer |
| | | ,form = layui.form; |
| | | , form = layui.form; |
| | | |
| | | |
| | | layui.use('table', function() { |
| | | layui.use('table', function () { |
| | | var table = layui.table; |
| | | |
| | | |
| | | |
| | | var Zong = localStorage.getItem("gsjc") |
| | | var data ="Zong="+Zong |
| | | if(Zong == null){ |
| | | var data = "Zong=" + Zong |
| | | if (Zong == null) { |
| | | |
| | | }else{ |
| | | $.post("/HxzkFlow/hxzk/jiemi",data,function (data){ |
| | | if(data == "1"){ |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , height: 850 |
| | | ,width: 1700 |
| | | , url: '/HxzkFlow/hxzk/FindCompany' //数据接口 |
| | | , page: true //开启分页 |
| | | , toolbar: '#toolbarDemo' |
| | | , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可 |
| | | title: '提示' |
| | | } else { |
| | | $.post("/HxzkFlow/hxzk/jiemi", data, function (data) { |
| | | if (data == "1") { |
| | | if (getjuese == "超级管理员") { |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , icon: 'layui-icon-tips' |
| | | }] |
| | | , cols: [[ //表头 |
| | | {type: 'checkbox', sort: true, fixed: "left"} |
| | | , {field: 'companyid', title: '序号', sort: true ,width:'4%'} |
| | | , {field: 'companyname', title: '公司名称'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true,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:'8%'} |
| | | , {field: 'accountbank', title: '开户行'} |
| | | , {field: 'account', title: '账号', sort: true,width:'10%'} |
| | | , height: 850 |
| | | , width: 1700 |
| | | , url: '/HxzkFlow/hxzk/FindCompany' //数据接口 |
| | | , method: 'post' |
| | | // , where: {company: Zi} // 搜索的字段 |
| | | // , where: {entry: getUserName} // 搜索的字段 |
| | | , page: true //开启分页 |
| | | , toolbar: '#toolbarDemo' |
| | | , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可 |
| | | title: '提示' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , icon: 'layui-icon-tips' |
| | | }] |
| | | , cols: [[ //表头 |
| | | {type: 'checkbox', sort: true, fixed: "left"} |
| | | , {field: 'companyid', title: '序号', sort: true, width: '4%'} |
| | | , {field: 'companyname', title: '公司名称'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true, 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: '8%'} |
| | | , {field: 'accountbank', title: '开户行'} |
| | | , {field: 'account', title: '账号', sort: true, width: '10%'} |
| | | |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $("table").css("width", "100%") |
| | | }, |
| | | limit:100, |
| | | limits:[10,20,30,40,50,60,70,80,90,100], |
| | | }); |
| | | }else{ |
| | | $("#relo").css("left","-60px") |
| | | var dt ="Zong="+localStorage.getItem("gsmc") |
| | | $.post("/HxzkFlow/hxzk/chaZi",dt,function (data){ |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $("table").css("width", "100%") |
| | | }, |
| | | limit: 100, |
| | | limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], |
| | | }); |
| | | } else { |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , height: 850 |
| | | , width: 1700 |
| | | , url: '/HxzkFlow/hxzk/FindCompany;' //数据接口 |
| | | , method: 'post' |
| | | // , where: {company: Zi} // 搜索的字段 |
| | | , where: {entry: getUserName} // 搜索的字段 |
| | | , page: true //开启分页 |
| | | , toolbar: '#toolbarDemo' |
| | | , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可 |
| | | title: '提示' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , icon: 'layui-icon-tips' |
| | | }] |
| | | , cols: [[ //表头 |
| | | {type: 'checkbox', sort: true, fixed: "left"} |
| | | , {field: 'companyid', title: '序号', sort: true, width: '4%'} |
| | | , {field: 'companyname', title: '公司名称'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true, 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: '8%'} |
| | | , {field: 'accountbank', title: '开户行'} |
| | | , {field: 'account', title: '账号', sort: true, width: '10%'} |
| | | |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $("table").css("width", "100%") |
| | | }, |
| | | limit: 100, |
| | | limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], |
| | | }); |
| | | } |
| | | |
| | | } else { |
| | | $("#relo").css("left", "-60px") |
| | | var dt = "Zong=" + localStorage.getItem("gsmc") |
| | | $.post("/HxzkFlow/hxzk/chaZi", dt, function (data) { |
| | | var jc = Zong; |
| | | table.render({ |
| | | elem: '#demo' |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , height: 850 |
| | | |
| | | , url: '/HxzkFlow/hxzk/FindCompanyZi?Zong='+jc //数据接口 |
| | | , url: '/HxzkFlow/hxzk/FindCompanyZi?Zong=' + jc //数据接口 |
| | | |
| | | , page: true //开启分页 |
| | | , toolbar: '#toolbarDemo1' |
| | |
| | | , layEvent: 'LAYTABLE_TIPS' |
| | | , icon: 'layui-icon-tips' |
| | | }] |
| | | ,cols: [[ //表头 |
| | | , cols: [[ //表头 |
| | | {type: 'checkbox', sort: true, fixed: "left"} |
| | | , {field: 'companyid', title: '序号', sort: true ,width:'4%'} |
| | | , {field: 'companyname', title: '公司名称',width:'10%'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true,width:'10%'} |
| | | , {field: 'loginphone', title: '登录电话',width:'10%'} |
| | | , {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: 'account', title: '账号', sort: true,width:'10%'} |
| | | , {field: 'companyid', title: '序号', sort: true, width: '4%'} |
| | | , {field: 'companyname', title: '公司名称', width: '10%'} |
| | | , {field: 'companyabbname', title: '公司简称', sort: true, width: '10%'} |
| | | , {field: 'loginphone', title: '登录电话', width: '10%'} |
| | | , {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: 'account', title: '账号', sort: true, width: '10%'} |
| | | |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $("table").css("width", "100%") |
| | | }, |
| | | limit:100, |
| | | limits:[10,20,30,40,50,60,70,80,90,100], |
| | | limit: 100, |
| | | limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], |
| | | }); |
| | | }); |
| | | |
| | |
| | | |
| | | |
| | | //头工具栏事件 |
| | | table.on('toolbar(demo)', function(obj){ |
| | | 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) { |
| | | 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)+"&caozuoname="+getUserName |
| | | $.post("/HxzkFlow/hxzk/DeleteCompany", datas, function (data) { |
| | | |
| | | }); |
| | | } |
| | | layer.alert("删除成功") |
| | | if (data.length == 0) { |
| | | layer.alert("请选中一条数据") |
| | | } else { |
| | | layer.confirm("此操作将永久删除该数据, 是否继续?",{icon: 3, title:'提示'}, function () { |
| | | 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) { |
| | | location.reload(); |
| | | }); |
| | | } |
| | | layer.alert("删除成功") |
| | | }) |
| | | } |
| | | |
| | | layui.table.reload('demo') |
| | | // 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 { |
| | | console.log(data[0]) |
| | | $("#companynameup").val(data[0].companyname) |
| | | $("#companyabbnameup").val(data[0].companyabbname) |
| | | $("#loginphoneup").val(data[0].loginphone) |
| | | $("#passwordup").val(data[0].password) |
| | | |
| | | $("#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') |
| | | }); |
| | | form.on('submit(demo-table-search)', function(data){ |
| | | form.on('submit(demo-table-search)', function (data) { |
| | | var field = data.field; // 获得表单字段 |
| | | if(field.companyname == ""){ |
| | | if (field.companyname == "") { |
| | | |
| | | if(localStorage.getItem("gsjc") == "华星智控"){ |
| | | if (localStorage.getItem("gsjc") == "华星智控") { |
| | | table.reload('demo', { |
| | | url: "/HxzkFlow/hxzk/GongSitableSearch", |
| | | method:'post', |
| | | method: 'post', |
| | | page: { |
| | | curr: 1 // 重新从第 1 页开始 |
| | | } |
| | | ,where: field // 搜索的字段 |
| | | , where: field // 搜索的字段 |
| | | }); |
| | | layer.msg('搜索成功'); |
| | | }else{ |
| | | } else { |
| | | field.companyname = localStorage.getItem("gsjc") |
| | | table.reload('demo', { |
| | | url: "/HxzkFlow/hxzk/GongSitableSearch", |
| | | method:'post', |
| | | method: 'post', |
| | | page: { |
| | | curr: 1 // 重新从第 1 页开始 |
| | | } |
| | | ,where: field // 搜索的字段 |
| | | , where: field // 搜索的字段 |
| | | }); |
| | | layer.msg('搜索成功'); |
| | | } |
| | | }else{ |
| | | if(localStorage.getItem("gsjc") == "华星智控"){ |
| | | } else { |
| | | if (localStorage.getItem("gsjc") == "华星智控") { |
| | | table.reload('demo', { |
| | | url: "/HxzkFlow/hxzk/GongSitableSearch", |
| | | method:'post', |
| | | method: 'post', |
| | | page: { |
| | | curr: 1 // 重新从第 1 页开始 |
| | | } |
| | | ,where: field // 搜索的字段 |
| | | ,done: function(res, curr, count) { |
| | | , where: field // 搜索的字段 |
| | | , done: function (res, curr, count) { |
| | | // res为接口返回的数据 |
| | | if (res.data.length > 0) { |
| | | |
| | |
| | | } |
| | | }); |
| | | layer.msg('搜索成功'); |
| | | }else{ |
| | | if (field.companyname != localStorage.getItem("gsjc")){ |
| | | } else { |
| | | if (field.companyname != localStorage.getItem("gsjc")) { |
| | | alert("没有权限查看其他公司") |
| | | } |
| | | } |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | //修改 |
| | | function canselupdate(){ |
| | | function canselupdate() { |
| | | $(".update").hide(); |
| | | $(".heimu").hide(); |
| | | } |
| | | |
| | | //新增 |
| | | function add(){ |
| | | function add() { |
| | | $(".add").show(); |
| | | $(".heimu").show(); |
| | | } |
| | | function canseladd(){ |
| | | |
| | | function canseladd() { |
| | | $(".add").hide(); |
| | | $(".heimu").hide(); |
| | | } |
| | | |
| | | function checkadd() { |
| | | var add1 = $("#companynameadd").val(); |
| | | var add2 = $("#companyabbnameadd").val(); |
| | |
| | | var add6 = $("#phoneadd").val(); |
| | | var add7 = $("#accountbankadd").val(); |
| | | var add8 = $("#accountadd").val(); |
| | | var add9 = "0" ; |
| | | var data = "companyname="+add1+"&companyabbname="+add2 |
| | | var add9 = "0" |
| | | var add10 = $("#passwordadd").val(); |
| | | |
| | | // 密码验证:长度不能小于6位,必须包含大小写字母 |
| | | if (add10.length < 6) { |
| | | layer.alert("密码长度不能少于6位"); |
| | | return false; |
| | | } |
| | | |
| | | // 检查是否包含大写字母 |
| | | if (!/[A-Z]/.test(add10)) { |
| | | layer.alert("密码必须包含大写字母"); |
| | | return false; |
| | | } |
| | | |
| | | // 检查是否包含小写字母 |
| | | if (!/[a-z]/.test(add10)) { |
| | | layer.alert("密码必须包含小写字母"); |
| | | return false; |
| | | } |
| | | var parts = add3.replace(/\s*/g, "").split(/,|,/); |
| | | // var parts1 = add5.split(";"); |
| | | // if (parts.length<1){ |
| | | // parts=add3.replaceAll(/\s*/g, "").split(","); |
| | | // } |
| | | console.log(parts) |
| | | // if (parts.length) |
| | | // |
| | | var data2 = "companyname=" + add1 |
| | | if (parts.length>1){ |
| | | for (let i = 0; i < parts.length; i++) { |
| | | console.log(parts[i]) |
| | | var data = "phone=" + parts[i] |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/findPnone", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | console.log(data) |
| | | if (data != "") { |
| | | alert( parts[i]+"该手机号已绑定") |
| | | add9 = "1"; |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }else{ |
| | | var data = "phone=" + add3 |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/findPnone", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | console.log(data) |
| | | if (data != "") { |
| | | alert(add3+"该手机号已绑定") |
| | | add9 = "1"; |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if(add1 == "" || add1 == null){ |
| | | |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/findCompanyname", |
| | | type: "POST", |
| | | data: data2, |
| | | async: false, |
| | | success: function (data) { |
| | | console.log(data) |
| | | if (data != "") { |
| | | alert("公司名称已存在") |
| | | add9 = "1"; |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (add1 == "" || add1 == null) { |
| | | layer.alert("公司名称不能为空") |
| | | return false; |
| | | }else if(add2 == "" || add2 == null){ |
| | | } else if (add2 == "" || add2 == null) { |
| | | layer.alert("公司简称不能为空") |
| | | return false; |
| | | }else if(add3 == "" || add3 == null){ |
| | | } else if (add3 == "" || add3 == null) { |
| | | layer.alert("登陆电话不能为空") |
| | | return false; |
| | | }else if(add4 == "" || add4 == null){ |
| | | } else if (add10 == "" || add10 == null) { |
| | | layer.alert("登陆密码不能为空") |
| | | return false; |
| | | } else if (add4 == "" || add4 == null) { |
| | | layer.alert("税号不能为空") |
| | | return false; |
| | | }else if(add5 == "" || add5 == null){ |
| | | } else if (add5 == "" || add5 == null) { |
| | | layer.alert("地址不能为空") |
| | | return false; |
| | | }else if(add6 == "" || add6 == null){ |
| | | } else if (add6 == "" || add6 == null) { |
| | | layer.alert("电话不能为空") |
| | | return false; |
| | | }else if(add7 == "" || add7 == null){ |
| | | } else if (add7 == "" || add7 == null) { |
| | | layer.alert("开户行不能为空") |
| | | return false; |
| | | }else if(add8 == "" || add8 == null){ |
| | | } else if (add8 == "" || add8 == null) { |
| | | layer.alert("账号不能为空") |
| | | return false; |
| | | }else if(add9 == "1"){ |
| | | } else if (add9 == "1") { |
| | | return false; |
| | | }else{ |
| | | } else { |
| | | console.log(add1) |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/ifGongSi", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function(data) { |
| | | success: function (data) { |
| | | console.log(data) |
| | | if(data != ""){ |
| | | if (data != "") { |
| | | alert("该公司名称或简称已存在!") |
| | | add9 = "1"; |
| | | }else{ |
| | | } 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){ |
| | | var upp = "companyname=" + add1 + "&companyabbname=" + add2 + "&loginphone=" + add3+ "&password=" + add10 + "&shuinum=" + add4 + "&address=" + add5 + "&phone=" + add6 + "&accountbank=" + add7 + "&account=" + add8 + "&caozuoname=" + getUserName + "&entryclerk=" + getUserName |
| | | $.post("/HxzkFlow/hxzk/addGongSi", upp, function (data) { |
| | | |
| | | }) |
| | | add9 = "0"; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | function checkup(){ |
| | | |
| | | function checkup() { |
| | | |
| | | var up0 = $("#companyidup").val(); |
| | | var up1 = $("#companynameup").val(); |
| | | var up2 = $("#companyabbnameup").val(); |
| | | var up3 = $("#loginphoneup").val(); |
| | | var up4 = $("#shuinumup").val(); |
| | | var up5 = $("#addressup").val(); |
| | | var up6 = $("#phoneup").val(); |
| | | var up7 = $("#accountbankup").val(); |
| | | var up8 = $("#accountup").val(); |
| | | var up2 = $("#companyabbnameup").val(); |
| | | var up3 = $("#loginphoneup").val(); |
| | | var up4 = $("#shuinumup").val(); |
| | | var up5 = $("#addressup").val(); |
| | | var up6 = $("#phoneup").val(); |
| | | var up7 = $("#accountbankup").val(); |
| | | var up8 = $("#accountup").val(); |
| | | var add9 = '0' |
| | | var up10 = $("#passwordup").val(); |
| | | |
| | | // 密码验证:长度不能小于6位,必须包含大小写字母 |
| | | if (up10.length < 6) { |
| | | layer.alert("密码长度不能少于6位"); |
| | | return false; |
| | | } |
| | | |
| | | // 检查是否包含大写字母 |
| | | if (!/[A-Z]/.test(up10)) { |
| | | layer.alert("密码必须包含大写字母"); |
| | | return false; |
| | | } |
| | | |
| | | // 检查是否包含小写字母 |
| | | if (!/[a-z]/.test(up10)) { |
| | | layer.alert("密码必须包含小写字母"); |
| | | return false; |
| | | } |
| | | |
| | | var parts = up3.replace(/\s*/g, "").split(/,|,/);; |
| | | // var parts1 = add5.split(";"); |
| | | // if (parts.length<1){ |
| | | // parts=add3.replaceAll(/\s*/g, "").split(","); |
| | | // } |
| | | console.log(parts) |
| | | // if (parts.length) |
| | | // |
| | | var data2 = "companyname=" + add1 |
| | | if (parts.length>1){ |
| | | for (let i = 0; i < parts.length; i++) { |
| | | console.log(parts[i]) |
| | | // var data = {} "phone=" + parts[i]+'&companyId='+up0 |
| | | |
| | | var data = { |
| | | phone: parts[i], |
| | | companyId: up0, |
| | | } |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/findPnone", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | console.log(data) |
| | | if (data != "") { |
| | | alert(parts[i]+"该手机号已绑定") |
| | | add9 = "1"; |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }else{ |
| | | |
| | | // var data = "phone=" + up3 |
| | | var data = { |
| | | phone: up3, |
| | | companyId: up0, |
| | | } |
| | | $.ajax({ |
| | | url: "/HxzkFlow/hxzk/findPnone", |
| | | type: "POST", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | console.log(data) |
| | | if (data != "") { |
| | | alert(up3+"该手机号已绑定") |
| | | add9 = "1"; |
| | | return false; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | console.log(up3) |
| | | if(up1 == null || up1 == ""){ |
| | | if (up1 == null || up1 == "") { |
| | | layer.alert("公司名称不能为空") |
| | | return false; |
| | | }else if(up2 == null || up2 == ""){ |
| | | } else if (up2 == null || up2 == "") { |
| | | layer.alert("公司简称不能为空") |
| | | return false; |
| | | }else if(up4 == null || up4 == ""){ |
| | | } else if (up4 == null || up4 == "") { |
| | | layer.alert("税号不能为空") |
| | | return false; |
| | | }else if(up5 == null || up5 == ""){ |
| | | } else if (up5 == null || up5 == "") { |
| | | layer.alert("地址不能为空") |
| | | return false; |
| | | }else if(up6 == null || up6 == ""){ |
| | | } else if (up6 == null || up6 == "") { |
| | | layer.alert("电话不能为空") |
| | | return false; |
| | | }else if(up7 == null || up7 == ""){ |
| | | } else if (up10 == null || up10 == "") { |
| | | layer.alert("密码不能为空") |
| | | return false; |
| | | } else if (up7 == null || up7 == "") { |
| | | layer.alert("开户行不能为空") |
| | | return false; |
| | | }else if(up8 == null || up8 == ""){ |
| | | } else if (up8 == null || up8 == "") { |
| | | 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+"&caozuoname="+getUserName |
| | | } else if (add9 == '1') { |
| | | // layer.alert("账号不能为空") |
| | | return false; |
| | | } else{ |
| | | var upp = "companyid=" + up0 + "&companyname=" + up1 + "&companyabbname=" + up2 + "&loginphone=" + up3 + "&password=" + up10 + "&shuinum=" + up4 + "&address=" + up5 + "&phone=" + up6 + "&accountbank=" + up7 + "&account=" + up8 + "&caozuoname=" + getUserName |
| | | console.log(upp) |
| | | $.post("/HxzkFlow/hxzk/UpdateGongSi",upp,function (data){ |
| | | $.post("/HxzkFlow/hxzk/UpdateGongSi", upp, function (data) { |
| | | |
| | | }) |
| | | console.log(66666666) |
| | |
| | | } |
| | | |
| | | </script> |
| | | |
| | | |
| | | |
| | | </html> |