wzp
2023-03-02 374ce4ffd0c459bb4067e8d5765f972668aff9b1
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
<%@ Page Language="C#"  masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="GwAuditCache.aspx.cs" Inherits="GwAuditCache" %>
 
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
    <form name="cacheForm" method="post" action="gwAuditCache.ashx?action=load" id="cacheForm"
    class="form-inline">
    <div class="form-group">
        <div class="input-group m-b">
            <span class="input-group-addon">账号</span>
            <input type="text" name="spids" id="spids" value="<%=SelectedSpIDs%>" class="form-control" />
        </div>
    </div>
    <div class="form-group">
        <div class="input-group m-b">
            <span class="input-group-addon">短信内容</span>
            <input type="text" name="content" id="content" value="<%=Content%>" class="form-control " />
        </div>
    </div>
        <div class="form-group">
        <div class="input-group m-b">
            <span class="input-group-addon">通道名称</span>
            <input type="text" name="content" id="opname" value="<%=Content%>" class="form-control " />
        </div>
    </div>
    <div class="form-group">
        <div class="input-group  m-b ">
            <div class="input-daterange input-group" id="datepicker">
                <span class="input-group-addon">时间范围&nbsp;<i class="fa fa-calendar"></i></span>
                <input type="text" class="input-sm form-control" name="startTime" id="startTime"
                    value="<%=StartTime.ToString("yyyy-MM-dd") %>" />
                <span class="input-group-addon">到</span> <span class="input-group-addon"><i class="fa fa-calendar">
                </i></span>
                <input type="text" class="input-sm form-control" name="endTime" id="endTime" value="<%=EndTime.ToString("yyyy-MM-dd") %>" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="input-group m-b">
            <input type="radio" class="icheck-me" name="auditingStatus" <%=(AuditingStatus==0 ? "checked":"")%>
                value="0" /><label>待审核信息</label>
            <input class="icheck-me" type="radio" <%=(AuditingStatus==10 ? "checked":"")%>  name="auditingStatus"
                value="10" /><label>待二次鉴定信息</label>&nbsp;<input type="button" value="刷新" class="btn btn-primary   action-go" />
        </div>
    </div>
    </form>
 
 
 
    <div class="table-responsive">
            <input class="btn btn-success action-modal-approve" data-status="4" value="批量通过(可修改通道)"
                type="button" />&nbsp
            <input class="btn btn-danger  action-audit-all" data-status="4" value="直接批量通过"
                type="button" />&nbsp
            <input class="btn btn-warning  action-audit-all" data-status="5" value="直接批量拒绝"
                type="button" />
            <input class="btn btn-primary  action-edit-content" data-status="999" value="修改内容"
                type="button" />
 
        <table class="table table-striped table-bordered table-hover" id="cacheTable" style="margin:10px 0 0 0;">
        <thead>
            <tr class="header">
                <th style="width: 20px">
                    <input type="checkbox" name='checkAll' id="checkAll" />
                </th>
                <th style="width: 50px">
                    短信账号
                </th>
                <th>客户账户</th>
                <th>
                    通道
                </th>
                <th>
                    内容
                </th>
                <th>
                    关键字
                </th>
                <th>
                    条数
                </th>
                <th style="width: 200px">
                    操作
                </th>
            </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div id="pager" style="margin:10px 0 0 0;">
    </div>
 
    <%--通道选择--%>
    <div class="modal inmodal " id="opDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <span class="title">选择通道</span><a class="close" data-dismiss="modal" aria-hidden="true">×</a></div>
                <div class="modal-body">
                    <select class="form-control" name="opid" id="opid">
                        <%=RenderOpOptions()%>
                    </select>
                </div>
                <div class="modal-footer">
                    <button class="btn-warning btn" data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn-primary btn action-approve-all">
                        确定</button>
                </div>
            </div>
        </div>
    </div>
 
 
    <%--内容修改--%>
    <div class="modal inmodal " id="editContentDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content" style="width:450px;">
                <div class="modal-header">
                    <span class="title">修改内容</span><a class="close" data-dismiss="modal" aria-hidden="true">×</a></div>
                <div class="modal-body">
                    <div style="display:flex;align-items:center;flex-direction:column;justify-content:center;">
                        <div>原内容:<textarea style="width:400px;height:200px" readonly id="oldContent"></textarea></div>
 
                        <div style="margin:30px 0 0 0;"><span style="color:red;font-weight:bold;">修改后的内容:</span><textarea style="width:400px;height:200px" id="newContent"></textarea></div>
                    </div>
 
 
                </div>
                <div class="modal-footer">
                    <button class="btn-warning btn" data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn-primary btn action-edit-submit">
                        确定</button>
                </div>
            </div>
        </div>
    </div>
 
 
    <%--详情面板--%>
    <div class="modal inmodal " id="detailDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <span class="title">详情</span><a class="close" data-dismiss="modal" aria-hidden="true">×</a></div>
                <div class="modal-body">
               
                </div>
                <div class="modal-footer">
                    <button class="btn-warning btn" data-dismiss="modal" aria-hidden="true">
                        关闭</button>
                </div>
            </div>
        </div>
    </div>
 
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#checkAll").click(function () {
                $("input[name='hashCode']").prop("checked", $(this).is(":checked"));
            });
 
            $("#pager").Pager({
                pageSize: 100,
                onChange: function (pageIndex, pageSize) {
                    load();
                }
            });
 
            function load() {
                $.post("gwauditcache.ashx", {
                    action: "load",
                    startTime: $("#startTime").val(),
                    endTime: $("#endTime").val(),
                    auditingStatus: $("input:radio[name='auditingStatus']:checked").val(),
                    content: $("#content").val(),
                    spids: $("#spids").val(),
                    pageSize: $("#pager").Pager("getPageSize"),
                    pageIndex: $("#pager").Pager("getPageIndex"),
                    opname: $("#opname").val()
                }, function (r) {
                    if (r.OK) {
                        $("#cacheTable tbody").html(r.Message.Table);
                        $("#pager").Pager("setTotalCount", r.Message.TotalCount);
                    }
                    else {
                        mytek.alert(r.Message, r.OK);
                    }
                }, "json");
            }
 
            $(".input-daterange").datepicker({ keyboardNavigation: !1, forceParse: !1, autoclose: !0 });
 
            $(".action-go").on("click", function () {
                load();
            });
 
            $(document).on("click", ".action-audit", function () {
                var me = $(this);
                var id = me.data("id");
                var status = me.data("status");
 
                $.post("gwauditcache.ashx", { action: "saveAudit", hashCode: id, status: status },
                function (result) {
                    mytek.alert(result.Message, result.OK, function () {
                        load();
                    });
                }, "json");
            });
 
            $(document).on("click", ".action-load-detail", function () {
                var me = $(this);
                var id = me.data("id");
 
                $.post("gwauditcache.ashx", { action: "loadDetail", hashCode: id, startTime: $("#startTime").val(), endTime: $("#endTime").val() },
                function (result) {
                    if (!result.OK) {
                        mytek.alert(result.Message);
                    } else {
                        var html = [];
                        html.push("<table class='table table-striped table-bordered table-hover'>");
                        html.push("<tr><th>手机</th><th>SPID</th><th>OPID</th><th>内容</th><th>时间</th></tr>");
                        $.each(result.Message, function () {
                            html.push("<tr>");
                            html.push("<td>" + this.MOBILE + "</td>");
                            html.push("<td>" + this.SP_ID + "</td>");
                            html.push("<td>" + this.OP_ID + "</td>");
                            html.push("<td>" + this.MSG_CONTENT + "</td>");
                            html.push("<td>" + this.AP_SUBMIT_TIME + "</td>");
                            html.push("</tr>");
                        });
                        html.push("</table>");
                        $("#detailDialog .modal-body").html(html.join(""));
                        $("#detailDialog").modal("show");
                    }
                }, "json");
            });
 
 
            $(".action-approve-all").on("click", function () {
                var me = $(this);
                var hashCodes = [];
                $("input[name=hashCode]").each(function () {
                    if ($(this).is(":checked")) {
                        hashCodes.push($(this).val());
                    }
                });
 
                if (hashCodes.length == 0) {
                    mytek.alert("尚未选择要审核的短信");
                    return;
                }
 
                var opid = $("#opDialog #opid").val();
 
                $.post("gwauditcache.ashx", { action: "approveAll", hashCodes: $.toJSON(hashCodes), status: 4, opid: opid },
                    function (result) {
                        $("#opDialog").modal("hide");
                        mytek.alert(result.Message, result.OK, function () {
                            load();
                        });
                    }, "json");
            });
 
            $(".action-audit-all").on("click", function () {
                var me = $(this);
                var hashCodes = [];
 
                $("input[name=hashCode]").each(function () {
                    if ($(this).is(":checked")) {
                        hashCodes.push($(this).val());
                    }
                });
 
                if (hashCodes.length == 0) {
                    mytek.alert("尚未选择要审核的短信");
                    return;
                }
 
                $.post("gwauditcache.ashx", { action: "auditAll", hashCodes: $.toJSON(hashCodes), status: me.data("status") },
                    function (result) {
                        mytek.alert(result.Message, result.OK, function () {
                            load();
                        });
                    }, "json");
            });
 
            $(".action-modal-approve").on("click", function () {
                var hashCodes = [];
 
                $("input[name=hashCode]").each(function () {
                    if ($(this).is(":checked")) {
                        hashCodes.push($(this).val());
                    }
                });
 
                if (hashCodes.length == 0) {
                    mytek.alert("尚未选择要审核的短信");
                    return;
                }
 
                $("#opDialog").modal("show");
            });
 
 
            //修改内容
            $(".action-edit-content").on("click", function () {
                var hashCodes = [];
 
                $("input[name=hashCode]").each(function () {
                    if ($(this).is(":checked")) {
                        hashCodes.push($(this).val());
                    }
                });
 
                $("input[type='checkbox']").each(function () { //遍历checkbox的选择状态
                    if ($(this).prop("checked")) { //如果值为checked表明选中了
                        hashCodes.push($(this).val());
 
                        // console.log("选中该行的IEMI:"+$(this).closest('tr').find('td').eq(7).text());
                        var delei = $(this).closest('tr').find('td').eq(4).text();//获取eq为7的那一列数据(就是第7列)
                        console.log("选中该行的列值:" + typeof delei + '--' + delei);
 
                        $("#oldContent").val(delei);
                        $("#newContent").val(delei);
 
                    }
                });
 
                if (hashCodes.length == 0) {
                    mytek.alert("尚未选择要修改的内容");
                    return;
                }
 
                $("#editContentDialog").modal("show");
            });
 
 
            //提交修改内容
            $(".action-edit-submit").on("click", function () {
                
                var hashCodes = [];
 
                $("input[name=hashCode]").each(function () {
                    if ($(this).is(":checked")) {
                        hashCodes.push($(this).val());
                    }
                });
 
                if (hashCodes.length == 0) {
                    mytek.alert("尚未选择要修改内容的短信");
                    return;
                }
 
                let newSms = $("#newContent").val();
 
 
                $.post("gwauditcache.ashx", { action: "editContent", hashCodes: $.toJSON(hashCodes), newSms: newSms },
                    function (result) {
                        $("#editContentDialog").modal("hide");
                        mytek.alert(result.Message, result.OK, function () {
                            load();
                        });
                    }, "json");
            });
 
        });
    </script>
</asp:Content>