guoyuji
2023-10-08 7dbbcd0e54b4094e9f2b620197147e69911669c6
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
<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="ng.db.DBHelper"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
 
<html>
<head>
<link rel="stylesheet" href="../static/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="../static/AdminLTE/bower_components/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="../static/AdminLTE/bower_components/Ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="../static/AdminLTE/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="../static/AdminLTE/dist/css/skins/skin-blue.min.css">
 
<link rel="stylesheet" href="../static/css/element.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
    
<script type="text/javascript">
/*   var interval = setInterval('refreshStatus()', 20000);
   $(document).ready(function(){
        var info = $("#info").attr("info");
        $("#infos").html(info);
   }); */
  // 设备页面自动刷新
/*    function refreshStatus() {
    window.location.reload();
   } 
  // 停止页面自动刷新
  function disableAutoRefresh() {
    clearInterval(interval);
   } */
  
 
 
 
</script>
<style>
    .box table tr th,.box table tr td{
        text-align:center;
    }
</style>    
<title>任务</title>
</head>
<body style="padding: 20px;background-color:#D5EAFF;height:100%">
    <div id='app'>
    <!-- <div style='height:20px;width:300px;background-color:#3C8DBC;float:right;'><span style = 'color:#fff;' >故障情况:</span><span id='infos'></span></div> -->
        <section class="content-header" style="padding: 0px 15px 0 15px;">
            <h1 @dblclick="dangqianpeifang()">订单任务&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h1>
            
            <ol class="breadcrumb">
            
                
                </a></li>
            </ol>
        </section>
    
    <div id = "allstatu" ></div>
           <div id = "info" ></div>
        <!-- Main content -->
            <input style="display:none" type="text" name="groups" value="${groups}" />
        <section class="content container-fluid" style="padding: 0px;">
            <div>        
            </div>
            
            <div class="box" style="height: 600px; overflow: auto;margin-top: 10px;">
                    <table class="table table-striped table-hover"
                        style="overflow-x: auto;font-size: 12px;">
                        <thead>
                            <tr>
                                <th>项目名称</th>
                                <th>原片宽度</th>
                                <th>原片高度</th>
                                <th>小片宽度</th>
                                <th>小片高度</th>
                                <th>厚度</th>
                                <th>原片总数量</th>
                                <th>原片已加工数量</th>
                                <th>小片总数量</th>
                                <th>小片已加工数量</th>
                                <th>订单状态</th>
                                <th>制单人</th>
                                <th>操作</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="item in shuzu" style="height: 51px;">
                                <td>{{item['1_order_id']}}</td>
                                <td>{{item['2_original_width']}}</td>
                                <td>{{item['3_original_height']}}</td>
                                <td>{{item['4_width']}}</td>
                                <td>{{item['5_height']}}</td>
                                <td>{{item['6_thickness']}}</td>
                                <td>{{item['7_largeglass_no']}}</td>
                                <td>{{item['8_largeglass_completed']}}</td>
                                <td>{{item['9_smallglass_no']}}</td>
                                <td>{{item['10_smallglass_completed']}}</td>
                                <td v-if="item['11_order_status']==1">
                                    已下发
                                </td>
                                <td v-else-if="item['11_order_status']==2">
                                    已领取
                                </td>
                                <td v-else-if="item['11_order_status']==3">
                                    已完成
                                </td>
                                <td v-else-if="item['11_order_status']==4">
                                    手动完成
                                </td>
                                <td v-else>
                                     
                                     
                                </td>
                                <td>{{item['12_order_maker']}}</td>
                                <td  v-if="item['11_order_status']==1">
                                    <button @click="dainjishijian('领取任务',item['0_id'])" style='background-color: #5CADFE' class='btn btn-large btn-success' >领取任务</button>
                                    &nbsp;&nbsp;&nbsp;
                                    <button @click="dainjishijian('手动完成',item['0_id'])" style='background-color: #5CADFE' class='btn btn-large btn-success' >手动完成</button>
                                </td>
                                <td  v-else-if="item['11_order_status']==2">
                                    
                                    <button @click="dainjishijian('结束任务',item['0_id'])" style='background-color: red' class='btn btn-large btn-success' >结束任务</button>
                                    &nbsp;&nbsp;&nbsp;
                                    <button @click="dainjishijian('取消任务',item['0_id'])" style='background-color: #5CADFE' class='btn btn-large btn-success' >取消任务</button>
                                </td>
                                <!-- <td  v-else-if="item[11]==2">
                                    <button @click="dainjishijian('重新下发',item[0])" style='background-color: #5CADFE' class='btn btn-large btn-success' >重新下发</button>
                                </td> -->
                                <td v-else>
                                    
                                </td>
                            </tr>
                        </tbody>
                    </table>
            </div>
            
            <div class="modal fade" id="modify-info" 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" @click='renwuguanliquxiao' class="btn btn-default btn-lg"
                                    data-dismiss="modal">取消</button>
 
                                <button id="dianjishijian" @click='getMSg' type="button" class="btn btn-primary btn-lg"
                                    id="surefinish">确认</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            
            
            <div class="modal fade" id="modify-infos" tabindex="-1" role="dialog"
                aria-labelledby="myModalLabel" aria-hidden="true" style="height: 600px;">
                
                    <div class="modal-dialog" >
                        <div class="modal-content" >
                        <table class="table table-striped table-hover"
                        style="overflow-x: auto;font-size: 12px;">
                        <thead>
                            <tr>
                                <th>机器编号</th>
                                <th>机器名称</th>
                                <th>配方类型</th>
                                <th>配方值</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="item in shuzu2">
                                <td>{{item['0_id']}}</td>
                                <td>{{item['1_machine_name']}}</td>
                                <td>{{item['2_class_html']}}</td>
                                <td>{{item['3_content_value']}}</td>
                                
                            </tr>
                        </tbody>
                    </table>
                    <div class="modal-footer">
                                <button type="button" class="btn btn-default btn-lg"
                                    data-dismiss="modal">关闭</button>
                                        <button v-if="peifanhao[0]['0_recipe_no']!=null" id="tiebiaoji" @click="peifangxiafa(2)" type="button" class="btn btn-primary btn-lg"
                                        id="tiebiaoji">贴标机数据下发</button>
                                        <button v-if="peifanhao[0]['0_recipe_no']!=null" id="peifangxiafa" @click="peifangxiafa(1)" type="button" class="btn btn-primary btn-lg"
                                        id="peifangxiafa">配方下发</button>
                                    
                                
                            
                            </div>
                        </div>
                        
                    </div>
                
            </div>
            
        </section>
        <!-- /.content -->
    </div>
