address-client 3.2.83 → 3.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1125 +1,1125 @@
1
- <template>
2
- <div class="auto" id="userAddress" style="height:80%">
3
- <validator name='v'>
4
- <p class="bg-info text-center" style="padding: 8px;">{{usertype ? '特殊地址管理' : '民用地址管理'}}</p>
5
- <div class="auto select-overspread form-horizontal">
6
- <div class="form-group" v-if="!usertype&&!model.id&&!config.hasnumber">
7
- <input type="radio" id="true" value="one" v-model="onedata">
8
- <label for="true">单户</label>
9
- <input type="radio" id="false" value="more" v-model="onedata">
10
- <label for="false">多户</label>
11
- <button class="button_new-1 button_spacing" v-if="false" v-show=" $login.f.f_role_name.includes('管理员') "style="width: max-content;position: fixed;right: 20px" @click="add('非民用')">添加特殊地址</button>
12
- </div>
13
- <div class="form-group" v-if="usertype&&!model.id&&!config.hasnumber" style="height: 30.5px">
14
- <button class="button_new-1 button_spacing" style="width: max-content;position: fixed;right: 20px" @click="add('民用')">添加民用地址</button>
15
- </div>
16
- <!--单个录入-->
17
- <div v-if="onedata=='one'" class="row">
18
- <div class="col-sm-6 form-group "
19
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="!usertype">
20
- <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
21
- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"
22
- v-validate:f_pcd_id='{required: true }'
23
- >
24
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
25
- :options='pcdslist' placeholder='请选择'
26
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
27
- </v-select>
28
- </div>
29
- <div class="col-sm-6 form-group "
30
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="usertype">
31
- <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
32
- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id" v-validate:f_pcd_id='{required: true }'
33
- >
34
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
35
- :options='pcdslist' placeholder='请选择'
36
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
37
- </v-select>
38
- </div>
39
-
40
- <div class="col-sm-6 form-group " v-if="!usertype"
41
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
42
- <label class="font_normal_body">&emsp;&emsp;街道/乡镇</label>
43
- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
44
- v-validate:f_street_id='{required: true }'
45
- >
46
- <v-select :value.sync="model.f_street_id" :value-single="true"
47
- :options='streetslist' placeholder='请选择'
48
- close-on-select search="true" :disabled="!usertype">
49
- </v-select>
50
- </div>
51
- <div class="col-sm-6 form-group " v-if="usertype"
52
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
53
- <label class="font_normal_body">&emsp;&emsp;街道/乡镇</label>
54
- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id" v-validate:f_street_id='{required: true }'
55
- >
56
- <v-select :value.sync="model.f_street_id" :value-single="true"
57
- :options='streetslist' placeholder='请选择'
58
- @change="streetChange"
59
- close-on-select search="true" :disabled="!usertype">
60
- </v-select>
61
- </div>
62
- <div class="col-sm-6 form-group " :class="[$v.slice_area1.required ? 'has-error' : 'has-success']">
63
- <label class="font_normal_body">&emsp;片区/管理站</label>
64
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
65
- v-validate:slice_area1='{required: true }'>
66
- <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
67
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
68
- close-on-select v-ref:slice>
69
- </v-select>
70
- </div>
71
- <div class="col-sm-6 form-group " v-if="!usertype"
72
- :class="[$v.f_residential_area_id1.required ? 'has-error' : 'has-success']">
73
- <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
74
- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
75
- v-validate:f_residential_area_id1='{required: true }'>
76
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
77
- :options='areaschoice' placeholder='请选择'
78
- @change="areaChange"
79
- close-on-select search="true">
80
- </v-select>
81
- </div>
82
-
83
- <div class="col-sm-6 form-group " v-if="usertype">
84
- <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
85
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
86
- :options='areaschoice' placeholder='请选择'
87
- @change="areaChange"
88
- close-on-select search="true">
89
- </v-select>
90
- </div>
91
-
92
-
93
- <div class="col-sm-6 form-group " v-if="!usertype">
94
- <label class="font_normal_body">&emsp;&emsp;&nbsp;地区类型</label>
95
- <v-select
96
- :value.sync="model.f_iscity" :value-single="true"
97
- :options='iscity' placeholder='请选择'
98
- @change="changecity"
99
- close-on-select>
100
- </v-select>
101
-
102
- </div>
103
- <div class="col-sm-6 form-group " v-if="!usertype">
104
- <label class="font_normal_body">&emsp;&emsp;&nbsp;乡&emsp;&emsp;镇</label>
105
- <v-select
106
- :value.sync="model.f_community" :value-single="true"
107
- :options='community' placeholder='请选择'
108
- close-on-select>
109
- </v-select>
110
-
111
- </div>
112
- <div class="col-sm-6 form-group " v-if="!usertype">
113
- <label class="font_normal_body">&emsp;&emsp;&nbsp;社&emsp;&emsp;区</label>
114
- <v-select
115
- :value.sync="model.f_committee" :value-single="true"
116
- :options='committee' placeholder='请选择'
117
- close-on-select>
118
- </v-select>
119
-
120
- </div>
121
- <div v-if="!usertype" class="col-sm-6 form-group" :class="[$v.f_building_id.required ? 'has-error' : 'has-success']">
122
- <label class="font_normal_body">&emsp;&emsp;&nbsp;楼&emsp;&emsp;号</label>
123
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.f_building_id.selectedItems" v-validate:f_building_id='{required: true }'>
124
- <v-select :value.sync="model.f_building_id" v-model="model.f_building_id" :value-single="true"
125
- :options='buildingList' placeholder='楼号' close-on-select v-ref:f_building_id>
126
- </v-select>
127
- </div>
128
- <div v-if="!usertype" class="col-sm-6 form-group ">
129
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;单&emsp;&emsp;元</label>
130
- <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
131
- <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search"
132
- />
133
- </div>
134
- <div v-if="!usertype" class="col-sm-6 form-group ">
135
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;楼&emsp;&emsp;层</label>
136
- <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
137
- placeholder="楼层" />
138
- <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
139
- />
140
- </div>
141
- <div v-if="!usertype" class="col-sm-6 form-group"
142
- :class="[$v.f_room.required ? 'has-error' : 'has-success']">
143
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;门&ensp;牌&ensp;号</label>
144
- <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
145
- @change="roomChange" />
146
- </div>
147
- <div class="col-sm-6 form-group">
148
- <label class="font_normal_body">&emsp;&emsp;&nbsp;地址状态</label>
149
- <v-select :value.sync="model.f_address_state" :value-single="true"
150
- class="select_list select"
151
- condition="f_address_state = '{}'"
152
- :options='addresstate' placeholder='地址状态'
153
- close-on-select>
154
- </v-select>
155
- </div>
156
- <div v-if="!usertype" class="col-sm-6 form-group">
157
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;地址杂项</label>
158
- <input type="text" style="width:60%" v-model="model.f_room_suffix" placeholder="地址杂项"
159
- @change="roomChange"
160
- class="input_search"/>
161
- </div>
162
- <div v-if="!usertype" class="col-sm-8 form-group ">
163
- <label class="font_normal_body">&emsp;&emsp;&nbsp;经&ensp;纬&ensp;度</label>
164
- <input type="text" style="width:30%" v-model="model.f_lng" class="input_search" placeholder="经度"/>
165
- <input type="text" style="width:30%" v-model="model.f_lat" class="input_search" placeholder="纬度"/>
166
- &ensp;<span class="glyphicon glyphicon-map-marker" @click="openModal" ></span>
167
- </div>
168
-
169
- <div v-if="!usertype" class="col-sm-12 form-group "
170
- :class="[$v.f_address.required ? 'has-error' : 'has-success']">
171
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;详细地址</label>
172
- <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
173
- v-validate:f_address='{required: true }' disabled="true"/>
174
- </div>
175
-
176
- <div v-if="usertype" class="col-sm-12 form-group "
177
- >
178
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;详细地址</label>
179
- <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
180
- disabled="true"/>
181
- </div>
182
- <div v-if="usertype" class="col-sm-8 form-group ">
183
- <label class="font_normal_body">&emsp;&emsp;&nbsp;经&ensp;纬&ensp;度</label>
184
- <input type="text" style="width:30%" v-model="model.f_lng" class="input_search" placeholder="经度"/>
185
- <input type="text" style="width:30%" v-model="model.f_lat" class="input_search" placeholder="纬度"/>
186
- &ensp;<span class="glyphicon glyphicon-map-marker" @click="openModal" ></span>
187
- </div>
188
- <div class="col-sm-6 form-group " v-if="config.hasnumber"
189
- :class="[$v.f_standard_number.required ? 'has-error' : 'has-success']">
190
- <label class="font_normal_body">&emsp;&emsp;&nbsp;&nbsp;&nbsp;&nbsp;规范号</label>
191
- <input type="text" v-model="model.f_standard_number"
192
- @change="standardyanzheng"
193
- class="input_search" style="width:60%" placeholder="地址规范号"
194
- v-validate:f_standard_number='{required: true }'>
195
- </div>
196
- <div class="col-sm-6 form-group " v-if="config.hasnumber"
197
- :class="[$v.f_contracts_number.required ? 'has-error' : 'has-success']">
198
- <label class="font_normal_body">&emsp;&emsp;&nbsp;&nbsp;&nbsp;&nbsp;合同号</label>
199
- <input type="text" v-model="model.f_contracts_number"
200
- @change="contractsyanzheng"
201
- class="input_search" style="width:60%" placeholder="合同顺序号"
202
- v-validate:f_contracts_number='{required: true }'>
203
- </div>
204
- <div class="col-sm-6 form-group " :class="[$v.f_enter_number.required ? 'has-error' : 'has-success']">
205
- <label class="font_normal_body">&emsp;&emsp;&nbsp;入户证号</label>
206
- <input type="text" v-model="model.f_enter_number"
207
- class="input_search" style="width:60%" placeholder="入户证号"
208
- v-validate:f_enter_number='{required: true }'>
209
- </div>
210
- <div class="col-sm-12 form-group">
211
- <label class="font_normal_body " >&emsp;&emsp;&nbsp;备&emsp;&emsp;注</label>
212
- <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
213
- </div>
214
- <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
215
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
216
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
217
- </div>
218
-
219
- </div>
220
- <!--批量录入-->
221
- <div v-if="onedata=='more'" class="row">
222
- <div class="col-sm-6 form-group "
223
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
224
- <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
225
- <input type="text" style="width:60%" v-show="false" v-model="model.f_pcd_id"
226
- v-validate:f_pcd_id='{required: true }'
227
- >
228
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
229
- :options='pcdslist' placeholder='请选择'
230
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
231
- </v-select>
232
- </div>
233
- <div class="col-sm-6 form-group "
234
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
235
- <label class="font_normal_body">&emsp;&emsp;&nbsp;街&emsp;&emsp;道</label>
236
- <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id"
237
- v-validate:f_street_id='{required: true }'
238
- >
239
- <v-select :value.sync="model.f_street_id" :value-single="true"
240
- :options='streetslist' placeholder='请选择'
241
- close-on-select search="true" :disabled="!usertype">
242
- </v-select>
243
- </div>
244
- <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">
245
- <label class="font_normal_body">片区/管理站</label>
246
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
247
- v-validate:slice='{required: true }'>
248
- <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
249
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
250
-
251
- close-on-select v-ref:slice>
252
- </v-select>
253
- </div>
254
- <div class="col-sm-6 form-group "
255
- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
256
- <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
257
- <input type="text" style="width:60%" v-show="false" v-model="model.f_residential_area_id"
258
- v-validate:f_residential_area_id='{required: true }'>
259
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
260
- @change="areaChange"
261
- :options='areaschoice' placeholder='请选择'
262
- close-on-select search="true">
263
- </v-select>
264
- </div>
265
-
266
-
267
- <div class="col-sm-6 form-group "
268
- :class="[$v.f_building_start.integernum || $v.f_building_start.dctest ?'has-error' : 'has-success']">
269
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始楼号</label>
270
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
271
- <input type="text" style="width:25%"
272
- v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
273
- v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
274
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"/>
275
- </div>
276
- <div class="col-sm-6 form-group "
277
- :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
278
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止楼号</label>
279
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
280
- <input type="text" style="width:25%"
281
- v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
282
- v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
283
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"
284
- />
285
- </div>
286
- <div class="col-sm-6 form-group "
287
- :class="[$v.f_unit_start.integernum || $v.f_unit_start.dctest ? 'has-error' : 'has-success']">
288
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始单元</label>
289
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
290
- <input type="text" style="width:25%"
291
- v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
292
- v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
293
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
294
- </div>
295
- <div class="col-sm-6 form-group "
296
- :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
297
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止单元</label>
298
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
299
- <input type="text" style="width:25%"
300
- v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
301
- v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
302
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search"/>
303
- </div>
304
- <div class="col-sm-6 form-group "
305
- :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
306
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始楼层</label>
307
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
308
- <input type="text" style="width:25%"
309
- v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
310
- v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
311
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
312
- </div>
313
- <div class="col-sm-6 form-group "
314
- :class="[$v.f_floor_end.integernum ||$v.f_floor_end.dctest ? 'has-error' : 'has-success']">
315
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止楼层</label>
316
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
317
- <input type="text" style="width:25%" v-model="model.f_floor_end"
318
- v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
319
- class="input_search" placeholder="楼层"/>
320
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
321
- </div>
322
- <div class="col-sm-6 form-group "
323
- :class="[$v.f_room_start.integernum || $v.f_room_start.dctest ? 'has-error' : 'has-success']">
324
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始门牌</label>
325
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
326
- <input type="text" style="width:25%" v-model="model.f_room_start"
327
- class="input_search" placeholder="门牌号"
328
- v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
329
- />
330
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
331
- </div>
332
- <div class="col-sm-6 form-group "
333
- :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
334
- <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止门牌</label>
335
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
336
- <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
337
- v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
338
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
339
- </div>
340
- <div class="col-sm-6 form-group">
341
- <label class="font_normal_body">&emsp;&emsp;&nbsp;地址状态</label>
342
- <v-select :value.sync="model.f_address_state" :value-single="true"
343
- class="select_list select"
344
- condition="f_address_state = '{}'"
345
- :options='addresstate' placeholder='地址状态'
346
- close-on-select>
347
- </v-select>
348
- </div>
349
- <div class="col-sm-10 form-group ">
350
- <p class="navbar-text" style="margin-left: 10%">说明: 层数输入1,门牌号输入001。产生的最终门牌号显示1001</p>
351
- </div>
352
- <div class="col-sm-12 form-group">
353
- <label class="font_normal_body " style="margin-top:-20px">&emsp;&emsp;&nbsp;备&emsp;&emsp;注</label>
354
- <textarea class="input_textarea" rows="3" style="width:80%;height: auto;" v-model="model.f_comments"></textarea>
355
- </div>
356
- <div class="row">
357
- <div style="text-align:right;margin-top:20px;margin-right:50px;" class="col-sm-12">
358
- <button class="button_search button_spacing" @click="confirmall()" :disabled='!$v.valid'>保存</button>
359
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
360
- </div>
361
- </div>
362
- </div>
363
- </div>
364
- </validator>
365
-
366
- <modal :show.sync="isshow" large backdrop="false" :width="900">
367
- <header slot="modal-header" class="modal-header">
368
- </header>
369
- <article slot="modal-body" class="modal-body">
370
- <amap-location :islocationclearmark="false" dom="addboxmap" v-ref:positionInfo @getmylocation="getmylocation"></amap-location>
371
- </article>
372
- <footer slot="modal-footer" class="modal-footer">
373
- <button v-show="isshow" type="button" class="button_search button_spacing" @click='confirmLocation'>确认</button>
374
- <button v-show="isshow" type="button" class="button_clear button_spacing" @click='closeModal'>取消</button>
375
- </footer>
376
- </modal>
377
-
378
- </div>
379
- </template>
380
-
381
- <script>
382
- import {HttpResetClass} from 'vue-client'
383
-
384
-
385
- let getAreaConfig = async function (self) {
386
- // 获取气价里面的配置
387
- await self.$getConfig(self, 'UserAddress')
388
- console.log('原地址配置',self.config)
389
- console.log('获取地址配置',self.config)
390
- // Object.assign(self.model, self.config)
391
- }
392
-
393
- export default {
394
- title: '用户地址添加',
395
- data () {
396
- return {
397
- //模态框是否显示
398
- isshow: false,
399
- //接收位置
400
- templng: '', //临时经度
401
- templat: '' , //临时纬度
402
-
403
- //初始化省市区数据
404
- pcdslist:[],
405
- //初始化街道数据
406
- streetslist:[],
407
- //初始化街道数据
408
- areaslist:[],
409
- areaschoice:[],
410
- // 楼栋数据
411
- buildingList: [],
412
- iscity:[{label:'全部',value:''},{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'}],
413
- config:{
414
- hasnumber:false,
415
- f_building_suffix: '号楼',
416
- f_unit_suffix: '单元',
417
- f_floor_suffix: '层',
418
- f_room_suffix: '室'
419
- },
420
- model: {
421
- f_pcd_id: '',
422
- f_street_id: '',
423
- f_comments:'',
424
- f_residential_area_id: '',
425
- f_province: '',
426
- f_city: '',
427
- f_district: '',
428
- f_pcd: '',
429
- f_street: '',
430
- f_residential_area: '',
431
- f_slice_area: '',
432
- slice_area:'',
433
- f_building: '',
434
- f_building_start: '',
435
- f_building_end: '',
436
- f_building_suffix: '号楼',
437
- f_unit: '',
438
- f_unit_start: '',
439
- f_unit_end: '',
440
- f_unit_suffix: '单元',
441
- f_floor: '',
442
- f_floor_start: '',
443
- f_floor_end: '',
444
- f_floor_suffix: '层',
445
- f_room: '',
446
- f_room_start: '',
447
- f_room_end: '',
448
- f_room_suffix: '室',
449
- //详细地址
450
- f_address: '',
451
- //单位名称
452
- f_company: '',
453
- //单位地址
454
- f_company_address: '',
455
- f_lng: '', //经度
456
- f_lat: '', //纬度
457
- f_enter_number: '' //入户证号
458
- },
459
- //判读是否为单个数据录入
460
- onedata: 'one',
461
- //选中所有地址
462
- addresslist: [],
463
- usertype:false,
464
-
465
- // 公司信息
466
- curorgid: [this.$login.f.orgid],
467
-
468
- f_orgid: '',
469
-
470
- sliceArea: []
471
- }
472
- },
473
- props: ['f_filialeids', 'row','operation','usertype'],
474
- async ready(){
475
- this.initdata()
476
- getAreaConfig(this)
477
- //打印config
478
- console.log(this.config)
479
- this.model.f_building_suffix=this.config.f_building_suffix
480
- this.model.f_unit_suffix=this.config.f_unit_suffix
481
- this.model.f_floor_suffix=this.config.f_floor_suffix
482
- this.model.f_room_suffix=this.config.f_room_suffix
483
- },
484
- methods: {
485
- //添加方法
486
- add(val){
487
- if (this.f_filialeids) {
488
- // this.$refs.paged.$refs.grid.selectStore.selected = null
489
- this.$dispatch('add',val)
490
- } else {
491
- this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
492
- }
493
- },
494
- async sliceChange(slice){
495
- this.areaschoice=[]
496
- if(slice){
497
- this.areaslist.forEach((item)=>{
498
- if(item.data.f_slice_area==slice[0].name){
499
- this.areaschoice.push(item)
500
- }
501
- })
502
- }else{
503
- this.areaslist.forEach((item)=>{
504
- this.areaschoice.push(item)
505
- })
506
- }
507
- },
508
- async changecity(){
509
- this.areaslist = []
510
- // this.model.f_residential_area_id = null
511
- // this.model.f_residential_area = null
512
- // isnull(f_iscity,'') = isnull('${this.model.f_iscity}','') and
513
- let condition = `a.f_orgid = '${this.f_filialeids}'`
514
- let req = await this.$resetpost('rs/sql/address_getresidential', {
515
- data: {
516
- condition: condition
517
- }
518
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
519
- let redata = []
520
- req.data.forEach((row) => {
521
- redata.push({
522
- label: '['+row.f_street+']'+row.f_residential_area,
523
- value: row.id,
524
- data: row,
525
- id: row.id
526
- })
527
- })
528
- console.log("获取到的redata",redata)
529
- this.areaslist=redata
530
- },
531
- standardyanzheng() {
532
- console.log(this.model.f_standard_number.length)
533
- if (this.model.f_standard_number.length != 2){
534
- this.$showAlert('请输入正确的位数', 'warning', 2000)
535
- this.model.f_standard_number = ''
536
- }
537
- },
538
- contractsyanzheng(){
539
- console.log(this.model.f_contracts_number.length)
540
- if (this.model.f_contracts_number.length != 5){
541
- this.$showAlert('请输入正确的位数', 'warning', 2000)
542
- this.model.f_contracts_number = ''
543
- }
544
- },
545
- async initdata(){
546
- this.model.f_address_state = '未通气'
547
- this.initAreas(this.f_filialeids)
548
- // 添加特殊地址选省市区
549
- this.initpcds(` f_orgid = '${this.f_filialeids}'`)
550
- this.initstreets(` f_orgid = '${this.f_filialeids}' `)
551
- await this.initareas(` f_orgid = '${this.f_filialeids}'`)
552
- this.areaschoice = []
553
- this.areaslist.forEach((item)=>{
554
- this.areaschoice.push(item)
555
- })
556
- },
557
-
558
- // 初始化片区
559
- async initAreas (val) {
560
- if (val) {
561
- let HttpReset = new HttpResetClass()
562
- let getAllArea = await HttpReset.load('POST','/rs/search', {
563
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
564
- userid: this.$login.f.id
565
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
566
- let arr = getAllArea.data.filter((res) => {
567
- return res.parentid == val
568
- })
569
- console.log('过滤之后的片区', arr)
570
- this.sliceArea = []
571
- arr.forEach((res) => {
572
- this.sliceArea.push({label: res.name, value: res.name})
573
- })
574
- }
575
- },
576
- //初始化省市区,添加街道
577
- async initpcds(pconditon){
578
- this.pcdslist = []
579
- let HttpReset = new HttpResetClass()
580
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
581
- data: {
582
- items: '*',
583
- tablename: 't_pcd',
584
- orderitem: 'id',
585
- condition: pconditon
586
- }
587
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
588
- let redata = []
589
- req.data.forEach((row, n) => {
590
- redata[n] = {
591
- label: row.f_pcd,
592
- value: row.id,
593
- data:row,
594
- id:row.id
595
- }
596
- })
597
- this.pcdslist=redata
598
- },
599
- //初始化街道 添加小区
600
- async initstreets(pconditon){
601
- this.streetslist = []
602
- let HttpReset = new HttpResetClass()
603
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
604
- data: {
605
- items: '*',
606
- tablename: 't_street',
607
- orderitem: 'id',
608
- condition: pconditon
609
- }
610
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
611
- let redata = []
612
- req.data.forEach((row, n) => {
613
- redata[n] = {
614
- label: row.f_street,
615
- value: row.id,
616
- data:row,
617
- id:row.id
618
- }
619
- })
620
- this.streetslist=redata
621
- },
622
- //初始化小区添加小区
623
- async initareas(pconditon){
624
- // if(this.usertype){
625
- // pconditon=pconditon+` and f_special='1' `
626
- // }
627
- this.areaslist = []
628
- let HttpReset = new HttpResetClass()
629
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
630
- data: {
631
- items: '*',
632
- tablename: 't_area',
633
- orderitem: 'id',
634
- condition: pconditon
635
- }
636
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
637
- let redata = []
638
- if (req.data.length === 0){
639
- redata.push({
640
- label: '['+row.f_street+']'+'无',
641
- value: '',
642
- data: '',
643
- id: ''
644
- })
645
- }
646
- req.data.forEach((row) => {
647
- redata.push({
648
- label: '['+row.f_street+']'+row.f_residential_area,
649
- value: row.id,
650
- data: row,
651
- id: row.id
652
- })
653
- })
654
- this.areaslist=redata
655
- },
656
- // 根据选择小区查询楼栋
657
- async getbuildingList(pconditon){
658
- this.buildingList = []
659
- let HttpReset = new HttpResetClass()
660
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
661
- data: {
662
- items: '*',
663
- tablename: 't_building',
664
- orderitem: 'id',
665
- condition: pconditon
666
- }
667
- }, {resolveMsg: null, rejectMsg: '获取楼栋失败!'})
668
- let redata = []
669
- if(req.data.length === 0){
670
- redata.push({
671
- label: '无',
672
- value: ' ',
673
- })
674
- }
675
- req.data.forEach((row) => {
676
- redata.push({
677
- label: row.f_building,
678
- value: row.id,
679
- data: row,
680
- id: row.id
681
- })
682
- })
683
- this.buildingList=redata
684
- },
685
- //省/市/区变化
686
- async pcdChange(val){
687
- // 只有添加特殊地址时才级联
688
- if (!this.usertype) {
689
- return
690
- }
691
- console.log("省/市/区变化",val)
692
- if(val){
693
- //那就把[小区,街道]重新组织一下
694
- await this.initstreets(` f_pcd_id ='${val}' `)
695
- if(this.model.f_street_id){
696
- if (this.findbyid(this.streetslist,this.model.f_street_id)) {
697
- let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
698
- if(pcd_id!=val){
699
- this.model.f_street_id=''
700
- }
701
- } else {
702
- this.model.f_street_id=''
703
- }
704
-
705
- //那就把[小区,街道]重新组织一下
706
- if (this.model.f_street_id) {
707
- await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
708
- if(this.model.f_residential_area_id){
709
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
710
- let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
711
- if(pcd_id!=val){
712
- this.model.f_residential_area_id=''
713
- }
714
- } else {
715
- this.model.f_residential_area_id=''
716
- }
717
-
718
- }
719
- }
720
- }
721
- }
722
- this.$resetValidation()
723
- },
724
- //小区变化
725
- areaChange(val){
726
- console.log("小区变化",val)
727
- // 选择小区后级联出省市区和街道
728
- let selectArea // 选中的小区数据
729
- for (let row of this.areaslist) {
730
- if (val == row.value) {
731
- selectArea = row.data
732
- break
733
- }
734
- }
735
- if (selectArea) {
736
- this.model.f_street_id = selectArea.f_street_id
737
- this.model.f_pcd_id = selectArea.f_pcd_id
738
- this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
739
- this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `).then(
740
- (res)=>{
741
- this.model.slice_area = selectArea.f_slice_area
742
- // 拼接地址
743
- if(selectArea.f_residential_area !== '无'){
744
- this.model.f_district=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_district
745
- this.model.f_address = `${this.model.f_district}${selectArea.f_street}${selectArea.f_residential_area}`
746
- }
747
- this.getbuildingList(`f_filialeid = '${this.f_filialeids}' and f_residential_area_id ='${selectArea.id}'`)
748
- }
749
- )
750
- }
751
- this.$nextTick(() => {
752
- this.$resetValidation()
753
- })
754
- },
755
- roomChange(val){
756
-
757
- this.model.f_district = this.pcdslist ? this.pcdslist[0].data.f_district : ''
758
- this.model.f_create_person= this.$login.f.name
759
- this.model.f_filialeid = this.f_filialeids
760
- this.model.f_operator = this.$login.f.name
761
- this.model.f_operatorid = this.$login.f.id
762
- this.model.f_orgid = this.$login.f.orgid
763
- this.model.f_orgname = this.$login.f.orgs
764
- this.model.f_depid = this.$login.f.depids
765
- this.model.f_depname = this.$login.f.deps
766
- if (this.model.slice_area ) {
767
- if (this.model.slice_area instanceof Array) {
768
- this.model.f_slice_area = this.model.slice_area[0].name
769
- } if (this.model.slice_area instanceof Object) {
770
- this.model.f_slice_area = Object.values(this.model.slice_area)[0].name
771
- } else{
772
- this.model.f_slice_area = this.model.slice_area
773
- }
774
- }
775
-
776
- if (( this.model.f_unit+'').length == 1) {
777
- this.model.f_unit= '0'+ this.model.f_unit
778
- }
779
- if (( this.model.f_floor+'').length == 1) {
780
- this.model.f_floor= '0'+ this.model.f_floor
781
- }
782
- if (( this.model.f_room+'').length == 1) {
783
- this.model.f_room= '0'+ this.model.f_room
784
- }
785
- if (this.usertype) {
786
- //非民用
787
- this.model.f_special='1'
788
- this.model.f_building_suffix=''
789
- this.model.f_unit_suffix=''
790
- this.model.f_floor_suffix=''
791
- this.model.f_room_suffix=''
792
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
793
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
794
- this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
795
- this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
796
- } else {
797
- //民用
798
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
799
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
800
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
801
- if (( this.$refs.f_building_id.selectedItems+'').length == 1 && this.$refs.f_building_id.selectedItems!= '无') {
802
- this.model.f_building= '0'+ this.$refs.f_building_id.selectedItems
803
- }else{
804
- this.model.f_building = this.$refs.f_building_id.selectedItems
805
- }
806
- this.model.f_building_suffix=''
807
- if (!this.model.f_building) {
808
- this.$showMessage('请选择楼栋数据!!!')
809
- return
810
- }
811
- this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
812
- }
813
- },
814
- //街道变化
815
- async streetChange(val){
816
- console.log("街道变化",val)
817
- if(this.streetslist[0]) {
818
- var street=''
819
- this.streetslist.forEach((item)=>{
820
- if(item.id===val){
821
- street=item.label
822
- }
823
- })
824
- this.model.f_address = (this.model.f_district ? this.model.f_district : '') + street
825
- }
826
- if(val){
827
- //那就把[小区]重新组织一下
828
- await this.initareas(` f_street_id ='${val}' `)
829
- if(this.model.f_residential_area_id){
830
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
831
- let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
832
- if(street_id!=val){
833
- this.model.f_residential_area_id=''
834
- }
835
- } else {
836
- this.model.f_residential_area_id=''
837
- }
838
-
839
- }
840
- }
841
- this.$resetValidation()
842
- },
843
-
844
- getorg (val) {
845
- this.f_orgid = val[0]
846
- },
847
-
848
- //处理批量地址信息
849
- dealaddlist(){
850
- try {
851
- var resultlist=[]
852
- for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
853
- for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
854
- for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
855
- for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
856
- //预备一个空的json
857
- console.log('批量', this.model)
858
- let data=Object.assign({},this.model)
859
- data.f_create_person= this.$login.f.name
860
- if ( i != '无'){
861
- if ((i+'').length == 1) {
862
- data.f_building= data.f_building_prefix + '0' +i
863
- } else {
864
- data.f_building= data.f_building_prefix + '' +i
865
- }
866
- }else {
867
- data.f_building = data.f_building_prefix + ''
868
- }
869
- if ((j+'').length == 1) {
870
- data.f_unit= data.f_unit_prefix + '0'+j
871
- } else {
872
- data.f_unit= data.f_unit_prefix +''+ j
873
- }
874
- if ((m+'').length == 1) {
875
- data.f_floor= data.f_floor_prefix +'0'+ m
876
- } else {
877
- data.f_floor= data.f_floor_prefix +''+ m
878
- }
879
- // 目前房号都按两位处理 如: 101室 201室 110室
880
- if ((n+'').length == 1) {
881
- data.f_room = data.f_room_prefix + m + '0' + n
882
- } else {
883
- data.f_room = data.f_room_prefix + m + '' + n
884
- }
885
- data.f_filialeid = this.f_filialeids
886
- data.f_operator = this.$login.f.name
887
- data.f_operatorid = this.$login.f.id
888
- data.f_orgid = this.$login.f.orgid
889
- data.f_orgname = this.$login.f.orgs
890
- data.f_depid = this.$login.f.depids
891
- data.f_depname = this.$login.f.deps
892
- data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
893
- data.f_district=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_district
894
- data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
895
- data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
896
- data.f_address = data.f_district + data.f_street
897
- + data.f_residential_area +
898
- data.f_building + data.f_building_suffix
899
- + data.f_unit + data.f_unit_suffix
900
- + data.f_floor + data.f_floor_suffix
901
- + data.f_room + data.f_room_suffix
902
- data.f_slice_area = data.slice_area[0]?data.slice_area[0].name:data.slice_area
903
-
904
- resultlist.push(data)
905
- }
906
- }
907
- }
908
- }
909
- this.addresslist=resultlist
910
- } catch (e) {
911
- console.log(e)
912
- this.$showAlert('输出数据有误,请检查', 'warning', 2000)
913
- }
914
- },
915
- //保存多个
916
- async confirmall(){
917
- this.dealaddlist()
918
- if(this.addresslist.length>0){
919
- let msg = {
920
- resolveMsg: '地址保存成功',
921
- rejectMsg: '地址保存失败'
922
- }
923
- this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
924
- if (res === 'confirm') {
925
- this.$resetpost('rs/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
926
- this.cleardara()
927
- this.$dispatch('confirm')
928
- })
929
- }
930
- })
931
- }
932
- },
933
- //保存
934
- async confirm(){
935
- if(this.onedata=='one'){
936
- await this.saveonedata()
937
- }
938
- this.cleardara()
939
- this.$dispatch('confirm')
940
- },
941
- //保存一户信息
942
- async saveonedata(){
943
- this.model.f_create_person= this.$login.f.name
944
- this.model.f_filialeid = this.f_filialeids
945
- this.model.f_operator = this.$login.f.name
946
- this.model.f_operatorid = this.$login.f.id
947
- this.model.f_orgid = this.$login.f.orgid
948
- this.model.f_orgname = this.$login.f.orgs
949
- this.model.f_depid = this.$login.f.depids
950
- this.model.f_depname = this.$login.f.deps
951
- if (this.model.slice_area ) {
952
- if (this.model.slice_area instanceof Array) {
953
- this.model.f_slice_area = this.model.slice_area[0].name
954
- } if (this.model.slice_area instanceof Object) {
955
- this.model.f_slice_area = Object.values(this.model.slice_area)[0].name
956
- } else{
957
- this.model.f_slice_area = this.model.slice_area
958
- }
959
- }
960
-
961
- if (( this.model.f_unit+'').length == 1) {
962
- this.model.f_unit= '0'+ this.model.f_unit
963
- }
964
- if (( this.model.f_floor+'').length == 1) {
965
- this.model.f_floor= '0'+ this.model.f_floor
966
- }
967
- if (( this.model.f_room+'').length == 1) {
968
- this.model.f_room= '0'+ this.model.f_room
969
- }
970
- if (this.usertype) {
971
- //非民用
972
- this.model.f_special='1'
973
- this.model.f_building_suffix=''
974
- this.model.f_unit_suffix=''
975
- this.model.f_floor_suffix=''
976
- this.model.f_room_suffix=''
977
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
978
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
979
- this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
980
- } else {
981
- //民用
982
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
983
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
984
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
985
- if (( this.$refs.f_building_id.selectedItems+'').length == 1 && this.$refs.f_building_id.selectedItems!= '无') {
986
- this.model.f_building= '0'+ this.$refs.f_building_id.selectedItems
987
- }else{
988
- this.model.f_building = this.$refs.f_building_id.selectedItems
989
- }
990
- this.model.f_building_suffix=''
991
- if (!this.model.f_building) {
992
- this.$showMessage('请选择楼栋数据!!!')
993
- return
994
- }
995
- this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
996
- }
997
- await this.$resetpost('rs/logic/address_updateuseraddress', this.model)
998
- },
999
- cancel(){
1000
- this.cleardara()
1001
- this.$dispatch('cancel')
1002
- },
1003
- cleardara(){
1004
- this.model= {
1005
- f_pcd_id: '',
1006
- f_street_id: '',
1007
- f_iscity:'市区',
1008
- f_residential_area_id: '',
1009
- f_pcd: '',
1010
- f_comments:'',
1011
- f_street: '',
1012
- f_residential_area: '',
1013
- f_slice_area: '',
1014
- slice_area: '',
1015
- f_building: '',
1016
- f_building_start: '',
1017
- f_building_end: '',
1018
- f_building_prefix: '',
1019
- f_building_suffix: this.config.f_building_suffix,
1020
- f_unit: '',
1021
- f_unit_start: '',
1022
- f_unit_end: '',
1023
- f_unit_prefix: '',
1024
- f_unit_suffix: this.config.f_unit_suffix,
1025
- f_floor: '',
1026
- f_floor_start: '',
1027
- f_floor_end: '',
1028
- f_floor_prefix: '',
1029
- f_floor_suffix: this.config.f_floor_suffix,
1030
- f_room: '',
1031
- f_room_start: '',
1032
- f_room_end: '',
1033
- f_room_prefix: '',
1034
- f_room_suffix: this.config.f_room_suffix,
1035
- //详细地址
1036
- f_address: '',
1037
- //单位名称
1038
- f_company: '',
1039
- //单位地址
1040
- f_company_address: '',
1041
- f_lng: '',
1042
- f_lat: '',
1043
- f_enter_number: ''
1044
- }
1045
- // this.pcdslist = []
1046
- // this.streetslist = []
1047
- // this.areaslist = []
1048
- },
1049
-
1050
- //根据名字找数据
1051
- findbyid(list,name){
1052
- var result
1053
- list.forEach((row, n) => {
1054
- if(name==row.value){
1055
- result= row.data
1056
- }
1057
- })
1058
- return result
1059
- },
1060
- openModal () {
1061
- this.isshow = true
1062
- },
1063
- closeModal () {
1064
- this.isshow = false;
1065
- },
1066
- getmylocation (res) {
1067
- this.templng = res.position.lng
1068
- this.templat = res.position.lat
1069
- },
1070
- confirmLocation () {
1071
- this.model.f_lat = this.templat
1072
- this.model.f_lng = this.templng
1073
- this.isshow = false
1074
- }
1075
- },
1076
- watch: {
1077
- //分公司变化
1078
- 'f_filialeids'(){
1079
- if (this.model.f_filialeid) {
1080
- if (this.model.f_filialeid != this.f_filialeids) {
1081
- this.$dispatch('cancel')
1082
- }
1083
- }
1084
- this.cleardara()
1085
- this.initdata()
1086
- },
1087
- 'row'(){
1088
- this.onedata='one'
1089
- },
1090
- 'model.id' () {
1091
- this.getbuildingList(`f_filialeid = '${this.f_filialeids}' and f_residential_area_id ='${this.model.f_residential_area_id}'`)
1092
- }
1093
- },
1094
- computed: {
1095
- //地址状态下拉框
1096
- addresstate() {
1097
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
1098
- },
1099
- community() {
1100
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('行政划分')]
1101
- },
1102
- committee() {
1103
- let rs = []
1104
- if (this.model.f_community) {
1105
- rs = this.$appdata.getParam(this.model.f_community)
1106
- }
1107
- return rs
1108
- }
1109
- }
1110
- }
1111
- </script>
1112
- <style lang="less">
1113
- #userAddress{
1114
- #addboxmap {
1115
- height: 300px;
1116
- }
1117
- .glyphicon:hover {
1118
- color: red;
1119
- }
1120
- .glyphicon {
1121
- color: blue;
1122
- cursor: pointer;
1123
- }
1124
- }
1125
- </style>
1
+ <template>
2
+ <div class="auto" id="userAddress" style="height:80%">
3
+ <validator name='v'>
4
+ <p class="bg-info text-center" style="padding: 8px;">{{usertype ? '特殊地址管理' : '民用地址管理'}}</p>
5
+ <div class="auto select-overspread form-horizontal">
6
+ <div class="form-group" v-if="!usertype&&!model.id&&!config.hasnumber">
7
+ <input type="radio" id="true" value="one" v-model="onedata">
8
+ <label for="true">单户</label>
9
+ <input type="radio" id="false" value="more" v-model="onedata">
10
+ <label for="false">多户</label>
11
+ <button class="button_new-1 button_spacing" v-if="false" v-show=" $login.f.f_role_name.includes('管理员') "style="width: max-content;position: fixed;right: 20px" @click="add('非民用')">添加特殊地址</button>
12
+ </div>
13
+ <div class="form-group" v-if="usertype&&!model.id&&!config.hasnumber" style="height: 30.5px">
14
+ <button class="button_new-1 button_spacing" style="width: max-content;position: fixed;right: 20px" @click="add('民用')">添加民用地址</button>
15
+ </div>
16
+ <!--单个录入-->
17
+ <div v-if="onedata=='one'" class="row">
18
+ <div class="col-sm-6 form-group "
19
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="!usertype">
20
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
21
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"
22
+ v-validate:f_pcd_id='{required: true }'
23
+ >
24
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
25
+ :options='pcdslist' placeholder='请选择'
26
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
27
+ </v-select>
28
+ </div>
29
+ <div class="col-sm-6 form-group "
30
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="usertype">
31
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
32
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id" v-validate:f_pcd_id='{required: true }'
33
+ >
34
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
35
+ :options='pcdslist' placeholder='请选择'
36
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
37
+ </v-select>
38
+ </div>
39
+
40
+ <div class="col-sm-6 form-group " v-if="!usertype"
41
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
42
+ <label class="font_normal_body">&emsp;&emsp;街道/乡镇</label>
43
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
44
+ v-validate:f_street_id='{required: true }'
45
+ >
46
+ <v-select :value.sync="model.f_street_id" :value-single="true"
47
+ :options='streetslist' placeholder='请选择'
48
+ close-on-select search="true" :disabled="!usertype">
49
+ </v-select>
50
+ </div>
51
+ <div class="col-sm-6 form-group " v-if="usertype"
52
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
53
+ <label class="font_normal_body">&emsp;&emsp;街道/乡镇</label>
54
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id" v-validate:f_street_id='{required: true }'
55
+ >
56
+ <v-select :value.sync="model.f_street_id" :value-single="true"
57
+ :options='streetslist' placeholder='请选择'
58
+ @change="streetChange"
59
+ close-on-select search="true" :disabled="!usertype">
60
+ </v-select>
61
+ </div>
62
+ <div class="col-sm-6 form-group " :class="[$v.slice_area1.required ? 'has-error' : 'has-success']">
63
+ <label class="font_normal_body">&emsp;片区/管理站</label>
64
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
65
+ v-validate:slice_area1='{required: true }'>
66
+ <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
67
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
68
+ close-on-select v-ref:slice>
69
+ </v-select>
70
+ </div>
71
+ <div class="col-sm-6 form-group " v-if="!usertype"
72
+ :class="[$v.f_residential_area_id1.required ? 'has-error' : 'has-success']">
73
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
74
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
75
+ v-validate:f_residential_area_id1='{required: true }'>
76
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
77
+ :options='areaschoice' placeholder='请选择'
78
+ @change="areaChange"
79
+ close-on-select search="true">
80
+ </v-select>
81
+ </div>
82
+
83
+ <div class="col-sm-6 form-group " v-if="usertype">
84
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
85
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
86
+ :options='areaschoice' placeholder='请选择'
87
+ @change="areaChange"
88
+ close-on-select search="true">
89
+ </v-select>
90
+ </div>
91
+
92
+
93
+ <div class="col-sm-6 form-group " v-if="!usertype">
94
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;地区类型</label>
95
+ <v-select
96
+ :value.sync="model.f_iscity" :value-single="true"
97
+ :options='iscity' placeholder='请选择'
98
+ @change="changecity"
99
+ close-on-select>
100
+ </v-select>
101
+
102
+ </div>
103
+ <div class="col-sm-6 form-group " v-if="!usertype">
104
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;乡&emsp;&emsp;镇</label>
105
+ <v-select
106
+ :value.sync="model.f_community" :value-single="true"
107
+ :options='community' placeholder='请选择'
108
+ close-on-select>
109
+ </v-select>
110
+
111
+ </div>
112
+ <div class="col-sm-6 form-group " v-if="!usertype">
113
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;社&emsp;&emsp;区</label>
114
+ <v-select
115
+ :value.sync="model.f_committee" :value-single="true"
116
+ :options='committee' placeholder='请选择'
117
+ close-on-select>
118
+ </v-select>
119
+
120
+ </div>
121
+ <div v-if="!usertype" class="col-sm-6 form-group" :class="[$v.f_building_id.required ? 'has-error' : 'has-success']">
122
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;楼&emsp;&emsp;号</label>
123
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.f_building_id.selectedItems" v-validate:f_building_id='{required: true }'>
124
+ <v-select :value.sync="model.f_building_id" v-model="model.f_building_id" :value-single="true"
125
+ :options='buildingList' placeholder='楼号' close-on-select v-ref:f_building_id>
126
+ </v-select>
127
+ </div>
128
+ <div v-if="!usertype" class="col-sm-6 form-group ">
129
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;单&emsp;&emsp;元</label>
130
+ <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
131
+ <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search"
132
+ />
133
+ </div>
134
+ <div v-if="!usertype" class="col-sm-6 form-group ">
135
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;楼&emsp;&emsp;层</label>
136
+ <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
137
+ placeholder="楼层" />
138
+ <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
139
+ />
140
+ </div>
141
+ <div v-if="!usertype" class="col-sm-6 form-group"
142
+ :class="[$v.f_room.required ? 'has-error' : 'has-success']">
143
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;门&ensp;牌&ensp;号</label>
144
+ <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
145
+ @change="roomChange" />
146
+ </div>
147
+ <div class="col-sm-6 form-group">
148
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;地址状态</label>
149
+ <v-select :value.sync="model.f_address_state" :value-single="true"
150
+ class="select_list select"
151
+ condition="f_address_state = '{}'"
152
+ :options='addresstate' placeholder='地址状态'
153
+ close-on-select>
154
+ </v-select>
155
+ </div>
156
+ <div v-if="!usertype" class="col-sm-6 form-group">
157
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;地址杂项</label>
158
+ <input type="text" style="width:60%" v-model="model.f_room_suffix" placeholder="地址杂项"
159
+ @change="roomChange"
160
+ class="input_search"/>
161
+ </div>
162
+ <div v-if="!usertype" class="col-sm-8 form-group ">
163
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;经&ensp;纬&ensp;度</label>
164
+ <input type="text" style="width:30%" v-model="model.f_lng" class="input_search" placeholder="经度"/>
165
+ <input type="text" style="width:30%" v-model="model.f_lat" class="input_search" placeholder="纬度"/>
166
+ &ensp;<span class="glyphicon glyphicon-map-marker" @click="openModal" ></span>
167
+ </div>
168
+
169
+ <div v-if="!usertype" class="col-sm-12 form-group "
170
+ :class="[$v.f_address.required ? 'has-error' : 'has-success']">
171
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;详细地址</label>
172
+ <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
173
+ v-validate:f_address='{required: true }' disabled="true"/>
174
+ </div>
175
+
176
+ <div v-if="usertype" class="col-sm-12 form-group "
177
+ >
178
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;详细地址</label>
179
+ <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
180
+ disabled="true"/>
181
+ </div>
182
+ <div v-if="usertype" class="col-sm-8 form-group ">
183
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;经&ensp;纬&ensp;度</label>
184
+ <input type="text" style="width:30%" v-model="model.f_lng" class="input_search" placeholder="经度"/>
185
+ <input type="text" style="width:30%" v-model="model.f_lat" class="input_search" placeholder="纬度"/>
186
+ &ensp;<span class="glyphicon glyphicon-map-marker" @click="openModal" ></span>
187
+ </div>
188
+ <div class="col-sm-6 form-group " v-if="config.hasnumber"
189
+ :class="[$v.f_standard_number.required ? 'has-error' : 'has-success']">
190
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;&nbsp;&nbsp;&nbsp;规范号</label>
191
+ <input type="text" v-model="model.f_standard_number"
192
+ @change="standardyanzheng"
193
+ class="input_search" style="width:60%" placeholder="地址规范号"
194
+ v-validate:f_standard_number='{required: true }'>
195
+ </div>
196
+ <div class="col-sm-6 form-group " v-if="config.hasnumber"
197
+ :class="[$v.f_contracts_number.required ? 'has-error' : 'has-success']">
198
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;&nbsp;&nbsp;&nbsp;合同号</label>
199
+ <input type="text" v-model="model.f_contracts_number"
200
+ @change="contractsyanzheng"
201
+ class="input_search" style="width:60%" placeholder="合同顺序号"
202
+ v-validate:f_contracts_number='{required: true }'>
203
+ </div>
204
+ <div class="col-sm-6 form-group " :class="[$v.f_enter_number.required ? 'has-error' : 'has-success']">
205
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;入户证号</label>
206
+ <input type="text" v-model="model.f_enter_number"
207
+ class="input_search" style="width:60%" placeholder="入户证号"
208
+ v-validate:f_enter_number='{required: true }'>
209
+ </div>
210
+ <div class="col-sm-12 form-group">
211
+ <label class="font_normal_body " >&emsp;&emsp;&nbsp;备&emsp;&emsp;注</label>
212
+ <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
213
+ </div>
214
+ <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
215
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
216
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
217
+ </div>
218
+
219
+ </div>
220
+ <!--批量录入-->
221
+ <div v-if="onedata=='more'" class="row">
222
+ <div class="col-sm-6 form-group "
223
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
224
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;省&ensp;市&ensp;区</label>
225
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_pcd_id"
226
+ v-validate:f_pcd_id='{required: true }'
227
+ >
228
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
229
+ :options='pcdslist' placeholder='请选择'
230
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
231
+ </v-select>
232
+ </div>
233
+ <div class="col-sm-6 form-group "
234
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
235
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;街&emsp;&emsp;道</label>
236
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id"
237
+ v-validate:f_street_id='{required: true }'
238
+ >
239
+ <v-select :value.sync="model.f_street_id" :value-single="true"
240
+ :options='streetslist' placeholder='请选择'
241
+ close-on-select search="true" :disabled="!usertype">
242
+ </v-select>
243
+ </div>
244
+ <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">
245
+ <label class="font_normal_body">片区/管理站</label>
246
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
247
+ v-validate:slice='{required: true }'>
248
+ <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
249
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
250
+
251
+ close-on-select v-ref:slice>
252
+ </v-select>
253
+ </div>
254
+ <div class="col-sm-6 form-group "
255
+ :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
256
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;小区名称</label>
257
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_residential_area_id"
258
+ v-validate:f_residential_area_id='{required: true }'>
259
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
260
+ @change="areaChange"
261
+ :options='areaschoice' placeholder='请选择'
262
+ close-on-select search="true">
263
+ </v-select>
264
+ </div>
265
+
266
+
267
+ <div class="col-sm-6 form-group "
268
+ :class="[$v.f_building_start.integernum || $v.f_building_start.dctest ?'has-error' : 'has-success']">
269
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始楼号</label>
270
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
271
+ <input type="text" style="width:25%"
272
+ v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
273
+ v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
274
+ <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"/>
275
+ </div>
276
+ <div class="col-sm-6 form-group "
277
+ :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
278
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止楼号</label>
279
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
280
+ <input type="text" style="width:25%"
281
+ v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
282
+ v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
283
+ <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"
284
+ />
285
+ </div>
286
+ <div class="col-sm-6 form-group "
287
+ :class="[$v.f_unit_start.integernum || $v.f_unit_start.dctest ? 'has-error' : 'has-success']">
288
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始单元</label>
289
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
290
+ <input type="text" style="width:25%"
291
+ v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
292
+ v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
293
+ <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
294
+ </div>
295
+ <div class="col-sm-6 form-group "
296
+ :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
297
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止单元</label>
298
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
299
+ <input type="text" style="width:25%"
300
+ v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
301
+ v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
302
+ <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search"/>
303
+ </div>
304
+ <div class="col-sm-6 form-group "
305
+ :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
306
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始楼层</label>
307
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
308
+ <input type="text" style="width:25%"
309
+ v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
310
+ v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
311
+ <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
312
+ </div>
313
+ <div class="col-sm-6 form-group "
314
+ :class="[$v.f_floor_end.integernum ||$v.f_floor_end.dctest ? 'has-error' : 'has-success']">
315
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止楼层</label>
316
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
317
+ <input type="text" style="width:25%" v-model="model.f_floor_end"
318
+ v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
319
+ class="input_search" placeholder="楼层"/>
320
+ <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
321
+ </div>
322
+ <div class="col-sm-6 form-group "
323
+ :class="[$v.f_room_start.integernum || $v.f_room_start.dctest ? 'has-error' : 'has-success']">
324
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;起始门牌</label>
325
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
326
+ <input type="text" style="width:25%" v-model="model.f_room_start"
327
+ class="input_search" placeholder="门牌号"
328
+ v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
329
+ />
330
+ <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
331
+ </div>
332
+ <div class="col-sm-6 form-group "
333
+ :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
334
+ <label for="f_address" class="font_normal_body">&emsp;&emsp;&nbsp;截止门牌</label>
335
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
336
+ <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
337
+ v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
338
+ <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
339
+ </div>
340
+ <div class="col-sm-6 form-group">
341
+ <label class="font_normal_body">&emsp;&emsp;&nbsp;地址状态</label>
342
+ <v-select :value.sync="model.f_address_state" :value-single="true"
343
+ class="select_list select"
344
+ condition="f_address_state = '{}'"
345
+ :options='addresstate' placeholder='地址状态'
346
+ close-on-select>
347
+ </v-select>
348
+ </div>
349
+ <div class="col-sm-10 form-group ">
350
+ <p class="navbar-text" style="margin-left: 10%">说明: 层数输入1,门牌号输入001。产生的最终门牌号显示1001</p>
351
+ </div>
352
+ <div class="col-sm-12 form-group">
353
+ <label class="font_normal_body " style="margin-top:-20px">&emsp;&emsp;&nbsp;备&emsp;&emsp;注</label>
354
+ <textarea class="input_textarea" rows="3" style="width:80%;height: auto;" v-model="model.f_comments"></textarea>
355
+ </div>
356
+ <div class="row">
357
+ <div style="text-align:right;margin-top:20px;margin-right:50px;" class="col-sm-12">
358
+ <button class="button_search button_spacing" @click="confirmall()" :disabled='!$v.valid'>保存</button>
359
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
360
+ </div>
361
+ </div>
362
+ </div>
363
+ </div>
364
+ </validator>
365
+
366
+ <modal :show.sync="isshow" large backdrop="false" :width="900">
367
+ <header slot="modal-header" class="modal-header">
368
+ </header>
369
+ <article slot="modal-body" class="modal-body">
370
+ <amap-location :islocationclearmark="false" dom="addboxmap" v-ref:positionInfo @getmylocation="getmylocation"></amap-location>
371
+ </article>
372
+ <footer slot="modal-footer" class="modal-footer">
373
+ <button v-show="isshow" type="button" class="button_search button_spacing" @click='confirmLocation'>确认</button>
374
+ <button v-show="isshow" type="button" class="button_clear button_spacing" @click='closeModal'>取消</button>
375
+ </footer>
376
+ </modal>
377
+
378
+ </div>
379
+ </template>
380
+
381
+ <script>
382
+ import {HttpResetClass} from 'vue-client'
383
+
384
+
385
+ let getAreaConfig = async function (self) {
386
+ // 获取气价里面的配置
387
+ await self.$getConfig(self, 'UserAddress')
388
+ console.log('原地址配置',self.config)
389
+ console.log('获取地址配置',self.config)
390
+ // Object.assign(self.model, self.config)
391
+ }
392
+
393
+ export default {
394
+ title: '用户地址添加',
395
+ data () {
396
+ return {
397
+ //模态框是否显示
398
+ isshow: false,
399
+ //接收位置
400
+ templng: '', //临时经度
401
+ templat: '' , //临时纬度
402
+
403
+ //初始化省市区数据
404
+ pcdslist:[],
405
+ //初始化街道数据
406
+ streetslist:[],
407
+ //初始化街道数据
408
+ areaslist:[],
409
+ areaschoice:[],
410
+ // 楼栋数据
411
+ buildingList: [],
412
+ iscity:[{label:'全部',value:''},{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'}],
413
+ config:{
414
+ hasnumber:false,
415
+ f_building_suffix: '号楼',
416
+ f_unit_suffix: '单元',
417
+ f_floor_suffix: '层',
418
+ f_room_suffix: '室'
419
+ },
420
+ model: {
421
+ f_pcd_id: '',
422
+ f_street_id: '',
423
+ f_comments:'',
424
+ f_residential_area_id: '',
425
+ f_province: '',
426
+ f_city: '',
427
+ f_district: '',
428
+ f_pcd: '',
429
+ f_street: '',
430
+ f_residential_area: '',
431
+ f_slice_area: '',
432
+ slice_area:'',
433
+ f_building: '',
434
+ f_building_start: '',
435
+ f_building_end: '',
436
+ f_building_suffix: '号楼',
437
+ f_unit: '',
438
+ f_unit_start: '',
439
+ f_unit_end: '',
440
+ f_unit_suffix: '单元',
441
+ f_floor: '',
442
+ f_floor_start: '',
443
+ f_floor_end: '',
444
+ f_floor_suffix: '层',
445
+ f_room: '',
446
+ f_room_start: '',
447
+ f_room_end: '',
448
+ f_room_suffix: '室',
449
+ //详细地址
450
+ f_address: '',
451
+ //单位名称
452
+ f_company: '',
453
+ //单位地址
454
+ f_company_address: '',
455
+ f_lng: '', //经度
456
+ f_lat: '', //纬度
457
+ f_enter_number: '' //入户证号
458
+ },
459
+ //判读是否为单个数据录入
460
+ onedata: 'one',
461
+ //选中所有地址
462
+ addresslist: [],
463
+ usertype:false,
464
+
465
+ // 公司信息
466
+ curorgid: [this.$login.f.orgid],
467
+
468
+ f_orgid: '',
469
+
470
+ sliceArea: []
471
+ }
472
+ },
473
+ props: ['f_filialeids', 'row','operation','usertype'],
474
+ async ready(){
475
+ this.initdata()
476
+ getAreaConfig(this)
477
+ //打印config
478
+ console.log(this.config)
479
+ this.model.f_building_suffix=this.config.f_building_suffix
480
+ this.model.f_unit_suffix=this.config.f_unit_suffix
481
+ this.model.f_floor_suffix=this.config.f_floor_suffix
482
+ this.model.f_room_suffix=this.config.f_room_suffix
483
+ },
484
+ methods: {
485
+ //添加方法
486
+ add(val){
487
+ if (this.f_filialeids) {
488
+ // this.$refs.paged.$refs.grid.selectStore.selected = null
489
+ this.$dispatch('add',val)
490
+ } else {
491
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
492
+ }
493
+ },
494
+ async sliceChange(slice){
495
+ this.areaschoice=[]
496
+ if(slice){
497
+ this.areaslist.forEach((item)=>{
498
+ if(item.data.f_slice_area==slice[0].name){
499
+ this.areaschoice.push(item)
500
+ }
501
+ })
502
+ }else{
503
+ this.areaslist.forEach((item)=>{
504
+ this.areaschoice.push(item)
505
+ })
506
+ }
507
+ },
508
+ async changecity(){
509
+ this.areaslist = []
510
+ // this.model.f_residential_area_id = null
511
+ // this.model.f_residential_area = null
512
+ // isnull(f_iscity,'') = isnull('${this.model.f_iscity}','') and
513
+ let condition = `a.f_orgid = '${this.f_filialeids}'`
514
+ let req = await this.$resetpost('rs/sql/address_getresidential', {
515
+ data: {
516
+ condition: condition
517
+ }
518
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
519
+ let redata = []
520
+ req.data.forEach((row) => {
521
+ redata.push({
522
+ label: '['+row.f_street+']'+row.f_residential_area,
523
+ value: row.id,
524
+ data: row,
525
+ id: row.id
526
+ })
527
+ })
528
+ console.log("获取到的redata",redata)
529
+ this.areaslist=redata
530
+ },
531
+ standardyanzheng() {
532
+ console.log(this.model.f_standard_number.length)
533
+ if (this.model.f_standard_number.length != 2){
534
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
535
+ this.model.f_standard_number = ''
536
+ }
537
+ },
538
+ contractsyanzheng(){
539
+ console.log(this.model.f_contracts_number.length)
540
+ if (this.model.f_contracts_number.length != 5){
541
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
542
+ this.model.f_contracts_number = ''
543
+ }
544
+ },
545
+ async initdata(){
546
+ this.model.f_address_state = '未通气'
547
+ this.initAreas(this.f_filialeids)
548
+ // 添加特殊地址选省市区
549
+ this.initpcds(` f_orgid = '${this.f_filialeids}'`)
550
+ this.initstreets(` f_orgid = '${this.f_filialeids}' `)
551
+ await this.initareas(` f_orgid = '${this.f_filialeids}'`)
552
+ this.areaschoice = []
553
+ this.areaslist.forEach((item)=>{
554
+ this.areaschoice.push(item)
555
+ })
556
+ },
557
+
558
+ // 初始化片区
559
+ async initAreas (val) {
560
+ if (val) {
561
+ let HttpReset = new HttpResetClass()
562
+ let getAllArea = await HttpReset.load('POST','/rs/search', {
563
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
564
+ userid: this.$login.f.id
565
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
566
+ let arr = getAllArea.data.filter((res) => {
567
+ return res.parentid == val
568
+ })
569
+ console.log('过滤之后的片区', arr)
570
+ this.sliceArea = []
571
+ arr.forEach((res) => {
572
+ this.sliceArea.push({label: res.name, value: res.name})
573
+ })
574
+ }
575
+ },
576
+ //初始化省市区,添加街道
577
+ async initpcds(pconditon){
578
+ this.pcdslist = []
579
+ let HttpReset = new HttpResetClass()
580
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
581
+ data: {
582
+ items: '*',
583
+ tablename: 't_pcd',
584
+ orderitem: 'id',
585
+ condition: pconditon
586
+ }
587
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
588
+ let redata = []
589
+ req.data.forEach((row, n) => {
590
+ redata[n] = {
591
+ label: row.f_pcd,
592
+ value: row.id,
593
+ data:row,
594
+ id:row.id
595
+ }
596
+ })
597
+ this.pcdslist=redata
598
+ },
599
+ //初始化街道 添加小区
600
+ async initstreets(pconditon){
601
+ this.streetslist = []
602
+ let HttpReset = new HttpResetClass()
603
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
604
+ data: {
605
+ items: '*',
606
+ tablename: 't_street',
607
+ orderitem: 'id',
608
+ condition: pconditon
609
+ }
610
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
611
+ let redata = []
612
+ req.data.forEach((row, n) => {
613
+ redata[n] = {
614
+ label: row.f_street,
615
+ value: row.id,
616
+ data:row,
617
+ id:row.id
618
+ }
619
+ })
620
+ this.streetslist=redata
621
+ },
622
+ //初始化小区添加小区
623
+ async initareas(pconditon){
624
+ // if(this.usertype){
625
+ // pconditon=pconditon+` and f_special='1' `
626
+ // }
627
+ this.areaslist = []
628
+ let HttpReset = new HttpResetClass()
629
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
630
+ data: {
631
+ items: '*',
632
+ tablename: 't_area',
633
+ orderitem: 'id',
634
+ condition: pconditon
635
+ }
636
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
637
+ let redata = []
638
+ if (req.data.length === 0){
639
+ redata.push({
640
+ label: '['+row.f_street+']'+'无',
641
+ value: '',
642
+ data: '',
643
+ id: ''
644
+ })
645
+ }
646
+ req.data.forEach((row) => {
647
+ redata.push({
648
+ label: '['+row.f_street+']'+row.f_residential_area,
649
+ value: row.id,
650
+ data: row,
651
+ id: row.id
652
+ })
653
+ })
654
+ this.areaslist=redata
655
+ },
656
+ // 根据选择小区查询楼栋
657
+ async getbuildingList(pconditon){
658
+ this.buildingList = []
659
+ let HttpReset = new HttpResetClass()
660
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
661
+ data: {
662
+ items: '*',
663
+ tablename: 't_building',
664
+ orderitem: 'id',
665
+ condition: pconditon
666
+ }
667
+ }, {resolveMsg: null, rejectMsg: '获取楼栋失败!'})
668
+ let redata = []
669
+ if(req.data.length === 0){
670
+ redata.push({
671
+ label: '无',
672
+ value: ' ',
673
+ })
674
+ }
675
+ req.data.forEach((row) => {
676
+ redata.push({
677
+ label: row.f_building,
678
+ value: row.id,
679
+ data: row,
680
+ id: row.id
681
+ })
682
+ })
683
+ this.buildingList=redata
684
+ },
685
+ //省/市/区变化
686
+ async pcdChange(val){
687
+ // 只有添加特殊地址时才级联
688
+ if (!this.usertype) {
689
+ return
690
+ }
691
+ console.log("省/市/区变化",val)
692
+ if(val){
693
+ //那就把[小区,街道]重新组织一下
694
+ await this.initstreets(` f_pcd_id ='${val}' `)
695
+ if(this.model.f_street_id){
696
+ if (this.findbyid(this.streetslist,this.model.f_street_id)) {
697
+ let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
698
+ if(pcd_id!=val){
699
+ this.model.f_street_id=''
700
+ }
701
+ } else {
702
+ this.model.f_street_id=''
703
+ }
704
+
705
+ //那就把[小区,街道]重新组织一下
706
+ if (this.model.f_street_id) {
707
+ await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
708
+ if(this.model.f_residential_area_id){
709
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
710
+ let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
711
+ if(pcd_id!=val){
712
+ this.model.f_residential_area_id=''
713
+ }
714
+ } else {
715
+ this.model.f_residential_area_id=''
716
+ }
717
+
718
+ }
719
+ }
720
+ }
721
+ }
722
+ this.$resetValidation()
723
+ },
724
+ //小区变化
725
+ areaChange(val){
726
+ console.log("小区变化",val)
727
+ // 选择小区后级联出省市区和街道
728
+ let selectArea // 选中的小区数据
729
+ for (let row of this.areaslist) {
730
+ if (val == row.value) {
731
+ selectArea = row.data
732
+ break
733
+ }
734
+ }
735
+ if (selectArea) {
736
+ this.model.f_street_id = selectArea.f_street_id
737
+ this.model.f_pcd_id = selectArea.f_pcd_id
738
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
739
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `).then(
740
+ (res)=>{
741
+ this.model.slice_area = selectArea.f_slice_area
742
+ // 拼接地址
743
+ if(selectArea.f_residential_area !== '无'){
744
+ this.model.f_district=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_district
745
+ this.model.f_address = `${this.model.f_district}${selectArea.f_street}${selectArea.f_residential_area}`
746
+ }
747
+ this.getbuildingList(`f_filialeid = '${this.f_filialeids}' and f_residential_area_id ='${selectArea.id}'`)
748
+ }
749
+ )
750
+ }
751
+ this.$nextTick(() => {
752
+ this.$resetValidation()
753
+ })
754
+ },
755
+ roomChange(val){
756
+
757
+ this.model.f_district = this.pcdslist ? this.pcdslist[0].data.f_district : ''
758
+ this.model.f_create_person= this.$login.f.name
759
+ this.model.f_filialeid = this.f_filialeids
760
+ this.model.f_operator = this.$login.f.name
761
+ this.model.f_operatorid = this.$login.f.id
762
+ this.model.f_orgid = this.$login.f.orgid
763
+ this.model.f_orgname = this.$login.f.orgs
764
+ this.model.f_depid = this.$login.f.depids
765
+ this.model.f_depname = this.$login.f.deps
766
+ if (this.model.slice_area ) {
767
+ if (this.model.slice_area instanceof Array) {
768
+ this.model.f_slice_area = this.model.slice_area[0].name
769
+ } if (this.model.slice_area instanceof Object) {
770
+ this.model.f_slice_area = Object.values(this.model.slice_area)[0].name
771
+ } else{
772
+ this.model.f_slice_area = this.model.slice_area
773
+ }
774
+ }
775
+
776
+ if (( this.model.f_unit+'').length == 1) {
777
+ this.model.f_unit= '0'+ this.model.f_unit
778
+ }
779
+ if (( this.model.f_floor+'').length == 1) {
780
+ this.model.f_floor= '0'+ this.model.f_floor
781
+ }
782
+ if (( this.model.f_room+'').length == 1) {
783
+ this.model.f_room= '0'+ this.model.f_room
784
+ }
785
+ if (this.usertype) {
786
+ //非民用
787
+ this.model.f_special='1'
788
+ this.model.f_building_suffix=''
789
+ this.model.f_unit_suffix=''
790
+ this.model.f_floor_suffix=''
791
+ this.model.f_room_suffix=''
792
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
793
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
794
+ this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
795
+ this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
796
+ } else {
797
+ //民用
798
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
799
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
800
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
801
+ if (( this.$refs.f_building_id.selectedItems+'').length == 1 && this.$refs.f_building_id.selectedItems!= '无') {
802
+ this.model.f_building= '0'+ this.$refs.f_building_id.selectedItems
803
+ }else{
804
+ this.model.f_building = this.$refs.f_building_id.selectedItems
805
+ }
806
+ this.model.f_building_suffix=''
807
+ if (!this.model.f_building) {
808
+ this.$showMessage('请选择楼栋数据!!!')
809
+ return
810
+ }
811
+ this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
812
+ }
813
+ },
814
+ //街道变化
815
+ async streetChange(val){
816
+ console.log("街道变化",val)
817
+ if(this.streetslist[0]) {
818
+ var street=''
819
+ this.streetslist.forEach((item)=>{
820
+ if(item.id===val){
821
+ street=item.label
822
+ }
823
+ })
824
+ this.model.f_address = (this.model.f_district ? this.model.f_district : '') + street
825
+ }
826
+ if(val){
827
+ //那就把[小区]重新组织一下
828
+ await this.initareas(` f_street_id ='${val}' `)
829
+ if(this.model.f_residential_area_id){
830
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
831
+ let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
832
+ if(street_id!=val){
833
+ this.model.f_residential_area_id=''
834
+ }
835
+ } else {
836
+ this.model.f_residential_area_id=''
837
+ }
838
+
839
+ }
840
+ }
841
+ this.$resetValidation()
842
+ },
843
+
844
+ getorg (val) {
845
+ this.f_orgid = val[0]
846
+ },
847
+
848
+ //处理批量地址信息
849
+ dealaddlist(){
850
+ try {
851
+ var resultlist=[]
852
+ for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
853
+ for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
854
+ for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
855
+ for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
856
+ //预备一个空的json
857
+ console.log('批量', this.model)
858
+ let data=Object.assign({},this.model)
859
+ data.f_create_person= this.$login.f.name
860
+ if ( i != '无'){
861
+ if ((i+'').length == 1) {
862
+ data.f_building= data.f_building_prefix + '0' +i
863
+ } else {
864
+ data.f_building= data.f_building_prefix + '' +i
865
+ }
866
+ }else {
867
+ data.f_building = data.f_building_prefix + ''
868
+ }
869
+ if ((j+'').length == 1) {
870
+ data.f_unit= data.f_unit_prefix + '0'+j
871
+ } else {
872
+ data.f_unit= data.f_unit_prefix +''+ j
873
+ }
874
+ if ((m+'').length == 1) {
875
+ data.f_floor= data.f_floor_prefix +'0'+ m
876
+ } else {
877
+ data.f_floor= data.f_floor_prefix +''+ m
878
+ }
879
+ // 目前房号都按两位处理 如: 101室 201室 110室
880
+ if ((n+'').length == 1) {
881
+ data.f_room = data.f_room_prefix + m + '0' + n
882
+ } else {
883
+ data.f_room = data.f_room_prefix + m + '' + n
884
+ }
885
+ data.f_filialeid = this.f_filialeids
886
+ data.f_operator = this.$login.f.name
887
+ data.f_operatorid = this.$login.f.id
888
+ data.f_orgid = this.$login.f.orgid
889
+ data.f_orgname = this.$login.f.orgs
890
+ data.f_depid = this.$login.f.depids
891
+ data.f_depname = this.$login.f.deps
892
+ data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
893
+ data.f_district=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_district
894
+ data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
895
+ data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
896
+ data.f_address = data.f_district + data.f_street
897
+ + data.f_residential_area +
898
+ data.f_building + data.f_building_suffix
899
+ + data.f_unit + data.f_unit_suffix
900
+ + data.f_floor + data.f_floor_suffix
901
+ + data.f_room + data.f_room_suffix
902
+ data.f_slice_area = data.slice_area[0]?data.slice_area[0].name:data.slice_area
903
+
904
+ resultlist.push(data)
905
+ }
906
+ }
907
+ }
908
+ }
909
+ this.addresslist=resultlist
910
+ } catch (e) {
911
+ console.log(e)
912
+ this.$showAlert('输出数据有误,请检查', 'warning', 2000)
913
+ }
914
+ },
915
+ //保存多个
916
+ async confirmall(){
917
+ this.dealaddlist()
918
+ if(this.addresslist.length>0){
919
+ let msg = {
920
+ resolveMsg: '地址保存成功',
921
+ rejectMsg: '地址保存失败'
922
+ }
923
+ this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
924
+ if (res === 'confirm') {
925
+ this.$resetpost('rs/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
926
+ this.cleardara()
927
+ this.$dispatch('confirm')
928
+ })
929
+ }
930
+ })
931
+ }
932
+ },
933
+ //保存
934
+ async confirm(){
935
+ if(this.onedata=='one'){
936
+ await this.saveonedata()
937
+ }
938
+ this.cleardara()
939
+ this.$dispatch('confirm')
940
+ },
941
+ //保存一户信息
942
+ async saveonedata(){
943
+ this.model.f_create_person= this.$login.f.name
944
+ this.model.f_filialeid = this.f_filialeids
945
+ this.model.f_operator = this.$login.f.name
946
+ this.model.f_operatorid = this.$login.f.id
947
+ this.model.f_orgid = this.$login.f.orgid
948
+ this.model.f_orgname = this.$login.f.orgs
949
+ this.model.f_depid = this.$login.f.depids
950
+ this.model.f_depname = this.$login.f.deps
951
+ if (this.model.slice_area ) {
952
+ if (this.model.slice_area instanceof Array) {
953
+ this.model.f_slice_area = this.model.slice_area[0].name
954
+ } if (this.model.slice_area instanceof Object) {
955
+ this.model.f_slice_area = Object.values(this.model.slice_area)[0].name
956
+ } else{
957
+ this.model.f_slice_area = this.model.slice_area
958
+ }
959
+ }
960
+
961
+ if (( this.model.f_unit+'').length == 1) {
962
+ this.model.f_unit= '0'+ this.model.f_unit
963
+ }
964
+ if (( this.model.f_floor+'').length == 1) {
965
+ this.model.f_floor= '0'+ this.model.f_floor
966
+ }
967
+ if (( this.model.f_room+'').length == 1) {
968
+ this.model.f_room= '0'+ this.model.f_room
969
+ }
970
+ if (this.usertype) {
971
+ //非民用
972
+ this.model.f_special='1'
973
+ this.model.f_building_suffix=''
974
+ this.model.f_unit_suffix=''
975
+ this.model.f_floor_suffix=''
976
+ this.model.f_room_suffix=''
977
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
978
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
979
+ this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
980
+ } else {
981
+ //民用
982
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
983
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
984
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
985
+ if (( this.$refs.f_building_id.selectedItems+'').length == 1 && this.$refs.f_building_id.selectedItems!= '无') {
986
+ this.model.f_building= '0'+ this.$refs.f_building_id.selectedItems
987
+ }else{
988
+ this.model.f_building = this.$refs.f_building_id.selectedItems
989
+ }
990
+ this.model.f_building_suffix=''
991
+ if (!this.model.f_building) {
992
+ this.$showMessage('请选择楼栋数据!!!')
993
+ return
994
+ }
995
+ this.model.f_address = (this.model.f_district ? this.model.f_district : '') + this.model.f_street + (this.model.f_residential_area!='无'?this.model.f_residential_area:'') + (this.model.f_building&&this.model.f_building!='无'?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
996
+ }
997
+ await this.$resetpost('rs/logic/address_updateuseraddress', this.model)
998
+ },
999
+ cancel(){
1000
+ this.cleardara()
1001
+ this.$dispatch('cancel')
1002
+ },
1003
+ cleardara(){
1004
+ this.model= {
1005
+ f_pcd_id: '',
1006
+ f_street_id: '',
1007
+ f_iscity:'市区',
1008
+ f_residential_area_id: '',
1009
+ f_pcd: '',
1010
+ f_comments:'',
1011
+ f_street: '',
1012
+ f_residential_area: '',
1013
+ f_slice_area: '',
1014
+ slice_area: '',
1015
+ f_building: '',
1016
+ f_building_start: '',
1017
+ f_building_end: '',
1018
+ f_building_prefix: '',
1019
+ f_building_suffix: this.config.f_building_suffix,
1020
+ f_unit: '',
1021
+ f_unit_start: '',
1022
+ f_unit_end: '',
1023
+ f_unit_prefix: '',
1024
+ f_unit_suffix: this.config.f_unit_suffix,
1025
+ f_floor: '',
1026
+ f_floor_start: '',
1027
+ f_floor_end: '',
1028
+ f_floor_prefix: '',
1029
+ f_floor_suffix: this.config.f_floor_suffix,
1030
+ f_room: '',
1031
+ f_room_start: '',
1032
+ f_room_end: '',
1033
+ f_room_prefix: '',
1034
+ f_room_suffix: this.config.f_room_suffix,
1035
+ //详细地址
1036
+ f_address: '',
1037
+ //单位名称
1038
+ f_company: '',
1039
+ //单位地址
1040
+ f_company_address: '',
1041
+ f_lng: '',
1042
+ f_lat: '',
1043
+ f_enter_number: ''
1044
+ }
1045
+ // this.pcdslist = []
1046
+ // this.streetslist = []
1047
+ // this.areaslist = []
1048
+ },
1049
+
1050
+ //根据名字找数据
1051
+ findbyid(list,name){
1052
+ var result
1053
+ list.forEach((row, n) => {
1054
+ if(name==row.value){
1055
+ result= row.data
1056
+ }
1057
+ })
1058
+ return result
1059
+ },
1060
+ openModal () {
1061
+ this.isshow = true
1062
+ },
1063
+ closeModal () {
1064
+ this.isshow = false;
1065
+ },
1066
+ getmylocation (res) {
1067
+ this.templng = res.position.lng
1068
+ this.templat = res.position.lat
1069
+ },
1070
+ confirmLocation () {
1071
+ this.model.f_lat = this.templat
1072
+ this.model.f_lng = this.templng
1073
+ this.isshow = false
1074
+ }
1075
+ },
1076
+ watch: {
1077
+ //分公司变化
1078
+ 'f_filialeids'(){
1079
+ if (this.model.f_filialeid) {
1080
+ if (this.model.f_filialeid != this.f_filialeids) {
1081
+ this.$dispatch('cancel')
1082
+ }
1083
+ }
1084
+ this.cleardara()
1085
+ this.initdata()
1086
+ },
1087
+ 'row'(){
1088
+ this.onedata='one'
1089
+ },
1090
+ 'model.id' () {
1091
+ this.getbuildingList(`f_filialeid = '${this.f_filialeids}' and f_residential_area_id ='${this.model.f_residential_area_id}'`)
1092
+ }
1093
+ },
1094
+ computed: {
1095
+ //地址状态下拉框
1096
+ addresstate() {
1097
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
1098
+ },
1099
+ community() {
1100
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('行政划分')]
1101
+ },
1102
+ committee() {
1103
+ let rs = []
1104
+ if (this.model.f_community) {
1105
+ rs = this.$appdata.getParam(this.model.f_community)
1106
+ }
1107
+ return rs
1108
+ }
1109
+ }
1110
+ }
1111
+ </script>
1112
+ <style lang="less">
1113
+ #userAddress{
1114
+ #addboxmap {
1115
+ height: 300px;
1116
+ }
1117
+ .glyphicon:hover {
1118
+ color: red;
1119
+ }
1120
+ .glyphicon {
1121
+ color: blue;
1122
+ cursor: pointer;
1123
+ }
1124
+ }
1125
+ </style>