严智鑫
2024-05-13 cedce4883f0d204f5bf7bf87c0bf4858dabb0c23
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
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
 
<html>
<head>
<script type="text/javascript"
    src="${ctx}/static/jquery/jquery-3.1.0.min.js"></script>
<title>打印界面</title>
<script type="text/javascript">
    var interval = setInterval('refreshStatus()', 60000);
    $(document).ready(function(){
          var allstatu = $("#allstatu").attr("allstatu");
          var info = $("#info").attr("info");
          $("#infos").html("<img src=\"/gmms2/static/images/danger.jpg\">"+"  "+info);
          if(allstatu == 0){
               $("#allstatus").attr("style","background-color:#f00"); 
          }
    });
    // 设备页面自动刷新
    function refreshStatus() {
        window.location.reload();
    }
    
    // 停止页面自动刷新
    function disableAutoRefresh() {
        clearInterval(interval);
    }
    
    function modifypattern(id){
         disableAutoRefresh()
        $('#myModal-pattern').modal('toggle');
         $('#pattern_id').val(id);
}
    //单打
    function printalone(glassid){
        disableAutoRefresh();
        $("#printalone").modal('toggle');
        $("#lineprint").val(glassid);
    }
    //全打
    function printall(glassid){
        disableAutoRefresh();
        $("#printall").modal('toggle');
        $("#lineprint").val(glassid);
    }
    
    function modifystatu(id){
        disableAutoRefresh();
        $('#myModal-statu').modal('toggle');
        $('#statu_id').val(id);
    }
    
    function finishtask(){
        disableAutoRefresh();
        $('#taskFinish').modal('toggle');
    }
    function serach(){
        var name = $('#name').val();
        $.ajax({
               url:"/gmms2/device/serach/"+name,
               async:true,
               type:"GET",
               dataType:"json",
               cache:false, 
               success: function(data){
                   alert(date);
               }
           });
    }
    
      //异步处理单打
     $(document).delegate('#allprint','click',function(){
        var glassid = $('#lineprint').val();
        $.ajax({ 
            async: false, 
        
            type:"GET", 
 
             url:"${ctx}/device/printalone/"+glassid, 
 
            dataType:"text", 
 
            success:function(data){
                alert("打印完成!");
                window.location.href="${ctx}/device/printmanage";
                }
            });
     }); 
     
     //异步处理全打
     $(document).delegate('#allprinttwo','click',function(){
         var glassid = $('#lineprint').val();
         $.ajax({ 
             async: false, 
         
             type:"GET", 
 
              url:"${ctx}/device/printglass/"+glassid, 
 
             dataType:"text", 
 
             success:function(data){
                 
                 window.location.href="${ctx}/device/printmanage";
                 alert("打印完成")
                 }
             });
      }); 
     
     $(document).delegate('#myModal-pattern','click',function(){
         var glassid = $('#searchsubmit').val();
         $.ajax({ 
             async: false, 
             type:"GET", 
              url:"${ctx}/device/modifyPattern/"+glassid, 
             dataType:"text", 
             success:function(data){    
                 window.location.href="${ctx}/device/printmanage";
                 alert("打印完成!")
                 }
             });
      });   
    function modifyGlassCount(id, glasscount) {
         $('#modifyPortModal').modal('toggle');
         $('#CountInput').val(glasscount);
         $('#modifyGlassCountForm').attr('action', '${ctx}/device/printorglass/' + id);
     } 
