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
<%@ 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>
<script>
    setInterval(function(){
        Initialize();
    },1000); 
<%String lines = request.getParameter("line");
out.print("var line='" + lines + "';\r\n");%>
    
    Initialize();
    function Initialize() {
        
        loadDataRack();
    }
    function loadDataRack() {
        $.ajax({
            cache : false,
            type : "POST",
            dataType : "json",
            url : "${ctx}/loadTask/loadRackLine",
            data : {
                "line" : line
            },
            success : function(data) {
                console.log(data);
                var LoadRackshtml = "";
                $('#loaddata').remove();
                $('#Table_Load').append("<tbody id='loaddata'></tbody>");
                for (var i = 0; i < data.length; i++) {
                    var row = data[i];
                    
                    LoadRackshtml+="<tr><td style=\"text-align: center;\"><input class=\"loadcheckboxs\" type=\"checkbox\" /></td>";
                    LoadRackshtml+="<td class=\"RackId\">"+row.id+"</td>";
                    if(row.id%2!=0){
                        LoadRackshtml+="<td rowspan='2'>"+row.rackName+"</td>";
                        LoadRackshtml+="<td rowspan='2'>"+row.machineLoad.workState+"</td>";
                    }                                                        
                    LoadRackshtml+="<td>"+row.number+"</td>";
                    LoadRackshtml+="<td>"+row.state+"</td>";
                    if(row.outTasks==undefined||row.outTasks==null){
                        LoadRackshtml+="<td><input style=\"width:70px;\" class=\"OutTaskId\" type=\"text\" value=''/></td>";
                        LoadRackshtml+="<td></td>";
                        LoadRackshtml+="<td></td>";
                        LoadRackshtml+="<td style=\"width:100px;\"></td>";
                        LoadRackshtml+="<td style=\"width:100px;\"></td>";
                        LoadRackshtml+="<td></td>";
                        LoadRackshtml+="<td></td>";
                    }else{
                        LoadRackshtml+="<td><input style=\"width:70px;\" class=\"OutTaskId\" type=\"text\" value='"+row.outTasks.taskId+"'/></td>";
                        LoadRackshtml+="<td>"+row.outTasks.stockName+"</td>";
                        LoadRackshtml+="<td>"+(row.outTasks.planLoadNum1+row.outTasks.planLoadNum2+row.outTasks.planLoadNum3)+"</td>";
                        LoadRackshtml+="<td style=\"width:100px;\">"+row.outTasks.stockNum+"</td>";
                        LoadRackshtml+="<td style=\"width:100px;\">"+row.outTasks.posunCount+"</td>";
                        LoadRackshtml+="<td>"+row.outTasks.machineStatus+"</td>";
                        LoadRackshtml+="<td>"+row.outTasks.workStatus+"</td>";
                    }
                    
                    LoadRackshtml+="<td>"+"</td>";
                    LoadRackshtml+="<td>"+"</td>"
                             + "</tr>";
                }
                $('#loaddata').append(LoadRackshtml);
            }
        });
}
</script>
<title>上片任务管理</title>
<style type="text/css">
* {
    padding: 0px;
    margin: 0px;
    font-family: "microsoft yahei", "Helvetica Neue", Helvetica, Arial,
        sans-serif;
}
 
#Top {
    display: block;
    padding: 5px;
    padding-left: 6px;
    padding-right: 15px;
    line-height: 22px;
    /* border-left: 5px solid #15c142; */
    border-radius: 0 2px 2px 0;
    background-color: #f2f2f2;
}
 
.btn {
    height: 35px;
    line-height: 35px;
    background-color: #0dc316;
    padding: 0 15px;
    color: #fff;
    border: none;
    border-radius: 2px;
}
 
.Rowbtn {
    height: 20px;
    line-height: 20px;
    background-color: #0dc316;
    padding: 0 15px;
    color: #fff;
    border: none;
    border-radius: 2px;
}
 
#Table_Minche thead tr {
    background-color: #00BFFF;
    font-weight: 800;
}
 
#Table_Minche thead td {
    border: 1px solid #00BFFF;
}
 
#Table_Minche td {
    border: 1px solid #f2f2f2;
    height: 20px;
    line-height: 20px;
    padding: 3px 6px 3px 6px;
}
 
.dtable thead tr {
    background-color: #00BFFF;
    font-weight: 800;
}
 
.dtable thead td {
    border: 1px solid #00BFFF;
}
 
.dtable td {
    border:1px solid #f2f2f2;
    text-align:center;
    padding:5px 5px 5px 5px;
}
</style>
</head>
<body>
    <div class="content-wrapper" style="background-color: white;">
        <!--         <section class="content-header"></section> -->
        <section class="content container-fluid">
            <div id="Top">
                <button class="btn" onclick="Updates()">绑定任务</button>
                <button class="btn" style="margin-left:10px;" onclick="loadTaskStusts('铁架已到二次接力')">铁架已到二次接力</button>
                <button class="btn" style="margin-left:10px;" onclick="loadTaskStusts('铁架已到上片位')">铁架已到上片位</button>                
                <button class="btn" style="margin-left:10px;" onclick="loadTaskStusts('上片完成请求退回')">上片完成请求退回</button>
                <button class="btn" style="margin-left:10px;" onclick="loadTaskStusts('铁架退回二次接力')">铁架退回二次接力</button>
                <button class="btn" style="margin-left:10px;" onclick="loadTaskStusts('等待退回库区')">等待退回库区</button>
            </div>
            <div>
                
                <div style="margin-top: 10px;margin-bottom: 30px;">
                    <table id="Table_Load" class="dtable"
                        style="width: 100%; min-width: 1200px; border-collapse: collapse; border-spacing: 0;">
                        <thead>
                            <tr>
                                <td style="text-align: center;">选择</td>
                                <td>ID</td>
                                <td>机器</td>
                                <td>上片机状态</td>
                                <td>工位编号</td>
                                <td>状态</td>
                                <td>任务ID</td>
                                <td>架号</td>
                                <td>待上数量</td>
                                <td>已上片数量</td>
                                <td>破损数量</td>
                                <td>MES状态</td>
                                <td>任务状态</td>
                                <td>启用状态</td>
                                <td>操作</td>
                            </tr>
                        </thead>
                        <tbody id="loaddata">
                        </tbody>
                    </table>
                </div>
                
            </div>
        </section>
    </div>
</body>
</html>