8b8a2107 by 杨威

在多幢下新建自然幢

1 parent 2fe36949
......@@ -109,7 +109,7 @@ export default {
self.time = setTimeout(() => {
item.expand = item.expand == undefined? true:!item.expand;
// self.$emit("itemClick", item);
if (!item.children) {
if (!item.children && !item.type) {
let data = {
xzqbsm:item.xzq,
djqbsm:item.djq,
......@@ -150,6 +150,9 @@ export default {
this.$emit("changeIsZD", true);
this.$emit("changeVisible", true);
break;
case 'dz':
this.$emit("changeDzVisible", true);
break;
case 'zrz':
this.$emit("changeIsZD", false);
this.$emit("changeVisible", true);
......
......@@ -42,6 +42,7 @@
@changeLpbVisible="changeLpbVisible"
@changeIsZD="changeIsZD"
@changeCreateVisible="changeCreateVisible"
@changeDzVisible="changeDzVisible"
:list="item.children"
:visible="visible"
:size="size"
......@@ -65,6 +66,13 @@
<li @click="deleteByBsm()">删除</li>
</ul>
<ul
v-show="dzVisible"
:style="{ left: left + 'px', top: top + 'px' }"
class="contextmenu"
>
<li @click="openCreateDialog">新建自然幢</li>
</ul>
<ul
v-show="createVisible"
:style="{ left: left + 'px', top: top + 'px' }"
class="contextmenu"
......@@ -121,6 +129,8 @@ export default {
lpbleft: 0,
//控制新建宗地菜单
createVisible:false,
//多幢
dzVisible:false
};
},
watch: {
......@@ -136,6 +146,13 @@ export default {
document.body.removeEventListener("click", this.closeMenu);
}
},
dzVisible(value) {
if (value) {
document.body.addEventListener("click", this.closeMenu);
} else {
document.body.removeEventListener("click", this.closeMenu);
}
},
// createVisible(value) {
// if (value) {
......@@ -176,10 +193,16 @@ export default {
changeCreateVisible(data){
this.createVisible = true;
},
//多幢
changeDzVisible(data){
this.dzVisible = data
},
//添加定着物
openCreateDialog(){
console.log(this.zdData,'this.zdData');
this.dialogVisible = true;
this.$store.state.rightClickZdbsm = this.zdData.zdbsm;
this.$store.state.zdbsm = this.zdData.zdbsm;
this.$store.state.dzbsm = this.zdData.bsm;
},
//关闭添加定着物弹框
closeDialog() {
......@@ -262,6 +285,7 @@ export default {
//关闭右键菜单
closeMenu(){
this.lpbvisible = false;
this.dzVisible = false;
// this.createVisible = false;
},
//楼盘表右键菜单项打开父组件弹框
......
......@@ -45,7 +45,8 @@ const store = new Vuex.Store({
gyfsList: [],
hbsm:'',
contentWidth:'', //内容区域宽度
zrzh:'' //自然幢号
zrzh:'', //自然幢号
dzbsm:'' // 多幢bsm
},
modules: {
user,
......
......@@ -250,7 +250,8 @@ export default {
//todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm
this.$refs['ruleForm1'].validate((valid) => {
if (valid) {
this.ruleForm1.zdbsm = this.$store.state.rightClickZdbsm != '' ? this.$store.state.rightClickZdbsm : '';
this.ruleForm1.zdbsm = this.$store.state.zdbsm != '' ? this.$store.state.zdbsm : '';
this.ruleForm1.dzbsm = this.$store.state.dzbsm != '' ? this.$store.state.dzbsm : '';
insertZrzjbxx(this.ruleForm1)
.then((res) => {
if (res.code == "200") {
......