warehouseLocation_edit.jsp
5.9 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
<%@page import="com.framework.util.PropertiesLoader"%>
<%@page import="com.google.common.base.Objects"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>库位编辑</title>
<jsp:include page="../../template/head.jsp"></jsp:include>
<link href="<%=request.getContextPath() %>/resource/library/css/form.css" rel="stylesheet">
<style type="text/css">
#pf-hd{
height:70px;
position:relative;
z-index:2;
background-color:#321752;
}
#pf-hd .pf-logo{
float:left;
height:100%;
width:230px;
line-height:70px;
}
#pf-hd .pf-logo img{
margin-left:-10px;
}
</style>
</head>
<body>
<div class="container">
<div id="pf-hd">
<div class="pf-logo" style="border-right: none;">
<!-- <h1 style="font-size:24px;color:white;">保税航材库管理系统</h1> -->
<a href="<%=PropertiesLoader.get("sso_main") %>"><img src="<%=request.getContextPath()%>/resource/library/images/main/main_logo.png" alt="logo" style="height: 70px;"></a>
</div>
</div>
<div class="content" ms-controller="container">
<form class="from-control" id="editForm">
<input type="hidden" name="id" ms-duplex="@data.id">
<div id="tt" class="easyui-tabs" style="width: 100%;">
<div title="账册列表" style="padding: 20px; width: 100%; height: 100%; display: none;overflow: auto;" ms-controller="container"></div>
<div title="经营范围列表" style="padding: 20px; width: 100%; height: 100%; overflow: auto;" ms-controller="container"></div>
<div title="库位列表" style="padding: 20px; width: 100%; height: 100%; overflow: auto;" ms-controller="container"></div>
<div title="库位编辑" style="overflow: auto; padding: 20px; display: none;">
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label"><span><label>*</label>库位编号</span></td>
<td class="kv-content" colspan="3">
<input type="text" name="locationNo" ms-duplex="@data.locationNo | notEmpty"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span><label>*</label>库位名称</span></td>
<td class="kv-content" colspan="3">
<input type="text" name="locationName" ms-duplex="@data.locationName | notEmpty"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span>备注</span></td>
<td class="kv-content" colspan="3">
<input type="text" name="remark" ms-duplex="@data.remark | notEmpty" style="width:60%;"></input>
</td>
</tr>
<tr>
<td colspan="4">
<div class="opt-buttons" style="padding-top:20px;">
<a href="javascript:doSave();" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true" group="" id=""><span class="l-btn-left"><span class="l-btn-text">保存</span></span></a>
<a href="javascript:history.back()" class="easyui-linkbutton l-btn l-btn-small" group="" id=""><span class="l-btn-left"><span class="l-btn-text">取消</span></span></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
<script>
//定义 avalon
var datavm = avalon.define({
$id: "container",
data:${entity}
});
//保存
function doSave(){
var data = $("#editForm").serializeJson();
var url = '';
if(data.id=='null'){//新增
data.id = '';
url='<%=request.getContextPath()%>/rest/eptWarehouseLocation/insert';
}else{
url='<%=request.getContextPath()%>/rest/eptWarehouseLocation/update';
}
$.post(url, data, function(result) {
if(result.status==200){
window.location.href="<%=request.getContextPath()%>/warehouseLocation/list";
}else{
var html = result.msg+"<br/>"
if(result.data){
for(var i=0;i<result.data.length;i++){
html+=result.data[i].message+"<br/>";
}
}
$.messager.alert("提示", html);
}
});
}
//读取编辑资料(编辑时使用)
function loadData(id){
var par = {};
par.id=id;
$.post("<%=request.getContextPath()%>/rest/eptWarehouseLocation/findByPK", par, function(result) {
if(result.status==200){
datavm.data = result.data
initFormData();
}else{
$.messager.alert("提示", result.msg);
}
});
}
//初始化表单关联数据
function initFormData(){
//initUserStatus();
}
//初始化使用者状态选择
function initUserStatus(){
var par = {};
par.parType=1;
$.post("<%=request.getContextPath()%>/rest/eptParameter/findByType", par, function(result) {
if(result.status==200){
datavm.userStatus=result.data;
//初始化选项值
if($('#status_'+datavm.data.status).length>0){
$('#status_'+datavm.data.status)[0].checked='true';
}else{
$('#status_1')[0].checked='true';
}
}else{
$.messager.alert("提示", result.msg);
}
});
}
$(document).ready(function(){
var tabs = $('#tt').tabs().tabs('tabs');
for(var i=0; i<tabs.length; i++){
tabs[i].panel('options').tab.unbind().bind('click',{index:i},function(e){
if(e.data.index==0){
window.location.href='<%=request.getContextPath()%>/book/list';
} else if(e.data.index==1){
window.location.href='<%=request.getContextPath()%>/businessScope/list';
} else if(e.data.index==2){
window.location.href='<%=request.getContextPath()%>/warehouseLocation/list';
}
});
}
<%if(request.getParameter("id")==null){%>
initFormData();
<%}else{%>
loadData(<%=request.getParameter("id")%>);
<%}%>
$('#tt').tabs('select',3);
});
</script>
</body>
</html>