6c02e19f0da1404262d5ac2feb44e058964c32c6.svn-base
6.89 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
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>楼盘挂接</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
var saveList = new Array();
var submitBz = false;
var submitList = new Array();
$(document).ready(function() {
});
function page(n,s){
if (saveList.length > 0) {
alert("请先保存!");
return false;
} else {
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").submit();
return false;
}
}
function getUrl(){
var bdcdyhStr = "";
var fybhStr = "";
var submitBz = true;
//saveList是添加过房源编号的数据的下标的数组
$.each(saveList, function(index, item){
var saveIndex = saveList[index];
var fybhValue = $("input[id='fybhSave']")[saveIndex].value;
var bdcdyhValue = $("input[id='bdcdyhSave']")[saveIndex].value;
/* if (fybhValue.length < 6) {
alert("存在格式不正确房源编号,保存失败!");
submitBz = false;
return false;
} */
fybhStr = fybhStr + fybhValue + ";";
bdcdyhStr = bdcdyhStr + bdcdyhValue + ";";
});
if (submitBz) {
$.ajax({
type:"POST",
url:"${ctx}/reg/base/regBaseH/saveFybh",
cache: false,
data:"bdcdyhStr="+bdcdyhStr+"&fybhStr="+fybhStr,
async:true,
success:function(modelmap){
success = modelmap.success;
if(success == 0){
alert("保存成功!");
saveList = new Array();
}else{
alert(modelmap.msg);
saveList = new Array();
}
}
});
} else {
saveList = new Array();
}
}
function getquery(){
var shbw = $("#shbwtext").val();
var bdcdyh = $("#bdcdyhtext").val();
var zl = $("#zltext").val();
var url = "${ctx}/reg/base/regBaseH/ycslhlist?shbw="+shbw+"&bdcdyh="+bdcdyh+"&zl="+zl;
window.location = url;
}
function changeFybh(index){
//获取改变后的fybh的值 如果为空并且已经存在在list中就去掉
var fybh = $("input[id='fybhSave']")[index].value;
var test = /^[0-9]*$/; //正则表达式验证
/* if (fybh != null && fybh != '' && fybh.length < 6) {
alert("请输入6位房源编号!"); //输入的fybh里有一个格式不对就不能提交
} */
if (fybh == null || fybh == '') {
saveList.splice(saveList.indexOf(index), 1); //去掉空值对应的在list中index元素
} else if (saveList.indexOf(index) == -1) { //如果不为空就把对应行数加到list里
saveList.push(index);
}
console.log(saveList);
}
</script>
<style type="text/css">
.inlineDiv{
float:left;
}
.inlineDiv1{
float:left;
width: 100%;
margin-right: -4%;
}
.inlineDiv2{
display: none;
float:left;
width: 41%;
/* border-left: 1px solid red; */
}
.input-medium{
width:80px;
}
#searchForm{
width:95%;
}
#searchFormResult{
width:95%;
margin-top: -10px;
}
</style>
</head>
<body>
<!-- <ul class="nav nav-tabs">
<li class="active"><a href="#">户信息列表</a></li>
</ul> -->
<div id="ODM" class="inlineDiv1">
<form:form id="searchForm" modelAttribute="regBaseH" action="${ctx}/reg/base/regBaseH/ycslhlist" method="post" class="breadcrumb form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form" id="lpgjcx">
<li>不动产单元号 <form:input path="bdcdyh" id="bdcdyhtext" htmlEscape="false" maxlength="28" class="input-large"/>
</li>
<li> 坐落 <form:input path="zl" id="zltext" htmlEscape="false" maxlength="28" class="input-large"/>
</li>
<li> 室号部位 <form:input path="shbw" id="shbwtext" htmlEscape="false" maxlength="28" class="input-large"/>
</li>
<!-- <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="button" ?shbw=${shbw}&bdcdyh=${bdcdyh}&zl=${zl} onclick="getquery()" value="查询"/></li> -->
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
<li id="btns_1"><input class="btn btn-primary" type="button" onclick="getUrl()" value="保 存"/><a id="aaa"></a></li>
<li class="clearfix"></li>
</ul>
</form:form>
<form:form class="breadcrumb form-search" id="searchFormResult">
<c:forEach items="${page.list}" var="regBaseH" varStatus="hlist">
<ul class="ul-form">
<li >不动产单元号
<input id="bdcdyhSave" htmlEscape="false" readOnly="true" value="${regBaseH.bdcdyh}" maxlength="28" class="input-large"/>
</li>
<li > 坐落
<input htmlEscape="false" readOnly="true" value="${regBaseH.zl}" class="input-large"/>
</li>
<li> 室号部位
<input htmlEscape="false" readOnly="true" value="${regBaseH.shbw}" class="input-medium"/>
</li>
<li> 房源编号
<c:if test="${regBaseH.rights eq '2'}">
<input id="fybhSave" htmlEscape="false" readOnly="true" value="${regBaseH.fybh}" class="input-medium"/>
</c:if>
<c:if test="${regBaseH.rights ne '2'}">
<input id="fybhSave" htmlEscape="false" type="text" value="${regBaseH.fybh}" maxlength="6" onchange="changeFybh(${hlist.index})" class="input-medium"/>
</c:if>
</li>
</ul>
</c:forEach>
</form:form>
<div class="pagination" style="width: 730px">${page}</div>
</div>
<%-- <div id="FC" class="inlineDiv2">
<form:form id="searchForm" modelAttribute="regBaseH" action="${ctx}/reg/base/regBaseH/alllist?shbw=${shbw}" method="post" class="breadcrumb form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form">
<li>室号部位
<input path="shbw" id="shbwtext" htmlEscape="false" maxlength="28" class="input-large"/>
</li>
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="button" onclick="getquery()" value="查询"/></li>
<li id="btns_1"><input class="btn btn-primary" type="button" onclick="getUrl()" value="保 存"/></li>
<li class="clearfix"></li>
</ul>
<c:forEach items="${page.list}" var="regBaseH">
<ul class="ul-form">
<li> 室号部位
<input path="shbw" htmlEscape="false" readOnly="true" value="${regBaseH.shbw}" class="input-medium"/>
</li>
<li> 室号部位
<input path="shbw" htmlEscape="false" readOnly="true" value="${regBaseH.shbw}" class="input-medium"/>
</li>
<li> 室号部位
<input path="shbw" htmlEscape="false" readOnly="true" value="${regBaseH.shbw}" class="input-medium"/>
</li>
</ul>
</c:forEach>
</form:form>
<div class="pagination" style="width: 500px; height:20px; display: inline;" >${page}</div>
</div> --%>
</body>
</html>