严智鑫
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
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="com.northglass.Globel.mes"%>
<%@page import="com.northglass.SqlHelper.*"%>
<%@ 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}" />
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    
        <title>玻璃架查询</title>
        
        <style>
           th, td {
                    text-align: center;
                  
            }
            
           th{
              width:15%
           }
         </style>
      </head>
<body>
    <div class="content-wrapper">
        <div style="display:grid;grid-template-rows:40px auto auto;">
        <div>
        <h3 style="margin:auto auto 20px 0" id="head"></h3>
        </div>
        <div>
            <span>流程卡:</span>
            <input type="text"  id="input1"></input>
              
            <button style="margin-left:20px" onclick="ptl();" class="btn btn-primary" >打印</button>
       <button style="margin-left:50px" onclick="update();" class="btn btn-primary" >刷新<button>
        </div>
      
        <div id="tab" style="width:100%">
            <table   class="table table-striped table-hover" style="width:100%" >
                <thead>
                   <th>位置号</th>
                   <th>工程号</th>
                   <th>架号</th>
                   <th>流程卡</th>
                    <th>数量</th>
                   <th>打印</th>
                </thead>
                <tbody id="tbody">
                </tbody>
                
                
            </table>
        </div>
        
   </div>
        <script>
         <%
         try{
         String line=request.getParameter("line");      
        out.print("var ln="+(line==null?"null":line)+";\r\n");
         if(line!=null){
            
             org.json.JSONArray s= mes.getMesDBHelper().getTableToJson("SELECT stops,engineering_id,drop_frame,processcard_id,processcard_count,finsh_count FROM gmms_drop_frame where state='使用中' and groups="+line, false);
               if(s==null)
                   out.print("var data=null;\r\n");
               else
            out.print("var data="+s.toString()+";\r\n");
             }
         }
         catch(Exception e){
             out.print("var data=null;\r\n");
         }        
    %>
    
        function update(a){
            window.location.reload();
            if(a==1){
                setTimeout(
                        function(){
                            update(1);
                        },
                        20000);
            }
        }
    
    
        function pt(bt){
            var liuchengka= bt.parentNode.parentNode.children[3].innerText;
            var gc= bt.parentNode.parentNode.children[1].innerText;
            var jh=bt.parentNode.parentNode.children[2].innerText;
            var ss=liuchengka.split('/');
            var str="http://10.12.0.104:8080/GERP/pp/liuchengkaguanlis/HTML/liuchengkadayin.jsp?lckh="+ss[0]+"/&dyfs="+ss[1]+"/&lckjh="+jh+"/&xingming=&gongchenghao="+gc;
            window.open(str);
            $.ajax(
            {
                async:false,
                type:"post",
                url:"/gmms2/mesview/data/_service",
                data:{
                    m:"leng_print",
                    p:liuchengka
                },
                success:function(data){
                    var js= JSON.parse(data);
                    if(js.result!="ok"){
                        alert("提示:"+js.result);
                    }
                },
                error:function(data){
                    alert("汇报出错:"+data);
                }
            }        
            );
        }
        
         function create(){
                var dk= document.getElementById("head");
                dk.innerText=ln+"号线流程卡打印";
                 if(data!=null ){
                     var tb=document.getElementById("tbody");
                 
                     tb.innerHTML=null;
                     for(var i=0;i<data.length;i++){
                         var tr=document.createElement("tr");
                         for(var j=0;j<4;j++){
                             var    td=document.createElement("td");
                             td.innerText=data[i][j];
                             tr.appendChild(td);
                         }
                        tdd=document.createElement("td");
                        tdd.innerText=""+data[i][5]+'/'+data[i][4];
                        tr.appendChild(tdd);
                         var td1=document.createElement("td");
                         if(data[i][4]<=data[i][5]){
                             td1.innerHTML="<button onclick='pt(this);' style='background-color:red' class='btn btn-primary'>打印</button>";
                         }
                         else
                         td1.innerHTML="<button onclick='pt(this);' class='btn btn-primary'>打印</button>";
                         tr.appendChild(td1);
                         tb.appendChild(tr);
                     }                 
                     
                 }
                setTimeout(
                        function(){
                            update(1);
                        },
                        20000);
         }    
         create(); 
        </script>
</body>
</html>