WmsLocationForm.jsp
8.65 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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%--
- Author(s): lty
- Date: 2024-04-03 11:20:51
- Description:
--%>
<head>
<title>
WmsLocation录入
</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="<%= request.getContextPath() %>/common/nui/nui.js" type="text/javascript">
</script>
</head>
<body>
<!-- 标识页面是查看(query)、修改(edit)、新增(add) -->
<input name="pageType" class="nui-hidden"/>
<div id="dataform1" style="padding-top:5px;">
<!-- hidden域 -->
<input class="nui-hidden" name="wmslocation.id"/>
<table style="width:100%;height:100%;table-layout:fixed;" class="nui-form-table">
<tr>
<td class="form_label">
库位编码:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.code"/>
</td>
<td class="form_label">
容器编码:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.containerCode"/>
</td>
</tr>
<tr>
<td class="form_label">
物料分区存放:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.materialAreaCode"/>
</td>
<td class="form_label">
状态:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.status"/>
</td>
</tr>
<tr>
<td class="form_label">
巷道:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.roadWay"/>
</td>
<td class="form_label">
行:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.iRow"/>
</td>
</tr>
<tr>
<td class="form_label">
列:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.iColumn"/>
</td>
<td class="form_label">
层:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.iLayer"/>
</td>
</tr>
<tr>
<td class="form_label">
高低位:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.high"/>
</td>
<td class="form_label">
内外侧:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.rowFlag"/>
</td>
</tr>
<tr>
<td class="form_label">
创建人:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.createBy"/>
</td>
<td class="form_label">
创建日期:
</td>
<td colspan="1">
<input class="nui-datepicker" name="wmslocation.createTime"/>
</td>
</tr>
<tr>
<td class="form_label">
更新人:
</td>
<td colspan="1">
<input class="nui-textbox" name="wmslocation.updateBy"/>
</td>
<td class="form_label">
更新日期:
</td>
<td colspan="1">
<input class="nui-datepicker" name="wmslocation.updateTime"/>
</td>
</tr>
</table>
<div class="nui-toolbar" style="padding:0px;" borderStyle="border:0;">
<table width="100%">
<tr>
<td style="text-align:center;" colspan="4">
<a class="nui-button" iconCls="icon-save" onclick="onOk()">
保存
</a>
<span style="display:inline-block;width:25px;">
</span>
<a class="nui-button" iconCls="icon-cancel" onclick="onCancel()">
取消
</a>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
nui.parse();
function saveData(){
var form = new nui.Form("#dataform1");
form.setChanged(false);
//保存
var urlStr = "com.huaheng.wms.wmslocationbiz.addWmsLocation.biz.ext";
var pageType = nui.getbyName("pageType").getValue();//获取当前页面是编辑还是新增状态
//编辑
if(pageType=="edit"){
urlStr = "com.huaheng.wms.wmslocationbiz.updateWmsLocation.biz.ext";
}
form.validate();
if(form.isValid()==false) return;
var data = form.getData(false,true);
var json = nui.encode(data);
$.ajax({
url:urlStr,
type:'POST',
data:json,
cache:false,
contentType:'text/json',
success:function(text){
var returnJson = nui.decode(text);
if(returnJson.exception == null){
CloseWindow("saveSuccess");
}else{
nui.alert("保存失败", "系统提示", function(action){
if(action == "ok" || action == "close"){
//CloseWindow("saveFailed");
}
});
}
}
});
}
//页面间传输json数据
function setFormData(data){
//跨页面传递的数据对象,克隆后才可以安全使用
var infos = nui.clone(data);
//保存list页面传递过来的页面类型:add表示新增、edit表示编辑
nui.getbyName("pageType").setValue(infos.pageType);
//如果是点击编辑类型页面
if (infos.pageType == "edit") {
var json = infos.record;
var form = new nui.Form("#dataform1");//将普通form转为nui的form
form.setData(json);
form.setChanged(false);
}
}
//关闭窗口
function CloseWindow(action) {
if (action == "close" && form.isChanged()) {
if (confirm("数据被修改了,是否先保存?")) {
saveData();
}
}
if (window.CloseOwnerWindow)
return window.CloseOwnerWindow(action);
else window.close();
}
//确定保存或更新
function onOk() {
saveData();
}
//取消
function onCancel() {
CloseWindow("cancel");
}
</script>
</body>
</html>