87856703 by 杨威

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

1 parent 5810b0e0
......@@ -401,13 +401,18 @@ export default {
if (this.bsms.length <= 0) {
Message.warning("请选择操作户")
return
}
}else{
if (this.qsztList.indexOf('1') > -1) {
Message.warning("已提交的户无法继续操作")
}else{
batchCommit(this.bsms).then(res=>{
if (res.success) {
Message.success("提交成功");
this.getlpbData();
}
})
}
}
},
loading(){
this.getLpbMenuTree(this.$store.state.zrzbsm);
......@@ -423,7 +428,10 @@ export default {
if (this.bsms.length <= 0) {
Message.warning("请选择操作户")
return
}
}else{
if (this.qsztList.indexOf('1') > -1) {
Message.warning("已提交的户无法继续操作")
}else{
switch (val) {
case 'h':
this.plhVisible=true;
......@@ -437,6 +445,8 @@ export default {
default:
break;
}
}
}
},
lodding(){
this.getlpbData();
......@@ -462,6 +472,7 @@ export default {
//清空已选中层户
this.cbsmList = [];
this.bsms = [];
this.qsztList = [];
this.$refs.lpbContent.hbsmList = [];
this.$nextTick(()=>{
//户
......@@ -565,6 +576,16 @@ export default {
this.bsms = data;
}
},
//获取选中户信息
getQsztList(data, type) {
if (type) {
// 双击
} else {
//单击 TO DO
this.qsztList = data;
}
},
//获取选中层bsmlist
getCbsm(data){
this.cbsmList = data;
......@@ -631,7 +652,9 @@ export default {
},
//批量添加不动产单元号
addBdcdyh() {
// this.pd[0].bsm //自然幢标识码
if (this.qsztList.indexOf('1') > -1) {
Message.warning("已提交的户无法继续操作")
}else{
batchGeneratorBdcdyh(this.$store.state.zrzh, this.pd[0].bsm,0).then(
(res) => {
if (res.code === 200) {
......@@ -643,6 +666,7 @@ export default {
}
}
);
}
},
open(hasGenerateCount,unGenerateCount) {
......
......@@ -65,6 +65,7 @@
:rowspan="hs.sjcs"
:colspan="hs.sjhs"
:data-bsm="hs.bsm"
:data-qszt="hs.qszt"
ref="hBsm"
:key="hsIndex"
:class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
......@@ -126,6 +127,7 @@
:rowspan="hs.sjcs"
:colspan="hs.sjhs"
:data-bsm="hs.bsm"
:data-qszt="hs.qszt"
ref="hBsm"
:key="hsIndex"
:class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
......@@ -199,6 +201,7 @@
:rowspan="hs.sjcs"
:colspan="hs.sjhs"
:data-bsm="hs.bsm"
:data-qszt="hs.qszt"
ref="hBsm"
:key="hsIndex"
:class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
......@@ -253,6 +256,7 @@
:rowspan="hs.sjcs"
:colspan="hs.sjhs"
:data-bsm="hs.bsm"
:data-qszt="hs.qszt"
ref="hBsm"
:key="hsIndex"
:class="searchNum == hs.shbw || searchNum == hs.bdcdyh ? 'tdSelect' : ''"
......@@ -425,6 +429,7 @@ export default {
loading: true,
hbsm:'',
hbsmList: [],
hqsztList:[],
cbsmList: [],
time: null, //区分单双击事件的定时器
searchNum: Math.random(),
......@@ -619,6 +624,7 @@ export default {
//未选中→选中
e.className = "tdSelect"; //加边框
this.hbsmList.push(bsm); // 将户bsm放进hbsmList
this.hqsztList.push(hs.qszt); // 将户qszt放进hqsztList
switch (this.lpbParent) {
case 'isHbfg':
this.fghbChoosedList.push(hs);
......@@ -631,6 +637,7 @@ export default {
break;
case 'isLpb':
this.$parent.getHbsm(this.hbsmList, false);
this.$parent.getQsztList(this.hqsztList, false);
break;
default:
......@@ -651,7 +658,9 @@ export default {
break;
case 'isLpb':
this.hbsmList = this.hbsmList.filter(i=>i!=bsm);
this.hqsztList = this.hqsztList.filter(i=>i!=hs.qszt);
this.$parent.getHbsm(this.hbsmList, false);
this.$parent.getQsztList(this.hqsztList, false);
break;
default:
......@@ -695,6 +704,7 @@ export default {
});
// 清空hbsmList
this.hbsmList = [];
this.hqsztList = [];
// });
},
//户右键点击事件
......@@ -774,7 +784,7 @@ export default {
if (e.target.className.indexOf("tdSelect") == -1) {
//未选中→选中
e.target.className += " tdSelect"; //加边框
this.cbsmList.push(item.bsm); // 将户bsm放进hbsmList
this.cbsmList.push(item.bsm);
} else {
//选中→未选中
e.target.className = "floor";
......@@ -965,35 +975,39 @@ export default {
this.$refs.hBsm.forEach((item) => {
item.className = "tdSelect";
this.hbsmList.push(item.dataset.bsm); // 将户bsm放进hbsmList
this.hqsztList.push(item.dataset.qszt)
});
}else{
this.$refs.hBsm.forEach((item) => {
item.className = "";
this.hbsmList = [];
this.hqsztList = [];
});
}
this.$nextTick(()=>{
this.$parent.getHbsm(this.hbsmList, false);
this.$parent.getQsztList(this.hqsztList, false);
})
},
//幢单元全选
zdySelectAll(val,cs){
let zdyHbsmList = [];
let zdyHqsztList = [];
cs.forEach(i=>{
i.hs.forEach(j=>{
zdyHbsmList.push(j.bsm)
zdyHqsztList.push(j.qszt)
})
});
if (val) {
this.$nextTick(()=>{
console.log(zdyHbsmList);
this.$refs.hBsm.forEach((item) => {
console.log(item.dataset.bsm);
if (zdyHbsmList.indexOf(item.dataset.bsm)>-1) {
item.className = "tdSelect";
this.hbsmList = zdyHbsmList; // 将户bsm放进hbsmList
}
});
this.hbsmList = this.hbsmList.concat(zdyHbsmList);
this.hqsztList = this.hqsztList.concat(zdyHqsztList);
})
}else{
this.$refs.hBsm.forEach((item) => {
......@@ -1006,10 +1020,16 @@ export default {
this.hbsmList = this.hbsmList.filter(i=>i!=j)
}
})
zdyHqsztList.forEach(j=>{
if (item.dataset.qszt == j) {
this.hqsztList = this.hqsztList.filter(i=>i!=j)
}
})
});
}
this.$nextTick(()=>{
this.$parent.getHbsm(this.hbsmList, false);
this.$parent.getQsztList(this.hqsztList, false);
})
},
//逻辑幢、幢单元、层双击
......@@ -1056,7 +1076,8 @@ export default {
console.log(item.dataset.bsm, "item.dataset.bsm");
// 判断hbsmList中是否已经存在
if (this.hbsmList.indexOf(item.dataset.bsm) == -1) {
this.hbsmList.push(item.dataset.bsm); // 将户bsm放进hbsmList
this.hbsmList.push(item.dataset.bsm);
this.hqsztList.push(item.dataset.qszt);
}
}
});
......