9920fe4d by 杨威

树结构添加逻辑幢

1 parent 9274d1a1
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
66 :style="{ left: lpbleft + 'px', top: lpbtop + 'px' }" 66 :style="{ left: lpbleft + 'px', top: lpbtop + 'px' }"
67 class="contextmenu" 67 class="contextmenu"
68 > 68 >
69 <li v-show="zdData.type == 'zrz'" @click="openLpbDialog">添加逻辑幢</li> 69 <li v-show="zdData.type == 'zrz'" @click="openLpbDialog('ljz')">添加逻辑幢</li>
70 <li v-show="zdData.type == 'zrz' || zdData.type == 'ljz'" @click="openLpbDialog">添加幢单元</li> 70 <li v-show="zdData.type == 'zrz' || zdData.type == 'ljz'" @click="openLpbDialog('zdy')">添加幢单元</li>
71 <li @click="openLpbDialog">添加层户</li> 71 <li @click="openLpbDialog('ch')">添加层户</li>
72 </ul> 72 </ul>
73 <!-- 添加定着物弹框 --> 73 <!-- 添加定着物弹框 -->
74 <el-dialog title="新建" :visible.sync="dialogVisible" width="40%"> 74 <el-dialog title="新建" :visible.sync="dialogVisible" width="40%">
...@@ -151,7 +151,6 @@ export default { ...@@ -151,7 +151,6 @@ export default {
151 this.isZD = data; 151 this.isZD = data;
152 }, 152 },
153 changeLpbVisible(data) { 153 changeLpbVisible(data) {
154 console.log(this.zdData,'zdData');
155 this.lpbvisible = data; 154 this.lpbvisible = data;
156 }, 155 },
157 //添加定着物 156 //添加定着物
...@@ -213,8 +212,8 @@ export default { ...@@ -213,8 +212,8 @@ export default {
213 this.lpbvisible = false 212 this.lpbvisible = false
214 }, 213 },
215 //楼盘表右键菜单项打开父组件弹框 214 //楼盘表右键菜单项打开父组件弹框
216 openLpbDialog(){ 215 openLpbDialog(type){
217 this.$parent.openLpbDialog(this.zdData); 216 this.$parent.openLpbDialog(this.zdData,type);
218 }, 217 },
219 detailDoubleClick(data) { 218 detailDoubleClick(data) {
220 clearTimeout(this.timer); 219 clearTimeout(this.timer);
......
...@@ -155,10 +155,6 @@ ...@@ -155,10 +155,6 @@
155 </tbody> 155 </tbody>
156 </table> 156 </table>
157 </el-form> 157 </el-form>
158 <div style="min-height: 40px;text-align: center;margin-top: 10px">
159 <el-button type="success" @click="onSave">保存</el-button>
160 <el-button type="primary" @click="onSubmit">提交</el-button>
161 </div>
162 </div> 158 </div>
163 159
164 </template> 160 </template>
...@@ -243,16 +239,14 @@ ...@@ -243,16 +239,14 @@
243 this.fwjgTitleRowspan=this.form.fwjgList.length; 239 this.fwjgTitleRowspan=this.form.fwjgList.length;
244 } 240 }
245 }, 241 },
246 onSave(){ 242 onSave(data,bsm){
247 console.log(this.form)
248 //自然幢标识码 243 //自然幢标识码
249 this.form.zrzbsm=this.$router.query.bsm; 244 this.form.zrzbsm= bsm;
250 insertLjzInfo(this.form).then((res)=>{ 245 insertLjzInfo(data).then((res)=>{
251 if(res.code===200){ 246 if(res.code===200){
252 this.$message.success("保存成功") 247 this.$message.success("保存成功")
253 } 248 }
254 }) 249 })
255
256 }, 250 },
257 onSubmit(){ 251 onSubmit(){
258 console.log(this.form) 252 console.log(this.form)
...@@ -269,10 +263,8 @@ ...@@ -269,10 +263,8 @@
269 <style rel="stylesheet/less" lang="less" scoped> 263 <style rel="stylesheet/less" lang="less" scoped>
270 .h { 264 .h {
271 min-height: 200px; 265 min-height: 200px;
272 width: 80%; 266 width: 100%;
273 margin-top: 10px; 267 margin: 0 auto;
274 margin-left: 10%;
275 float: left;
276 268
277 /deep/.el-input__inner{ 269 /deep/.el-input__inner{
278 width: 100%; 270 width: 100%;
......
...@@ -37,17 +37,32 @@ ...@@ -37,17 +37,32 @@
37 width="50%" 37 width="50%"
38 center 38 center
39 > 39 >
40 添加 40 <!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
41 <div class="addCh" v-show="menuType == 'ljz'">
42 <addLjz ref="ljz"></addLjz>
43 </div>
44 <div class="addCh" v-show="menuType == 'zdy'">
45 幢单元
46 </div>
47 <div class="addCh" v-show="menuType == 'ch'">
48 层户
49 </div>
50 <div class="btnGroup">
51 <el-button type="primary" @click="saveInfo">保存</el-button>
52 <el-button type="primary">重置</el-button>
53 <el-button type="primary" @click="dialogVisible = false">取消</el-button>
54 </div>
41 </el-dialog> 55 </el-dialog>
42 </div> 56 </div>
43 </template> 57 </template>
44 58
45 <script> 59 <script>
46 import LineTree from "../../../../components/lineTree/lineTree"; 60 import LineTree from "../../../../components/lineTree/lineTree";
61 import addLjz from "../../ljz/index"
47 import {getLpbMenuTree} from "../../../../api/lpb" 62 import {getLpbMenuTree} from "../../../../api/lpb"
48 export default { 63 export default {
49 name:"", 64 name:"",
50 components:{LineTree}, 65 components:{LineTree,addLjz},
51 props:{}, 66 props:{},
52 data(){ 67 data(){
53 return { 68 return {
...@@ -57,7 +72,9 @@ export default { ...@@ -57,7 +72,9 @@ export default {
57 bdcdyh:'', 72 bdcdyh:'',
58 islpb:true, 73 islpb:true,
59 pd:[], //创建楼盘的树结构数据 74 pd:[], //创建楼盘的树结构数据
60 dialogVisible:false 75 dialogVisible:false,
76 menuType:'',
77 treeData:{}
61 } 78 }
62 }, 79 },
63 created(){}, 80 created(){},
...@@ -78,9 +95,28 @@ export default { ...@@ -78,9 +95,28 @@ export default {
78 .catch((error) => {}); 95 .catch((error) => {});
79 }, 96 },
80 //打开新建楼盘树结构右键菜单唤起的弹框 97 //打开新建楼盘树结构右键菜单唤起的弹框
81 openLpbDialog(data){ 98 openLpbDialog(data,type){
82 console.log(data,'data'); 99 console.log(data,'data');
100 this.treeData = data;
101 this.menuType = type;
83 this.dialogVisible = true 102 this.dialogVisible = true
103 },
104 //弹框中的保存按钮
105 saveInfo(){
106 switch (this.menuType) {
107 case 'ljz':
108 this.$refs.ljz.onSave(this.$refs.ljz.form,this.treeData.bsm)
109 break;
110 case 'zdy':
111
112 break;
113 case 'ch':
114
115 break;
116
117 default:
118 break;
119 }
84 } 120 }
85 }, 121 },
86 computed: {}, 122 computed: {},
...@@ -147,5 +183,9 @@ export default { ...@@ -147,5 +183,9 @@ export default {
147 width: 200px; 183 width: 200px;
148 } 184 }
149 } 185 }
186 .btnGroup{
187 margin: 20px auto 0;
188 width: 230px;
189 }
150 } 190 }
151 </style> 191 </style>
...\ No newline at end of file ...\ No newline at end of file
......