hzinfo_add.jsp
6.4 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
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath %>resource/css/base.css" rel="stylesheet">
<link href="<%=basePath %>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" href="<%=basePath %>resource/easyui/uimaker/easyui.css">
<link href="<%=basePath %>resource/css/form.css" rel="stylesheet">
<script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/validate/validate-extends.js"></script>
<link rel="stylesheet" href="<%=basePath %>resource/css/form.css">
<script type="text/javascript" src="<%=basePath %>resource/js/tools.js"></script>
<!-- validate 验证中英文 -->
<script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
<div class="content">
<form class="from-control" id="form">
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label">简称</td>
<td class="kv-content">
<input id="forshort" name="forshort" type="text" required/>
</td>
</tr>
<tr>
<td class="kv-label">全称</td>
<td class="kv-content">
<input id="fullname" name="fullname" type="text" required/>
</td>
</tr>
<tr>
<td class="kv-label">货主类型</td>
<td class="kv-content">
<div class="date">
<label>
<input id="one" name="one" type="checkbox" value="111" checked>发货人
</label>
<label>
<input id="two" name="two" type="checkbox" value="222">订舱代理
</label>
<label>
<input id="three" name="three" type="checkbox" value="333">操作代理
</label>
</div>
</td>
</tr>
<tr>
<td class="kv-label">联系人</td>
<td class="kv-content"><input type="text" id="contacts" name="contacts" required></td>
</tr>
<tr>
<td class="kv-label">电话</td>
<td class="kv-content"><input type="text" id="phone" name="phone" required></td>
</tr>
<tr>
<td colspan="6">
<div class="opt-buttons" style="padding-top:20px;">
<button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true">
<span class="l-btn-left"><span class="l-btn-text"><spring:message code="opt.save" /></span></span>
</button>
<%--<button type="button" class="easyui-linkbutton l-btn l-btn-small" onclick="window.location.href='<%=basePath%>system/user/list'">--%>
<%--<span class="l-btn-left"><span class="l-btn-text"><spring:message code="opt.cancel"/></span></span>--%>
<%--</button>--%>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<script type="text/javascript" src="<%=basePath %>resource/layer-v3.0.3/layer/layer.js"></script>
<script src="<%=basePath %>resource/easyui/jquery.easyui.min.js"></script>
<script src="<%=basePath %>resource/js/tools.js"></script>
<script type="text/javascript">
$("#form").validate({
submitHandler:function(form){
submit();
}
});
var selectFals = false;
function submit(){
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>hzinfo/save",data,function(data){
if(data.status==200){
layer.confirm("<spring:message code="opt.savesuccess" />!",{btn:['<spring:message code="opt.confirm" />','<spring:message code="opt.cancel" />']},function(){
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
window.parent.location.reload();
})
}else if(data.status == 201){
layer.open({content:"该简称和货主类型已存在!"});
}else {
layer.open({content:"网络异常!"});
}
})
}else {
alert("货主类型至少选择一项");
return false;
}
}
</script>
</body>
</html>