</script>
</head>
<body>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>打印界面&nbsp;&nbsp;<a href="${ctx}/device/printOrder" class="btn btn-success">打印全部标签</a></h1>
            <ol class="breadcrumb">
                <li><a href="#">设备<i class="fa fa-dashboard"></i> 打印
                </a></li>
            </ol>
        </section>
         <div id = "allstatu" allstatu = "${allstatu}"></div>
           <div id = "info" info = "${info}"></div>
        <!-- Main content -->
        <section class="content container-fluid"
            style="margin-top: 10px; margin-left: 10px;">
            <fieldset>
                <legend>
                    &nbsp;&nbsp;<span class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;打印状态
                </legend>
                <table class="table table-striped table-hover"
                    style="height: 113px;text-align:center;">
                    <thead>
                        <tr>
                            <th width="10%" style="text-align:center;">所属线路</th>
                            <th width="15%" style="text-align:center;">打印机</th>
                            <th width="10%" style="text-align:center;">状态</th>
                            <th width="30%" style="text-align:center;">连接操作</th>    
                        </tr>
                    </thead>
                    <tbody>
                            ${printhtml}
                    </tbody>
                </table>
            </fieldset>
            <div class="box" style="height: 400px; overflow: auto;margin-top: 15px;">
 
                <div class="box-tools">
                    <form class="form-horizontal" action="${ctx}/device/serach"
                            method="post" role="form" id="category_add">
                    <div class="input-group input-group-sm"
                        style="width: 150px; float: right;">
                        <input type="text" name="txt_name" id='name'
                            class="form-control pull-right" placeholder="文件名称">
 
                        <div class="input-group-btn">
                            <button type="submit" class="btn btn-default"><i
                                class="fa fa-search"></i></button>
                        </div>
                    </div>
                    </form>
                </div>
                 <div><h3 style="margin-top:10px;">&nbsp;&nbsp;&nbsp;${printword}</h3></div>
              <table class="table table-striped table-hover"
                        style="overflow-x: auto;text-align:center;">
                        <thead>
                            <tr>
                                <th style="text-align:center;">架号ID</th>
                                <th style="text-align:center;">客户名</th>
                                <th style="text-align:center;">长度</th>
                                <th style="text-align:center;">宽度</th>
                                <th style="text-align:center;">厚度</th>
                                <th style="text-align:center;">颜色</th>
                                <th style="text-align:center;">当前架号数</th>
                                <th style="text-align:center;">成品名称</th>
                                <th style="text-align:center;">楼层编号</th>
                                <th style="text-align:center;">单打操作</th>
                                <th style="text-align:center;">多打操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${allGlasseshtml}
                        </tbody>
                    </table> 
            </div>
            <div class="modal fade" id="myModal-pattern" tabindex="-1"
                role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true" data-backdrop="static">&times;</button>
                            <h3 class="modal-title" id="myModalLabel"
                                style="font-weight: bolder;">打印类型</h3>
                        </div>
                        <form class="form-horizontal" action="${ctx}/device/modifyPattern"
                            method="post" role="form" id="category_add">
                            <input type="hidden" id="pattern_id" name="line" >
                            
                            <div class="form-group">
                                <h4>
                                    <label class="col-sm-3 control-label no-padding-right"
                                        style="font-weight: bolder;"> 打印类型</label>
                                </h4>
                                <div class="col-sm-9">
                                    <select class='form-control' name="pattern"
                                        id="pattern" style="width: 250px; font-size: 15px">
                                        <option>单片打印</option>
                                        <option>全部打印</option>
                                        <option>不打印</option>
                                    </select>
                                </div>
                            </div>
 
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default btn-lg"
                                    data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary btn-lg"
                                    id="searchsubmit">提交</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            
            <div class="modal fade" id="printalone" tabindex="-1" role="dialog"
                aria-labelledby="myModalLabel" aria-hidden="true">
                <form class="form-horizontal" role="form">
                    <div class="modal-dialog">
                        <div class="modal-content">
                        <input type='hidden' id = "lineprint">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">&times;</button>
                                <h3 class="modal-title" id="myModalLabel">提示信息</h3>
                            </div>
                            <div class="modal-body" style="text-align: left;">
                                <h3>您确定要打印单片的玻璃标签么?</h3>
                            </div>
                            <div class="modal-footer">
 
                                <button type="button" class="btn btn-default btn-lg"
                                    data-dismiss="modal">取消</button>
 
                                <button type="button" class="btn btn-primary btn-lg"
                                    id="allprint">确认</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal fade" id="printall" tabindex="-1" role="dialog"
                aria-labelledby="myModalLabel" aria-hidden="true">
                <form class="form-horizontal" role="form">
                    <div class="modal-dialog">
                        <div class="modal-content">
                        <input type='hidden' id = "lineprint">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">&times;</button>
                                <h3 class="modal-title" id="myModalLabel">提示信息</h3>
                            </div>
                            <div class="modal-body" style="text-align: left;">
                                <h3>您确定要打印此类单片的所有玻璃标签么?</h3>
                            </div>
                            <div class="modal-footer">
 
                                <button type="button" class="btn btn-default btn-lg"
                                    data-dismiss="modal">取消</button>
                                <button type="button" class="btn btn-primary btn-lg"
                                    id="allprinttwo">确认</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            
            <div id="modifyPortModal"  class="modal fade"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
            <form id="modifyGlassCountForm" method="post" class="form-horizontal"  style="background-color:white;width:400px;margin:50px auto;">
            <div class="modal-header"> 
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 class="modal-title" id="myModalLabel">打印次数</h3>
            </div>
            <div class="modal-body"  style="background-color:white;text-align:center;">
                <div class="control-group" >
                    <div class="controls">
                        <input type="text"  id="CountInput" name="glasscount" class="required" placeholder="glasscount">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">确定打印</button>
                <button type="button" class="btn" data-dismiss="modal">关闭</button>
            </div>
        </form>
    </div>    
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</body>
</html>