feederView.jsp
8.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
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<fmt:message key="menu.workOrder"/>
<small><fmt:message key="feeder.view.subtitle"/></small>
</h3>
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-list"></i>${feeder.name}
<fmt:message key="feeder.line"/>:${feeder.line}
<fmt:message key="feeder.amount"/>:${feeder.amount}
<fmt:message key="指定批次"/>: ${feeder.specifiedBatchInfo}
</div>
<div class="actions">
<c:if test="${not empty feeder.specifiedBatchId}">
<a href="#" class="btn btn-default btn-sm caption-btn" onclick="addBatchToCheckOut('${feeder.specifiedBatchId}');">
<i class="fa fa-sign-out"></i> <fmt:message key="出库指定批次"/> </a>
</c:if>
<a href="feederSearch.html" class="btn btn-default btn-sm">
<i class="fa fa-reply"></i> <fmt:message key="button.return"/> </a>
</div>
</div>
<div class="portlet-body">
<div class="form-group" id="msg">
</div>
<div class="col-md-6">
<div class="btn-group">
<button class="btn yellow" id="checkoutBtn" style="display: none;">
<i class="fa fa-sign-out"></i><fmt:message key="button.addto.checkout"/></button>
</div>
</div>
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th class="table-checkbox">
<input type="checkbox" id="allCheck" class="group-checkable" data-set="#sample_1 .checkboxes"/>
</th>
<th>机器</th>
<th>站位信息</th>
<th>物料编码</th>
<th>用量</th>
<th>Feeder 类型</th>
<%--<th>间距</th>--%>
<th>已出/所需</th>
</tr>
</thead>
<tbody>
<c:forEach items="${feeder.positions}" var="feederPos">
<c:set var="trClass" value=""/>
<c:set var="checkedValue" value=""/>
<c:if test="${feederPos.status=='WAIT'}">
<c:set var="trClass" value="active"/>
<c:set var="checkedValue" value="disabled checked"/>
</c:if>
<tr class="odd gradeX ${trClass}">
<td>
<c:if test="${feederPos.quantity != '' && feederPos.quantity != '0' && feederPos.partNumber !='' && !fn:contains(feederPos.partNumber, '*')}">
<input type="checkbox" id="checkBox${feederPos.id}" class="checkboxes" value="${feederPos.id}" name="posIds" ${checkedValue} />
</c:if>
</td>
<td>${feederPos.zone}</td>
<td id="posInfo${feederPos.id}">${feederPos.table}-${feederPos.position}-${feederPos.lane}</td>
<td id="pn${feederPos.id}">${feederPos.partNumber}</td>
<td>${feederPos.quantity}</td>
<td>${feederPos.feederType}</td>
<%--<td>${feederPos.pitch}</td>--%>
<td>
<a href="${ctx}/dataLog/search.html?fid=${feederPos.feederId}&pid=${feederPos.id}" targe="_blank">${feederPos.needNum - feederPos.remainNeed}/${feederPos.needNum}</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
<c:set var="scripts" scope="request">
<script>
function addBatchToCheckOut(batchId){
$.post("${ctx}/service/store/addBatchToCheckOut", {bid: batchId}, function (data) {
alert(data);
window.location.href="";
});
}
jQuery(document).ready(function () {
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
"html-percent-pre": function (a) {
var x = String(a).replace(/<[\s\S]*?>/g, ""); //去除html标记
x = x.replace(/ /ig, ""); //去除空格
return parseFloat(x);
},
"html-percent-asc": function (a, b) { //正序排序引用方法
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"html-percent-desc": function (a, b) { //倒序排序引用方法
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});
var table = $('#sample_1');
// begin first table
table.dataTable({
"bDestroy": true,
"sScrollXInner": "100%",
"info": false,
"bProcessing": true, //显示是否加载
"sScrollX": "100%",
"scrollY": "300px",
"scrollCollapse": true,
"columnDefs": [{ // set default column settings
'orderable': false,
'targets': [0]
}, {
"searchable": false,
"targets": [0]
}],
"order": [
[1, "asc"]
],
paging: false,
"language": {
"search": "查找: "
}
});
var tableWrapper = jQuery('#sample_1_wrapper');
$('#allCheck').change(function () {
var set = jQuery(this).attr("data-set");
var checked = jQuery(this).is(":checked");
jQuery(set).each(function () {
var disabled = jQuery(this).is(":disabled");
if(!disabled){
if (checked) {
$(this).attr("checked", true);
$(this).parents('tr').addClass("active");
} else {
$(this).attr("checked", false);
$(this).parents('tr').removeClass("active");
}
}
});
jQuery.uniform.update(set);
});
table.on('change', 'tbody tr .checkboxes', function () {
$(this).parents('tr').toggleClass("active");
});
tableWrapper.find('.dataTables_length select').addClass("form-control input-xsmall input-inline"); // modify table per page dropdown
$("#checkoutBtn").click(function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked") && !$(this).attr("disabled") ){
str+=$(this).val()+",";
}
});
if(str != "") {
$.post("${ctx}/service/store/addFeederTask", {fid: "${feeder.id}", pids: str}, function (data) {
if(data.indexOf("#") >= 0){//有无法出库的站位
var msg = "以下物料无法出库,已去除,继续出库请点击加入出库队列:<br/>";
var idList = data.substring(1).split(",");
for (i in idList)
{
var id = idList[i];
var box = $("#checkBox"+id);
box.attr("checked", false);
box.parents('tr').removeClass("active");
msg = msg + "<span class='col-md-4'>【"+$("#posInfo"+id).text() + "】"+$("#pn"+id).text()+"</span>";
}
var set = jQuery(this).attr("data-set");
jQuery.uniform.update(set);
$("#msg").html(msg);
//alert(msg);
} else if(data != ""){
alert(data);
}else{
window.location.href="";
}
});
}else{
alert("至少需要选择一个站位");
}
});
$("#checkoutBtn").show();
});
</script>
</c:set>