5197994c8da4aaa37a807c7cfd3f95aecff52347.svn-base
11.2 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<%@ 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">
$(document).ready(function() {
$("#fileinp").change(function () {
var value = $("#fileinp").val();
if(!value){
value = "请选择房屋分户图...";
}
$("#filetext").html(value);
})
});
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").submit();
return false;
}
function checkUnfined(value){
if(typeof(value)=='undefined'){
return "";
}
return value;
}
function choiceFwxx(bdcdyh){
//弹出窗口的宽度;
var iWidth=1100;
//弹出窗口的高度;
var iHeight=600;
//获得窗口的垂直位置
var iTop = (window.screen.height - 30 - iHeight) / 2;
//获得窗口的水平位置
var iLeft = (window.screen.width - 10 - iWidth) / 2;
var url = "${ctx}/reg/bus/regBusBdcqzsdjxx/openHouseInfoView?cxfs=${cxfs}&DJLX=${DJLX}&bdcdyh="+bdcdyh;
window.open(url, "窗口", "width=" + iWidth + ", height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + ",toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no,alwaysRaised=yes,depended=yes");
}
//动态添加checkbox
function innerCheckBox(tbtdObj, hobject){
var $v=$(tbtdObj); //转化为jQuery对象
var innerCheckBox = "<div class='btnc'><input id="+hobject.id+" name='fwxx' "+
"value="+hobject.shbw+" class='btn btn-primary btn-mini btn-info' type='button'/></div>";
$v.find(".isinfo").before(innerCheckBox);
}
window.onload = function(){
//给楼盘表中填值
//开始根据后台返回的所有户信息,进行遍历填值
var h_json = ${fns:toJson(regBaseAllHList)};
for(var i = 0; i < h_json.length; i++){
var positionxy_c = h_json[i].xyposition; ////户坐标位置 [获取到层房序号,也就是一层上的户型号,获取到3、4位]
var begin_c = h_json[i].beginc; ////户其实层
var end_c = h_json[i].endc; ////户终止层
var shbw_c = h_json[i].shbw; //室号部位取值
var step_c = end_c - begin_c + 1; //户所跨的层数
var hhao = h_json[i].hh;//户 号
if(begin_c<0 && end_c>0){ //跨层有负层时
step_c = step_c - 1;
}
var colvalue = "01";//这里的colvalue值需要考虑到100层【10001】以上,1000层以上就不考虑了
if(positionxy_c.indexOf("-") != -1){
positionxy_c = positionxy_c.replace("-", "");
}
if(positionxy_c.length>=6){//100100
colvalue = parseInt(positionxy_c.substring(3,6));
}else if(positionxy_c.length>=4){//10001 \01100
if(end_c >= 100){
colvalue = parseInt(positionxy_c.substring(3,5));
}else{
//竖向层小于100 时;横向大于等于100 时
if(hhao >= 100){// 10100 - 99100
if(end_c >= 10){
colvalue = parseInt(positionxy_c.substring(2,5));
}else{
colvalue = parseInt(positionxy_c.substring(1,4));
}
}else{
colvalue = parseInt(positionxy_c.substring(2,4));
}
}
}else if(positionxy_c.length>=3){
if(end_c >= 100){
colvalue = parseInt(positionxy_c.substring(1,4));
}else{
colvalue = parseInt(positionxy_c.substring(1,3));
}
}
if(begin_c == end_c){ //不跨层填值处理
fillTdWithoutStep(end_c, colvalue, shbw_c, h_json[i]);
}else{
fillTdWithStep(end_c, begin_c, colvalue, step_c, shbw_c, h_json[i]);
}
}
//循环填值完后,再把当前表格循环一次,如果发现户坐标位置一样的话 就纵向合并
vert_merger();
$(".shbwtext").text("");
};
//带有跨行的户信息填值 - 除过行表头和列表头
function fillTdWithStep(rc,rm,col,sl,htm,hobject){
var tb = document.getElementById("zchtableid");
var x1;
for (var ii=1;ii<tb.rows.length;ii++){
px = parseInt(tb.rows[ii].cells[0].innerText);//每行的第一列层值
if (px==rc) {
x1=ii;
}
if (px<rc & px>=rm) {
fillTdWithoutDifferenceColorAndHtml(tb.rows[ii].cells[col+1], hobject, htm);
//tb.rows[ii].cells[col+1].innerHTML = "<div class='hhao'><div class='shbwtext'>"+htm+"</div></div>";
//tb.rows[ii].cells[col+1].setAttribute("style","background-color:#D6EEF3");
//加详细信息
//innerDetailInfo(tb.rows[ii].cells[col+1], hobject);
//加选择信息
innerCheckBox(tb.rows[ii].cells[col+1], hobject);
}
}
fillTdWithoutDifferenceColorAndHtml(tb.rows[x1].cells[col+1], hobject, htm);
//tb.rows[x1].cells[col+1].innerHTML = "<div class='hhao'><div class='shbwtext'>"+htm+"</div></div>";
//tb.rows[x1].cells[col+1].setAttribute("style","background-color:#D6EEF3");
//innerDetailInfo(tb.rows[x1].cells[col+1], hobject);
innerCheckBox(tb.rows[x1].cells[col+1], hobject);
}
//只有一层的情况填值 - 除过行表头和列表头
//终止层、层房序号、房名称
function fillTdWithoutStep(row,col,htm,hobject){
var tb = document.getElementById("zchtableid");
for (var ii=1;ii<tb.rows.length;ii++) {
px=parseInt(tb.rows[ii].cells[0].innerText);
if (px==row) {
fillTdWithoutDifferenceColorAndHtml(tb.rows[ii].cells[col+1], hobject, htm);
//tb.rows[ii].cells[col+1].innerHTML = "<div class='hhao'><div class='shbwtext'>"+htm+"</div></div>";
//tb.rows[ii].cells[col+1].setAttribute("style","background-color:#D6EEF3");
//innerDetailInfo(tb.rows[ii].cells[col+1], hobject);
innerCheckBox(tb.rows[ii].cells[col+1], hobject);
}
}
}
function vert_merger(){
var tb = document.getElementById("zchtableid");
var xx,yy,s1;
var collh=tb.rows[0].cells.length-1;//列数
var rowlh=tb.rows.length-1;//行数
for(var jj=collh;jj>=2;jj--){//从最大列数递减开始遍历
s1=1;
for(var ii=rowlh;ii>1;ii--){//从最大行数递减开始遍历
xx = tb.rows[ii].cells[jj].innerHTML; //获取要合并的上层单元格的值
yy = tb.rows[ii-1].cells[jj].innerHTML;//获取要合并的下层单元格的值
if(xx == yy&&xx!==""){
tb.rows[ii].deleteCell(jj);//删除上层的单元格
s1++;//计算需要合并的行数
tb.rows[ii-1].cells[jj].rowSpan = s1;//把需要合并的行数赋值给 rowspan,完成层的上下合并
}else{
s1=1;
}
}
}
}
function submitFht(){
var form = $("#searchForm");
var ids = [];
$(".hselect").each(function(i,o){
var id = $(o).attr("id");
if($(o).is(':checked')){
ids[ids.length] = id;
}
});
if(ids.length <=0){
alert("请选择分户图对应的房屋信息");
return;
}
if(!$("#fileinp").val()){
alert("请上传分户图的CAD文件");
return;
}
$("#hids").val(JSON.stringify(ids));
form.attr("action","${ctx}/jy/fw/jyFw/uploadFht");
form.submit();
}
function deleteFht(hid){
if(!confirm ('确认要删除当前分户图信息吗?'))
{
return;
}
var form = $("#searchForm");
$("#hid").val(hid);
form.attr("action","${ctx}/jy/fw/jyFw/deleteFht");
form.submit();
}
function fillTdWithoutDifferenceColorAndHtml(td, hobject, htm){
if(hobject == undefined || hobject == null || td == undefined || td == null){
return;
}
var fht = "<div style='padding:0 0 10px 20px;' >"
+ "<input type='checkbox' class='hselect' id="+hobject.id+">"
+"</div>";
var hcss = "hhao_qf";
if(hobject.fhtCad){
hcss = "hhao_xf" ;
var fht = "<div style='padding:0 0 10px 20px;' >"
+ "<a target='view_window' href='/ODM/userfiles/"+hobject.fhtCad+"'>CAD</a>"
+ "<label style='float: right; color: red; padding-right: 30px;' onclick='deleteFht("+'"'+hobject.id+'"'+")'>X</label>"
+ "</div>";
}
if(hobject.fhtImage){
hcss = "hhao_ms" ;
var fht = "<div style='padding:0 0 10px 10px;' >";
if(hobject.fhtCad){
fht = fht
+ "<a style=' color: red;' target='view_window' href='/ODM/userfiles/"+hobject.fhtCad+"'>CAD</a>"
+ " ";
}
fht = fht
+ "<a style=' color: red;' target='view_window' href='/ODM/userfiles/"+hobject.fhtImage+"'>合成图</a>"
+ "<label style='float: right; color: red; padding-right: 10px;' onclick='deleteFht("+'"'+hobject.id+'"'+")'>X</label>"
+ "</div>";
}
td.innerHTML = "<div style='width:140px;height:50px;border:0px solid red;text-align:left; ' class=' "+hcss+"'><div class='isinfo'>"+fht+"</div></div>";
}
</script>
<style type="text/css">
#fileinp{
position: absolute;
left: 0;
top: 0;
visibility: hidden;
}
#btnFile{
cursor: pointer;
padding: 5px 10px;
background: #FFF;
color: #eea931;
border: solid 1px #eea931;
border-radius: 5px;
height: 31px;
width: 81px;
}
</style>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="#">楼盘信息表</a></li>
</ul>
<sys:message content="${message}"/>
<div class="form-horizontal">
<div class="current_fwinfo">当前楼盘信息:项目【${XMMC}】,建筑物【${JZWMC}】,实测建筑面积【${ZSCJZMJ}】㎡;一共【${cCount}】层,【${hCount}】户</div>
<br>
<table class="zchtable-form" id="zchtableid">
<tr>
<td><div class="chao">层号</div></td>
<td><div class="cgaik">层概况</div></td>
<c:forEach items="${requestScope.intS}" var="intS" varStatus="statusmch">
<td><div class="cinfo">${intS}</div></td>
</c:forEach>
</tr>
<c:forEach items="${requestScope.regBaseCList}" var="regBaseC" varStatus="status">
<tr id="${regBaseC.ch}">
<td><div class="chao">${regBaseC.sjc}
</div>
</td>
<td>
<div class="cgaik">
<fmt:formatNumber value="${regBaseC.chjzmj}"
pattern="#0.##"
var="formattedNumber"/>
${formattedNumber} ㎡
</div>
</td>
<c:set value="${'option'}${status.index}" var="option" />
<c:forEach items="${requestScope.intS}" var="intS" varStatus="statush">
<td>
</td>
</c:forEach>
</tr>
</c:forEach>
</table>
<br>
<form:form id="searchForm" modelAttribute="regBaseZrz" enctype="multipart/form-data" action="${ctx}/jy/fw/jyFw/uploadFht" method="post" class="breadcrumb form-search">
<div class="ul-form" style="margin: 10px 0px">
<label for="fileinp" style="line-height: 50px;">
<a id="btnFile"> 选择文件 </a><span id="filetext" style="padding-left: 10px;">请选择房屋分户图...</span>
<input type="file" id="fileinp" accept=".dwg" name="fileinp">
</label>
</div>
<input name = 'bdcdyh' type="hidden" value ="${cbdcdyh}">
<input name = 'hids' id="hids" type="hidden" >
<input name = 'hid' id="hid" type="hidden" >
<div class="ul-form">
<span style="padding: 5px 50px;">
<input id="btnCancel" class="btn btn-primary" type="button" value="关闭" onclick="window.close()"/>
</span>
<span style="padding: 5px 50px;">
<input id="btnCancel" class="btn btn-primary" type="button" value="确认" onclick="submitFht()"/>
</span>
</div>
</form:form>
<sys:message content="${message}"/>
</div>
</body>
</html>