添加层户功能完善
Showing
5 changed files
with
181 additions
and
121 deletions
| ... | @@ -11,9 +11,18 @@ export function getLpbMenuTree (data) { | ... | @@ -11,9 +11,18 @@ export function getLpbMenuTree (data) { | 
| 11 | }, | 11 | }, | 
| 12 | }) | 12 | }) | 
| 13 | } | 13 | } | 
| 14 | |||
| 15 | /** | 14 | /** | 
| 16 | * 新增幢单元接口信息 | 15 | * 添加逻辑幢信息接口 | 
| 16 | */ | ||
| 17 | export function insertLjzInfo (data) { | ||
| 18 | return request({ | ||
| 19 | url: '/system/qjLjz/insertQjLjz', | ||
| 20 | method: 'post', | ||
| 21 | data:data | ||
| 22 | }) | ||
| 23 | } | ||
| 24 | /** | ||
| 25 | * 添加幢单元接口信息 | ||
| 17 | */ | 26 | */ | 
| 18 | export function insertZdyInfo (data) { | 27 | export function insertZdyInfo (data) { | 
| 19 | return request({ | 28 | return request({ | 
| ... | @@ -21,4 +30,14 @@ export function insertZdyInfo (data) { | ... | @@ -21,4 +30,14 @@ export function insertZdyInfo (data) { | 
| 21 | method: 'post', | 30 | method: 'post', | 
| 22 | data:data | 31 | data:data | 
| 23 | }) | 32 | }) | 
| 33 | } | ||
| 34 | /** | ||
| 35 | * 添加层户接口信息 | ||
| 36 | */ | ||
| 37 | export function insertChInfo (data) { | ||
| 38 | return request({ | ||
| 39 | url: 'fw/lpb/insertQjCH', | ||
| 40 | method: 'post', | ||
| 41 | data:data | ||
| 42 | }) | ||
| 24 | } | 43 | } | 
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
| ... | @@ -69,16 +69,6 @@ export function queryYzgy(id) { | ... | @@ -69,16 +69,6 @@ export function queryYzgy(id) { | 
| 69 | params: {id} | 69 | params: {id} | 
| 70 | }) | 70 | }) | 
| 71 | } | 71 | } | 
| 72 | /** | ||
| 73 | * 新增逻辑幢信息接口 | ||
| 74 | */ | ||
| 75 | export function insertLjzInfo (data) { | ||
| 76 | return request({ | ||
| 77 | url: '/system/qjLjz/insertQjLjz', | ||
| 78 | method: 'post', | ||
| 79 | data:data | ||
| 80 | }) | ||
| 81 | } | ||
| 82 | 72 | ||
| 83 | /** | 73 | /** | 
| 84 | * 新增逻辑幢信息接口 | 74 | * 新增逻辑幢信息接口 | ... | ... | 
| 1 | <template> | 1 | <template> | 
| 2 | <div class="addCh"> | 2 | <div class="addCh"> | 
| 3 | <el-table | 3 | <el-table class="addChTable" :data="tableData" style="width: 100%" border> | 
| 4 | class="addChTable" | 4 | <el-table-column prop="cz" width="40" align="center"> | 
| 5 | :data="tableData" | ||
| 6 | style="width: 100%" | ||
| 7 | border | ||
| 8 | > | ||
| 9 | <el-table-column prop="cz" width="40" align="center"> | ||
| 10 | <template slot-scope="scope"> | ||
| 11 | <span class="cp" @click="handleRowClick(scope.row,scope.$index)">{{scope.row.cz}}</span> | ||
| 12 | </template> | ||
| 13 | </el-table-column> | ||
| 14 | <el-table-column prop="ljzbsm" label="逻辑幢" align="center"> | ||
| 15 | <template slot-scope="scope"> | 5 | <template slot-scope="scope"> | 
| 16 | <el-input size="small" v-model="scope.row.ljzbsm"></el-input> | 6 | <span class="cp" @click="handleRowClick(scope.row, scope.$index)">{{ | 
| 7 | scope.row.cz | ||
| 8 | }}</span> | ||
| 17 | </template> | 9 | </template> | 
| 18 | </el-table-column> | 10 | </el-table-column> | 
| 19 | <el-table-column prop="zdybsm" label="幢单元" align="center"> | 11 | <el-table-column prop="ljzmc" label="逻辑幢" align="center"> | 
| 20 | <template slot-scope="scope"> | 12 | <!-- <template slot-scope="scope"> | 
| 13 | <el-input size="small" v-model="scope.row.ljzbsm"></el-input> | ||
| 14 | </template> --> | ||
| 15 | </el-table-column> | ||
| 16 | <el-table-column prop="zdymc" label="幢单元" align="center"> | ||
| 17 | <!-- <template slot-scope="scope"> | ||
| 21 | <el-input size="small" v-model="scope.row.zdybsm"></el-input> | 18 | <el-input size="small" v-model="scope.row.zdybsm"></el-input> | 
| 22 | </template> | 19 | </template> --> | 
| 23 | </el-table-column> | 20 | </el-table-column> | 
| 24 | <el-table-column prop="qsc" label="起始层" align="center"> | 21 | <el-table-column prop="qsc" label="起始层" align="center"> | 
| 25 | <template slot-scope="scope"> | 22 | <template slot-scope="scope"> | 
| ... | @@ -30,88 +27,158 @@ | ... | @@ -30,88 +27,158 @@ | 
| 30 | <template slot-scope="scope"> | 27 | <template slot-scope="scope"> | 
| 31 | <el-input size="small" v-model="scope.row.jsc"></el-input> | 28 | <el-input size="small" v-model="scope.row.jsc"></el-input> | 
| 32 | </template> | 29 | </template> | 
| 33 | </el-table-column> | 30 | </el-table-column> | 
| 34 | <el-table-column prop="mchs" label="每层户数" align="center"> | 31 | <el-table-column prop="mchs" label="每层户数" align="center"> | 
| 35 | <template slot-scope="scope"> | 32 | <template slot-scope="scope"> | 
| 36 | <el-input size="small" v-model="scope.row.mchs"></el-input> | 33 | <el-input size="small" v-model="scope.row.mchs"></el-input> | 
| 37 | </template> | 34 | </template> | 
| 38 | </el-table-column> | 35 | </el-table-column> | 
| 39 | </el-table> | 36 | </el-table> | 
| 40 | </div> | 37 | </div> | 
| 41 | </template> | 38 | </template> | 
| 42 | 39 | ||
| 43 | <script> | 40 | <script> | 
| 41 | import { insertChInfo } from "../../../../../api/lpb"; | ||
| 44 | export default { | 42 | export default { | 
| 45 | name:"", | 43 | name: "", | 
| 46 | components:{}, | 44 | components: {}, | 
| 47 | props:{}, | 45 | props: { | 
| 48 | data(){ | 46 | treeData: {}, | 
| 49 | return { | 47 | dialogVisible: { | 
| 50 | tableData:[ | 48 | type: Boolean, | 
| 51 | 49 | default: false, | |
| 52 | ], | 50 | }, | 
| 53 | formData:{ | 51 | }, | 
| 54 | cz:'+', | 52 | data() { | 
| 55 | ljzbsm:'', | 53 | return { | 
| 56 | zdybsm:'', | 54 | ljzBsm: null, | 
| 57 | qsc:'', | 55 | zdyBsm: null, | 
| 58 | jsc:'', | 56 | zrzBsm: null, | 
| 59 | mchs:'', | 57 | tableData: [], | 
| 60 | } | 58 | formData: { | 
| 61 | } | 59 | cz: "+", | 
| 62 | }, | 60 | ljzbsm: "", | 
| 63 | created(){ | 61 | ljzmc:"", | 
| 64 | this.tableData.push(this.formData) | 62 | zdymc:"", | 
| 65 | }, | 63 | zdybsm: "", | 
| 66 | mounted(){}, | 64 | zrzbsm: "", | 
| 67 | methods:{ | 65 | syclx: "0", | 
| 68 | //行操作 | 66 | qsc: "", | 
| 69 | handleRowClick(row,index){ | 67 | jsc: "", | 
| 70 | console.log(index); | 68 | hs: "", | 
| 71 | if(row.cz =='+'){ | 69 | }, | 
| 72 | let temp = JSON.parse(JSON.stringify(this.formData)); | 70 | }; | 
| 73 | temp.cz = '-'; | 71 | }, | 
| 74 | this.tableData.push(temp); | 72 | created() {}, | 
| 75 | }else{ | 73 | mounted() { | 
| 76 | this.tableData.splice(index, 1) | 74 | console.log(this.treeData, "treeData"); | 
| 77 | } | 75 | }, | 
| 78 | }, | 76 | methods: { | 
| 79 | //重置数据 | 77 | //行操作 | 
| 80 | reset(){ | 78 | handleRowClick(row, index) { | 
| 81 | this.tableData = [ | 79 | console.log(this.tableData, "this.tableData"); | 
| 82 | { | 80 | console.log(this.formData, "this.formData"); | 
| 83 | cz:'+', | 81 | console.log(index); | 
| 84 | ljzbsm:'', | 82 | if (row.cz == "+") { | 
| 85 | zdybsm:'', | 83 | let temp = JSON.parse(JSON.stringify(this.formData)); | 
| 86 | qsc:'', | 84 | temp.cz = "-"; | 
| 87 | jsc:'', | 85 | this.tableData.push(temp); | 
| 88 | mchs:'', | 86 | } else { | 
| 89 | } | 87 | this.tableData.splice(index, 1); | 
| 90 | ] | 88 | } | 
| 91 | } | 89 | }, | 
| 92 | }, | 90 | onSave(bsm) { | 
| 93 | computed: {}, | 91 | insertChInfo(this.tableData).then((res) => { | 
| 94 | watch: {}, | 92 | if (res.code === 200) { | 
| 95 | } | 93 | this.$message.success("保存成功"); | 
| 94 | //更新树结构数据 | ||
| 95 | console.log(this); | ||
| 96 | this.$parent.$parent.getLpbMenuTree(bsm); | ||
| 97 | //关闭弹框 | ||
| 98 | this.$parent.$parent.closeDaialog(); | ||
| 99 | } | ||
| 100 | }); | ||
| 101 | }, | ||
| 102 | //重置数据 | ||
| 103 | reset() { | ||
| 104 | this.tableData = [ | ||
| 105 | { | ||
| 106 | cz: "+", | ||
| 107 | ljzbsm: "", | ||
| 108 | zdybsm: "", | ||
| 109 | qsc: "", | ||
| 110 | jsc: "", | ||
| 111 | mchs: "", | ||
| 112 | }, | ||
| 113 | ]; | ||
| 114 | }, | ||
| 115 | }, | ||
| 116 | computed: {}, | ||
| 117 | watch: { | ||
| 118 | treeData: { | ||
| 119 | handler(n) { | ||
| 120 | this.formData = { | ||
| 121 | cz: "+", | ||
| 122 | ljzbsm: "", | ||
| 123 | zdybsm: "", | ||
| 124 | zrzbsm: "", | ||
| 125 | syclx: "0", | ||
| 126 | qsc: "", | ||
| 127 | jsc: "", | ||
| 128 | hs: "", | ||
| 129 | }; | ||
| 130 | switch (n.type) { | ||
| 131 | case "zrz": | ||
| 132 | this.formData.zrzbsm = n.bsm; | ||
| 133 | break; | ||
| 134 | case "ljz": | ||
| 135 | this.formData.zrzbsm = n.zrzbsm; | ||
| 136 | this.formData.ljzbsm = n.bsm; | ||
| 137 | this.formData.ljzmc = n.ljzmc; | ||
| 138 | break; | ||
| 139 | case "zdy": | ||
| 140 | this.formData.zrzbsm = n.zrzbsm; | ||
| 141 | this.formData.ljzbsm = n.ljzbsm; | ||
| 142 | this.formData.ljzmc = n.ljzmc; | ||
| 143 | this.formData.zdybsm = n.bsm; | ||
| 144 | this.formData.zdymc = n.mc; | ||
| 145 | break; | ||
| 146 | default: | ||
| 147 | break; | ||
| 148 | } | ||
| 149 | this.tableData = []; | ||
| 150 | this.tableData.push(this.formData); | ||
| 151 | }, | ||
| 152 | //深度监听,第一次接收到父组件传值就触发事件 | ||
| 153 | immediate: true, | ||
| 154 | deep: true, | ||
| 155 | }, | ||
| 156 | // dialogVisible(n){ | ||
| 157 | // this.tableData = []; | ||
| 158 | // if(n){ | ||
| 159 | // this.tableData.push(this.formData); | ||
| 160 | // } | ||
| 161 | // } | ||
| 162 | }, | ||
| 163 | }; | ||
| 96 | </script> | 164 | </script> | 
| 97 | <style lang="less"> | 165 | <style lang="less"> | 
| 98 | .addCh{ | 166 | .addCh { | 
| 99 | .addChTable { | 167 | .addChTable { | 
| 100 | .el-input__inner { | 168 | .el-input__inner { | 
| 101 | height: 20px; | 169 | height: 20px; | 
| 102 | margin: 0; | 170 | margin: 0; | 
| 103 | line-height: 20px; | 171 | line-height: 20px; | 
| 104 | outline: none; | 172 | outline: none; | 
| 105 | border: none; | 173 | border: none; | 
| 106 | color: #606764; | 174 | color: #606764; | 
| 107 | overflow: visible; | 175 | overflow: visible; | 
| 108 | cursor: text; | 176 | cursor: text; | 
| 109 | text-align: center; | 177 | text-align: center; | 
| 110 | } | 178 | } | 
| 111 | } | 179 | } | 
| 112 | .cp{ | 180 | .cp { | 
| 113 | cursor: pointer; | 181 | cursor: pointer; | 
| 114 | } | 182 | } | 
| 115 | } | 183 | } | 
| 116 | |||
| 117 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | 
| 184 | </style> | ... | ... | 
| ... | @@ -38,7 +38,7 @@ | ... | @@ -38,7 +38,7 @@ | 
| 38 | <LineTree :pd="pd" class="treeData" :islpb="islpb"></LineTree> | 38 | <LineTree :pd="pd" class="treeData" :islpb="islpb"></LineTree> | 
| 39 | <p | 39 | <p | 
| 40 | @click="createFlag = false" | 40 | @click="createFlag = false" | 
| 41 | style="width:20px;float:left;cursor:pointer;" | 41 | style="width:20px;float:left;margin-top: 12px;margin-left:10px;cursor:pointer;" | 
| 42 | > | 42 | > | 
| 43 | X | 43 | X | 
| 44 | </p> | 44 | </p> | 
| ... | @@ -96,7 +96,7 @@ | ... | @@ -96,7 +96,7 @@ | 
| 96 | <addZdy ref="zdy"></addZdy> | 96 | <addZdy ref="zdy"></addZdy> | 
| 97 | </div> | 97 | </div> | 
| 98 | <div class="addCh" v-show="menuType == 'ch'"> | 98 | <div class="addCh" v-show="menuType == 'ch'"> | 
| 99 | <addCh ref="ch"></addCh> | 99 | <addCh ref="ch" :dialogVisible="dialogVisible" :treeData="treeData"></addCh> | 
| 100 | </div> | 100 | </div> | 
| 101 | <div class="btnGroup"> | 101 | <div class="btnGroup"> | 
| 102 | <el-button type="primary" @click="saveInfo">保存</el-button> | 102 | <el-button type="primary" @click="saveInfo">保存</el-button> | 
| ... | @@ -203,7 +203,7 @@ export default { | ... | @@ -203,7 +203,7 @@ export default { | 
| 203 | this.getHeight(); | 203 | this.getHeight(); | 
| 204 | }, | 204 | }, | 
| 205 | mounted() { | 205 | mounted() { | 
| 206 | this.getLpbMenuTree("d1b82b27f2a6ab7bf3f0e7708c96e46f"); | 206 | this.getLpbMenuTree("1e0c83dfe2e73284f834a80a0947f0c9"); | 
| 207 | // 楼盘表绘制区域宽度计算:楼盘表区域宽度-图例宽度34-滚动条宽度6 | 207 | // 楼盘表绘制区域宽度计算:楼盘表区域宽度-图例宽度34-滚动条宽度6 | 
| 208 | setTimeout(() => { | 208 | setTimeout(() => { | 
| 209 | this.lpbContentwidth = this.$store.state.contentWidth - 34 - 6; | 209 | this.lpbContentwidth = this.$store.state.contentWidth - 34 - 6; | 
| ... | @@ -243,8 +243,8 @@ export default { | ... | @@ -243,8 +243,8 @@ export default { | 
| 243 | this.$refs.zdy.submitForm("form", this.pd[0].bsm, this.treeData.bsm); | 243 | this.$refs.zdy.submitForm("form", this.pd[0].bsm, this.treeData.bsm); | 
| 244 | break; | 244 | break; | 
| 245 | case "ch": | 245 | case "ch": | 
| 246 | this.$refs.ch.onSave(this.pd[0].bsm); | ||
| 246 | break; | 247 | break; | 
| 247 | |||
| 248 | default: | 248 | default: | 
| 249 | break; | 249 | break; | 
| 250 | } | 250 | } | 
| ... | @@ -276,15 +276,6 @@ export default { | ... | @@ -276,15 +276,6 @@ export default { | 
| 276 | }, | 276 | }, | 
| 277 | }, | 277 | }, | 
| 278 | computed: { | 278 | computed: { | 
| 279 | // tabContentWidth(){ | ||
| 280 | // let w = this.$refs.tabContent != undefined ? this.$refs.tabContent.offsetWidth : 0 | ||
| 281 | // return w; | ||
| 282 | // // if(this.$refs.tabContent != undefined){ | ||
| 283 | // // return this.$refs.tabContent.offsetWidth | ||
| 284 | // // }else{ | ||
| 285 | // // return | ||
| 286 | // // } | ||
| 287 | // } | ||
| 288 | }, | 279 | }, | 
| 289 | destroyed() { | 280 | destroyed() { | 
| 290 | window.removeEventListener("resize", this.getHeight); | 281 | window.removeEventListener("resize", this.getHeight); | 
| ... | @@ -304,13 +295,6 @@ export default { | ... | @@ -304,13 +295,6 @@ export default { | 
| 304 | this.lpbContentwidth += 260; | 295 | this.lpbContentwidth += 260; | 
| 305 | } | 296 | } | 
| 306 | }, | 297 | }, | 
| 307 | // tabContentWidth(n){ | ||
| 308 | // debugger | ||
| 309 | // if(n != 0){ | ||
| 310 | // // 楼盘表绘制区域宽度计算:楼盘表区域宽度-图例宽度34-滚动条宽度6 | ||
| 311 | // this.lpbContentwidth = this.$refs.tabContent.offsetWidth - 34 - 6; | ||
| 312 | // } | ||
| 313 | // } | ||
| 314 | }, | 298 | }, | 
| 315 | }; | 299 | }; | 
| 316 | </script> | 300 | </script> | ... | ... | 
This diff is collapsed.
Click to expand it.
- 
Please register or sign in to post a comment