廖井涛
2025-05-27 d687ff755f0f3022dcd1f57a03104b0e91536ab3
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
<%@ 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>
            <span>流程卡:</span>
            <input type="text"  id="input1"></input>
            <button class="btn btn-primary" onclick="select();">查询</button>
            <button style="margin-left:50px" onclick="comit();" 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>
                </thead>
                <tbody id="tbody">
                </tbody>
                
                
            </table>
        </div>
        
   </div>
        <script>
         <%
        //String liuchengka=request.getParameter("line");
         DBSession sn=null;
         try{
         String line=mes.getSession("gmms_groups");
         System.out.println("l="+line);
         String liuchengka=request.getParameter("liuchengka");
 
         out.print("var line="+line +";");
        sn=mes.getMesDBHelper().createSession(false);
        sn.createStdCall("web_show_zhewan",2);
        org.json.JSONArray arr=sn.stdCall(line,liuchengka).resultToJson(false);
        out.print("var data=");
        out.print(arr.toString());
        out.print(";\r\n");
        sn.close();
         }
         catch(Exception e){
             e.printStackTrace();
         }
        
    %>
    
 
         function create(){
                 if(data!=null && data!=undefined){
                     var datas=[];
                     var last=null;
                     for(var i=0;i<data.length;i++){
                         var a=data[i];
                         if(last==null){
                             last=[
                                 a[0],a[1],a[2],
                                 1
                             ];
                             datas.push(last);
                         }
                         else{
                             if(a[1]==last[1] && a[2]==last[2]){
                                 last[3]++;
                             }
                             else{
                                 last=[
                                         a[0],a[1],a[2],
                                         1
                                     ];
                                     datas.push(last);
                             }
                         }
                     }
                     var tb=document.getElementById("tbody");
                     tb.innerHTML=null;
                     for(var i=0;i<datas.length;i++){
                         var tr=document.createElement("tr");
                        var td1=document.createElement("td");
                         td1.innerText=(i+1);
                         tr.appendChild(td1);
                        for(var j=0;j<4;j++){
                             var td=document.createElement("td");
                             td.innerText=datas[i][j];
                             tr.appendChild(td);
                         }
                         tbody.appendChild(tr);
                     }
                 }
         }
         function selectAll(td){
             td.parentNode.children[0].value=td.parentNode.parentNode.children[3].innerText;
         }
         create();
  
         
        
         
        </script>
</body>
</html>