refactor(fg,hb):分割合并代码重构
Showing
3 changed files
with
219 additions
and
253 deletions
src/components/queryData/queryData.vue
0 → 100644
1 | <template> | ||
2 | <div> | ||
3 | <el-dialog | ||
4 | title="新增" | ||
5 | :visible.sync="isVisible" | ||
6 | width="50%" | ||
7 | @close="close" | ||
8 | center> | ||
9 | <div class="search"> | ||
10 | <el-button type="primary" @click="search">查询</el-button> | ||
11 | <el-button type="primary" @click="result">重置</el-button> | ||
12 | <el-row :gutter="10" class="shop"> | ||
13 | <el-col :span="4" class="inputtitle"> | ||
14 | 宗地编码: | ||
15 | </el-col> | ||
16 | <el-col :span="8" class=""> | ||
17 | <el-input v-model="queryData.zddm"></el-input> | ||
18 | </el-col> | ||
19 | <el-col :span="4" class="inputtitle"> | ||
20 | 不动产权证号: | ||
21 | </el-col> | ||
22 | <el-col :span="8" class=""> | ||
23 | <el-input v-model="queryData.bdcqzh"></el-input> | ||
24 | </el-col> | ||
25 | </el-row> | ||
26 | <el-row :gutter="10"> | ||
27 | <el-col :span="4" class="inputtitle"> | ||
28 | 不动产权单元号: | ||
29 | </el-col> | ||
30 | <el-col :span="8"> | ||
31 | <el-input v-model="queryData.bdcdyh"></el-input> | ||
32 | </el-col> | ||
33 | <el-col :span="4" class="inputtitle"> | ||
34 | 权利人: | ||
35 | </el-col> | ||
36 | <el-col :span="8"> | ||
37 | <el-input v-model="queryData.qlrmc"></el-input> | ||
38 | </el-col> | ||
39 | </el-row> | ||
40 | <el-row :gutter="10"> | ||
41 | <el-col :span="4" class="inputtitle"> | ||
42 | 坐落: | ||
43 | </el-col> | ||
44 | <el-col :span="8"> | ||
45 | <el-input v-model="queryData.zl"></el-input> | ||
46 | </el-col> | ||
47 | </el-row> | ||
48 | <table border="1"> | ||
49 | <tr> | ||
50 | <td>序号</td> | ||
51 | <td>操作</td> | ||
52 | <td>宗地代码</td> | ||
53 | <td>不动产单元号</td> | ||
54 | <td>项目名称</td> | ||
55 | <td>不动产权证号</td> | ||
56 | <td>权利人</td> | ||
57 | <td>坐落</td> | ||
58 | </tr> | ||
59 | <tr v-if="Data.length==0"> | ||
60 | <td colspan="8"> | ||
61 | <span class="noData">暂无数据</span> | ||
62 | </td> | ||
63 | </tr> | ||
64 | <tr v-else v-for="(item,index) in Data" :key="index"> | ||
65 | <td>{{index+1}}</td> | ||
66 | <td @click="addData(item)" class="xz"> | ||
67 | <span>选择</span> | ||
68 | </td> | ||
69 | <td>{{item.zddm}}</td> | ||
70 | <td>{{item.bdcdyh}}</td> | ||
71 | <td>{{item.xmmc}}</td> | ||
72 | <td>{{item.bdcqzh}}</td> | ||
73 | <td>{{item.qlr}}</td> | ||
74 | <td>{{item.zl}}</td> | ||
75 | </tr> | ||
76 | |||
77 | </table> | ||
78 | </div> | ||
79 | <span slot="footer" class="dialog-footer"> | ||
80 | </span> | ||
81 | </el-dialog> | ||
82 | |||
83 | </div> | ||
84 | </template> | ||
85 | |||
86 | <script> | ||
87 | import {getSearchList} from './../../api/search' | ||
88 | |||
89 | export default { | ||
90 | name: "queryData", | ||
91 | data() { | ||
92 | return { | ||
93 | queryData: { | ||
94 | bdcdyh: "", | ||
95 | bdcqzh: "", | ||
96 | dylxs: ['zd'], | ||
97 | qlrmc: "", | ||
98 | qszt: "", | ||
99 | xmmc: "", | ||
100 | zddm: "", | ||
101 | zl: "" | ||
102 | }, | ||
103 | Data: [], | ||
104 | isVisible: false | ||
105 | } | ||
106 | }, | ||
107 | props: { | ||
108 | centerDialogVisible: { | ||
109 | type: Boolean, | ||
110 | default: function () { | ||
111 | return false | ||
112 | } | ||
113 | } | ||
114 | }, | ||
115 | mounted() { | ||
116 | this.getData(this.queryData) | ||
117 | }, | ||
118 | created() { | ||
119 | }, | ||
120 | methods: { | ||
121 | result: function () { | ||
122 | this.queryData = { | ||
123 | bdcdyh: "", | ||
124 | bdcqzh: "", | ||
125 | dylxs: ['zd'], | ||
126 | qlrmc: "", | ||
127 | qszt: "2", | ||
128 | xmmc: "", | ||
129 | zddm: "", | ||
130 | zl: "" | ||
131 | } | ||
132 | }, | ||
133 | getData: function (data) { | ||
134 | getSearchList(data).then(res => { | ||
135 | this.Data = res.result.records | ||
136 | }) | ||
137 | }, | ||
138 | search: function () { | ||
139 | this.getData(this.queryData) | ||
140 | }, | ||
141 | addData: function (val) { | ||
142 | this.$emit("getData", val) | ||
143 | }, | ||
144 | close: function () { | ||
145 | this.$emit('close') | ||
146 | this.isVisible = false | ||
147 | } | ||
148 | }, | ||
149 | watch: { | ||
150 | centerDialogVisible(val) { | ||
151 | this.isVisible = val | ||
152 | } | ||
153 | } | ||
154 | } | ||
155 | </script> | ||
156 | |||
157 | <style scoped lang="less"> | ||
158 | .main { | ||
159 | box-sizing: border-box; | ||
160 | padding: 18px; | ||
161 | height: auto; | ||
162 | width: 80%; | ||
163 | } | ||
164 | |||
165 | table { | ||
166 | margin-top: 10px; | ||
167 | background-color: #fff; | ||
168 | font-size: 14px; | ||
169 | width: 100%; | ||
170 | } | ||
171 | |||
172 | td { | ||
173 | text-align: center; | ||
174 | height: 36px; | ||
175 | min-width: 50px; | ||
176 | } | ||
177 | |||
178 | table:hover { | ||
179 | cursor: pointer; | ||
180 | } | ||
181 | |||
182 | .shop { | ||
183 | margin-top: 20px; | ||
184 | } | ||
185 | |||
186 | .xz { | ||
187 | color: blue; | ||
188 | } | ||
189 | |||
190 | .noData { | ||
191 | color: #b2b2b2; | ||
192 | } | ||
193 | |||
194 | </style> |
... | @@ -14,127 +14,38 @@ | ... | @@ -14,127 +14,38 @@ |
14 | <td>权利人</td> | 14 | <td>权利人</td> |
15 | <td>坐落</td> | 15 | <td>坐落</td> |
16 | </tr> | 16 | </tr> |
17 | <tr v-if="bgqData.length==0"> | 17 | <tr v-if="Object.keys(bgqData)==0"> |
18 | <td colspan="7"> | 18 | <td colspan="7"> |
19 | <span class="noData">暂无数据</span> | 19 | <span class="noData">暂无数据</span> |
20 | </td> | 20 | </td> |
21 | </tr> | 21 | </tr> |
22 | <tr v-else v-for="(item,index) in bgqData" :key="index"> | 22 | <tr v-else> |
23 | <td>{{index+1}}</td> | 23 | <!--<tr v-else v-for="(item,index) in bgqData" :key="index">--> |
24 | <td><input type="text" class="formInput" v-model="item.zddm" readonly="readonly"/></td> | 24 | <td>1</td> |
25 | <td><input type="text" class="formInput" v-model="item.bdcdyh" readonly="readonly"/></td> | 25 | <td><input type="text" class="formInput" v-model="bgqData.zddm" readonly="readonly"/></td> |
26 | <td><input type="text" class="formInput" v-model="item.xmmc" readonly="readonly"/></td> | 26 | <td><input type="text" class="formInput" v-model="bgqData.bdcdyh" readonly="readonly"/></td> |
27 | <td><input type="text" class="formInput" v-model="item.bdcqzh" readonly="readonly"/></td> | 27 | <td><input type="text" class="formInput" v-model="bgqData.xmmc" readonly="readonly"/></td> |
28 | <td><input type="text" class="formInput" v-model="item.qlr" readonly="readonly"/></td> | 28 | <td><input type="text" class="formInput" v-model="bgqData.bdcqzh" readonly="readonly"/></td> |
29 | <td><input type="text" class="formInput" v-model="item.zl" readonly="readonly"/></td> | 29 | <td><input type="text" class="formInput" v-model="bgqData.qlr" readonly="readonly"/></td> |
30 | <td><input type="text" class="formInput" v-model="bgqData.zl" readonly="readonly"/></td> | ||
30 | </tr> | 31 | </tr> |
31 | </table> | 32 | </table> |
32 | </div> | 33 | </div> |
33 | <div> | 34 | <query-data @getData="getData" :centerDialogVisible.sync="centerDialogVisible" @close="closepop"></query-data> |
34 | <el-dialog | ||
35 | title="新增" | ||
36 | :visible.sync="centerDialogVisible" | ||
37 | width="50%" | ||
38 | center> | ||
39 | <div class="search"> | ||
40 | <el-button type="primary" @click="search">查询</el-button> | ||
41 | <el-button type="primary" @click="result">重置</el-button> | ||
42 | <el-row :gutter="10" class="shop"> | ||
43 | <el-col :span="4" class="inputtitle"> | ||
44 | 宗地编码: | ||
45 | </el-col> | ||
46 | <el-col :span="8" class=""> | ||
47 | <el-input v-model="queryData.zddm"></el-input> | ||
48 | </el-col> | ||
49 | <el-col :span="4" class="inputtitle"> | ||
50 | 不动产权证号: | ||
51 | </el-col> | ||
52 | <el-col :span="8" class=""> | ||
53 | <el-input v-model="queryData.bdcqzh"></el-input> | ||
54 | </el-col> | ||
55 | </el-row> | ||
56 | <el-row :gutter="10"> | ||
57 | <el-col :span="4" class="inputtitle"> | ||
58 | 不动产权单元号: | ||
59 | </el-col> | ||
60 | <el-col :span="8"> | ||
61 | <el-input v-model="queryData.bdcdyh"></el-input> | ||
62 | </el-col> | ||
63 | <el-col :span="4" class="inputtitle"> | ||
64 | 权利人: | ||
65 | </el-col> | ||
66 | <el-col :span="8"> | ||
67 | <el-input v-model="queryData.qlrmc"></el-input> | ||
68 | </el-col> | ||
69 | </el-row> | ||
70 | <el-row :gutter="10"> | ||
71 | <el-col :span="4" class="inputtitle"> | ||
72 | 坐落: | ||
73 | </el-col> | ||
74 | <el-col :span="8"> | ||
75 | <el-input v-model="queryData.zl"></el-input> | ||
76 | </el-col> | ||
77 | </el-row> | ||
78 | <table border="1"> | ||
79 | <tr> | ||
80 | <td>序号</td> | ||
81 | <td>操作</td> | ||
82 | <td>宗地代码</td> | ||
83 | <td>不动产单元号</td> | ||
84 | <td>项目名称</td> | ||
85 | <td>不动产权证号</td> | ||
86 | <td>权利人</td> | ||
87 | <td>坐落</td> | ||
88 | </tr> | ||
89 | <tr v-if="Data.length==0"> | ||
90 | <td colspan="8"> | ||
91 | <span class="noData">暂无数据</span> | ||
92 | </td> | ||
93 | </tr> | ||
94 | <tr v-else v-for="(item,index) in Data" :key="index"> | ||
95 | <td>{{index+1}}</td> | ||
96 | <td @click="addData(item)" class="xz"> | ||
97 | <span>选择</span> | ||
98 | </td> | ||
99 | <td>{{item.zddm}}</td> | ||
100 | <td>{{item.bdcdyh}}</td> | ||
101 | <td>{{item.xmmc}}</td> | ||
102 | <td>{{item.bdcqzh}}</td> | ||
103 | <td>{{item.qlr}}</td> | ||
104 | <td>{{item.zl}}</td> | ||
105 | </tr> | ||
106 | |||
107 | </table> | ||
108 | </div> | ||
109 | <span slot="footer" class="dialog-footer"> | ||
110 | </span> | ||
111 | </el-dialog> | ||
112 | </div> | ||
113 | </div> | 35 | </div> |
114 | </template> | 36 | </template> |
115 | 37 | ||
116 | <script> | 38 | <script> |
117 | import {getSearchList} from './../../../../api/search' | 39 | import QueryData from './../../../../components/queryData/queryData' |
118 | 40 | ||
119 | export default { | 41 | export default { |
120 | name: "", | 42 | name: "", |
121 | components: {}, | 43 | components: {QueryData}, |
122 | props: {}, | 44 | props: {}, |
123 | data() { | 45 | data() { |
124 | return { | 46 | return { |
125 | centerDialogVisible: false, | 47 | centerDialogVisible: false, |
126 | Data: [], | 48 | bgqData: {} |
127 | queryData: { | ||
128 | bdcdyh: "", | ||
129 | bdcqzh: "", | ||
130 | dylxs: ['zd'], | ||
131 | qlrmc: "", | ||
132 | qszt: "2", | ||
133 | xmmc: "", | ||
134 | zddm: "", | ||
135 | zl: "" | ||
136 | }, | ||
137 | bgqData: [] | ||
138 | } | 49 | } |
139 | }, | 50 | }, |
140 | created() { | 51 | created() { |
... | @@ -142,36 +53,19 @@ | ... | @@ -142,36 +53,19 @@ |
142 | mounted() { | 53 | mounted() { |
143 | }, | 54 | }, |
144 | methods: { | 55 | methods: { |
56 | closepop: function () { | ||
57 | this.centerDialogVisible = false; | ||
58 | }, | ||
145 | newAdd: function () { | 59 | newAdd: function () { |
146 | this.centerDialogVisible = true; | 60 | this.centerDialogVisible = true; |
147 | this.getData( | ||
148 | {dylxs: ['zd']} | ||
149 | ) | ||
150 | }, | 61 | }, |
151 | addData: function (val) { | 62 | addData: function (val) { |
152 | this.centerDialogVisible = false; | 63 | this.centerDialogVisible = false; |
153 | this.bgqData.push(val) | 64 | this.bgqData = val |
154 | }, | 65 | }, |
155 | getData: function (data) { | 66 | getData: function (data) { |
156 | getSearchList(data).then(res => { | 67 | this.bgqData = data |
157 | this.Data = res.result.records | ||
158 | }) | ||
159 | }, | 68 | }, |
160 | search: function () { | ||
161 | this.getData(this.queryData) | ||
162 | }, | ||
163 | result: function () { | ||
164 | this.queryData = { | ||
165 | bdcdyh: "", | ||
166 | bdcqzh: "", | ||
167 | dylxs: ['zd'], | ||
168 | qlrmc: "", | ||
169 | qszt: "2", | ||
170 | xmmc: "", | ||
171 | zddm: "", | ||
172 | zl: "" | ||
173 | } | ||
174 | } | ||
175 | }, | 69 | }, |
176 | computed: {}, | 70 | computed: {}, |
177 | watch: {}, | 71 | watch: {}, |
... | @@ -215,13 +109,7 @@ | ... | @@ -215,13 +109,7 @@ |
215 | .inputtitle { | 109 | .inputtitle { |
216 | line-height: 40px; | 110 | line-height: 40px; |
217 | } | 111 | } |
218 | .shop { | 112 | .noData { |
219 | margin-top: 20px; | ||
220 | } | ||
221 | .xz { | ||
222 | color: blue; | ||
223 | } | ||
224 | .noData{ | ||
225 | color: #b2b2b2; | 113 | color: #b2b2b2; |
226 | } | 114 | } |
227 | } | 115 | } | ... | ... |
... | @@ -34,111 +34,21 @@ | ... | @@ -34,111 +34,21 @@ |
34 | <td><input type="text" class="formInput" v-model="item.zl" readonly="readonly"/></td> | 34 | <td><input type="text" class="formInput" v-model="item.zl" readonly="readonly"/></td> |
35 | </tr> | 35 | </tr> |
36 | </table> | 36 | </table> |
37 | <div> | 37 | <query-data @getData="getData" :centerDialogVisible.sync="centerDialogVisible" @close="closepop"></query-data> |
38 | <el-dialog | ||
39 | title="新增" | ||
40 | :visible.sync="centerDialogVisible" | ||
41 | width="50%" | ||
42 | center> | ||
43 | <div class="search"> | ||
44 | <el-button type="primary" @click="search">查询</el-button> | ||
45 | <el-button type="primary" @click="result">重置</el-button> | ||
46 | <el-row :gutter="10" class="shop"> | ||
47 | <el-col :span="4" class="inputtitle"> | ||
48 | 宗地编码: | ||
49 | </el-col> | ||
50 | <el-col :span="8" class=""> | ||
51 | <el-input v-model="queryData.zddm"></el-input> | ||
52 | </el-col> | ||
53 | <el-col :span="4" class="inputtitle"> | ||
54 | 不动产权证号: | ||
55 | </el-col> | ||
56 | <el-col :span="8" class=""> | ||
57 | <el-input v-model="queryData.bdcqzh"></el-input> | ||
58 | </el-col> | ||
59 | </el-row> | ||
60 | <el-row :gutter="10"> | ||
61 | <el-col :span="4" class="inputtitle"> | ||
62 | 不动产权单元号: | ||
63 | </el-col> | ||
64 | <el-col :span="8"> | ||
65 | <el-input v-model="queryData.bdcdyh"></el-input> | ||
66 | </el-col> | ||
67 | <el-col :span="4" class="inputtitle"> | ||
68 | 权利人: | ||
69 | </el-col> | ||
70 | <el-col :span="8"> | ||
71 | <el-input v-model="queryData.qlrmc"></el-input> | ||
72 | </el-col> | ||
73 | </el-row> | ||
74 | <el-row :gutter="10"> | ||
75 | <el-col :span="4" class="inputtitle"> | ||
76 | 坐落: | ||
77 | </el-col> | ||
78 | <el-col :span="8"> | ||
79 | <el-input v-model="queryData.zl"></el-input> | ||
80 | </el-col> | ||
81 | </el-row> | ||
82 | <table border="1"> | ||
83 | <tr> | ||
84 | <td>序号</td> | ||
85 | <td>操作</td> | ||
86 | <td>宗地代码</td> | ||
87 | <td>不动产单元号</td> | ||
88 | <td>项目名称</td> | ||
89 | <td>不动产权证号</td> | ||
90 | <td>权利人</td> | ||
91 | <td>坐落</td> | ||
92 | </tr> | ||
93 | <tr v-if="Data.length==0"> | ||
94 | <td colspan="8"> | ||
95 | <span class="noData">暂无数据</span> | ||
96 | </td> | ||
97 | </tr> | ||
98 | <tr v-else v-for="(item,index) in Data" :key="index"> | ||
99 | <td>{{index+1}}</td> | ||
100 | <td @click="addData(item)" class="xz"> | ||
101 | <span>选择</span> | ||
102 | </td> | ||
103 | <td>{{item.zddm}}</td> | ||
104 | <td>{{item.bdcdyh}}</td> | ||
105 | <td>{{item.xmmc}}</td> | ||
106 | <td>{{item.bdcqzh}}</td> | ||
107 | <td>{{item.qlr}}</td> | ||
108 | <td>{{item.zl}}</td> | ||
109 | </tr> | ||
110 | |||
111 | </table> | ||
112 | </div> | ||
113 | <span slot="footer" class="dialog-footer"> | ||
114 | </span> | ||
115 | </el-dialog> | ||
116 | |||
117 | </div> | ||
118 | </div> | 38 | </div> |
119 | </template> | 39 | </template> |
120 | 40 | ||
121 | <script> | 41 | <script> |
122 | import {getSearchList} from './../../../../api/search' | 42 | import {getSearchList} from './../../../../api/search' |
43 | import QueryData from './../../../../components/queryData/queryData' | ||
123 | 44 | ||
124 | export default { | 45 | export default { |
125 | name: "", | 46 | name: "", |
126 | components: {}, | 47 | components: {QueryData}, |
127 | props: {}, | 48 | props: {}, |
128 | data() { | 49 | data() { |
129 | return { | 50 | return { |
130 | centerDialogVisible: false, | 51 | centerDialogVisible: false, |
131 | Data: [], | ||
132 | queryData: { | ||
133 | bdcdyh: "", | ||
134 | bdcqzh: "", | ||
135 | dylxs: ['zd'], | ||
136 | qlrmc: "", | ||
137 | qszt: "2", | ||
138 | xmmc: "", | ||
139 | zddm: "", | ||
140 | zl: "" | ||
141 | }, | ||
142 | bgqData: [] | 52 | bgqData: [] |
143 | } | 53 | } |
144 | }, | 54 | }, |
... | @@ -149,34 +59,14 @@ | ... | @@ -149,34 +59,14 @@ |
149 | methods: { | 59 | methods: { |
150 | newAdd: function () { | 60 | newAdd: function () { |
151 | this.centerDialogVisible = true; | 61 | this.centerDialogVisible = true; |
152 | this.getData( | ||
153 | {dylxs: ['zd']} | ||
154 | ) | ||
155 | }, | 62 | }, |
156 | addData: function (val) { | 63 | addData: function (val) { |
157 | this.centerDialogVisible = false; | 64 | this.centerDialogVisible = false; |
158 | this.bgqData.push(val) | 65 | this.bgqData.push(val) |
159 | }, | 66 | }, |
160 | search: function () { | ||
161 | this.getData(this.queryData) | ||
162 | }, | ||
163 | getData: function (data) { | 67 | getData: function (data) { |
164 | getSearchList(data).then(res => { | 68 | this.bgqData.push(data) |
165 | this.Data = res.result.records | ||
166 | }) | ||
167 | }, | 69 | }, |
168 | result: function () { | ||
169 | this.queryData = { | ||
170 | bdcdyh: "", | ||
171 | bdcqzh: "", | ||
172 | dylxs: ['zd'], | ||
173 | qlrmc: "", | ||
174 | qszt: "2", | ||
175 | xmmc: "", | ||
176 | zddm: "", | ||
177 | zl: "" | ||
178 | } | ||
179 | } | ||
180 | }, | 70 | }, |
181 | computed: {}, | 71 | computed: {}, |
182 | watch: {}, | 72 | watch: {}, |
... | @@ -195,7 +85,7 @@ | ... | @@ -195,7 +85,7 @@ |
195 | width: 130px; | 85 | width: 130px; |
196 | line-height: 40px; | 86 | line-height: 40px; |
197 | } | 87 | } |
198 | .el-input{ | 88 | .el-input { |
199 | width: 200px; | 89 | width: 200px; |
200 | margin-right: 20px; | 90 | margin-right: 20px; |
201 | } | 91 | } |
... | @@ -232,12 +122,6 @@ | ... | @@ -232,12 +122,6 @@ |
232 | .inputtitle { | 122 | .inputtitle { |
233 | line-height: 40px; | 123 | line-height: 40px; |
234 | } | 124 | } |
235 | .shop { | ||
236 | margin-top: 20px; | ||
237 | } | ||
238 | .xz { | ||
239 | color: blue; | ||
240 | } | ||
241 | .noData { | 125 | .noData { |
242 | color: #b2b2b2; | 126 | color: #b2b2b2; |
243 | } | 127 | } | ... | ... |
-
Please register or sign in to post a comment