dnIn.jsp
15.1 KB
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
<%@ page import="com.myproject.util.StorageConstants" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.box{
margin-top: 10px;
}
.alert{
padding:8px;
}
.partnumber-box{
height: 100px;text-align: center;
padding-top:35px;
margin-bottom:10px;
font-size: 16px;
vertical-align: middle;
word-wrap:break-word ;
cursor: pointer;
}
.table-scrollable{
overflow-y: auto;
}
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="alert alert-success" id="msg">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<div>
<span id="currentOp"> </span>
<%--当前料架:<span id="vmiRFID"></span>--%>
</div>
</div>
<ul class="nav nav-tabs">
<li class="active">
<a href="#portlet_tab_1" data-toggle="tab" id="dnTab">
DN单收料</a>
</li>
<li class="">
<a href="#portlet_tab_2" data-toggle="tab" id="facilityTab">
Facility收料</a>
</li>
<%--<li class="">--%>
<%--<a href="#portlet_tab_3" data-toggle="tab" id="inTab">--%>
<%--纯入库</a>--%>
<%--</li>--%>
</ul>
</div>
<div class="portlet-body">
<div class="tab-content">
<div class="tab-pane active" id="portlet_tab_1">
<div class="row">
<div class="col-md-5 col-sm-5">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="DN单"/></span>
<input type="text" class="form-control input-xlarge" id="scan-dn" value=""/>
</div>
</div>
</div>
<div class="col-md-3 col-sm-3">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="料架"/></span>
<input type="text" class="form-control input-small" id="dnRfid"/>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4">
<button type="button" class="btn green margin-top-10 " onclick="bindDn('DN')"><i class="fa fa-sign-in"></i><fmt:message key="绑定"/></button>
</div>
</div>
</div>
<div class="tab-pane" id="portlet_tab_2">
<div class="row">
<div class="col-md-5 col-sm-5">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="Facility"/></span>
<select class="form-control input-xlarge" data-placeholder="Select..." id="facility">
<option value=""></option>
<option value="S5-BACHS">S5-BACHS</option>
<option value="S9-BACHS">S9-BACHS</option>
<option value="SC-BACHS">SC-BACHS</option>
<option value="SI-BACHS">SI-BACHS</option>
<option value="SL-BACHS">SL-BACHS</option>
<option value="SP-BACHS">SP-BACHS</option>
<option value="SS-BACHS">SS-BACHS</option>
<option value="ST-BACHS">ST-BACHS</option>
<option value="S4-BACHOS">S4-BACHOS</option>
<option value="S7-BACHOS">S7-BACHOS</option>
<option value="S9-BACHOS">S9-BACHOS</option>
<option value="SB-BACHOS">SB-BACHOS</option>
<option value="SE-BACHOS">SE-BACHOS</option>
<option value="SJ-BACHOS">SJ-BACHOS</option>
<option value="SN-BACHOS">SN-BACHOS</option>
<option value="SU-BACHOS">SU-BACHOS</option>
<option value="SW-BACHOS">SW-BACHOS</option>
<option value="SZ-BACHOS">SZ-BACHOS</option>
</select>
</div>
</div>
</div>
<div class="col-md-3 col-sm-3">
<div class="form-group form-inline">
<div class="input-group margin-top-10">
<span class="input-group-addon"><fmt:message key="料架"/></span>
<input type="text" class="form-control input-small" id="facilityRfid"/>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4">
<button type="button" class="btn green margin-top-10" onclick="bindDn('Facility')"><i class="fa fa-sign-in"></i><fmt:message key="绑定"/></button>
</div>
</div>
</div>
<div class="tab-pane" id="portlet_tab_3">
</div>
<div class="">
<div class="table-scrollable" style="height:400px;">
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info">
<thead class="dataTableHeader">
<tr role="row">
<%--<th><fmt:message key="DN单号"/></th>--%>
<%--<th><fmt:message key="Facility"/></th>--%>
<%--<th><fmt:message key="Company"/></th>--%>
<%--<th><fmt:message key="料号"/></th>--%>
<%--<th><fmt:message key="已收/DN单数量"/></th>--%>
<%--<th><fmt:message key="差异"/></th>--%>
<%--<th><fmt:message key="DN单日期"/></th>--%>
<%--<th><fmt:message key="首盘日期"/></th>--%>
</tr>
</thead>
<tbody class="dataTableBody">
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
<%--<td></td>--%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<c:set var="scripts" scope="request">
<script type="text/javascript">
function showMsg(msg){
if(msg == ""){
$("#msg").attr("class","");
$("#msg").text("");
}else{
var error = true;
if(msg.indexOf("OK") == 0){
error = false;
msg = msg.substr(2);
}
if(msg.indexOf("0") == 0){
error = false;
msg = msg.substr(1);
}
if(msg.indexOf("x") == 0){
msg = msg.substr(1);
}
if(error){
$("#msg").attr("class","alert alert-danger");
}else{
$("#msg").attr("class","alert alert-success");
}
$("#msg").text(msg);
}
}
flushVmiRfid = function(){
$.post("${ctx}/service/store/qisda/getVmiRfid", {}, function (rfid) {
$("#vmiRFID").html(rfid);
});
}
flushDnItems = function(){
$.post("${ctx}/service/store/qisda/dnInfo", {}, function (dnInfo) {
$(".dataTableBody").html("");
if(dnInfo){
var currentOp = "当前操作: "+ dnInfo.showStr;
if(currentOp != $("#currentOp").text()){
$("#currentOp").text(currentOp);
}
var data = dnInfo.items;
var thread = "";
if(dnInfo.cisIn){
//纯入料
}else if(dnInfo.facility){
//facility入料
thread = " <tr> " +
"<th>Facility</th>"+
"<th>Company</th>"+
"<th>料号</th>"+
"<th>已收数量</th>"+
"</tr>";
}else{
//DN单入料
thread = " <tr> " +
"<th>DN单号</th>"+
"<th>Facility</th>"+
"<th>Company</th>"+
"<th>料号</th>"+
"<th>已收/DN单数量</th>"+
"<th>差异</th>"+
"<th>DN单日期</th>"+
"<th>首盘日期</th>" +
"</tr>";
}
$(".dataTableHeader").html(thread);
for(var item in data){
var dnNo = data[item].dnNo;
var fac = data[item].facility;
var company = data[item].company;
var pn = data[item].pn;
var dnQty = data[item].dnQty;
var inQty = data[item].inQty;
var diff = inQty - dnQty;
var diffColor = "";
if(diff < 0){
diffColor = "bg-red";
}else if(diff > 0){
diffColor = "bg-yellow";
}
var inNum = data[item].inNum;
var dnDateStr = data[item].dnDateStr;
var firstReelDateStr = data[item].firstReelDateStr;
var tdStr = "";
if(dnInfo.cisIn){
//纯入料
}else if(dnInfo.facility){
tdStr =
"<td>"+fac+"</td>"+
"<td>"+company+"</td>"+
"<td>"+pn+"</td>"+
"<td>"+inQty+ "</td>";
}else{
tdStr =
"<td>"+dnNo+"</td>"+
"<td>"+fac+"</td>"+
"<td>"+company+"</td>"+
"<td>"+pn+"</td>"+
"<td>"+inQty+"/" + dnQty +"</td>"+
"<td class='"+diffColor+"'>"+ diff +"</td>"+
//"<td>"+inNum+"</td>"+
"<td>"+dnDateStr+"</td>"+
"<td>"+firstReelDateStr+"</td>";
}
var trStr = "<tr>" + tdStr+ "</tr>";
$(".dataTableBody").append(trStr);
}
}
});
}
bindDn = function(type){
var params = {};
var useRFID = "";
if(type == 'DN'){
var dnNo = $("#scan-dn").val().trim();
if(dnNo == ''){
showMsg("DN单不能为空");
return;
}else{
params["dnNo"] = dnNo;
var dnRfid = $("#dnRfid").val();
params["rfid"]=dnRfid;
$("#dnRfid").val("");
$("#scan-dn").val("");
}
}else if(type == 'Facility'){
var facility = $("#facility").val();
params["facility"] = facility;
var facilityRfid = $("#facilityRfid").val();
params["rfid"]=facilityRfid;
$("#facilityRfid").val("");
$("#facility").val("");
}else{
}
params["stopCurrent"]=true;
$.post("${ctx}/service/store/qisda/bindDn", params, function (data) {
if(data.indexOf("c") == 0){
data = data.substr(1);
return stopConfirm(params,data);
}else{
showMsg(data);
return true;
}
});
}
stopConfirm = function(params, msg){
params["stopCurrent"]=true;
Lobibox.confirm({
//title: "${msg_title}",
msg: msg,
callback: function ($this, type, ev) {
if(type == 'yes'){
$.post("${ctx}/service/store/qisda/bindDn", params, function (data) {
showMsg(data);
return true;
});
}
return false;
}
});
}
setInterval(function(){
//flushVmiRfid();
flushDnItems();
}, 1000);
</script>
</c:set>