87856703 by 杨威

根据户权属状态判断是否可以做批量操作

1 parent 5810b0e0
...@@ -401,13 +401,18 @@ export default { ...@@ -401,13 +401,18 @@ export default {
401 if (this.bsms.length <= 0) { 401 if (this.bsms.length <= 0) {
402 Message.warning("请选择操作户") 402 Message.warning("请选择操作户")
403 return 403 return
404 } 404 }else{
405 if (this.qsztList.indexOf('1') > -1) {
406 Message.warning("已提交的户无法继续操作")
407 }else{
405 batchCommit(this.bsms).then(res=>{ 408 batchCommit(this.bsms).then(res=>{
406 if (res.success) { 409 if (res.success) {
407 Message.success("提交成功"); 410 Message.success("提交成功");
408 this.getlpbData(); 411 this.getlpbData();
409 } 412 }
410 }) 413 })
414 }
415 }
411 }, 416 },
412 loading(){ 417 loading(){
413 this.getLpbMenuTree(this.$store.state.zrzbsm); 418 this.getLpbMenuTree(this.$store.state.zrzbsm);
...@@ -423,7 +428,10 @@ export default { ...@@ -423,7 +428,10 @@ export default {
423 if (this.bsms.length <= 0) { 428 if (this.bsms.length <= 0) {
424 Message.warning("请选择操作户") 429 Message.warning("请选择操作户")
425 return 430 return
426 } 431 }else{
432 if (this.qsztList.indexOf('1') > -1) {
433 Message.warning("已提交的户无法继续操作")
434 }else{
427 switch (val) { 435 switch (val) {
428 case 'h': 436 case 'h':
429 this.plhVisible=true; 437 this.plhVisible=true;
...@@ -437,6 +445,8 @@ export default { ...@@ -437,6 +445,8 @@ export default {
437 default: 445 default:
438 break; 446 break;
439 } 447 }
448 }
449 }
440 }, 450 },
441 lodding(){ 451 lodding(){
442 this.getlpbData(); 452 this.getlpbData();
...@@ -462,6 +472,7 @@ export default { ...@@ -462,6 +472,7 @@ export default {
462 //清空已选中层户 472 //清空已选中层户
463 this.cbsmList = []; 473 this.cbsmList = [];
464 this.bsms = []; 474 this.bsms = [];
475 this.qsztList = [];
465 this.$refs.lpbContent.hbsmList = []; 476 this.$refs.lpbContent.hbsmList = [];
466 this.$nextTick(()=>{ 477 this.$nextTick(()=>{
467 //户 478 //户
...@@ -565,6 +576,16 @@ export default { ...@@ -565,6 +576,16 @@ export default {
565 this.bsms = data; 576 this.bsms = data;
566 } 577 }
567 }, 578 },
579 //获取选中户信息
580 getQsztList(data, type) {
581 if (type) {
582 // 双击
583
584 } else {
585 //单击 TO DO
586 this.qsztList = data;
587 }
588 },
568 //获取选中层bsmlist 589 //获取选中层bsmlist
569 getCbsm(data){ 590 getCbsm(data){
570 this.cbsmList = data; 591 this.cbsmList = data;
...@@ -631,7 +652,9 @@ export default { ...@@ -631,7 +652,9 @@ export default {
631 }, 652 },
632 //批量添加不动产单元号 653 //批量添加不动产单元号
633 addBdcdyh() { 654 addBdcdyh() {
634 // this.pd[0].bsm //自然幢标识码 655 if (this.qsztList.indexOf('1') > -1) {
656 Message.warning("已提交的户无法继续操作")
657 }else{
635 batchGeneratorBdcdyh(this.$store.state.zrzh, this.pd[0].bsm,0).then( 658 batchGeneratorBdcdyh(this.$store.state.zrzh, this.pd[0].bsm,0).then(
636 (res) => { 659 (res) => {
637 if (res.code === 200) { 660 if (res.code === 200) {
...@@ -643,6 +666,7 @@ export default { ...@@ -643,6 +666,7 @@ export default {
643 } 666 }
644 } 667 }
645 ); 668 );
669 }
646 }, 670 },
647 671
648 open(hasGenerateCount,unGenerateCount) { 672 open(hasGenerateCount,unGenerateCount) {
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
65 :rowspan="hs.sjcs" 65 :rowspan="hs.sjcs"
66 :colspan="hs.sjhs" 66 :colspan="hs.sjhs"
67 :data-bsm="hs.bsm" 67 :data-bsm="hs.bsm"
68 :data-qszt="hs.qszt"
68 ref="hBsm" 69 ref="hBsm"
69 :key="hsIndex" 70 :key="hsIndex"
70 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" 71 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
...@@ -126,6 +127,7 @@ ...@@ -126,6 +127,7 @@
126 :rowspan="hs.sjcs" 127 :rowspan="hs.sjcs"
127 :colspan="hs.sjhs" 128 :colspan="hs.sjhs"
128 :data-bsm="hs.bsm" 129 :data-bsm="hs.bsm"
130 :data-qszt="hs.qszt"
129 ref="hBsm" 131 ref="hBsm"
130 :key="hsIndex" 132 :key="hsIndex"
131 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" 133 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
...@@ -199,6 +201,7 @@ ...@@ -199,6 +201,7 @@
199 :rowspan="hs.sjcs" 201 :rowspan="hs.sjcs"
200 :colspan="hs.sjhs" 202 :colspan="hs.sjhs"
201 :data-bsm="hs.bsm" 203 :data-bsm="hs.bsm"
204 :data-qszt="hs.qszt"
202 ref="hBsm" 205 ref="hBsm"
203 :key="hsIndex" 206 :key="hsIndex"
204 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" 207 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
...@@ -253,6 +256,7 @@ ...@@ -253,6 +256,7 @@
253 :rowspan="hs.sjcs" 256 :rowspan="hs.sjcs"
254 :colspan="hs.sjhs" 257 :colspan="hs.sjhs"
255 :data-bsm="hs.bsm" 258 :data-bsm="hs.bsm"
259 :data-qszt="hs.qszt"
256 ref="hBsm" 260 ref="hBsm"
257 :key="hsIndex" 261 :key="hsIndex"
258 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''" 262 :class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
...@@ -425,6 +429,7 @@ export default { ...@@ -425,6 +429,7 @@ export default {
425 loading: true, 429 loading: true,
426 hbsm:'', 430 hbsm:'',
427 hbsmList: [], 431 hbsmList: [],
432 hqsztList:[],
428 cbsmList: [], 433 cbsmList: [],
429 time: null, //区分单双击事件的定时器 434 time: null, //区分单双击事件的定时器
430 searchNum: Math.random(), 435 searchNum: Math.random(),
...@@ -619,6 +624,7 @@ export default { ...@@ -619,6 +624,7 @@ export default {
619 //未选中→选中 624 //未选中→选中
620 e.className = "tdSelect"; //加边框 625 e.className = "tdSelect"; //加边框
621 this.hbsmList.push(bsm); // 将户bsm放进hbsmList 626 this.hbsmList.push(bsm); // 将户bsm放进hbsmList
627 this.hqsztList.push(hs.qszt); // 将户qszt放进hqsztList
622 switch (this.lpbParent) { 628 switch (this.lpbParent) {
623 case 'isHbfg': 629 case 'isHbfg':
624 this.fghbChoosedList.push(hs); 630 this.fghbChoosedList.push(hs);
...@@ -631,6 +637,7 @@ export default { ...@@ -631,6 +637,7 @@ export default {
631 break; 637 break;
632 case 'isLpb': 638 case 'isLpb':
633 this.$parent.getHbsm(this.hbsmList, false); 639 this.$parent.getHbsm(this.hbsmList, false);
640 this.$parent.getQsztList(this.hqsztList, false);
634 break; 641 break;
635 642
636 default: 643 default:
...@@ -651,7 +658,9 @@ export default { ...@@ -651,7 +658,9 @@ export default {
651 break; 658 break;
652 case 'isLpb': 659 case 'isLpb':
653 this.hbsmList = this.hbsmList.filter(i=>i!=bsm); 660 this.hbsmList = this.hbsmList.filter(i=>i!=bsm);
661 this.hqsztList = this.hqsztList.filter(i=>i!=hs.qszt);
654 this.$parent.getHbsm(this.hbsmList, false); 662 this.$parent.getHbsm(this.hbsmList, false);
663 this.$parent.getQsztList(this.hqsztList, false);
655 break; 664 break;
656 665
657 default: 666 default:
...@@ -695,6 +704,7 @@ export default { ...@@ -695,6 +704,7 @@ export default {
695 }); 704 });
696 // 清空hbsmList 705 // 清空hbsmList
697 this.hbsmList = []; 706 this.hbsmList = [];
707 this.hqsztList = [];
698 // }); 708 // });
699 }, 709 },
700 //户右键点击事件 710 //户右键点击事件
...@@ -774,7 +784,7 @@ export default { ...@@ -774,7 +784,7 @@ export default {
774 if (e.target.className.indexOf("tdSelect") == -1) { 784 if (e.target.className.indexOf("tdSelect") == -1) {
775 //未选中→选中 785 //未选中→选中
776 e.target.className += " tdSelect"; //加边框 786 e.target.className += " tdSelect"; //加边框
777 this.cbsmList.push(item.bsm); // 将户bsm放进hbsmList 787 this.cbsmList.push(item.bsm);
778 } else { 788 } else {
779 //选中→未选中 789 //选中→未选中
780 e.target.className = "floor"; 790 e.target.className = "floor";
...@@ -965,35 +975,39 @@ export default { ...@@ -965,35 +975,39 @@ export default {
965 this.$refs.hBsm.forEach((item) => { 975 this.$refs.hBsm.forEach((item) => {
966 item.className = "tdSelect"; 976 item.className = "tdSelect";
967 this.hbsmList.push(item.dataset.bsm); // 将户bsm放进hbsmList 977 this.hbsmList.push(item.dataset.bsm); // 将户bsm放进hbsmList
978 this.hqsztList.push(item.dataset.qszt)
968 }); 979 });
969 }else{ 980 }else{
970 this.$refs.hBsm.forEach((item) => { 981 this.$refs.hBsm.forEach((item) => {
971 item.className = ""; 982 item.className = "";
972 this.hbsmList = []; 983 this.hbsmList = [];
984 this.hqsztList = [];
973 }); 985 });
974 } 986 }
975 this.$nextTick(()=>{ 987 this.$nextTick(()=>{
976 this.$parent.getHbsm(this.hbsmList, false); 988 this.$parent.getHbsm(this.hbsmList, false);
989 this.$parent.getQsztList(this.hqsztList, false);
977 }) 990 })
978 }, 991 },
979 //幢单元全选 992 //幢单元全选
980 zdySelectAll(val,cs){ 993 zdySelectAll(val,cs){
981 let zdyHbsmList = []; 994 let zdyHbsmList = [];
995 let zdyHqsztList = [];
982 cs.forEach(i=>{ 996 cs.forEach(i=>{
983 i.hs.forEach(j=>{ 997 i.hs.forEach(j=>{
984 zdyHbsmList.push(j.bsm) 998 zdyHbsmList.push(j.bsm)
999 zdyHqsztList.push(j.qszt)
985 }) 1000 })
986 }); 1001 });
987 if (val) { 1002 if (val) {
988 this.$nextTick(()=>{ 1003 this.$nextTick(()=>{
989 console.log(zdyHbsmList);
990 this.$refs.hBsm.forEach((item) => { 1004 this.$refs.hBsm.forEach((item) => {
991 console.log(item.dataset.bsm);
992 if (zdyHbsmList.indexOf(item.dataset.bsm)>-1) { 1005 if (zdyHbsmList.indexOf(item.dataset.bsm)>-1) {
993 item.className = "tdSelect"; 1006 item.className = "tdSelect";
994 this.hbsmList = zdyHbsmList; // 将户bsm放进hbsmList
995 } 1007 }
996 }); 1008 });
1009 this.hbsmList = this.hbsmList.concat(zdyHbsmList);
1010 this.hqsztList = this.hqsztList.concat(zdyHqsztList);
997 }) 1011 })
998 }else{ 1012 }else{
999 this.$refs.hBsm.forEach((item) => { 1013 this.$refs.hBsm.forEach((item) => {
...@@ -1006,10 +1020,16 @@ export default { ...@@ -1006,10 +1020,16 @@ export default {
1006 this.hbsmList = this.hbsmList.filter(i=>i!=j) 1020 this.hbsmList = this.hbsmList.filter(i=>i!=j)
1007 } 1021 }
1008 }) 1022 })
1023 zdyHqsztList.forEach(j=>{
1024 if (item.dataset.qszt == j) {
1025 this.hqsztList = this.hqsztList.filter(i=>i!=j)
1026 }
1027 })
1009 }); 1028 });
1010 } 1029 }
1011 this.$nextTick(()=>{ 1030 this.$nextTick(()=>{
1012 this.$parent.getHbsm(this.hbsmList, false); 1031 this.$parent.getHbsm(this.hbsmList, false);
1032 this.$parent.getQsztList(this.hqsztList, false);
1013 }) 1033 })
1014 }, 1034 },
1015 //逻辑幢、幢单元、层双击 1035 //逻辑幢、幢单元、层双击
...@@ -1056,7 +1076,8 @@ export default { ...@@ -1056,7 +1076,8 @@ export default {
1056 console.log(item.dataset.bsm, "item.dataset.bsm"); 1076 console.log(item.dataset.bsm, "item.dataset.bsm");
1057 // 判断hbsmList中是否已经存在 1077 // 判断hbsmList中是否已经存在
1058 if (this.hbsmList.indexOf(item.dataset.bsm) == -1) { 1078 if (this.hbsmList.indexOf(item.dataset.bsm) == -1) {
1059 this.hbsmList.push(item.dataset.bsm); // 将户bsm放进hbsmList 1079 this.hbsmList.push(item.dataset.bsm);
1080 this.hqsztList.push(item.dataset.qszt);
1060 } 1081 }
1061 } 1082 }
1062 }); 1083 });
......