2fdf4543 by 杨威

修复自然幢上添加层户和幢单元以及逻辑幢上添加层户问题

1 parent 144011e0
......@@ -99,6 +99,11 @@ export default {
this.$parent.$parent.getlpbData();
//关闭弹框
this.$parent.$parent.closeDaialog();
}else{
this.$message({
message: res.message,
type: "warning",
})
}
});
},
......
......@@ -323,7 +323,6 @@ export default {
}
},
onSave(data, bsm) {
debugger
//自然幢标识码
this.form.zrzbsm = bsm;
insertLjzInfo(this.form).then((res) => {
......
......@@ -4,7 +4,8 @@
<div class="ljz-wrap" :style="{'width':ljzWidth+'px'}" v-show="lpbData.ljzs.length>0">
<!-- 循环逻辑幢数据 -->
<div class="ljz" ref="ljz" v-for="(ljzs,ljzIndex) in lpbData.ljzs" :key="ljzIndex">
<div class="ljz-zdy-wrap">
<div class="ljz-zdy-wrap" >
<!-- 循环逻辑幢下的幢单元 -->
<div class="ljz-zdy" v-show="ljzs.zdys.length>0" v-for="(zdys,zdyIndex) in ljzs.zdys" :key="zdyIndex">
<!-- 循环幢单元下的层户 -->
......@@ -21,7 +22,19 @@
{{zdys.zdymc}}
</div>
</div>
<!-- 循环逻辑幢下的层户 -->
<div class="ljz-ch">
<table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="ljzs.cs.length>0">
<tr v-for="(cs) in ljzs.cs" :key="cs.bsm">
<!-- 显示层数 -->
<td class="floor">{{cs.sjc}}</td>
<!-- 显示户 -->
<td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
</tr>
</table>
</div>
</div>
<!-- 逻辑幢名称 -->
<div class="ljz-name name">
{{ljzs.ljzmc}}
......@@ -85,7 +98,7 @@ export default {
},
lpbContentWidth: "",
ljzWidth:10000,
zdyWidth:2000,
zdyWidth:1000,
cHeight:0,
loading:true,
hbsmList:[],
......@@ -118,12 +131,18 @@ export default {
this.ljzWidth += item.offsetWidth + 20
})
//计算独立幢单元和独立层户宽度
this.zdyWidth -= 1980;
this.$refs.zdy.forEach(item=>{
this.zdyWidth += item.offsetWidth + 20;
this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight;
})
this.zdyWidth += this.$refs.ch.offsetWidth;
//考虑this.$refs.zdy的length为0的情况 TO DO
console.log(this.$refs.zdy,'this.$refs.zdy');
if(this.$refs.zdy.length > 0){
this.zdyWidth -= 980;
this.$refs.zdy.forEach(item=>{
this.zdyWidth += item.offsetWidth + 20;
this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight;
})
this.zdyWidth += this.$refs.ch.offsetWidth;
}else{
// this.zdyWidth = 124;
}
}, 200);
} else {
this.$message({
......@@ -223,6 +242,9 @@ export default {
background-color: rosybrown;
}
}
.ljz-ch{
display: inline-table;
}
.ljz-zdy:last-child{
margin-right: 0;
}
......
......@@ -82,9 +82,10 @@
}
},
methods:{
//在自然幢节点上添加幢单元只需传zrzbsm,ljzbsm为'';在逻辑幢上添加幢单元时需要同时传入zrzbsm和ljzbsm
submitForm(formName,zrzbsm,ljzbsm) {
this.form.zrzbsm=zrzbsm;
this.form.ljzbsm=ljzbsm;
this.form.ljzbsm= zrzbsm == ljzbsm ? '':ljzbsm;
this.$refs[formName].validate((valid) => {
if (valid) {
insertZdyInfo(this.form).then((res)=>{
......@@ -118,7 +119,6 @@
</script>
<style scoped>
/deep/.el-input__inner{
width: 100%;
border:0;
......