fei.wang
7 天以前 e15f561a1f9eddfde503d59baf45a860b131928e
src/webapp/page/XinXi.jsp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,405 @@
<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2023/8/14
  Time: 11:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
    <link href="/HxzkFlow/images/favicon.ico" rel="icon" type="image/x-icon"/>
    <link rel="stylesheet" href="/HxzkFlow/css/layui.css" media="all">
    <style>
        #sendcontext {
            display: block;
            margin: 0 auto;
            /*overflow: hidden;        */
            width: 490px;
            font-size: 14px;
            height: 100px;
            line-height: 24px;
            padding: 2px;
            border-radius: 4px;
            min-height: 20px;
            /* max-height: 70px;       */
        }
        textarea {
            outline: 0 none;
            border-color: rgba(82, 168, 236, 0.8);
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
        }
        .panbox{
            width: 540px;
            height: 130px;
            float: left;
            margin-left: 20px;
            margin-top: 10px;
            color: white;
            font-size: 22px;
        }
    </style>
</head>
<body>
<div style="width: 100%">
    <a href="javascript:;"><div class="panbox" style="background-color: #096DD9;">
        <div style="margin-top: 15px;margin-left: 20px">
            <span style="font-size: 14px">总卡数</span><br>
            <span style="font-size: 34px;margin-top: 18px;display: inline-block"  class="zk">0</span>
        </div>
    </div></a>
    <a href="javascript:;" onclick="bydq()"> <div class="panbox" style="background-color: #722ED1">
        <div style="float: left;margin-left: 20px;margin-top: 15px">
            <span style="font-size: 14px">本月到期</span><br>
            <span style="font-size: 34px;margin-top: 18px;display: inline-block" class="by">0</span>
        </div>
        <div style="float: left;margin-left: 250px;margin-top: 15px">
            <span style="font-size: 14px">次月激活</span><br>
            <span style="font-size: 34px;margin-top: 18px;display: inline-block" class="cy">0</span>
        </div>
    </div></a>
    <a href="javascript:;"> <div class="panbox" style="background-color:#D46B08;">
        <div style="float: left;margin-left: 20px;margin-top: 15px">
            <span style="font-size: 14px">达量断网</span><br>
            <span style="font-size: 34px;margin-top: 18px;display: inline-block" class="dw">0</span>
        </div>
        <div style="float: left;margin-left: 250px;margin-top: 15px">
            <span style="font-size: 14px">即将达量</span><br>
            <span style="font-size: 34px;margin-top: 18px;display: inline-block" class="jjdl">0</span>
        </div>
    </div></a>
</div>
<%--<script type="text/html" id="toolbarDemo">--%>
    <div style="margin-top: 15px;margin-left: 20px;display: inline-block" >
<%--        <button class="layui-btn " id="btn-add" lay-event="getadd1">新增</button>--%>
        <h2 >即将到期卡号汇总</h2>
    </div>
<%--</script>--%>
<div style="display: inline-block;width: 100%;">
    <table id="demo" lay-filter="demo"></table>
</div>
<div class="send"
     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" action="/HxzkFlow/hxzk/send" lay-filter="example" onsubmit="return checksend()">
        <input type="text" name="id" style="display: none" class="upnum"/>
        <input type="text" name="enddate" style="display: none" class="enddate"/>
        <div class="layui-form-item">
            <label class="layui-form-label">所属公司:</label>
            <div class="layui-input-block">
                <input type="text" name="company" id="company" lay-verify="title" autocomplete="off" placeholder=""
                       class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发送电话:</label>
            <div class="layui-input-block">
                <input type="text" name="phone" id="phone" lay-verify="title" autocomplete="off" lay-verify="required|phone"
                       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="sendcontext" id="sendcontext" lay-verify="title" autocomplete="off"--%>
<%--                       placeholder="请输入卡号,N个卡号需要 ; åˆ†éš”" class="layui-input">--%>
    <textarea id="sendcontext" name="enddate" autoHeight="true" placeholder="回复内容" disabled></textarea>
    </textarea>
            </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>
            </div>
        </div>
    </form>
</div>
</body>
<script type="text/html" id="barDemo">
    <a class="layui-btn  layui-btn-xs" lay-event="detail" >短信提示</a>
