address-client 3.2.2 → 3.2.3-zk

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