virtualStorage.jsp
6.5 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
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style>
.ui-autocomplete{
z-index: 111111;
}
</style>
<h3 class="page-title">
<fmt:message key="menu.box.virtualStorage"/>
</h3>
<div class="row">
<div class="col-md-12" style="padding-left:0px;">
<div class="clearfix">
</div>
<div class="row">
<div class="col-md-12" >
<div class="dashboard-stat blue-steel" id="box" style="margin-bottom: 0">
<div class="more" style="height: 50px;opacity: 1;padding-top:24px;">
<span id="msgTxt" style="color:#ffff00;line-height: 50px;font-size: 20px; ">
</span>
</div>
<div class="details">
<div class="box-status" id="statusTxt">
</div>
</div>
</div>
</div>
<div class="col-md-12">
<input type="text" id="scan-code" class="form-control" style="width: 100%;float:left;" autofocus/>
<input style="width: 1%;right:-500px;position: fixed;" type="text">
</div>
</div>
<!-- BEGIN PAGE CONTENT-->
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box green-haze">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-list-alt"></i><fmt:message key="virtualStorage.taskList"/>
</div>
<c:if test="${not empty virtualStorage}">
<div class="actions">
<a href="storageView.html?id=${virtualStorage.id}" class="btn btn-default btn-sm">
<i class="fa fa-list"></i> <fmt:message key="virtualStorage.positionList"/> </a>
</div>
</c:if>
</div>
<div class="portlet-body">
<table id="logTable"
class="table table-striped table-hover table-bordered dataTable no-footer" role="grid"
aria-describedby="sample_editable_1_info">
<thead>
<tr>
<th><fmt:message key="dataLog.storageName"/></th>
<th><fmt:message key="dataLog.type"/></th>
<th><fmt:message key="dataLog.status"/></th>
<th><fmt:message key="dataLog.orderSource"/></th>
<th><fmt:message key="dataLog.partNumber"/></th>
<th><fmt:message key="barcode.barcode"/></th>
<th><fmt:message key="inOutList.operate"/></th>
</tr>
</thead>
</table>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</div>
<fmt:message var="opType1" key="op.1"/>
<fmt:message var="opType2" key="op.2"/>
<fmt:message var="cancelMsg" key="op.status.cancel"/>
<fmt:message var="waitMsg" key="op.status.wait"/>
<fmt:message var="executingMsg" key="op.status.executing"/>
<fmt:message var="finishedMsg" key="op.status.finished"/>
<c:set var="scripts" scope="request">
<script>
jQuery(document).ready(function () {
$("#scan-code").change(function (){
$("#statusTxt").html("");
var codeValue = $(this).val();
//TCL的条码规则:用*号隔开,[物料编号]*[数量]*[供应商编号]*[批次]*[日期码]*[Reel Id]
//Reel Id 的前六位是供应商编号
$(this).attr("placeholder",codeValue);
$(this).val("");
postToServer("${aid}",codeValue);
})
function postToServer(areaId, barcode){
$.post("${ctx}/service/store/scanCodeForVirtual", {aid: areaId,bc:barcode}, function (data) {
$("#statusTxt").html(data);
});
}
var logTable = $('#logTable').DataTable({
"paging": false,
"ordering": false,
"info": false,
searching: false
} );
var opTypeMsg={
"1":"${opType1}",
"2":"${opType2}"
};
var statusMsg={
"cancelMsg":"${cancelMsg}",
"finishedMsg":"${finishedMsg}",
"waitMsg":"${waitMsg}",
"executingMsg":"${executingMsg}"
}
cancelTask = function (tid){
$.post("${ctx}/service/store/cancelTask", {tid: tid}, function (data) {
if(data){
alert('取消成功');
}
});
}
function updateTasks(){
var virtualStorageId = "${virtualStorage.id}";
//任务列表
$.post("${ctx}/service/store/tasks", {aid: "${aid}"}, function (data) {
logTable.clear().draw();
for(var item in data){
if(data[item].storageId == virtualStorageId){
var status = data[item].status.toLowerCase();
var operate = "";
if(data[item].wait){
operate = '<a class="btn btn-xs default" href="#" onclick=cancelTask('+data[item].id+');><i class="fa fa-trash-o"></i> 取消 </a>';
}
logTable.row.add( [
data[item].posStr,
opTypeMsg[data[item].type],
"<span class='label label-sm label-"+status+"'>"+statusMsg[status+'Msg']+"</span>",
data[item].partNumber,
data[item].barcode,
data[item].sourceStr,
operate
] ).draw( false );
}
}
});
}
function flushStatus(){
//输入框获得焦点
$("#scan-code").focus();
updateTasks();
//定时执行,2秒
window.setTimeout(flushStatus, 1000);
}
flushStatus();
});
</script>
</c:set>