户合并完善
Showing
3 changed files
with
123 additions
and
20 deletions
... | @@ -59,3 +59,14 @@ export function getHZdxx(bsm) { | ... | @@ -59,3 +59,14 @@ export function getHZdxx(bsm) { |
59 | }) | 59 | }) |
60 | 60 | ||
61 | } | 61 | } |
62 | |||
63 | /** | ||
64 | * 户合并 | ||
65 | */ | ||
66 | export function hhb(data) { | ||
67 | return request({ | ||
68 | url: '/bg/hSplitMerge/hHb', | ||
69 | method: 'post', | ||
70 | data: data | ||
71 | }) | ||
72 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -313,7 +313,7 @@ export default { | ... | @@ -313,7 +313,7 @@ export default { |
313 | xmmc:'测试自然幢', | 313 | xmmc:'测试自然幢', |
314 | bdcqzh:'A12111111111111111', | 314 | bdcqzh:'A12111111111111111', |
315 | dylx:'zrz', | 315 | dylx:'zrz', |
316 | zrzbsm:'18cea8b4438ebf838ac86f4ceff90a6b' | 316 | zrzbsm:'b7162d97848b0d31d301f8d4a5b4596b' |
317 | } | 317 | } |
318 | ] | 318 | ] |
319 | }, | 319 | }, |
... | @@ -349,7 +349,26 @@ export default { | ... | @@ -349,7 +349,26 @@ export default { |
349 | }, | 349 | }, |
350 | //实预测转换 | 350 | //实预测转换 |
351 | scyclxChange(){ | 351 | scyclxChange(){ |
352 | 352 | //清空已选中层户 | |
353 | // this.bsms = []; | ||
354 | this.$refs.lpbContent.hbsmList = []; | ||
355 | this.$nextTick(()=>{ | ||
356 | //户 | ||
357 | this.$refs.lpbContent.$refs.hBsm.forEach(item=>{ | ||
358 | item.style.borderColor = 'rgb(230, 230, 230)'; | ||
359 | if (item.className == "tdSelect") { | ||
360 | item.className = ""; | ||
361 | } | ||
362 | }); | ||
363 | //层 | ||
364 | this.$refs.lpbContent.$refs.cBsm.forEach(item=>{ | ||
365 | console.log(item.className,'item.className'); | ||
366 | item.className = "floor"; | ||
367 | }); | ||
368 | }) | ||
369 | //获取图例数据 | ||
370 | this.getDyztBsmList(); | ||
371 | this.getLpbFwytAndQlxz(); | ||
353 | }, | 372 | }, |
354 | inputChange() { | 373 | inputChange() { |
355 | if (this.bdcdyh != "") { | 374 | if (this.bdcdyh != "") { | ... | ... |
... | @@ -62,7 +62,7 @@ | ... | @@ -62,7 +62,7 @@ |
62 | ref="hBsm" | 62 | ref="hBsm" |
63 | :key="hsIndex" | 63 | :key="hsIndex" |
64 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" | 64 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" |
65 | @click="handleTdClick($event, hs.bsm)" | 65 | @click="handleTdClick($event, hs.bsm,hs)" |
66 | @dblclick="dbclick(hs.bsm)" | 66 | @dblclick="dbclick(hs.bsm)" |
67 | @contextmenu.prevent="openMenu($event, hs, 'h')" | 67 | @contextmenu.prevent="openMenu($event, hs, 'h')" |
68 | > | 68 | > |
... | @@ -117,7 +117,7 @@ | ... | @@ -117,7 +117,7 @@ |
117 | ref="hBsm" | 117 | ref="hBsm" |
118 | :key="hsIndex" | 118 | :key="hsIndex" |
119 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" | 119 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" |
120 | @click="handleTdClick($event, hs.bsm)" | 120 | @click="handleTdClick($event, hs.bsm,hs)" |
121 | @dblclick="dbclick(hs.bsm)" | 121 | @dblclick="dbclick(hs.bsm)" |
122 | @contextmenu.prevent="openMenu($event, hs, 'h')" | 122 | @contextmenu.prevent="openMenu($event, hs, 'h')" |
123 | > | 123 | > |
... | @@ -179,7 +179,7 @@ | ... | @@ -179,7 +179,7 @@ |
179 | ref="hBsm" | 179 | ref="hBsm" |
180 | :key="hsIndex" | 180 | :key="hsIndex" |
181 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" | 181 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" |
182 | @click="handleTdClick($event, hs.bsm)" | 182 | @click="handleTdClick($event, hs.bsm,hs)" |
183 | @dblclick="dbclick(hs.bsm)" | 183 | @dblclick="dbclick(hs.bsm)" |
184 | @contextmenu.prevent="openMenu($event, hs, 'h')" | 184 | @contextmenu.prevent="openMenu($event, hs, 'h')" |
185 | > | 185 | > |
... | @@ -224,7 +224,7 @@ | ... | @@ -224,7 +224,7 @@ |
224 | ref="hBsm" | 224 | ref="hBsm" |
225 | :key="hsIndex" | 225 | :key="hsIndex" |
226 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" | 226 | :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" |
227 | @click="handleTdClick($event, hs.bsm)" | 227 | @click="handleTdClick($event, hs.bsm,hs)" |
228 | @dblclick="dbclick(hs.bsm)" | 228 | @dblclick="dbclick(hs.bsm)" |
229 | @contextmenu.prevent="openMenu($event, hs, 'h')" | 229 | @contextmenu.prevent="openMenu($event, hs, 'h')" |
230 | > | 230 | > |
... | @@ -259,6 +259,10 @@ | ... | @@ -259,6 +259,10 @@ |
259 | 向下添加层 | 259 | 向下添加层 |
260 | </li> | 260 | </li> |
261 | <li v-show="rightClickFlag == 'c'" @click="handleDeleteC">删除层</li> | 261 | <li v-show="rightClickFlag == 'c'" @click="handleDeleteC">删除层</li> |
262 | <!-- 合并 --> | ||
263 | <li v-show="rightClickFlag == 'hb'" :class="canHb!='zyhb'? 'cantHb':''" @click="handleHb('zyhb')">左右合并</li> | ||
264 | <li v-show="rightClickFlag == 'hb'" :class="canHb!='sxhb'? 'cantHb':''" @click="handleHb('sxhb')">上下合并</li> | ||
265 | |||
262 | </ul> | 266 | </ul> |
263 | <!-- 层操作弹框 --> | 267 | <!-- 层操作弹框 --> |
264 | <el-dialog | 268 | <el-dialog |
... | @@ -301,7 +305,8 @@ | ... | @@ -301,7 +305,8 @@ |
301 | </template> | 305 | </template> |
302 | <script> | 306 | <script> |
303 | import moveH from "./../../../../../components/moveH/moveH"; | 307 | import moveH from "./../../../../../components/moveH/moveH"; |
304 | import { getLpb, insertUpDownC, deleteCByBsm } from "../../../../../api/lpb"; | 308 | import { getLpb, insertUpDownC, deleteCByBsm } from "@api/lpb"; |
309 | import { hhb } from "@api/h"; | ||
305 | export default { | 310 | export default { |
306 | name: "", | 311 | name: "", |
307 | components: { moveH }, | 312 | components: { moveH }, |
... | @@ -356,6 +361,8 @@ export default { | ... | @@ -356,6 +361,8 @@ export default { |
356 | formLabelWidth: "120px", | 361 | formLabelWidth: "120px", |
357 | yclpbData:{}, | 362 | yclpbData:{}, |
358 | sclpbData:{}, | 363 | sclpbData:{}, |
364 | fghbChoosedList:[], | ||
365 | canHb:''//判断合并类型 | ||
359 | }; | 366 | }; |
360 | }, | 367 | }, |
361 | created() {}, | 368 | created() {}, |
... | @@ -500,7 +507,7 @@ export default { | ... | @@ -500,7 +507,7 @@ export default { |
500 | } | 507 | } |
501 | }, | 508 | }, |
502 | //户单击事件 | 509 | //户单击事件 |
503 | handleTdClick(e, bsm) { | 510 | handleTdClick(e, bsm,hs) { |
504 | let self = this; | 511 | let self = this; |
505 | // 开启延时器,200ms的间隔区分单击和双击,解决双击时执行两次单击事件 | 512 | // 开启延时器,200ms的间隔区分单击和双击,解决双击时执行两次单击事件 |
506 | clearTimeout(self.time); | 513 | clearTimeout(self.time); |
... | @@ -509,13 +516,27 @@ export default { | ... | @@ -509,13 +516,27 @@ export default { |
509 | if (e.target.className.indexOf("tdSelect") == -1) { | 516 | if (e.target.className.indexOf("tdSelect") == -1) { |
510 | //未选中→选中 | 517 | //未选中→选中 |
511 | e.target.className = "tdSelect"; //加边框 | 518 | e.target.className = "tdSelect"; //加边框 |
512 | this.hbsmList.push(bsm); // 将户bsm放进hbsmList | 519 | if(this.isHbfg){ |
520 | this.fghbChoosedList.push(hs); | ||
521 | this.hbsmList.push(bsm); // 将户bsm放进hbsmList | ||
522 | }else{ | ||
523 | this.hbsmList.push(bsm); // 将户bsm放进hbsmList | ||
524 | } | ||
513 | } else { | 525 | } else { |
514 | //选中→未选中 | 526 | //选中→未选中 |
515 | e.target.className = ""; | 527 | e.target.className = ""; |
516 | this.deleteArrOption(this.hbsmList, bsm); | 528 | if(this.isHbfg){ |
529 | this.deleteArrOption(this.fghbChoosedList, hs) | ||
530 | this.deleteArrOption(this.hbsmList, bsm); | ||
531 | }else{ | ||
532 | this.deleteArrOption(this.hbsmList, bsm); | ||
533 | } | ||
534 | } | ||
535 | if(this.isHbfg){ | ||
536 | |||
537 | }else{ | ||
538 | this.$parent.getHbsm(this.hbsmList, false); | ||
517 | } | 539 | } |
518 | this.$parent.getHbsm(this.hbsmList, false); | ||
519 | }, 200); | 540 | }, 200); |
520 | }, | 541 | }, |
521 | //户双击事件 | 542 | //户双击事件 |
... | @@ -551,13 +572,32 @@ export default { | ... | @@ -551,13 +572,32 @@ export default { |
551 | }, | 572 | }, |
552 | //户右键点击事件 | 573 | //户右键点击事件 |
553 | openMenu(e, item, type) { | 574 | openMenu(e, item, type) { |
554 | 575 | this.lpbChLeft = e.pageX; | |
576 | this.lpbChTop = e.pageY; | ||
555 | if (this.isHbfg) { | 577 | if (this.isHbfg) { |
556 | 578 | this.rightClickFlag = 'hb'; | |
579 | console.log(this.fghbChoosedList,'this.fghbChoosedList '); | ||
580 | if (this.fghbChoosedList.length>1) { | ||
581 | this.lpbChVisible = true; | ||
582 | //判断选中户可以执行的合并类型 | ||
583 | let chIsSame = this.fghbChoosedList.every((item)=> { | ||
584 | return item.ch == this.fghbChoosedList[0].ch; | ||
585 | }); | ||
586 | let hhIsSame = this.fghbChoosedList.every((item)=> { | ||
587 | return item.hh == this.fghbChoosedList[0].hh; | ||
588 | }); | ||
589 | this.$nextTick(()=>{ | ||
590 | if(chIsSame){ | ||
591 | this.canHb = 'zyhb' | ||
592 | }else if(hhIsSame){ | ||
593 | this.canHb = 'sxhb' | ||
594 | }else{ | ||
595 | this.canHb = '' | ||
596 | } | ||
597 | }) | ||
598 | } | ||
557 | }else{ | 599 | }else{ |
558 | console.log(e, "e"); | 600 | console.log(e, "e"); |
559 | this.lpbChLeft = e.pageX; | ||
560 | this.lpbChTop = e.pageY; | ||
561 | this.chData = item; | 601 | this.chData = item; |
562 | this.rightClickFlag = type; | 602 | this.rightClickFlag = type; |
563 | this.lpbChVisible = true; | 603 | this.lpbChVisible = true; |
... | @@ -662,6 +702,40 @@ export default { | ... | @@ -662,6 +702,40 @@ export default { |
662 | qsztClick(){ | 702 | qsztClick(){ |
663 | 703 | ||
664 | }, | 704 | }, |
705 | //户合并 | ||
706 | handleHb(type){ | ||
707 | let olbBsms = ''; | ||
708 | this.hbsmList.forEach((item,index)=>{ | ||
709 | olbBsms+= index<this.hbsmList.length-1? item+',':item | ||
710 | }) | ||
711 | if (type == this.canHb) { | ||
712 | this.$confirm("是否确认合并选中户?", "提示", { | ||
713 | confirmButtonText: "确定", | ||
714 | cancelButtonText: "取消", | ||
715 | type: "warning", | ||
716 | }) | ||
717 | .then(() => { | ||
718 | //确定合并 调用合并接口 this.hbsmList为选中户bsm数组 TO DO | ||
719 | let params = { | ||
720 | "ljzbsm": "", | ||
721 | "newuserbsm": "", | ||
722 | "oldBsms": olbBsms, | ||
723 | "scyclx": "", | ||
724 | "zdybsm": "", | ||
725 | "zrzbsm": "" | ||
726 | } | ||
727 | console.log(params,'params'); | ||
728 | // hhb(params).then(() => { | ||
729 | //合并成功后更新楼盘表 | ||
730 | |||
731 | // }) | ||
732 | // .catch(() => {}); | ||
733 | }) | ||
734 | .catch(() => {}); | ||
735 | }else{ | ||
736 | |||
737 | } | ||
738 | } | ||
665 | }, | 739 | }, |
666 | computed: { | 740 | computed: { |
667 | createFlagChange() { | 741 | createFlagChange() { |
... | @@ -711,12 +785,8 @@ export default { | ... | @@ -711,12 +785,8 @@ export default { |
711 | //父组件中选择单元状态改变选中户的边框颜色 | 785 | //父组件中选择单元状态改变选中户的边框颜色 |
712 | choosedList(n) { | 786 | choosedList(n) { |
713 | this.$refs.hBsm.forEach((item) => { | 787 | this.$refs.hBsm.forEach((item) => { |
714 | // console.log(item.dataset.bsm,'item.dataset.bsm'); | ||
715 | // console.log(this.choosedList,'this.choosedList'); | ||
716 | this.choosedList.forEach((i) => { | 788 | this.choosedList.forEach((i) => { |
717 | if (item.dataset.bsm == i) { | 789 | if (item.dataset.bsm == i) { |
718 | // console.log(item.style.border,'item.style.border'); | ||
719 | // console.log(this.borderColor,'this.borderColor'); | ||
720 | item.style.border = '1px solid '+this.borderColor; | 790 | item.style.border = '1px solid '+this.borderColor; |
721 | } | 791 | } |
722 | }); | 792 | }); |
... | @@ -915,7 +985,10 @@ export default { | ... | @@ -915,7 +985,10 @@ export default { |
915 | text-align: center; | 985 | text-align: center; |
916 | transition: 0.5s; | 986 | transition: 0.5s; |
917 | } | 987 | } |
918 | 988 | .cantHb{ | |
989 | opacity: .5; | ||
990 | cursor: not-allowed; | ||
991 | } | ||
919 | .btnGroup { | 992 | .btnGroup { |
920 | margin: 20px auto 0; | 993 | margin: 20px auto 0; |
921 | width: 150px; | 994 | width: 150px; | ... | ... |
-
Please register or sign in to post a comment