address-client 3.2.14 → 3.2.18

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