fei.wang
6 天以前 e15f561a1f9eddfde503d59baf45a860b131928e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
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>