stockCheck.jsp
4.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
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.modal-body {
position: relative;
padding: 15px;
height: 360px;
overflow-y: scroll;
}
.td-item{
display: block;
padding:1px;
}
</style>
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<span id="total" style="margin-right:20px;">已盘点: 0</span><span id="ng">NG: 0</span>
</h3>
<!-- BEGIN PAGE CONTENT-->
<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-alt"></i>
</div>
</div>
<div class="portlet-body">
<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="库位"/></th>
<th><fmt:message key="条码"/></th>
<th><fmt:message key="客户端检测"/></th>
<th><fmt:message key="时间"/></th>
<th><fmt:message key="操作"/></th>
</tr>
</thead>
<tbody class="dataTableBody" id="dataTableItems">
</tbody>
</table>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<c:set var="scripts" scope="request">
<script type="text/javascript">
$(document).ready(function(){
checkout = function(posId) {
$("#btn"+posId).attr("disabled","true");
$.post("${ctx}/service/store/checkout.html", {pids: posId}, function (data) {
alert(data);
});
}
function flushItems(){
$.post("${ctx}/service/store/qisda/stockCheckItems", {}, function (data) {
var itemsHtml = '';
var total = 0;
var ng = 0;
for(var i in data){
var stockCheckItem = data[i];
var resultColor = "bg-green";
var operate = "";
total = total + 1;
if(!stockCheckItem.right){
resultColor = "bg-red";
ng = ng + 1;
operate = "<button class='btn yellow' onclick=\"checkout('"+stockCheckItem.posId+"')\"> " +
"<i class='fa fa-sign-out'></i><fmt:message key='button.checkout'/></button>";
}
var trHtml = "<tr>" +
"<td class='"+resultColor+" td-item'>"+ stockCheckItem.posName +"</td>" +
"<td>"+ stockCheckItem.barcode +"</td>" +
"<td>"+ stockCheckItem.clientHasReel +"</td>" +
"<td>"+ stockCheckItem.dateStr +"</td>" +
"<td>"+ operate +"</td>" +
"</tr>";
if(!stockCheckItem.right){
itemsHtml = trHtml + itemsHtml;
}else{
itemsHtml = itemsHtml + trHtml;
}
}
$("#dataTableItems").html(itemsHtml);
$("#total").html("已盘点: " + total);
var ngColor = "";
if(ng > 0){
ngColor = "color: #ff0000;";
}
$("#ng").html("NG: <span style='"+ ngColor +"'>" + ng +"</span>");
});
}
flushItems();
setInterval(function(){
flushItems();
}, 1000);
});
</script>
</c:set>