storagePosManage.jsp
7.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
<%@ 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">
库位管理
</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">
<!-- 正常展示-->
<form:form commandName="searchCriteria" class="form-horizontal form-bordered" id="searchCriteria"
action="storagePosManage.html">
<div class="form-group">
<label class="control-label col-md-1 col-xs-2"><fmt:message key="dataLog.storageName"/></label>
<div class="col-md-2">
<form:select path="storageId" class="form-control">
<form:option value=""><fmt:message key="select.all"/></form:option>
<c:forEach items="${allStorage}" var="storage">
<form:option value="${storage.id}"> ${storage.name}</form:option>
</c:forEach>
</form:select>
</div>
<label class="control-label col-md-1"><fmt:message key="仓位"/></label>
<div class="col-md-2">
<div style="text-align:left">
<form:input path="posName" class="form-control"/>
</div>
</div>
<label class="control-label col-md-1 col-xs-2"><fmt:message key="storage.enable"/></label>
<div class="col-md-2">
<form:select path="enabled" class="form-control">
<form:option value=""><fmt:message key="select.all"/></form:option>
<form:option value="true"> <fmt:message key="storage.enable.yes"/></form:option>
<form:option value="false"> <fmt:message key="storage.enable.no"/></form:option>
</form:select>
</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-scrollable">
<c:set var="today" value="<%= new Date()%>"/>
<display:table name="searchCriteria.pageList" requestURI="storagePosManage.html" sort="external"
defaultsort="1" class="table table-striped table-bordered table-hover" export="true"
id="pos" >
<display:setProperty name="export.csv.filename" value="posList.csv" />
<c:set var="enabledClass" value=""/>
<c:if test="${!pos.enabled}">
<c:set var="enabledClass" value="enabled"/>
</c:if>
<display:column titleKey="storagePosFind.index">${pos_rowNum}</display:column>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
<display:column titleKey="storage.enable" class="${enabledClass}" media="html">
<c:if test="${!pos.enabled}">
<fmt:message key="storage.enable.no"/>
[
<a onclick="enablePos(this,'${pos.id}',true);">
启用
</a>]
</c:if>
<c:if test="${pos.enabled}" >
<fmt:message key="storage.enable.yes"/>
[
<a onclick="enablePos(this,'${pos.id}',false);">
禁用
</a>]
</c:if>
</display:column>
<display:column titleKey="storage.posSize">
${pos.sizeStr}
</display:column>
<display:column property="barcode.barcode" titleKey="barcode.barcode" sortProperty="barcode.barcode" sortable="true"/>
<display:column titleKey="时间" sortProperty="updateDate" sortable="true">
<fmt:formatDate value="${pos.updateDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
<display:column titleKey="" media="html">
<button class="btn yellow" id="btn${pos.id}" onclick="checkoutPos('${pos.id}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</display:column>
</display:table>
</div>
</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>
function enablePos(linkDom, posId,enabled){
$.post("${ctx}/service/store/enablePos", {pid: posId,enabled:enabled }, function (data) {
if(data != ''){
alert(data);
}else{
$(linkDom).parents("tr").toggleClass("font-grey");
$(linkDom).toggleClass("enabled");
if(enabled){
$(linkDom).parents("td").html("是[<a onclick='enablePos(this,"+posId+",false);'>禁用</a>]");
}else{
$(linkDom).parents("td").html("否[<a onclick='enablePos(this,"+posId+",true);'>启用</a>]");
}
alert("操作成功");
}
})
}
$(".enabled").each(function(){
var oldClass = $(this).parent().attr("class");
$(this).parents("tr").attr("class",oldClass + " font-grey");
});
function checkoutPos(posId) {
$("#btn"+posId).attr("disabled","true");
$.post("${ctx}/service/store/checkout.html", {pids: posId}, function (data) {
alert(data);
});
}
</script>
</c:set>