逻辑幢编辑功能
Showing
3 changed files
with
77 additions
and
26 deletions
... | @@ -231,10 +231,10 @@ | ... | @@ -231,10 +231,10 @@ |
231 | <xxxx v-if="!bjztFlag"></xxxx> | 231 | <xxxx v-if="!bjztFlag"></xxxx> |
232 | 232 | ||
233 | <!-- 右键菜单弹出框 --> | 233 | <!-- 右键菜单弹出框 --> |
234 | <el-dialog v-dialogDrag :close-on-click-modal="false" title="添加" :visible.sync="dialogVisible" width="50%" > | 234 | <el-dialog v-dialogDrag :close-on-click-modal="false" :title="taskTitle" :visible.sync="dialogVisible" width="50%" > |
235 | <!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 --> | 235 | <!-- 根据菜单类型(menuType)和右键点击的楼盘类型(treeData.type)来区分弹框内容 --> |
236 | <div class="addCh" v-show="menuType == 'ljz'"> | 236 | <div class="addCh" v-show="menuType == 'ljz'"> |
237 | <addLjz ref="ljz"></addLjz> | 237 | <addLjz ref="ljz" :ljzbsm="curBsm"></addLjz> |
238 | </div> | 238 | </div> |
239 | <div class="addCh" v-show="menuType == 'zdy'"> | 239 | <div class="addCh" v-show="menuType == 'zdy'"> |
240 | <addZdy ref="zdy"></addZdy> | 240 | <addZdy ref="zdy"></addZdy> |
... | @@ -377,6 +377,8 @@ export default { | ... | @@ -377,6 +377,8 @@ export default { |
377 | cbsmList:[], // 层bsmlist | 377 | cbsmList:[], // 层bsmlist |
378 | lpbloading:true, | 378 | lpbloading:true, |
379 | bjztFlag:true, | 379 | bjztFlag:true, |
380 | taskTitle:'添加', | ||
381 | curBsm:'', | ||
380 | }; | 382 | }; |
381 | }, | 383 | }, |
382 | created() { | 384 | created() { |
... | @@ -510,6 +512,8 @@ export default { | ... | @@ -510,6 +512,8 @@ export default { |
510 | this.resetInfo(); | 512 | this.resetInfo(); |
511 | }); | 513 | }); |
512 | this.dialogVisible = true; | 514 | this.dialogVisible = true; |
515 | this.taskTitle = '添加'; | ||
516 | this.curBsm = ''; | ||
513 | }, | 517 | }, |
514 | //弹框中的保存按钮,根据不同菜单点击类型调用不同子组件的保存方法 | 518 | //弹框中的保存按钮,根据不同菜单点击类型调用不同子组件的保存方法 |
515 | saveInfo() { | 519 | saveInfo() { | ... | ... |
... | @@ -196,6 +196,12 @@ import { formdate } from "@libs/function"; | ... | @@ -196,6 +196,12 @@ import { formdate } from "@libs/function"; |
196 | export default { | 196 | export default { |
197 | name: "ljz", | 197 | name: "ljz", |
198 | components: {}, | 198 | components: {}, |
199 | props: { | ||
200 | ljzbsm:{ | ||
201 | type: String, | ||
202 | default: '', | ||
203 | } | ||
204 | }, | ||
199 | data() { | 205 | data() { |
200 | return { | 206 | return { |
201 | form: { | 207 | form: { |
... | @@ -314,26 +320,50 @@ export default { | ... | @@ -314,26 +320,50 @@ export default { |
314 | onSave(data, bsm) { | 320 | onSave(data, bsm) { |
315 | //自然幢标识码 | 321 | //自然幢标识码 |
316 | this.form.zrzbsm = bsm; | 322 | this.form.zrzbsm = bsm; |
317 | insertLjzInfo(this.form).then((res) => { | 323 | if(this.ljzbsm == ''){ |
318 | if (res.code === 200) { | 324 | insertLjzInfo(this.form).then((res) => { |
319 | this.$message.success("保存成功"); | 325 | if (res.code === 200) { |
320 | //更新树结构数据 | 326 | this.$message.success("保存成功"); |
321 | console.log(this); | 327 | //更新树结构数据 |
322 | this.$parent.$parent.getLpbMenuTree(bsm); | 328 | console.log(this); |
323 | //关闭弹框 | 329 | this.$parent.$parent.getLpbMenuTree(bsm); |
324 | this.$parent.$parent.closeDaialog(); | 330 | //关闭弹框 |
325 | }else{ | 331 | this.$parent.$parent.closeDaialog(); |
326 | this.$message.error(res.message); | 332 | }else{ |
327 | } | 333 | this.$message.error(res.message); |
328 | }); | 334 | } |
335 | }); | ||
336 | }else{ | ||
337 | //逻辑幢更新接口调用 TODO | ||
338 | console.log('保存'); | ||
339 | } | ||
329 | }, | 340 | }, |
330 | onSubmit() { | 341 | onSubmit() { |
331 | console.log(this.form); | 342 | // console.log(this.form); |
332 | }, | 343 | }, |
344 | //根据逻辑幢bsm查询逻辑幢信息 | ||
345 | getLjzInfo(bsm){ | ||
346 | //逻辑幢信息查询接口调用 bsm为逻辑幢bsm TODO | ||
347 | this.form = {zrzh:'11111111'}; | ||
348 | this.$forceUpdate(); | ||
349 | } | ||
350 | }, | ||
351 | created() { | ||
333 | }, | 352 | }, |
334 | created() {this.form.zrzh = this.$store.state.zrzh;}, | ||
335 | mounted() { | 353 | mounted() { |
354 | this.form.zrzh = this.$store.state.zrzh; | ||
336 | }, | 355 | }, |
356 | watch:{ | ||
357 | ljzbsm: { | ||
358 | handler: function (item) { | ||
359 | console.log(item,'item'); | ||
360 | if(item!=''){ | ||
361 | this.getLjzInfo(this.ljzbsm) | ||
362 | } | ||
363 | }, | ||
364 | immediate: true | ||
365 | }, | ||
366 | } | ||
337 | }; | 367 | }; |
338 | </script> | 368 | </script> |
339 | <style rel="stylesheet/less" lang="less" scoped> | 369 | <style rel="stylesheet/less" lang="less" scoped> | ... | ... |
... | @@ -153,7 +153,7 @@ | ... | @@ -153,7 +153,7 @@ |
153 | 153 | ||
154 | <!-- 逻辑幢名称 --> | 154 | <!-- 逻辑幢名称 --> |
155 | <div class="ljz-name name"> | 155 | <div class="ljz-name name"> |
156 | <p> | 156 | <p class="cp" @dblclick="openZxx(ljzs.bsm,'ljz')"> |
157 | {{ ljzs.ljzmc }} | 157 | {{ ljzs.ljzmc }} |
158 | </p> | 158 | </p> |
159 | </div> | 159 | </div> |
... | @@ -893,6 +893,8 @@ export default { | ... | @@ -893,6 +893,8 @@ export default { |
893 | this.fghbChoosedList = []; | 893 | this.fghbChoosedList = []; |
894 | // 更新楼盘表 | 894 | // 更新楼盘表 |
895 | this.getLpb(this.zrzbsm, this.$parent.scyclx); | 895 | this.getLpb(this.zrzbsm, this.$parent.scyclx); |
896 | }else{ | ||
897 | Message.error(res.message); | ||
896 | } | 898 | } |
897 | }) | 899 | }) |
898 | .catch(() => {}); | 900 | .catch(() => {}); |
... | @@ -917,6 +919,8 @@ export default { | ... | @@ -917,6 +919,8 @@ export default { |
917 | this.fghbChoosedList = []; | 919 | this.fghbChoosedList = []; |
918 | // 更新楼盘表 | 920 | // 更新楼盘表 |
919 | this.getLpb(this.zrzbsm, this.$parent.scyclx); | 921 | this.getLpb(this.zrzbsm, this.$parent.scyclx); |
922 | }else{ | ||
923 | Message.error(res.message); | ||
920 | } | 924 | } |
921 | }) | 925 | }) |
922 | .catch(() => {}); | 926 | .catch(() => {}); |
... | @@ -1007,6 +1011,15 @@ export default { | ... | @@ -1007,6 +1011,15 @@ export default { |
1007 | this.$nextTick(()=>{ | 1011 | this.$nextTick(()=>{ |
1008 | this.$parent.getHbsm(this.hbsmList, false); | 1012 | this.$parent.getHbsm(this.hbsmList, false); |
1009 | }) | 1013 | }) |
1014 | }, | ||
1015 | //逻辑幢、幢单元、层双击 | ||
1016 | openZxx(bsm,type){ | ||
1017 | if (this.lpbParent == 'isLpb') { | ||
1018 | this.$parent.taskTitle = '编辑'; | ||
1019 | this.$parent.dialogVisible = true; | ||
1020 | this.$parent.curBsm = bsm; | ||
1021 | this.$parent.menuType = type; | ||
1022 | } | ||
1010 | } | 1023 | } |
1011 | }, | 1024 | }, |
1012 | computed: { | 1025 | computed: { |
... | @@ -1051,16 +1064,20 @@ export default { | ... | @@ -1051,16 +1064,20 @@ export default { |
1051 | }, | 1064 | }, |
1052 | //父组件中选择单元状态改变选中户的边框颜色 | 1065 | //父组件中选择单元状态改变选中户的边框颜色 |
1053 | choosedList(n) { | 1066 | choosedList(n) { |
1054 | this.$refs.hBsm.forEach((item) => { | 1067 | if (n.length>0) { |
1055 | this.choosedList.forEach((i) => { | 1068 | this.$refs.hBsm.forEach((item) => { |
1056 | if (item.dataset.bsm == i) { | 1069 | this.choosedList.forEach((i,ind) => { |
1057 | //定位到最后一个户所在位置 | 1070 | if (item.dataset.bsm == i) { |
1058 | this.$refs.lpbContent.scrollTop = item.offsetTop; | 1071 | if (ind == 0) { |
1059 | this.$refs.lpbContent.scrollLeft = item.offsetLeft; | 1072 | //定位到第一个户所在位置 |
1060 | item.style.border = '1px solid '+this.borderColor; | 1073 | this.$refs.lpbContent.scrollTop = item.offsetTop; |
1061 | } | 1074 | this.$refs.lpbContent.scrollLeft = item.offsetLeft; |
1075 | } | ||
1076 | item.style.border = '1px solid '+this.borderColor; | ||
1077 | } | ||
1078 | }); | ||
1062 | }); | 1079 | }); |
1063 | }); | 1080 | } |
1064 | }, | 1081 | }, |
1065 | lpbChVisible(value) { | 1082 | lpbChVisible(value) { |
1066 | if (value) { | 1083 | if (value) { | ... | ... |
-
Please register or sign in to post a comment