楼盘表添加层户功能
Showing
5 changed files
with
140 additions
and
31 deletions
... | @@ -84,23 +84,11 @@ const constantRoutes = [ | ... | @@ -84,23 +84,11 @@ const constantRoutes = [ |
84 | component: () => import("@/views/systemZD/index"), | 84 | component: () => import("@/views/systemZD/index"), |
85 | }, | 85 | }, |
86 | { | 86 | { |
87 | path: "/ljz", | ||
88 | name: "逻辑幢", | ||
89 | code: "1-6", | ||
90 | component: () => import("@/views/systemZRZ/ljz/index"), | ||
91 | }, | ||
92 | { | ||
93 | path: "/c", | 87 | path: "/c", |
94 | name: "层", | 88 | name: "层", |
95 | code: "1-7", | 89 | code: "1-7", |
96 | component: () => import("@/views/systemZRZ/c/index"), | 90 | component: () => import("@/views/systemZRZ/c/index"), |
97 | }, | 91 | }, |
98 | { | ||
99 | path: "/zdy", | ||
100 | name: "幢单元", | ||
101 | code: "1-8", | ||
102 | component: () => import("@/views/systemZRZ/lpb/zdy/index"), | ||
103 | }, | ||
104 | ], | 92 | ], |
105 | }, | 93 | }, |
106 | ]; | 94 | ]; | ... | ... |
src/views/systemZRZ/lpb/bjlp/ch/index.vue
0 → 100644
1 | <template> | ||
2 | <div class="addCh"> | ||
3 | <el-table | ||
4 | class="addChTable" | ||
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"> | ||
16 | <el-input size="small" v-model="scope.row.ljzbsm"></el-input> | ||
17 | </template> | ||
18 | </el-table-column> | ||
19 | <el-table-column prop="zdybsm" label="幢单元" align="center"> | ||
20 | <template slot-scope="scope"> | ||
21 | <el-input size="small" v-model="scope.row.zdybsm"></el-input> | ||
22 | </template> | ||
23 | </el-table-column> | ||
24 | <el-table-column prop="qsc" label="起始层" align="center"> | ||
25 | <template slot-scope="scope"> | ||
26 | <el-input size="small" v-model="scope.row.qsc"></el-input> | ||
27 | </template> | ||
28 | </el-table-column> | ||
29 | <el-table-column prop="jsc" label="结束层" align="center"> | ||
30 | <template slot-scope="scope"> | ||
31 | <el-input size="small" v-model="scope.row.jsc"></el-input> | ||
32 | </template> | ||
33 | </el-table-column> | ||
34 | <el-table-column prop="mchs" label="每层户数" align="center"> | ||
35 | <template slot-scope="scope"> | ||
36 | <el-input size="small" v-model="scope.row.mchs"></el-input> | ||
37 | </template> | ||
38 | </el-table-column> | ||
39 | </el-table> | ||
40 | </div> | ||
41 | </template> | ||
42 | |||
43 | <script> | ||
44 | export default { | ||
45 | name:"", | ||
46 | components:{}, | ||
47 | props:{}, | ||
48 | data(){ | ||
49 | return { | ||
50 | tableData:[ | ||
51 | |||
52 | ], | ||
53 | formData:{ | ||
54 | cz:'+', | ||
55 | ljzbsm:'', | ||
56 | zdybsm:'', | ||
57 | qsc:'', | ||
58 | jsc:'', | ||
59 | mchs:'', | ||
60 | } | ||
61 | } | ||
62 | }, | ||
63 | created(){ | ||
64 | this.tableData.push(this.formData) | ||
65 | }, | ||
66 | mounted(){}, | ||
67 | methods:{ | ||
68 | //行操作 | ||
69 | handleRowClick(row,index){ | ||
70 | console.log(index); | ||
71 | if(row.cz =='+'){ | ||
72 | let temp = JSON.parse(JSON.stringify(this.formData)); | ||
73 | temp.cz = '-'; | ||
74 | this.tableData.push(temp); | ||
75 | }else{ | ||
76 | this.tableData.splice(index, 1) | ||
77 | } | ||
78 | }, | ||
79 | //重置数据 | ||
80 | reset(){ | ||
81 | this.tableData = [ | ||
82 | { | ||
83 | cz:'+', | ||
84 | ljzbsm:'', | ||
85 | zdybsm:'', | ||
86 | qsc:'', | ||
87 | jsc:'', | ||
88 | mchs:'', | ||
89 | } | ||
90 | ] | ||
91 | } | ||
92 | }, | ||
93 | computed: {}, | ||
94 | watch: {}, | ||
95 | } | ||
96 | </script> | ||
97 | <style lang="less"> | ||
98 | .addCh{ | ||
99 | .addChTable { | ||
100 | .el-input__inner { | ||
101 | height: 20px; | ||
102 | margin: 0; | ||
103 | line-height: 20px; | ||
104 | outline: none; | ||
105 | border: none; | ||
106 | color: #606764; | ||
107 | overflow: visible; | ||
108 | cursor: text; | ||
109 | text-align: center; | ||
110 | } | ||
111 | } | ||
112 | .cp{ | ||
113 | cursor: pointer; | ||
114 | } | ||
115 | } | ||
116 | |||
117 | </style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -70,10 +70,10 @@ | ... | @@ -70,10 +70,10 @@ |
70 | <addLjz ref="ljz"></addLjz> | 70 | <addLjz ref="ljz"></addLjz> |
71 | </div> | 71 | </div> |
72 | <div class="addCh" v-show="menuType == 'zdy'"> | 72 | <div class="addCh" v-show="menuType == 'zdy'"> |
73 | 幢单元 | 73 | <addZdy ref="zdy"></addZdy> |
74 | </div> | 74 | </div> |
75 | <div class="addCh" v-show="menuType == 'ch'"> | 75 | <div class="addCh" v-show="menuType == 'ch'"> |
76 | 层户 | 76 | <addCh ref="ch"></addCh> |
77 | </div> | 77 | </div> |
78 | <div class="btnGroup"> | 78 | <div class="btnGroup"> |
79 | <el-button type="primary" @click="saveInfo">保存</el-button> | 79 | <el-button type="primary" @click="saveInfo">保存</el-button> |
... | @@ -86,11 +86,13 @@ | ... | @@ -86,11 +86,13 @@ |
86 | 86 | ||
87 | <script> | 87 | <script> |
88 | import LineTree from "../../../../components/lineTree/lineTree"; | 88 | import LineTree from "../../../../components/lineTree/lineTree"; |
89 | import addLjz from "../../ljz/index" | 89 | import addLjz from "./ljz/index" |
90 | import addZdy from "./zdy/index" | ||
91 | import addCh from "./ch/index" | ||
90 | import {getLpbMenuTree} from "../../../../api/lpb" | 92 | import {getLpbMenuTree} from "../../../../api/lpb" |
91 | export default { | 93 | export default { |
92 | name:"", | 94 | name:"", |
93 | components:{LineTree,addLjz}, | 95 | components:{LineTree,addLjz,addZdy,addCh}, |
94 | props:{}, | 96 | props:{}, |
95 | data(){ | 97 | data(){ |
96 | return { | 98 | return { |
... | @@ -202,12 +204,13 @@ export default { | ... | @@ -202,12 +204,13 @@ export default { |
202 | }, | 204 | }, |
203 | //弹框中的保存按钮 | 205 | //弹框中的保存按钮 |
204 | saveInfo(){ | 206 | saveInfo(){ |
207 | debugger | ||
205 | switch (this.menuType) { | 208 | switch (this.menuType) { |
206 | case 'ljz': | 209 | case 'ljz': |
207 | this.$refs.ljz.onSave(this.$refs.ljz.form,this.treeData.bsm) | 210 | this.$refs.ljz.onSave(this.$refs.ljz.form,this.treeData.bsm) |
208 | break; | 211 | break; |
209 | case 'zdy': | 212 | case 'zdy': |
210 | 213 | this.$refs.zdy.submitForm('form',this.pd[0].bsm,this.treeData.bsm) | |
211 | break; | 214 | break; |
212 | case 'ch': | 215 | case 'ch': |
213 | 216 | ||
... | @@ -224,10 +227,10 @@ export default { | ... | @@ -224,10 +227,10 @@ export default { |
224 | this.$refs.ljz.reset() | 227 | this.$refs.ljz.reset() |
225 | break; | 228 | break; |
226 | case 'zdy': | 229 | case 'zdy': |
227 | 230 | this.$refs.zdy.reset() | |
228 | break; | 231 | break; |
229 | case 'ch': | 232 | case 'ch': |
230 | 233 | this.$refs.ch.reset() | |
231 | break; | 234 | break; |
232 | 235 | ||
233 | default: | 236 | default: | ... | ... |
... | @@ -161,8 +161,8 @@ | ... | @@ -161,8 +161,8 @@ |
161 | </template> | 161 | </template> |
162 | 162 | ||
163 | <script> | 163 | <script> |
164 | import {insertLjzInfo} from "../../../api/zrz"; | 164 | import {insertLjzInfo} from "../../../../../api/zrz"; |
165 | import {formdate} from "../../../libs/function"; | 165 | import {formdate} from "../../../../../libs/function"; |
166 | export default { | 166 | export default { |
167 | name:'ljz', | 167 | name:'ljz', |
168 | components:{}, | 168 | components:{}, | ... | ... |
... | @@ -39,25 +39,16 @@ | ... | @@ -39,25 +39,16 @@ |
39 | </tr> | 39 | </tr> |
40 | </tbody> | 40 | </tbody> |
41 | </table> | 41 | </table> |
42 | |||
43 | <el-row :gutter="24"> | ||
44 | <el-col :span="24"> | ||
45 | <el-button type="primary" @click="submitForm('form')">立即创建</el-button> | ||
46 | </el-col> | ||
47 | </el-row> | ||
48 | |||
49 | |||
50 | </el-form> | 42 | </el-form> |
51 | </div> | 43 | </div> |
52 | </template> | 44 | </template> |
53 | 45 | ||
54 | <script> | 46 | <script> |
55 | 47 | ||
56 | import {insertZdyInfo} from "../../../../api/lpb" | 48 | import {insertZdyInfo} from "../../../../../api/lpb" |
57 | export default { | 49 | export default { |
58 | name: "index", | 50 | name: "index", |
59 | components: {}, | 51 | components: {}, |
60 | |||
61 | data(){ | 52 | data(){ |
62 | return{ | 53 | return{ |
63 | form:{ | 54 | form:{ |
... | @@ -112,6 +103,16 @@ | ... | @@ -112,6 +103,16 @@ |
112 | } | 103 | } |
113 | }); | 104 | }); |
114 | }, | 105 | }, |
106 | reset(){ | ||
107 | this.form = { | ||
108 | zdyh:'', | ||
109 | zdymc:'', | ||
110 | dscs:'', | ||
111 | dxcs:'', | ||
112 | zcs:'', | ||
113 | bz:'', | ||
114 | } | ||
115 | } | ||
115 | } | 116 | } |
116 | } | 117 | } |
117 | </script> | 118 | </script> | ... | ... |
-
Please register or sign in to post a comment