9920fe4d by 杨威

树结构添加逻辑幢

1 parent 9274d1a1
......@@ -66,9 +66,9 @@
:style="{ left: lpbleft + 'px', top: lpbtop + 'px' }"
class="contextmenu"
>
<li v-show="zdData.type == 'zrz'" @click="openLpbDialog">添加逻辑幢</li>
<li v-show="zdData.type == 'zrz' || zdData.type == 'ljz'" @click="openLpbDialog">添加幢单元</li>
<li @click="openLpbDialog">添加层户</li>
<li v-show="zdData.type == 'zrz'" @click="openLpbDialog('ljz')">添加逻辑幢</li>
<li v-show="zdData.type == 'zrz' || zdData.type == 'ljz'" @click="openLpbDialog('zdy')">添加幢单元</li>
<li @click="openLpbDialog('ch')">添加层户</li>
</ul>
<!-- 添加定着物弹框 -->
<el-dialog title="新建" :visible.sync="dialogVisible" width="40%">
......@@ -151,7 +151,6 @@ export default {
this.isZD = data;
},
changeLpbVisible(data) {
console.log(this.zdData,'zdData');
this.lpbvisible = data;
},
//添加定着物
......@@ -213,8 +212,8 @@ export default {
this.lpbvisible = false
},
//楼盘表右键菜单项打开父组件弹框
openLpbDialog(){
this.$parent.openLpbDialog(this.zdData);
openLpbDialog(type){
this.$parent.openLpbDialog(this.zdData,type);
},
detailDoubleClick(data) {
clearTimeout(this.timer);
......
......@@ -155,10 +155,6 @@
</tbody>
</table>
</el-form>
<div style="min-height: 40px;text-align: center;margin-top: 10px">
<el-button type="success" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</div>
</template>
......@@ -243,16 +239,14 @@
this.fwjgTitleRowspan=this.form.fwjgList.length;
}
},
onSave(){
console.log(this.form)
onSave(data,bsm){
//自然幢标识码
this.form.zrzbsm=this.$router.query.bsm;
insertLjzInfo(this.form).then((res)=>{
this.form.zrzbsm= bsm;
insertLjzInfo(data).then((res)=>{
if(res.code===200){
this.$message.success("保存成功")
}
})
},
onSubmit(){
console.log(this.form)
......@@ -269,10 +263,8 @@
<style rel="stylesheet/less" lang="less" scoped>
.h {
min-height: 200px;
width: 80%;
margin-top: 10px;
margin-left: 10%;
float: left;
width: 100%;
margin: 0 auto;
/deep/.el-input__inner{
width: 100%;
......
......@@ -37,17 +37,32 @@
width="50%"
center
>
添加
<!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
<div class="addCh" v-show="menuType == 'ljz'">
<addLjz ref="ljz"></addLjz>
</div>
<div class="addCh" v-show="menuType == 'zdy'">
幢单元
</div>
<div class="addCh" v-show="menuType == 'ch'">
层户
</div>
<div class="btnGroup">
<el-button type="primary" @click="saveInfo">保存</el-button>
<el-button type="primary">重置</el-button>
<el-button type="primary" @click="dialogVisible = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LineTree from "../../../../components/lineTree/lineTree";
import addLjz from "../../ljz/index"
import {getLpbMenuTree} from "../../../../api/lpb"
export default {
name:"",
components:{LineTree},
components:{LineTree,addLjz},
props:{},
data(){
return {
......@@ -57,7 +72,9 @@ export default {
bdcdyh:'',
islpb:true,
pd:[], //创建楼盘的树结构数据
dialogVisible:false
dialogVisible:false,
menuType:'',
treeData:{}
}
},
created(){},
......@@ -78,9 +95,28 @@ export default {
.catch((error) => {});
},
//打开新建楼盘树结构右键菜单唤起的弹框
openLpbDialog(data){
openLpbDialog(data,type){
console.log(data,'data');
this.treeData = data;
this.menuType = type;
this.dialogVisible = true
},
//弹框中的保存按钮
saveInfo(){
switch (this.menuType) {
case 'ljz':
this.$refs.ljz.onSave(this.$refs.ljz.form,this.treeData.bsm)
break;
case 'zdy':
break;
case 'ch':
break;
default:
break;
}
}
},
computed: {},
......@@ -147,5 +183,9 @@ export default {
width: 200px;
}
}
.btnGroup{
margin: 20px auto 0;
width: 230px;
}
}
</style>
\ No newline at end of file
......