index.vue
18 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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
<template>
<div class="edit">
<div class="tab-header">
<el-row class="searchContent">
<el-col :span="8">
<el-radio-group v-model="tabPosition">
<el-radio-button label="1">实测</el-radio-button>
<el-radio-button label="0">预测</el-radio-button>
</el-radio-group>
<el-input
v-model="bdcdyh"
:style="{'width':inputWidth+'px'}"
@focus="inputFocus"
@blur="inputBlur"
@change="inputChange"
class="searchInput"
placeholder="输入不动产单元号"
><i slot="suffix" class="el-input__icon el-icon-search" @click="inputChange"></i></el-input>
</el-col>
<el-col :span="16">
<div class="fr">
<el-button class="radioBtn" label="1" border @click="create">创建楼盘</el-button>
<el-button class="radioBtn" label="2" border @click="plScYcChange">实预测转换</el-button>
<el-button class="radioBtn" label="3" border @click="plhVisible=true">批量户</el-button>
<el-button class="radioBtn" label="4" border @click="plcVisible=true">批量层</el-button>
<el-button class="radioBtn" label="5" border @click="plShVisible=true">批量室号</el-button>
<el-button class="radioBtn" label="6" border @click="plzlVisible=true">批量坐落</el-button>
<el-button class="radioBtn" label="7" border @click="addBdcdyh">批量单元号</el-button>
</div>
</el-col>
</el-row>
</div>
<div
class="tab-content"
ref="tabContent"
:style="{ height: lpbContentHight + 'px' }"
>
<!-- 左侧树结构 -->
<div class="lp-tree" :class="createFlag ? 'w260' : 'w0'">
<LineTree :pd="pd" class="treeData" :islpb="islpb"></LineTree>
<p
@click="createFlag = false"
style="width:20px;float:left;margin-top: 12px;margin-left:10px;cursor:pointer;"
>
X
</p>
</div>
<!-- 楼盘表主体 -->
<div class="lp-overview" :style="{ width: lpbContentwidth + 'px' }">
<lpbContent ref="lpbContent" :key="time"></lpbContent>
</div>
<!-- 右侧图例 -->
<div class="lp-legend">
<div class="handleCol">
<div class="btn" @click="legendToggle">
<i v-show="!legendToggleFlag" class="el-icon-d-arrow-left"></i>
<i v-show="legendToggleFlag" class="el-icon-d-arrow-right"></i>
</div>
<div :class="selectedZt == 'dyzt'? 'dyzt selectedZt':'dyzt'" @click="selectedZt='dyzt'">
<span>单元状态</span>
</div>
<div :class="selectedZt == 'fwxz'? 'fwxz selectedZt':'fwxz'" @click="selectedZt='fwxz'">
<span>房屋性质</span>
</div>
<div :class="selectedZt == 'fwyt'? 'fwyt selectedZt':'fwyt'" @click="selectedZt='fwyt'">
<span>房屋用途</span>
</div>
</div>
<div
class="legendTable-wrap"
:style="{ width: legendToggleFlag ? '204px' : '0' }"
>
<table class="legendTable" v-show="selectedZt == 'dyzt'" cellspacing="1" cellpadding="1" border="1">
<tr>
<th>状态</th>
<th>套数</th>
<th>面积</th>
</tr>
<tr v-for="(item, index) in dyztList" :key="index" class="cp" @click="handleChoosedH(item.name)">
<td>
<i class="el-icon-star-on" :style="{ color: item.color }"></i
>{{ item.name }}
</td>
<td>{{ item.ts }}</td>
<td>{{ item.mj }}</td>
</tr>
</table>
<table class="legendTable" v-show="selectedZt == 'fwxz'" cellspacing="1" cellpadding="1" border="1">
<tr>
<th>性质</th>
<th>套数</th>
<th>面积</th>
</tr>
<tr v-for="(item, index) in fwxzList" :key="index" class="cp" @click="handleChoosedH(item.name)">
<td>
<i class="el-icon-star-on" :style="{ color: item.color }"></i
>{{ item.name }}
</td>
<td>{{ item.ts }}</td>
<td>{{ item.mj }}</td>
</tr>
<tr v-show="fwxzList.length<1">
<td colspan="3" class="tac">暂无数据</td>
</tr>
</table>
<table class="legendTable" v-show="selectedZt == 'fwyt'" cellspacing="1" cellpadding="1" border="1">
<tr>
<th>用途</th>
<th>套数</th>
<th>面积</th>
</tr>
<tr v-for="(item, index) in fwytList" :key="index" class="cp" @click="handleChoosedH(item.name)">
<td>
<i class="el-icon-star-on" :style="{ color: item.color }"></i
>{{ item.name }}
</td>
<td>{{ item.ts }}</td>
<td>{{ item.mj }}</td>
</tr>
<tr v-show="fwytList.length<1">
<td colspan="3" class="tac">暂无数据</td>
</tr>
</table>
</div>
</div>
</div>
<!-- 右键菜单弹出框 -->
<el-dialog title="添加" :visible.sync="dialogVisible" width="50%" center>
<!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
<div class="addCh" v-show="menuType == 'ljz'">
<addLjz ref="ljz"></addLjz>
</div>
<div class="addCh" v-show="menuType == 'zdy'">
<addZdy ref="zdy"></addZdy>
</div>
<div class="addCh" v-show="menuType == 'ch'">
<addCh ref="ch" :dialogVisible="dialogVisible" :treeData="treeData"></addCh>
</div>
<div class="btnGroup">
<el-button type="primary" @click="saveInfo">保存</el-button>
<el-button type="primary" @click="resetInfo">重置</el-button>
<el-button type="primary" @click="dialogVisible = false"
>取消</el-button
>
</div>
</el-dialog>
<!-- 批量操作弹出框 -->
<pl-h :plh-visible="plhVisible" :bsms="bsms" @close="plhClose"></pl-h>
<pl-zl :pl-zl-visible="plzlVisible" :bsms="bsms" @close="plZlClose"></pl-zl>
<pl-c :plc-visible="plcVisible" :bsms="bsms" @close="plcClose"></pl-c>
<pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose"></pl-sh>
<!-- 双击户的弹出框 -->
<el-dialog title="户编辑" :visible.sync="hbjVisible" width="50%" center>
<hbj ref="hbj" :bsm='hbsm'></hbj>
<div class="btnGroup">
<el-button type="primary" @click="hbjSaveInfo">保存</el-button>
<el-button type="primary" @click="hbjResetInfo">重置</el-button>
<el-button type="primary" @click="hbjVisible = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import PlC from "./../../../../components/plc/plC"
import PlSh from "./../../../../components/plsh/plSh"
import PlH from "./../../../../components/plh/plH"
import PlZl from "./../../../../components/plzl/plZl"
import LineTree from "../../../../components/lineTree/lineTree";
import addLjz from "./ljz/index";
import addZdy from "./zdy/index";
import addCh from "./ch/index";
import hbj from "./hbj/index"
import lpbContent from "./lpbContent/index";
import {getLpbMenuTree,batchScYcChange,getLpbTj} from "../../../../api/lpb";
export default {
name: "",
components: { LineTree, addLjz, addZdy, addCh, lpbContent,PlC,PlSh,PlH ,PlZl,hbj},
props: {},
data() {
return {
bsms:["123","321","231"],
hbsm:'',
dialogVisible: false,
plcVisible:false,
plhVisible:false,
plShVisible:false,
plzlVisible:false,
hbjVisible:false,
tabPosition:"1", //1是实测 0是预测
radio1: "",
radio2: "",
createFlag: false,
bdcdyh: "",
islpb: true,
pd: [], //创建楼盘的树结构数据
menuType: "",
treeData: {},
inputWidth:74,
selectedZt:'dyzt', //图例选中项,默认选中单元状态
dyztList: [
{
name: "未确权",
color: "#2591FD",
ts: "12",
mj: "1633",
},
{
name: "已确权",
color: "#2591FD",
ts: "22",
mj: "3109",
},
{
name: "已备案",
color: "#2591FD",
ts: "3",
mj: "409",
},
{
name: "预抵押",
color: "#2591FD",
ts: "11",
mj: "1466",
},
{
name: "在建抵押",
color: "#2591FD",
ts: "13",
mj: "1792",
},
{
name: "抵押",
color: "#2591FD",
ts: "14",
mj: "13",
},
{
name: "查封",
color: "#2591FD",
ts: "9",
mj: "1436",
},
{
name: "异议",
color: "#2591FD",
ts: "34",
mj: "4342",
},
{
name: "限制",
color: "#2591FD",
ts: "2",
mj: "285",
},
],
fwxzList:[],
fwytList:[],
legendToggleFlag: false,
lpbContentHight: "",
lpbContentwidth: "",
time:'',
dyztBsmList:{},//单元状态bsmList
};
},
created() {
window.addEventListener("resize", this.getHeight);
this.getHeight();
},
mounted() {
//获取楼盘表树结构
this.getLpbMenuTree(this.$store.state.zrzbsm);
//获取各项单元状态的户bsm
this.getDyztBsmList();
// 楼盘表绘制区域宽度计算:楼盘表区域宽度-图例宽度34-滚动条宽度6
setTimeout(() => {
this.lpbContentwidth = this.$store.state.contentWidth - 34 - 6;
}, 100);
},
methods: {
plZlClose(){
this.plzlVisible=false
},
plcClose(){
this.plcVisible=false;
},
plhClose(){
this.plhVisible=false;
},
plshClose(){
this.plShVisible=false
},
//获取高度计算lpb内容区高度
getHeight() {
this.lpbContentHight = window.innerHeight - 285;
},
//创建楼盘
create() {
this.createFlag = true;
},
//获取自然幢树结构数据
getLpbMenuTree(zrzbsm) {
getLpbMenuTree(zrzbsm)
.then((res) => {
this.pd = res.result;
})
.catch((error) => {});
},
//打开新建楼盘树结构右键菜单唤起的弹框
openLpbDialog(data, type) {
this.treeData = data;
this.menuType = type;
this.dialogVisible = true;
},
//弹框中的保存按钮,根据不同菜单点击类型调用不同子组件的保存方法
saveInfo() {
switch (this.menuType) {
case "ljz":
this.$refs.ljz.onSave(this.$refs.ljz.form, this.treeData.bsm);
break;
case "zdy":
this.$refs.zdy.submitForm("form", this.pd[0].bsm, this.treeData.bsm);
break;
case "ch":
this.$refs.ch.onSave(this.pd[0].bsm);
break;
default:
break;
}
},
//弹框中的重置按钮
resetInfo() {
switch (this.menuType) {
case "ljz":
this.$refs.ljz.reset();
break;
case "zdy":
this.$refs.zdy.reset();
break;
case "ch":
this.$refs.ch.reset();
break;
default:
break;
}
},
//关闭弹框
closeDaialog() {
this.dialogVisible = false;
},
//图例的展开收起
legendToggle() {
this.legendToggleFlag = !this.legendToggleFlag;
},
//获取选中户bsm
getHbsm(data,type){
this.bsms = data;
if(type){
// 双击
this.hbsm = this.bsms[this.bsms.length-1];
this.hbjVisible = true;
this.$nextTick(function () {
this.$refs.hbj.getHInfo(this.hbsm);
})
}else{
//单击 TO DO
}
console.log(this.bsms);
},
//不动产单元号输入框事件
inputFocus(){
this.inputWidth = 200
},
inputBlur(){
this.inputWidth = 74
},
inputChange(){
if (this.bdcdyh!='') {
console.log('查询'+this.bdcdyh);
this.$refs.lpbContent.lpbDataMap(this.bdcdyh);
}else{
this.$message({
message: "请输入内容后查询",
type: "warning",
})
}
},
//户保存
hbjSaveInfo(){
this.$refs.hbj.onSave(this.bsms[this.bsms.length-1],this.tabPosition);
},
//户编辑表单重置
hbjResetInfo(){
this.$refs.hbj.onReset();
},
//调用楼盘表信息查询接口
getlpbData(){
this.$refs.lpbContent.getLpb(this.$store.state.zrzbsm);
//改变楼盘表子组件的key值,重新渲染
this.time = new Date().getTime();
},
//实预测装换
plScYcChange(){
let data={
zrzbsm:this.$store.state.zrzbsm,
scyclx:"0"
}
batchScYcChange(data).then((res)=>{
if(res.code===200){
this.$message.success("实预测转换成功")
}
})
},
//选中房屋状态
handleChoosedH(name){
console.log(name,'选中房屋状态');
// Dyzt:{list:[],mj:''}
//清除选中户
this.$refs.lpbContent.clearChoosedH()
//给hBsmList传值
switch (name) {
case '未确权':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Wqqzt.bsms;
break;
case '已确权':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Qqzt.bsms;
break;
case '已备案':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Bazt.bsms;
break;
case '预抵押':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Ydyzt.bsms;
break;
case '在建抵押':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Zjgcdyzt.bsms;
break;
case '抵押':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Dyzt.bsms;
break;
case '查封':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Cfzt.bsms;
break;
case '异议':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Yyzt.bsms;
break;
case '限制':
this.$refs.lpbContent.choosedList = this.dyztBsmList.Xzzt.bsms;
break;
default:
break;
}
// this.$refs.lpbContent.choosedList=["0a66bc775dcec26385f9124cc0fd8656", "58cafdbee129bb412527f674ef9267ae", "4bbca678fa56d5ab97b8a62c7cb54898", "ecfd72e9a31a03ba0ab4e46faba2b51b", "049033ea9d244b4b5ea75521b6862239", "013352d8a001a1d5f790296b6843627b", "ed8e3f0e2b2682cf76b4d58b9a74e49c", "37cc53acaf2c3bb92be4b9adf06d94c9", "f5a5e14ce08c26056aca5861f56e5cf6", "11eeaaa5c9f5f1231c69d3b958d05568", "421978023a36d4920dbb86300cc52dc9", "e97f2af2588cc0e41ffb6b203df617c9", "7210987d94350472dca10d4ad71fffc5", "6eb1b50edce538a4c63574e9e28fedce", "43c5fecd7623ceabc37844e8a4722603", "c361ccfcd3da9f7288110c6fa202cb96", "2321512f6f8d0ec9f570c6eec9a892fe", "ea08fb234cd908c89a0d21c085dadb2f", "be71f7f0ec926e1850d3baec8817cdbd", "6f695d6b7ecb97f7ff17f22dbe86b93c", "4ee1604b2629e6797d3096c20229223b"]
},
//批量添加不动产单元号
addBdcdyh(){
// this.pd[0].bsm //自然幢标识码
console.log(this.$store.state.zrzh,'this.$store.state.zrzh');
},
//获取各项单元状态的户bsm
getDyztBsmList(){
let data={
zrzbsm:this.$store.state.zrzbsm,
syclx:"0"
}
getLpbTj(data).then((res)=>{
if(res.code===200){
this.dyztBsmList = res.result;
//给单元状态图例数据dyztList赋值
this.dyztList[0].mj = res.result.Wqqzt.mj
this.dyztList[0].ts = res.result.Wqqzt.bsms.length
this.dyztList[1].mj = res.result.Qqzt.mj
this.dyztList[1].ts = res.result.Qqzt.bsms.length
this.dyztList[2].mj = res.result.Bazt.mj
this.dyztList[2].ts = res.result.Bazt.bsms.length
this.dyztList[3].mj = res.result.Ydyzt.mj
this.dyztList[3].ts = res.result.Ydyzt.bsms.length
this.dyztList[4].mj = res.result.Zjgcdyzt.mj
this.dyztList[4].ts = res.result.Zjgcdyzt.bsms.length
this.dyztList[5].mj = res.result.Dyzt.mj
this.dyztList[5].ts = res.result.Dyzt.bsms.length
this.dyztList[6].mj = res.result.Cfzt.mj
this.dyztList[6].ts = res.result.Cfzt.bsms.length
this.dyztList[7].mj = res.result.Yyzt.mj
this.dyztList[7].ts = res.result.Yyzt.bsms.length
this.dyztList[8].mj = res.result.Xzzt.mj
this.dyztList[8].ts = res.result.Xzzt.bsms.length
console.log(res,'各项单元状态的户bsmList');
}
})
}
},
computed: {
},
destroyed() {
window.removeEventListener("resize", this.getHeight);
},
watch: {
//树结构和图例伸缩时修改楼盘表主要内容区宽度
legendToggleFlag(n) {
if (n) {
this.lpbContentwidth -= 204;
} else {
this.lpbContentwidth += 204;
}
},
createFlag(n) {
if (n) {
this.lpbContentwidth -= 260;
} else {
this.lpbContentwidth += 260;
}
},
},
};
</script>
<style scoped lang="less">
.edit {
height: 100%;
background-color: #eaedf5;
.tab-header {
border: 1px solid #dedede;
border-top: 0;
box-sizing: border-box;
padding: 20px 0;
background-color: #ffffff;
margin-bottom: 15px;
.searchContent {
box-sizing: border-box;
padding: 0 20px;
/deep/.el-radio-button__inner {
border: 1px solid #00CACD;
color: #00CACD;
}
/deep/.el-radio-button__inner:hover{
color: #00CACD;
}
/deep/.is-active .el-radio-button__inner{
color: #fff;
}
/deep/.el-radio-button__orig-radio:checked+.el-radio-button__inner{
background-color: #00CACD;
border-color: #00CACD;
}
.searchInput {
transition: .5s;
margin-left: 20px;
display: inline-block;
}
}
.radioBtn {
margin-left: 20px;
/deep/.el-radio-button__inner {
border: 1px solid #dcdfe6;
border-radius: 4px;
box-shadow: 0 0 0 0 #409eff !important;
}
}
}
.tab-content {
background-color: #ffffff;
display: flex;
overflow-y: scroll;
.lp-tree {
height: 100%;
overflow: hidden;
transition: 0.5s;
.treeData {
margin-top: 20px;
margin-left: 20px;
float: left;
}
}
.w0 {
width: 0;
}
.w260 {
width: 260px;
}
.lp-overview {
transition: 0.5s;
flex: 1;
padding-right: 20px;
box-sizing: border-box;
}
.lp-legend {
transition: 0.5s;
height: 100%;
font-size: 14px;
.handleCol {
width: 34px;
float: right;
height: 100%;
.btn {
cursor: pointer;
height: 40px;
line-height: 40px;
text-align: center;
background-color: #0091FF;
color: #fff;
border-bottom: 1px solid #e6e6e6;
}
.dyzt {
height: 81px;
line-height: 81px;
}
.fwxz,
.fwyt {
height: 122px;
}
.dyzt,
.fwxz,
.fwyt {
cursor: pointer;
border-bottom: 1px solid #e6e6e6;
span {
text-align: center;
height: 100%;
-webkit-writing-mode: vertical-rl;
writing-mode: vertical-rl;
line-height: 34px;
letter-spacing: 2px;
}
}
.selectedZt{
background-color: #0091FF;
color: #fff;
}
}
.legendTable-wrap {
transition: 0.5s;
float: right;
overflow: hidden;
.legendTable {
margin-top: -1px;
tr {
height: 40px;
line-height: 40px;
th:first-child {
width: 80px;
}
th {
width: 60px;
height: 40px;
white-space: nowrap;
}
td {
height: 40px;
text-align: center;
white-space: nowrap;
}
td:first-child {
text-align: left;
text-indent: 2px;
}
}
}
}
}
}
.tab-content::-webkit-scrollbar{
width: 1px;
}
.btnGroup {
margin: 20px auto 0;
width: 230px;
}
}
</style>