2fdf4543 by 杨威

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

1 parent 144011e0
...@@ -99,6 +99,11 @@ export default { ...@@ -99,6 +99,11 @@ export default {
99 this.$parent.$parent.getlpbData(); 99 this.$parent.$parent.getlpbData();
100 //关闭弹框 100 //关闭弹框
101 this.$parent.$parent.closeDaialog(); 101 this.$parent.$parent.closeDaialog();
102 }else{
103 this.$message({
104 message: res.message,
105 type: "warning",
106 })
102 } 107 }
103 }); 108 });
104 }, 109 },
......
...@@ -323,7 +323,6 @@ export default { ...@@ -323,7 +323,6 @@ export default {
323 } 323 }
324 }, 324 },
325 onSave(data, bsm) { 325 onSave(data, bsm) {
326 debugger
327 //自然幢标识码 326 //自然幢标识码
328 this.form.zrzbsm = bsm; 327 this.form.zrzbsm = bsm;
329 insertLjzInfo(this.form).then((res) => { 328 insertLjzInfo(this.form).then((res) => {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
4 <div class="ljz-wrap" :style="{'width':ljzWidth+'px'}" v-show="lpbData.ljzs.length>0"> 4 <div class="ljz-wrap" :style="{'width':ljzWidth+'px'}" v-show="lpbData.ljzs.length>0">
5 <!-- 循环逻辑幢数据 --> 5 <!-- 循环逻辑幢数据 -->
6 <div class="ljz" ref="ljz" v-for="(ljzs,ljzIndex) in lpbData.ljzs" :key="ljzIndex"> 6 <div class="ljz" ref="ljz" v-for="(ljzs,ljzIndex) in lpbData.ljzs" :key="ljzIndex">
7 <div class="ljz-zdy-wrap"> 7
8 <div class="ljz-zdy-wrap" >
8 <!-- 循环逻辑幢下的幢单元 --> 9 <!-- 循环逻辑幢下的幢单元 -->
9 <div class="ljz-zdy" v-show="ljzs.zdys.length>0" v-for="(zdys,zdyIndex) in ljzs.zdys" :key="zdyIndex"> 10 <div class="ljz-zdy" v-show="ljzs.zdys.length>0" v-for="(zdys,zdyIndex) in ljzs.zdys" :key="zdyIndex">
10 <!-- 循环幢单元下的层户 --> 11 <!-- 循环幢单元下的层户 -->
...@@ -21,7 +22,19 @@ ...@@ -21,7 +22,19 @@
21 {{zdys.zdymc}} 22 {{zdys.zdymc}}
22 </div> 23 </div>
23 </div> 24 </div>
25 <!-- 循环逻辑幢下的层户 -->
26 <div class="ljz-ch">
27 <table class="chTable" border="1" cellspacing="0" cellpadding="0" v-show="ljzs.cs.length>0">
28 <tr v-for="(cs) in ljzs.cs" :key="cs.bsm">
29 <!-- 显示层数 -->
30 <td class="floor">{{cs.sjc}}</td>
31 <!-- 显示户 -->
32 <td v-for="(hs,hsIndex) in cs.hs" :key="hsIndex" @click="handleTdClick($event,hs.bsm)" @dblclick="dbclick(hs.bsm)">{{hs.hh}}</td>
33 </tr>
34 </table>
35 </div>
24 </div> 36 </div>
37
25 <!-- 逻辑幢名称 --> 38 <!-- 逻辑幢名称 -->
26 <div class="ljz-name name"> 39 <div class="ljz-name name">
27 {{ljzs.ljzmc}} 40 {{ljzs.ljzmc}}
...@@ -85,7 +98,7 @@ export default { ...@@ -85,7 +98,7 @@ export default {
85 }, 98 },
86 lpbContentWidth: "", 99 lpbContentWidth: "",
87 ljzWidth:10000, 100 ljzWidth:10000,
88 zdyWidth:2000, 101 zdyWidth:1000,
89 cHeight:0, 102 cHeight:0,
90 loading:true, 103 loading:true,
91 hbsmList:[], 104 hbsmList:[],
...@@ -118,12 +131,18 @@ export default { ...@@ -118,12 +131,18 @@ export default {
118 this.ljzWidth += item.offsetWidth + 20 131 this.ljzWidth += item.offsetWidth + 20
119 }) 132 })
120 //计算独立幢单元和独立层户宽度 133 //计算独立幢单元和独立层户宽度
121 this.zdyWidth -= 1980; 134 //考虑this.$refs.zdy的length为0的情况 TO DO
122 this.$refs.zdy.forEach(item=>{ 135 console.log(this.$refs.zdy,'this.$refs.zdy');
123 this.zdyWidth += item.offsetWidth + 20; 136 if(this.$refs.zdy.length > 0){
124 this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight; 137 this.zdyWidth -= 980;
125 }) 138 this.$refs.zdy.forEach(item=>{
126 this.zdyWidth += this.$refs.ch.offsetWidth; 139 this.zdyWidth += item.offsetWidth + 20;
140 this.cHeight = item.offsetHeight > this.cHeight ? item.offsetHeight : this.cHeight;
141 })
142 this.zdyWidth += this.$refs.ch.offsetWidth;
143 }else{
144 // this.zdyWidth = 124;
145 }
127 }, 200); 146 }, 200);
128 } else { 147 } else {
129 this.$message({ 148 this.$message({
...@@ -223,6 +242,9 @@ export default { ...@@ -223,6 +242,9 @@ export default {
223 background-color: rosybrown; 242 background-color: rosybrown;
224 } 243 }
225 } 244 }
245 .ljz-ch{
246 display: inline-table;
247 }
226 .ljz-zdy:last-child{ 248 .ljz-zdy:last-child{
227 margin-right: 0; 249 margin-right: 0;
228 } 250 }
......
...@@ -82,9 +82,10 @@ ...@@ -82,9 +82,10 @@
82 } 82 }
83 }, 83 },
84 methods:{ 84 methods:{
85 //在自然幢节点上添加幢单元只需传zrzbsm,ljzbsm为'';在逻辑幢上添加幢单元时需要同时传入zrzbsm和ljzbsm
85 submitForm(formName,zrzbsm,ljzbsm) { 86 submitForm(formName,zrzbsm,ljzbsm) {
86 this.form.zrzbsm=zrzbsm; 87 this.form.zrzbsm=zrzbsm;
87 this.form.ljzbsm=ljzbsm; 88 this.form.ljzbsm= zrzbsm == ljzbsm ? '':ljzbsm;
88 this.$refs[formName].validate((valid) => { 89 this.$refs[formName].validate((valid) => {
89 if (valid) { 90 if (valid) {
90 insertZdyInfo(this.form).then((res)=>{ 91 insertZdyInfo(this.form).then((res)=>{
...@@ -118,7 +119,6 @@ ...@@ -118,7 +119,6 @@
118 </script> 119 </script>
119 120
120 <style scoped> 121 <style scoped>
121
122 /deep/.el-input__inner{ 122 /deep/.el-input__inner{
123 width: 100%; 123 width: 100%;
124 border:0; 124 border:0;
......