storagePosFind.jsp
18.6 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
363
364
365
366
367
368
<%@ page import="com.myproject.webapp.controller.webService.DataCache" %>
<%@ page import="java.util.Date" %><%--
Created by IntelliJ IDEA.
User: kangmor
Date: 2015/12/4
Time: 9:28
To change this template use File | Settings | File Templates.
--%>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<c:if test="${screen != 'tablet'}">
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<fmt:message key="menu.findout"/>
</h3>
</c:if>
<!-- BEGIN PAGE CONTENT-->
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<c:if test="${screen != 'tablet'}">
<div class="portlet-title">
<div class="caption">
<%--<i class="fa fa-list-alt"></i><fmt:message key="component.list"/>--%>
</div>
<div class="tools">
</div>
</div>
</c:if>
<div class="portlet-body">
<!-- 正常展示-->
<c:if test='<%=!DataCache.isProductionFor("ChengDuKaiTian") %>'>
<form:form commandName="searchCriteria" class="form-horizontal form-bordered" id="searchCriteria"
action="storagePosFind.html">
<div class="form-group">
<label class="control-label col-md-1"><fmt:message key="inOutList.type"/></label>
<div class="col-md-2">
<form:select path="type" class="form-control">
<form:option value="-1"><fmt:message key="select.all"/></form:option>
<form:option value="0"><fmt:message key="inOutList.type.component"/></form:option>
<form:option value="1"><fmt:message key="inOutList.type.solder"/></form:option>
<form:option value="2"><fmt:message key="inOutList.type.pcb"/></form:option>
<form:option value="3"><fmt:message key="inOutList.type.others"/></form:option>
<form:option value="41"><fmt:message key="inOutList.type.solderFixture"/></form:option>
<form:option value="42"><fmt:message key="inOutList.type.pcbFixture"/></form:option>
</form:select>
</div>
<label class="control-label col-md-2"><fmt:message key="component.partNumber"/></label>
<input type="hidden" name="expire" value="${expire}"/>
<div class="col-md-2">
<div style="text-align:left">
<form:input id="name" path="name" class="form-control"/>
</div>
</div>
<label class="control-label col-md-1"><fmt:message key="barcode.barcode"/></label>
<div class="col-md-2">
<div style="text-align:left">
<form:input id="barcode" path="barcode" class="form-control"/>
</div>
</div>
<div class="col-md-2">
<button class="btn purple" type="submit"><i class="fa fa-search"></i><fmt:message key="button.search"/> </button>
</div>
</div>
</form:form>
<div class="table-toolbar">
<div class="col-md-4">
<div class="btn-group">
<button class="btn yellow" id="checkoutBtn">
<i class="fa fa-sign-out"></i><fmt:message key="storagePosFind.outSelect"/></button>
</div>
</div>
<div class="col-md-5">
<c:if test="${screen != 'tablet'}">
<div class="input-inline input-medium right">
<div class="input-group">
<input id="day" type="text" value="3" class="form-control" style="display: block;text-align:right;">
<span class="input-group-addon"><fmt:message key="storagePosFind.daysAgo"/></span>
<span class="input-group-btn">
<button class="btn green" type="button" id="inactionCheckOut"><i class="fa fa-check"></i><fmt:message key="storagePosFind.outInaction"/></button>
</span>
</div>
</div>
</c:if>
</div>
</div>
<div class="table-scrollable">
<c:set var="today" value="<%= new Date()%>"/>
<display:table name="searchCriteria.pageList" requestURI="storagePosFind.html" sort="external"
defaultsort="1" class="table table-striped table-bordered table-hover" export="true"
id="pos" >
<display:setProperty name="export.csv.filename" value="export.csv" />
<c:set var="alarmClass" value=""/>
<c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:if test="${pos.barcode.type == 2 && today >= pos.barcode.expireDate}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/>
<display:column title="<input type='checkbox' id='allCheck'/>" media="html">
<c:if test="${!limitCheckOut}">
<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>
</c:if>
</display:column>
<display:column titleKey="storagePosFind.index">${pos_rowNum}</display:column>
<display:column titleKey="component.partNumber" style="width: 15%;" sortProperty="barcode.partNumber" sortable="true" class="${alarmClass}">
${pos.barcode.partNumber}
</display:column>
<display:column titleKey="inOutList.type">
<c:if test="${pos.barcode.type == 0 || empty pos.barcode.type}"><fmt:message key="inOutList.type.component"/></c:if>
<c:if test="${pos.barcode.type == 1}"><fmt:message key="inOutList.type.solder"/></c:if>
<c:if test="${pos.barcode.type == 2}"><fmt:message key="inOutList.type.pcb"/></c:if>
<c:if test="${pos.barcode.type == 3}"><fmt:message key="inOutList.type.others"/></c:if>
<c:if test="${pos.barcode.type == 4}"><fmt:message key="inOutList.type.fixture"/></c:if>
</display:column>
<c:if test="${screen != 'tablet'}">
<display:column property="barcode.barcode" titleKey="barcode.barcode"/>
<display:column property="barcode.inFixture" titleKey="storagePosFind.inFixture"/>
<display:column property="barcode.providerNumber" titleKey="component.providerNumber"/>
<%--<display:column property="barcode.amount" titleKey="数量"/>--%>
<display:column property="barcode.lockName" titleKey="menu.inRule"/>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
</c:if>
<display:column titleKey="barcode.inStoreRemainTime" sortProperty="barcode.putInTime" sortable="true">
<c:if test="${pos.inStoreHour >= 1}">${pos.inStoreHour}<fmt:message key="solder.hour"/></c:if><c:if test="${pos.inStoreMiniute != 0}">${pos.inStoreMiniute}<fmt:message key="runStatus.minutes"/>
<c:if test="${pos.barcode.maxStorageTime != 0 }">
/${pos.barcode.maxStorageTime}<fmt:message key="solder.hour"/></c:if>
</c:if>
</display:column>
<display:column titleKey="component.amount">
<c:if test="${pos.barcode.type == 1 || pos.barcode.type == 4}">-</c:if>
<c:if test="${pos.barcode.type != 1 && pos.barcode.type != 4}">${pos.barcode.amount}</c:if>
</display:column>
<display:column titleKey="barcode.produceDate" sortProperty="barcode.produceDate" sortable="true">
<c:if test="${pos.barcode.type != 2}">-</c:if>
<c:if test="${pos.barcode.type == 2}"><fmt:formatDate value="${pos.barcode.produceDate}" pattern="yyyy-MM-dd"/></c:if>
</display:column>
<display:column titleKey="barcode.expireDate" sortProperty="barcode.expireDate" sortable="true">
<c:if test="${pos.barcode.type != 2}">-</c:if>
<c:if test="${pos.barcode.type == 2}"><fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/></c:if>
<%--<fmt:formatDate value="${pos.barcode.expireDate}" pattern="yyyy-MM-dd"/>--%>
</display:column>
<display:column titleKey="checkOut.operate" media="html">
<c:if test="${!limitCheckOut}">
<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
onclick="checkoutStorage('${pos.id}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</c:if>
</display:column>
<c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if>
</display:table>
</div>
</c:if>
<!-- 成都凯天-->
<c:if test='<%=DataCache.isProductionFor("ChengDuKaiTian") %>'>
<form:form commandName="searchCriteria" class="form-horizontal form-bordered" id="searchCriteria"
action="storagePosFind.html">
<div class="form-group">
<label class="control-label col-md-1"><fmt:message key="产品型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField2" class="form-control" value="${otherField2}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="组件型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField3" class="form-control" value="${otherField3}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="配套单号"/></label>
<div class="col-md-2">
<input type="text" name="otherField1" class="form-control" value="${otherField1}"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-1"><fmt:message key="元件型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField4" class="form-control" value="${otherField4}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="检验编号"/></label>
<div class="col-md-2">
<input type="text" name="otherField5" class="form-control" value="${otherField5}"/>
</div>
<div class="col-md-2">
<button class="btn purple" type="submit"><i class="fa fa-search"></i><fmt:message key="button.search"/> </button>
</div>
</div>
</form:form>
<div class="table-toolbar">
<div class="col-md-6">
<div class="btn-group">
<button class="btn yellow" id="checkoutBtn">
<i class="fa fa-sign-out"></i><fmt:message key="出库所选仓位"/></button>
</div>
</div>
<div class="col-md-6">
<c:if test="${screen != 'tablet'}">
<div class="input-inline input-medium right">
<div class="input-group">
<input id="day" type="text" value="3" class="form-control" style="display: block;text-align:right;">
<span class="input-group-addon">天前</span>
<span class="input-group-btn">
<button class="btn green" type="button" id="inactionCheckOut"><i class="fa fa-check"></i>呆滞料出库</button>
</span>
</div>
</div>
</c:if>
</div>
</div>
<div class="table-scrollable">
<display:table name="searchCriteria.pageList" requestURI="storagePosFind.html" sort="external"
defaultsort="1" class="table table-striped table-bordered table-hover" export="false"
id="pos">
<c:set var="alarmClass" value=""/>
<c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.maxStorageTime != 0 && pos.inStoreHour * 60 + pos.inStoreMiniute <= pos.barcode.warmTime * 60)}"/>
<display:column title="<input type='checkbox' id='allCheck'/>">
<c:if test="${!limitCheckOut}">
<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>
</c:if>
</display:column>
<display:column titleKey="序号">${pos_rowNum}</display:column>
<display:column property="barcode.barcode" sortProperty="barcode.barcode" sortable="true" titleKey="条码"/>
<display:column property="barcode.otherField2" sortProperty="barcode.otherField2" sortable="true" titleKey="产品型号"/>
<display:column property="barcode.otherField3" sortProperty="barcode.otherField3" sortable="true" titleKey="组件型号"/>
<display:column property="barcode.otherField1" sortProperty="barcode.otherField1" sortable="true" titleKey="配套单号"/>
<display:column property="barcode.otherField4" sortProperty="barcode.otherField4" sortable="true" titleKey="元件型号"/>
<display:column property="barcode.otherField5" sortProperty="barcode.otherField5" sortable="true" titleKey="检验编号"/>
<display:column property="barcode.otherField6" titleKey="备注"/>
<display:column property="barcode.amount" titleKey="数量"/>
<display:column property="barcode.lockName" titleKey="入库策略"/>
<display:column titleKey="在库/剩余时间" sortProperty="barcode.putInTime" sortable="true">
<c:if test="${pos.inStoreHour >= 1}">${pos.inStoreHour}小时</c:if><c:if test="${pos.inStoreMiniute != 0}">${pos.inStoreMiniute}分钟
<c:if test="${pos.barcode.maxStorageTime != 0 }">
/${pos.barcode.maxStorageTime}小时</c:if>
</c:if>
</display:column>
<display:column titleKey="checkOut.operate">
<c:if test="${!limitCheckOut}">
<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
onclick="checkoutStorage('${pos.id}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</c:if>
</display:column>
<c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if>
</display:table>
</div>
</c:if>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
<form method="get" action="${ctx}/service/store/checkout.html" id="checkoutForm">
<input type="hidden" name="pid" id="pid"/>
</form>
<c:set var="scripts" scope="request">
<script>
var limitCodes = "${limitCodes}".split(",");
for (i=0;i<limitCodes.length ;i++ ) {
var limitClass = ".limit"+limitCodes[i];
if(limitClass != ".limit"){
$(limitClass).remove();
}
}
$('#allCheck').change(function () {
var set = $("input[name=posIds]");
var checked = jQuery(this).is(":checked");
jQuery(set).each(function () {
if (checked) {
$(this).attr("checked", true);
} else {
$(this).attr("checked", false);
}
});
jQuery.uniform.update(set);
});
$("#checkoutBtn").click(function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked")){
str+=$(this).val()+";";
}
});
if(str != "") {
checkoutStorage(str);
}
});
$("#inactionCheckOut").click(function(){
var dayStr = $("#day").val();
var day = parseInt(dayStr);
if (isNaN(day))
{
alert("天数必须为数字");
return;
}
var result = confirm("确定要出库"+day+"天前(0天表示清空所有未指定批次的库存)的呆滞物料吗?");
if(result){
$.post("${ctx}/service/store/inactionCheckOut", {aid: "1",day:day}, function (data) {
alert(data);
});
}
});
function checkoutStorage(posId) {
var ids = posId.split(";");
for (var i=0;i<ids.length;i++)
{
$("#btn"+ids[i]).attr("disabled","true");
$("#check"+ids[i]).parent().attr("class","hide");
}
$.post("${ctx}/service/store/checkout.html", {pids: posId}, function (data) {
alert(data);
});
}
jQuery(".alarmItem").pulsate({
color: "#bf1c56"
});
</script>
</c:set>