address-client 3.2.13 → 3.2.17

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