<script src="../js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="../static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="../js/vue.min.js"></script>
  <script src="../js/axios.min.js"></script>
<script src="../js/mixins.js"></script>
 
<script>
Vue.prototype.$http= axios
 let app = new Vue({
      el:'#app',
      mixins:[mixin],
      data:{
          shuzu:[],
          shuzu1:[],
          shuzu2:[],
          lines:<%= request.getParameter("id") %>,
          peifanhao:[{}],
          subval:{
              id:'',
              type:''
          }
      },
      methods:{
          dangqianpeifang(){
             
              this.shuzu2="";
              let sql="{call AXJ_a_get_machine_recipe_select()}";
              let flag=2;
              this.loadAjxss('任务查询成功',sql,flag,"shuzu2"); 
              let sql1="{call AXJ_qiegeguanli_peifanghao_cahxun1()}";
              this.loadAjxss('配方号查询',sql1,2,"peifanhao")
              
              $("#modify-infos").modal('show');
          },
           dainjishijian(type,id){
              $("#modify-info").modal('show');
               if(type=="领取任务"){
                  this.subval.type=2;
              }else if(type=="结束任务"){
                  this.subval.type=3;
              }else if(type=="手动完成"){
                  this.subval.type=4;
              }else if(type=="取消任务"){
                  this.subval.type=1;
              }
               this.subval.id=id
               let para={
                       ids:id
               }
               let sql="{call AXJ_qiegeguanli_peifanghao_cahxun(?,?)}~"+JSON.stringify(para);
                this.loadAjxss('配方号查询',sql,2,"peifanhao")
          },
          getMSg(){
              //this.getMSgs();
             
              this.renwuguanli();
          },
          getMSgs(){
              return new Promise((resolve, reject) => {
                  // 发送第一个请求,获取 id
                  sql="{call AXJ_qiegeguanli_threelinetask_renwuguanli(?,?,?)}~"+JSON.stringify(this.subval);
                  let param = new URLSearchParams(); 
                  param.append("gongneng",'任务修改');
                  param.append("sql",sql);
                  param.append("flag",1);
                  param.append("anquanma",json["anquanma"]);
                  
                  this.$http.post('../mysqlInsert/mysql.jsp',param).then(( datas ) => {
                     let result=datas.data;
                     index = result.indexOf("[[");
                     if(index>-1){
                          if(result.indexOf("[[anquanmaerr]]")>-1){
                                //alert('请先登录后操作');
                                window.parent.location.href='../login/index.jsp';
                          }else{
                              result=result.substring(index).trim()
                              alert(result);
                              resolve();
                              window.location.reload();
                          }
                      }else{
                          alert("任务修改成功!")
                          resolve();
                          window.location.reload();
                          
                      } 
                    }).catch(err => {
                      console.log(err.msg);
                    });
                })
          },
          renwuguanli(){
              this.getMSgs().then(() => {
                  let param = new URLSearchParams(); 
                  param.append("zt",this.subval.type); 
                  param.append("peifanhao",this.peifanhao[0]['0_recipe_no']);
                  param.append("changpinghao",this.peifanhao[0]['1_changpinghao']);
                  param.append("way_of_working",this.peifanhao[0]['2_way_of_working']);
                  param.append("thickness",this.peifanhao[0]['3_thickness']);
                  param.append("glass_type",this.peifanhao[0]['4_glass_type']);
                  param.append("production_type",this.peifanhao[0]['5_production_type']);
                 this.$http.post( '../mysqlInsert/toPlc.jsp',param)
                  .then(function (response) {
                        console.log(response);
                   })
                   
                    .catch(function (error) {
                        alert('Error: ' + "服务器机器连接发生错误!"); 
                    });  
              })
          },
          peifangxiafa(leixing){
              if(leixing=1){
                  let param = new URLSearchParams(); 
                  param.append("zt",98); 
                  param.append("peifanhao",this.peifanhao[0]['0_recipe_no']);
                 this.$http.post( '../mysqlInsert/toPlc.jsp',param)
                  .then(function (response) {
                        console.log(response);
                   })
                   
                    .catch(function (error) {
                        alert('Error: ' + "服务器机器连接发生错误!"); 
                    });  
              }else if(leixing=2){
                  let param = new URLSearchParams(); 
                  param.append("zt",99); 
                  param.append("peifanhao",this.peifanhao[0]['0_recipe_no']);
                  param.append("changpinghao",this.peifanhao[0]['1_changpinghao']);
                  param.append("way_of_working",this.peifanhao[0]['2_way_of_working']);
                  param.append("thickness",this.peifanhao[0]['3_thickness']);
                  param.append("glass_type",this.peifanhao[0]['4_glass_type']);
                  param.append("production_type",this.peifanhao[0]['5_production_type']);
                 this.$http.post( '../mysqlInsert/toPlc.jsp',param)
                  .then(function (response) {
                        console.log(response);
                   })
                   
                    .catch(function (error) {
                        alert('Error: ' + "服务器机器连接发生错误!"); 
                    });  
              }
                  
              
          },
          renwuguanliquxiao:function(){
              this.subval='';
          }
          
      },
      mounted:function(){
         let canshu={
                 line:<%= request.getParameter("id") %>
         }
         this.shuzu="";
          let sql="{call AXJ_qiegeguanli_threelinetask_list1()}";
         let flag=2;
         this.loadAjxss('任务查询成功',sql,flag,"shuzu"); 
         /* sql="{call AXJ_qiegeguanli_peifanghao_cahxun()}";
         loadAjxs('配方号查询',sql,flag,"peifanhao");  */
      }
 
})
 </script>
</body>
</html>