<%--    <a class="layui-btn  layui-btn-xs" onclick="guanbi();" >关闭</a>--%>
</script>
<script src="/HxzkFlow/js/layui.js" charset="utf-8"></script>
<script src="../js/jquery-3.5.1.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
    var qb = localStorage.getItem("gsjc")
    var ds = "qb="+localStorage.getItem("gsmc")
    var getUserName = localStorage.getItem("getUserName")
    var getjuese = localStorage.getItem("getjuese")
    var data = "qb="+qb
    if(qb == "华星智控" || qb == "访客"){
        $.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{
        $.post("/HxzkFlow/hxzk/chawu1",ds,function (dt){
            $(".zk").text(dt[0])
            $(".by").text(dt[1])
            $(".cy").text(dt[2])
            $(".dw").text(dt[3])
            $(".jjdl").text(dt[4])
        })
        setInterval(function() {
            $.post("/HxzkFlow/hxzk/chawu1",ds,function (data){
                $(".zk").text(data[0])
                $(".by").text(data[1])
                $(".cy").text(data[2])
                $(".dw").text(data[3])
                $(".jjdl").text(data[4])
            })
        }, 60000);
    }
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer
            , form = layui.form;
        //从本地存储获取用户登录信息,如果是子账号,只显示else å¦‚果是总账号显示if
        layui.use('table', function () {
            var table = layui.table;
            var Zong = localStorage.getItem("gsjc")
            var data = "Zong=" + Zong
            if (Zong == null) {
            } else {
                $.post("/HxzkFlow/hxzk/jiemi", data, function (data) {
                    if (data == "1") {
                        if (getjuese == "超级管理员") {
                            // form.render();
                            // $("#hide").hide();
                            // $("#relo").css("left","-60px")
                            // $("#select").css("left","620px")
                            // $("#cardnum").css("left","620px")
                            table.render({
                                elem: '#demo'
                                , layEvent: 'LAYTABLE_TIPS'
                                , height: 610
                                , url: '/HxzkFlow/hxzk/FindCard' //数据接口
                                ,method:'post'
                                , where: {daoqi: 'yes'}
                                , width: 1680
                                , autoWidth: true
                                , page: true //开启分页
                                // , toolbar: '#toolbarDemo'
                                , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                                    title: '提示'
                                    , layEvent: 'LAYTABLE_TIPS'
                                    , icon: 'layui-icon-tips'
                                }]
                                , cols: [[ //表头
                                    {type: 'checkbox', sort: true, fixed: "left"}
                                    , {field: 'num', title: '序号', sort: true, width: '5%'}
                                    , {field: 'company', title: '所属公司',}
                                    , {field: 'cardnumber', title: '卡号', sort: true,}
                                    , {field: 'operator', title: '运营商', sort: true,}
                                    , {field: 'carddate', title: '开始日期', sort: true,}
                                    , {field: 'enddate', title: '结束日期', sort: true,}
                                    , {field: 'remainingdays', title: '剩余天数',}
                                    , {title: '操作', width: 150, toolbar: '#barDemo'}
                                ]],
                                limit: 100,
                                limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                            });
                        }else{
                            table.render({
                                elem: '#demo'
                                , layEvent: 'LAYTABLE_TIPS'
                                , height: 610
                                , url: '/HxzkFlow/hxzk/FindCard' //数据接口
                                ,method:'post'
                                , where: {daoqi: 'yes',entry:getUserName}
                                , width: 1680
                                , autoWidth: true
                                , page: true //开启分页
                                // , toolbar: '#toolbarDemo'
                                , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                                    title: '提示'
                                    , layEvent: 'LAYTABLE_TIPS'
                                    , icon: 'layui-icon-tips'
                                }]
                                , cols: [[ //表头
                                    {type: 'checkbox', sort: true, fixed: "left"}
                                    , {field: 'num', title: '序号', sort: true, width: '5%'}
                                    , {field: 'company', title: '所属公司',}
                                    , {field: 'cardnumber', title: '卡号', sort: true,}
                                    , {field: 'operator', title: '运营商', sort: true,}
                                    , {field: 'carddate', title: '开始日期', sort: true,}
                                    , {field: 'enddate', title: '结束日期', sort: true,}
                                    , {field: 'remainingdays', title: '剩余天数',}
                                    , {title: '操作', width: 150, toolbar: '#barDemo'}
                                ]],
                                limit: 100,
                                limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                            });
                        }
                    } else {
                        if (Zong=="访客"){
                            // $("#relo").hide();
                            $("#select").css("left", "160px")
                            // $("#relo").css("left", "-60px")
                            table.render({
                                elem: '#demo'
                                , layEvent: 'LAYTABLE_TIPS'
                                , height: 610
                                , url: '/HxzkFlow/hxzk/FindCard' //数据接口
                                , where: {company: Zi,daoqi:'yes'}
                                , width: 1680
                                , autoWidth: true
                                , page: true //开启分页
                                ,method:'post'
                                , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                                    title: '提示'
                                    , layEvent: 'LAYTABLE_TIPS'
                                    , icon: 'layui-icon-tips'
                                }]
                                , cols: [[ //表头
                                    {type: 'checkbox', sort: true, fixed: "left"}
                                    , {field: 'num', title: '序号', sort: true, width: '75'}
                                    , {field: 'company', title: '所属公司', width: '250'}
                                    , {field: 'cardnumber', title: '卡号', sort: true, width: '200'}
                                    , {field: 'operator', title: '运营商', sort: true, width: '110'}
                                    , {field: 'carddate', title: '开始日期', sort: true, width: '110'}
                                    , {field: 'enddate', title: '结束日期', sort: true, width: '110'}
                                    , {field: 'remainingdays', title: '剩余天数', width: '100'}
                                    // , {title: '操作',  width: 150, toolbar: '#barDemo'}
                                ]],
                                limit: 100,
                                limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                            });
                        }else{
                            $("#hide").hide();
                            $("#relo").css("left", "-60px")
                            $("#select").css("left", "620px")
                            $("#cardnum").css("left", "620px")
                            var Zi = localStorage.getItem("gsmc")
                            console.log(Zi)
                            var dt = "Zong=" + Zi
                            var field = data.field;
                            $.post("/HxzkFlow/hxzk/chaZi", dt, function (data) {
                                var jc = Zi;
                                table.render({
                                    elem: '#demo'
                                    , layEvent: 'LAYTABLE_TIPS'
                                    , height: 610
                                    , url: '/HxzkFlow/hxzk/FindCardZi' //数据接口
                                    , method: 'post'
                                    , cellMinWidth: 80
                                    , page: true //开启分页
                                    , limit: 100
                                    , where: {company: Zi,daoqi:'yes'} // æœç´¢çš„字段
                                    // , toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                                        title: '提示'
                                        , layEvent: 'LAYTABLE_TIPS'
                                        , icon: 'layui-icon-tips'
                                    }]
                                    , cols: [[ //表头
                                        {type: 'checkbox', sort: true, fixed: "left", top: 10}
                                        , {field: 'num', title: '序号', sort: true, width: '75'}
                                        , {field: 'company', title: '所属公司', width: '250'}
                                        , {field: 'cardnumber', title: '卡号', sort: true, width: '200'}
                                        , {field: 'operator', title: '运营商', sort: true, width: '110'}
                                        , {field: 'carddate', title: '开始日期', sort: true, width: '110'}
                                        , {field: 'enddate', title: '结束日期', sort: true, width: '110'}
                                        , {field: 'remainingdays', title: '剩余天数', width: '100'}
                                        // , {title: '操作',  width: 150, toolbar: '#barDemo'}
                                    ]],
                                    limit: 100,
                                    limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                                });
                            })
                        }
                    }
                })
            }
            table.on('tool(demo)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table å®¹å™¨çš„ id
                var data = obj.data; //获得当前行数据
                console.log(data)
                var layEvent = obj.event; //获得 lay-event å¯¹åº”的值(也就是处理的事件)
                if (layEvent === 'detail') {
                    var dt = "company=" + data.company
                    console.log(dt)
                    $.post("/HxzkFlow/hxzk/findcomPnone", dt, function (data) {
                        console.log(data)
                        $("#phone").val(data)
                    })
                    $(".send").show();
                    $(".upnum").val(data.num)
                    $("#company").val(data.company)
                    $(".enddate").val(data.enddate)
                    $("#sendcontext").val("您有使用的物联网卡还有"+data.remainingdays+"即将到期,请在" + data.enddate + "之前续费,如已续费忽略该提示信息,拒收请回复R")
                }
            });
        });
    });
    function checksend() {
        console.log("11111111111111111")
        console.log($("#phone").val())
        var add1 = $("#phone").val();
        if (add1 == "" || add1 == null) {
            layer.alert("请输入发送电话")
            return false;
        }
        if (add1.length!=11) {
            layer.alert("手机号有误!")
            return false;
        }
    }
    function canseladd() {
        $(".send").hide();
    }
</script>
</html>