bf17b557 by 杨威

逻辑幢编辑功能

1 parent a8f2f934
......@@ -231,10 +231,10 @@
<xxxx v-if="!bjztFlag"></xxxx>
<!-- 右键菜单弹出框 -->
<el-dialog v-dialogDrag :close-on-click-modal="false" title="添加" :visible.sync="dialogVisible" width="50%" >
<el-dialog v-dialogDrag :close-on-click-modal="false" :title="taskTitle" :visible.sync="dialogVisible" width="50%" >
<!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 -->
<div class="addCh" v-show="menuType == 'ljz'">
<addLjz ref="ljz"></addLjz>
<addLjz ref="ljz" :ljzbsm="curBsm"></addLjz>
</div>
<div class="addCh" v-show="menuType == 'zdy'">
<addZdy ref="zdy"></addZdy>
......@@ -377,6 +377,8 @@ export default {
cbsmList:[], // 层bsmlist
lpbloading:true,
bjztFlag:true,
taskTitle:'添加',
curBsm:'',
};
},
created() {
......@@ -510,6 +512,8 @@ export default {
this.resetInfo();
});
this.dialogVisible = true;
this.taskTitle = '添加';
this.curBsm = '';
},
//弹框中的保存按钮,根据不同菜单点击类型调用不同子组件的保存方法
saveInfo() {
......
......@@ -196,6 +196,12 @@ import { formdate } from "@libs/function";
export default {
name: "ljz",
components: {},
props: {
ljzbsm:{
type: String,
default: '',
}
},
data() {
return {
form: {
......@@ -314,26 +320,50 @@ export default {
onSave(data, bsm) {
//自然幢标识码
this.form.zrzbsm = bsm;
insertLjzInfo(this.form).then((res) => {
if (res.code === 200) {
this.$message.success("保存成功");
//更新树结构数据
console.log(this);
this.$parent.$parent.getLpbMenuTree(bsm);
//关闭弹框
this.$parent.$parent.closeDaialog();
}else{
this.$message.error(res.message);
}
});
if(this.ljzbsm == ''){
insertLjzInfo(this.form).then((res) => {
if (res.code === 200) {
this.$message.success("保存成功");
//更新树结构数据
console.log(this);
this.$parent.$parent.getLpbMenuTree(bsm);
//关闭弹框
this.$parent.$parent.closeDaialog();
}else{
this.$message.error(res.message);
}
});
}else{
//逻辑幢更新接口调用 TODO
console.log('保存');
}
},
onSubmit() {
console.log(this.form);
// console.log(this.form);
},
//根据逻辑幢bsm查询逻辑幢信息
getLjzInfo(bsm){
//逻辑幢信息查询接口调用 bsm为逻辑幢bsm TODO
this.form = {zrzh:'11111111'};
this.$forceUpdate();
}
},
created() {
},
created() {this.form.zrzh = this.$store.state.zrzh;},
mounted() {
this.form.zrzh = this.$store.state.zrzh;
},
watch:{
ljzbsm: {
handler: function (item) {
console.log(item,'item');
if(item!=''){
this.getLjzInfo(this.ljzbsm)
}
},
immediate: true
},
}
};
</script>
<style rel="stylesheet/less" lang="less" scoped>
......
......@@ -153,7 +153,7 @@
<!-- 逻辑幢名称 -->
<div class="ljz-name name">
<p>
<p class="cp" @dblclick="openZxx(ljzs.bsm,'ljz')">
{{ ljzs.ljzmc }}
</p>
</div>
......@@ -893,6 +893,8 @@ export default {
this.fghbChoosedList = [];
// 更新楼盘表
this.getLpb(this.zrzbsm, this.$parent.scyclx);
}else{
Message.error(res.message);
}
})
.catch(() => {});
......@@ -917,6 +919,8 @@ export default {
this.fghbChoosedList = [];
// 更新楼盘表
this.getLpb(this.zrzbsm, this.$parent.scyclx);
}else{
Message.error(res.message);
}
})
.catch(() => {});
......@@ -1007,6 +1011,15 @@ export default {
this.$nextTick(()=>{
this.$parent.getHbsm(this.hbsmList, false);
})
},
//逻辑幢、幢单元、层双击
openZxx(bsm,type){
if (this.lpbParent == 'isLpb') {
this.$parent.taskTitle = '编辑';
this.$parent.dialogVisible = true;
this.$parent.curBsm = bsm;
this.$parent.menuType = type;
}
}
},
computed: {
......@@ -1051,16 +1064,20 @@ export default {
},
//父组件中选择单元状态改变选中户的边框颜色
choosedList(n) {
this.$refs.hBsm.forEach((item) => {
this.choosedList.forEach((i) => {
if (item.dataset.bsm == i) {
//定位到最后一个户所在位置
this.$refs.lpbContent.scrollTop = item.offsetTop;
this.$refs.lpbContent.scrollLeft = item.offsetLeft;
item.style.border = '1px solid '+this.borderColor;
}
if (n.length>0) {
this.$refs.hBsm.forEach((item) => {
this.choosedList.forEach((i,ind) => {
if (item.dataset.bsm == i) {
if (ind == 0) {
//定位到第一个户所在位置
this.$refs.lpbContent.scrollTop = item.offsetTop;
this.$refs.lpbContent.scrollLeft = item.offsetLeft;
}
item.style.border = '1px solid '+this.borderColor;
}
});
});
});
}
},
lpbChVisible(value) {
if (value) {
......