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,799 +0,0 @@
1
- <template>
2
- <div class="auto" 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">
7
- <input type="radio" id="true" value="one" v-model="onedata">
8
- <label for="one">单户</label>
9
- <input type="radio" id="false" value="more" v-model="onedata">
10
- <label for="more">多户</label>
11
- </div>
12
- <!--单个录入-->
13
- <div v-if="onedata=='one'" class="row">
14
-
15
- <div class="col-sm-6 form-group "
16
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']" >
17
- <label class="font_normal_body">&emsp;区&emsp;&emsp;域</label>
18
- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
19
- >
20
- <v-select :value.sync="model.f_street_id" :value-single="true"
21
- :options='streetslist' placeholder='请选择'
22
- @change="streetChange"
23
- close-on-select search="true" >
24
- </v-select>
25
- </div>
26
- <div class="col-sm-6 form-group "v-if="usertype"
27
- :class="[$v.f_small_area.required ? 'has-error' : 'has-success']" >
28
- <label class="font_normal_body">&emsp;小区域</label>
29
- <input type="text" style="width:41%" v-show="false" v-model="model.f_small_area"
30
- v-validate:f_small_area='{required: true }'
31
- >
32
- <v-select :value.sync="model.f_small_area" :value-single="true"
33
- :options='smallarea' placeholder='请选择'
34
- close-on-select search="true" >
35
- </v-select>
36
- </div>
37
- <div class="col-sm-6 form-group "v-if="!usertype"
38
- :class="[$v.f_small_area.required ? 'has-error' : 'has-success']" >
39
- <label class="font_normal_body">民用小区域</label>
40
- <input type="text" style="width:41%" v-show="false" v-model="model.f_small_area"
41
- v-validate:f_small_area='{required: true }'
42
- >
43
- <v-select :value.sync="model.f_small_area" :value-single="true"
44
- :options='smallarea' placeholder='请选择'
45
- close-on-select search="true" >
46
- </v-select>
47
- </div>
48
- <div class="col-sm-6 form-group " v-if="!usertype"
49
- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
50
- <label class="font_normal_body">&emsp;小区名称</label>
51
- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
52
- v-validate:f_residential_area_id='{required: true }'>
53
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
54
- :options='areaslist' placeholder='请选择'
55
- close-on-select search="true">
56
- </v-select>
57
- </div>
58
- <div v-if="!usertype" class="col-sm-6 form-group ">
59
- <label for="f_address" class="font_normal_body">&emsp;楼&emsp;&emsp;号</label>
60
- <input type="text" style="width:40%" v-model="model.f_building" class="input_search"
61
- placeholder="楼号"/>
62
- <input type="text" style="width:20%" v-model="model.f_building_suffix" class="input_search"
63
- />
64
-
65
- </div>
66
- <div v-if="!usertype" class="col-sm-6 form-group ">
67
- <label for="f_address" class="font_normal_body">&emsp;单&emsp;&emsp;元</label>
68
- <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
69
- <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search"
70
- />
71
- </div>
72
- <div v-if="!usertype" class="col-sm-6 form-group ">
73
- <label for="f_address" class="font_normal_body">&emsp;楼&emsp;&emsp;层</label>
74
- <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
75
- placeholder="楼层" />
76
- <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
77
- />
78
- </div>
79
- <div v-if="!usertype" class="col-sm-6 form-group "
80
- :class="[$v.f_room.required ? 'has-error' : 'has-success']">
81
- <label for="f_address" class="font_normal_body">&emsp;门&ensp;牌&ensp;号</label>
82
- <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
83
- v-validate:f_room='{required: true }'/>
84
- <input type="text" style="width:20%" v-model="model.f_room_suffix" class="input_search"
85
- />
86
- </div>
87
- <div class="col-sm-6 form-group">
88
- <label class="font_normal_body">&emsp;地址状态</label>
89
- <v-select :value.sync="model.f_address_state" :value-single="true"
90
- class="select_list select"
91
- condition="f_address_state = '{}'"
92
- :options='addresstate' placeholder='地址状态'
93
- close-on-select>
94
- </v-select>
95
- </div>
96
- <div v-if="usertype" class="col-sm-12 form-group "
97
- :class="[$v.f_address.required ? 'has-error' : 'has-success']">
98
- <label for="f_address" class="font_normal_body">&emsp;详细地址</label>
99
- <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
100
- v-validate:f_address='{required: true }'/>
101
- </div>
102
- <div class="col-sm-12 form-group">
103
- <label class="font_normal_body " >&emsp;备&emsp;&emsp;注</label>
104
- <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
105
- </div>
106
- <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
107
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
108
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
109
- </div>
110
- </div>
111
- <!--批量录入-->
112
- <div v-if="onedata=='more'" class="row">
113
- <div class="col-sm-6 form-group "
114
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']" >
115
- <label class="font_normal_body">区&emsp;&emsp;域</label>
116
- <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id" v-validate:f_street_id='{required: true }'
117
- >
118
- <v-select :value.sync="model.f_street_id" :value-single="true"
119
- :options='streetslist' placeholder='请选择'
120
- @change="streetChange"
121
- close-on-select search="true" >
122
- </v-select>
123
- </div>
124
-
125
- <div class="col-sm-6 form-group "
126
- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
127
- <label class="font_normal_body">小区名称</label>
128
- <input type="text" style="width:60%" v-show="false" v-model="model.f_residential_area_id"
129
- v-validate:f_residential_area_id='{required: true }'>
130
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
131
- :options='areaslist' placeholder='请选择'
132
- close-on-select search="true">
133
- </v-select>
134
- </div>
135
- <div class="col-sm-6 form-group "
136
- :class="[$v.f_building_start.integernum || $v.f_building_start.dctest ?'has-error' : 'has-success']">
137
- <label for="f_address" class="font_normal_body">起始楼号</label>
138
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
139
- <input type="text" style="width:25%"
140
- v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
141
- v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
142
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"/>
143
- </div>
144
- <div class="col-sm-6 form-group "
145
- :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
146
- <label for="f_address" class="font_normal_body">截止楼号</label>
147
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
148
- <input type="text" style="width:25%"
149
- v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
150
- v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
151
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"
152
- />
153
- </div>
154
-
155
- <div class="col-sm-6 form-group "
156
- :class="[$v.f_units.integernum ?'has-error' : 'has-success']">
157
- <label for="f_address" class="font_normal_body">单元区间</label>
158
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
159
- <input type="text" style="width:25%"
160
- v-validate:f_units='{integernum: true }'
161
- v-model="model.f_units" class="input_search" placeholder="单元"/>
162
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
163
- </div>
164
- <div class="col-sm-6 form-group " v-if="!usertype"
165
- :class="[$v.f_address_type.required ? 'has-error' : 'has-success']">
166
- <label class="font_normal_body" >门牌类型</label>
167
- <input type="text" style="width:60%" v-show="false" v-model="model.f_address_type"
168
- v-validate:f_address_type='{required: true }'>
169
- <v-select :value.sync="model.f_address_type" v-model="model.f_address_type"
170
- :options='addresstype' placeholder='请选择门牌类型'
171
- @change="changeType"
172
- close-on-select>
173
- </v-select>
174
- </div>
175
-
176
- <div class="col-sm-6 form-group "
177
- :class="[$v.f_unit_start.integernum || $v.f_unit_start.dctest ? 'has-error' : 'has-success']">
178
- <label for="f_address" class="font_normal_body">起始单元</label>
179
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
180
- <input type="text" style="width:25%"
181
- v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
182
- v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
183
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
184
- </div>
185
- <div class="col-sm-6 form-group "
186
- :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
187
- <label for="f_address" class="font_normal_body">截至单元</label>
188
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search " readonly/>
189
- <input type="text" style="width:25%"
190
- v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
191
- v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
192
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search"/>
193
- </div>
194
-
195
- <div class="col-sm-6 form-group "
196
- :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
197
- <label for="f_address" class="font_normal_body">起始楼层</label>
198
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
199
- <input type="text" style="width:25%"
200
- v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
201
- v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
202
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
203
- </div>
204
- <div class="col-sm-6 form-group "
205
- :class="[$v.f_floor_end.integernum ||$v.f_floor_end.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_floor_prefix" class="input_search"/>
208
- <input type="text" style="width:25%" v-model="model.f_floor_end"
209
- v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
210
- class="input_search" placeholder="楼层"/>
211
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
212
- </div>
213
-
214
-
215
- <div v-if="menpaiType" class="col-sm-6 form-group "
216
- :class="[$v.f_room_start.integernum || $v.f_room_start.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_room_prefix" class="input_search"/>
219
- <input type="text" style="width:25%" v-model="model.f_room_start"
220
- class="input_search" placeholder="门牌号"
221
- v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
222
- />
223
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
224
- </div>
225
- <div v-if="menpaiType" class="col-sm-6 form-group "
226
- :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
227
- <label for="f_address" class="font_normal_body">截止门牌</label>
228
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
229
- <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
230
- v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
231
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
232
- </div>
233
- <div class="col-sm-10 form-group ">
234
- <p class="navbar-text" style="margin-left: 10%">说明: 层数输入1,门牌号输入001。产生的最终门牌号显示1001</p>
235
- </div>
236
- <div class="col-sm-12 form-group">
237
- <label class="font_normal_body " style="margin-top:-20px">备&emsp;&emsp;注</label>
238
- <textarea class="input_textarea" rows="3" style="width:80%;height: auto;" v-model="model.f_comments"></textarea>
239
- </div>
240
- <div class="row">
241
- <div style="text-align:right;margin-top:20px;margin-right:50px;" class="col-sm-12">
242
- <button class="button_search button_spacing" @click="confirmall()" :disabled='!$v.valid'>保存</button>
243
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
244
- </div>
245
- </div>
246
- </div>
247
- </div>
248
- </validator>
249
- </div>
250
- </template>
251
-
252
- <script>
253
- import {HttpResetClass} from 'vue-client'
254
-
255
-
256
- let getAreaConfig = async function (self) {
257
- // 获取气价里面的配置
258
- // await self.$getConfig(self, 'UserAddress')
259
- console.log('原地址配置',self.config)
260
- console.log('获取地址配置',self.config)
261
- Object.assign(self.model, self.config)
262
- console.log("查看配置文件",self.model)
263
- }
264
-
265
- export default {
266
- title: '用户地址添加',
267
- data () {
268
- return {
269
-
270
- //门牌类型展示
271
- menpaiType :false,
272
- //初始化省市区数据
273
- pcdslist:[],
274
- //初始化街道数据
275
- streetslist:[],
276
- //初始化街道数据
277
- areaslist:[],
278
- config:{
279
- f_building_suffix: '#',
280
- f_unit_suffix: '单元',
281
- f_floor_suffix: '楼',
282
- f_room_suffix: '户'
283
- },
284
- model: {
285
- f_pcd_id: '',
286
- f_street_id: '',
287
- f_comments:'',
288
- f_residential_area_id: '',
289
- f_pcd: '',
290
- f_street: '',
291
- f_residential_area: '',
292
- f_slice_area: '',
293
- f_building: '',
294
- f_building_start: '',
295
- f_building_end: '',
296
- f_building_suffix: '',
297
- f_unit: '',
298
- f_unit_start: '',
299
- f_unit_end: '',
300
- f_unit_suffix: '',
301
- f_floor: '',
302
- f_floor_start: '',
303
- f_floor_end: '',
304
- f_floor_suffix: '',
305
- f_room: '',
306
- f_room_start: '',
307
- f_room_end: '',
308
- f_room_suffix: '',
309
- //详细地址
310
- f_address: '',
311
- //单位名称
312
- f_company: '',
313
- //单位地址
314
- f_company_address: '',
315
- //门牌类型
316
- f_address_type:'',
317
- //单元区间
318
- f_units:''
319
- },
320
- //判读是否为单个数据录入
321
- onedata: 'one',
322
- //选中所有地址
323
- addresslist: [],
324
- usertype:false,
325
-
326
- // 公司信息
327
- curorgid: [this.$login.f.orgid],
328
-
329
- f_orgid: '',
330
-
331
- sliceArea: [],
332
- smallarea:this.$appdata.getParam('小区域'),
333
- chars:'零一二三四五六七八九'
334
- }
335
- },
336
- props: ['f_filialeids', 'row','operation','usertype'],
337
- ready(){
338
- this.initdata()
339
- getAreaConfig(this)
340
- },
341
- methods: {
342
- //阿拉伯数字转换中文汉字
343
- coverNumber(number){
344
- var chnNumChar = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
345
- var chnUnitChar = ["", "十", "百", "千"];
346
- var strIns = '', chnStr = '';
347
- var unitPos = 0;
348
- var zero = true;
349
- while (number > 0) {
350
- var v = number % 10;
351
- if (v === 0) {
352
- if (!zero) {
353
- zero = true;
354
- chnStr = chnNumChar[v] + chnStr;
355
- }
356
- } else {
357
- zero = false;
358
- strIns = chnNumChar[v];
359
- strIns += chnUnitChar[unitPos];
360
- chnStr = strIns + chnStr;
361
- }
362
- unitPos++;
363
- number = Math.floor(number / 10);
364
- }
365
- return chnStr;
366
- },
367
- async initdata(){
368
- this.model.f_address_state = '未通气'
369
- this.initAreas(this.f_filialeids)
370
- // 添加特殊地址选省市区
371
-
372
- this.initpcds(` f_orgid = '${this.f_filialeids}'`)
373
- this.initstreets(` f_orgid = '${this.f_filialeids}' `)
374
- this.initareas(` f_orgid = '${this.f_filialeids}'`)
375
-
376
- },
377
- //展示一梯多户 门牌
378
- changeType(){
379
- this.menpaiType=false
380
- if(this.model.f_address_type[0]==='一梯多户') {
381
- this.menpaiType=true
382
- }
383
- },
384
- // 初始化片区
385
- async initAreas (val) {
386
- if (val) {
387
- let getAllArea = await this.$resetpost('/rs/search', {
388
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
389
- userid: this.$login.f.id
390
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
391
-
392
- let arr = getAllArea.data.filter((res) => {
393
- return res.parentid == val
394
- })
395
- console.log('过滤之后的片区', arr)
396
- this.sliceArea = []
397
- arr.forEach((res) => {
398
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
399
- })
400
- }
401
- },
402
- //初始化省市区,添加街道
403
- async initpcds(pconditon){
404
- this.pcdslist = []
405
- let HttpReset = new HttpResetClass()
406
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
407
- data: {
408
- items: '*',
409
- tablename: 't_pcd',
410
- orderitem: 'id',
411
- condition: pconditon
412
- }
413
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
414
- let redata = []
415
- req.data.forEach((row, n) => {
416
- redata[n] = {
417
- label: row.f_pcd,
418
- value: row.id,
419
- data:row,
420
- id:row.id
421
- }
422
- })
423
- this.pcdslist=redata
424
- },
425
- //初始化街道 添加小区
426
- async initstreets(pconditon){
427
- this.streetslist = []
428
- let HttpReset = new HttpResetClass()
429
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
430
- data: {
431
- items: '*',
432
- tablename: 't_street',
433
- orderitem: 'id',
434
- condition: pconditon
435
- }
436
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
437
- let redata = []
438
- req.data.forEach((row, n) => {
439
- redata[n] = {
440
- label: row.f_street,
441
- value: row.id,
442
- data:row,
443
- id:row.id
444
- }
445
- })
446
- this.streetslist=redata
447
- },
448
- //初始化小区添加小区
449
- async initareas(pconditon){
450
- // if(this.usertype){
451
- // pconditon=pconditon+` and f_special='1' `
452
- // }
453
- this.areaslist = []
454
- let HttpReset = new HttpResetClass()
455
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
456
- data: {
457
- items: '*',
458
- tablename: 't_area',
459
- orderitem: 'id',
460
- condition: pconditon
461
- }
462
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
463
- let redata = []
464
- req.data.forEach((row) => {
465
- redata.push({
466
- label: row.f_residential_area,
467
- value: row.id,
468
- data: row,
469
- id: row.id
470
- })
471
- })
472
- this.areaslist=redata
473
- },
474
- //省/市/区变化
475
- async pcdChange(val){
476
- // 只有添加特殊地址时才级联
477
- if (!this.usertype) {
478
- return
479
- }
480
- console.log("省/市/区变化",val)
481
- if(val){
482
- //那就把[小区,街道]重新组织一下
483
- await this.initstreets(` f_pcd_id ='${val}' `)
484
- if(this.model.f_street_id){
485
- if (this.findbyid(this.streetslist,this.model.f_street_id)) {
486
- let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
487
- if(pcd_id!=val){
488
- this.model.f_street_id=''
489
- }
490
- } else {
491
- this.model.f_street_id=''
492
- }
493
-
494
- //那就把[小区,街道]重新组织一下
495
- if (this.model.f_street_id) {
496
- await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
497
- if(this.model.f_residential_area_id){
498
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
499
- let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
500
- if(pcd_id!=val){
501
- this.model.f_residential_area_id=''
502
- }
503
- } else {
504
- this.model.f_residential_area_id=''
505
- }
506
-
507
- }
508
- }
509
- }
510
- }
511
- this.$resetValidation()
512
- },
513
- //小区变化
514
- areaChange(val){
515
- console.log("小区变化",val)
516
- // 选择小区后级联出省市区和街道
517
- let selectArea // 选中的小区数据
518
- for (let row of this.areaslist) {
519
- if (val == row.value) {
520
- selectArea = row.data
521
- break
522
- }
523
- }
524
- if (selectArea) {
525
- this.model.f_street_id = selectArea.f_street_id
526
- this.model.f_pcd_id = selectArea.f_pcd_id
527
- this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
528
- this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
529
- this.model.slice_area = [{name: selectArea.f_slice_area, code: selectArea.f_area_code}]
530
- }
531
- this.$nextTick(() => {
532
- this.$resetValidation()
533
- })
534
- },
535
- //街道变化
536
- async streetChange(val){
537
- console.log("街道变化",val)
538
- if(this.streetslist[0]) {
539
- var street=''
540
- this.streetslist.forEach((item)=>{
541
- if(item.id===val){
542
- street=item.label
543
- }
544
- })
545
- this.model.f_address = ''
546
- }
547
- if(val){
548
- //那就把[小区]重新组织一下
549
- await this.initareas(` f_street_id ='${val}' `)
550
- if(this.model.f_residential_area_id){
551
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
552
- let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
553
- if(street_id!=val){
554
- this.model.f_residential_area_id=''
555
- }
556
- } else {
557
- this.model.f_residential_area_id=''
558
- }
559
- }
560
- }
561
- this.$resetValidation()
562
- },
563
-
564
- getorg (val) {
565
- this.f_orgid = val[0]
566
- },
567
-
568
- //处理批量地址信息
569
- dealaddlist(){
570
- //一梯两户时默认值
571
- if(this.model.f_room_end===''||this.model.f_room_end===null){
572
- this.model.f_room_start=1
573
- this.model.f_room_end=2
574
- }
575
- // console.log('单元区间')
576
- // console.log(this.model.f_units)
577
- try {
578
- var resultlist=[]
579
- for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
580
- for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
581
- for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
582
- for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
583
- //预备一个空的json
584
- console.log('批量', this.model)
585
- let data = Object.assign({}, this.model)
586
- data.f_create_person = this.$login.f.name
587
- data.f_building = data.f_building_prefix + i
588
- //单元
589
-
590
- if (this.model.f_unit_end === '1') { // 如果截至单元为1
591
- data.f_unit = '东'
592
- } else if (this.model.f_unit_end === '2') { // 如果截至单元为2
593
- if(j===1){ data.f_unit = '东'}
594
- else{data.f_unit = '西'}
595
- } else if(j===1 &&this.model.f_unit_end===this.model.f_units){ //当截至单元等于 单元区间 并且起始单元为1
596
- if(j===1){data.f_unit = '东'} //第一个单元
597
- else if(j+''===this.model.f_unit_end){data.f_unit = '西'} //最后一个单元西
598
- // coverNumber() 将阿拉伯数字转化为汉字数字
599
- else{data.f_unit = '东'+ this.coverNumber(j)} //其他 东二、东三、东四
600
- } else if(j>1 &&this.model.f_unit_end===this.model.f_units){ //当截至单元等于 单元区间 并且起始单元大于1
601
- if(j+''===this.model.f_unit_end){data.f_unit = '西'} //最后一个单元
602
- // coverNumber() 将阿拉伯数字转化为汉字数字
603
- else{data.f_unit = '东'+ this.coverNumber(j)} //其他 东二、东三、东四
604
- } else if(j>1 &&this.model.f_unit_end<this.model.f_units){
605
- data.f_unit = '东'+ this.coverNumber(j)} //其他 东二、东三、东四
606
-
607
-
608
- data.f_floor = data.f_floor_prefix + m // 楼层
609
- //门牌号
610
- if(this.model.f_address_type[0]==='一梯多户'){ //判断一梯多户
611
- if(this.model.f_room_end==='2'){ //用户选择多户 填2个 还是给东 西
612
- if(n===1){data.f_room = '东'}
613
- else{data.f_room = '西'}
614
- }else{ // 多户给 101、102、103
615
- if ((n+'').length === 1) {
616
- data.f_room = data.f_room_prefix + m + '0' + n
617
- } else {
618
- data.f_room = data.f_room_prefix + m + '' + n
619
- }
620
- }
621
- }else{ // 一梯两户
622
- if(n===1){data.f_room = '东'}
623
- else{data.f_room = '西'}
624
- }
625
- data.f_filialeid = this.f_filialeids
626
- data.f_operator = this.$login.f.name
627
- data.f_operatorid = this.$login.f.id
628
- data.f_orgid = this.$login.f.orgid
629
- data.f_orgname = this.$login.f.orgs
630
- data.f_depid = this.$login.f.depids
631
- data.f_depname = this.$login.f.deps
632
- data.f_pcd='山东省威海市荣成市'
633
- data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
634
- data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
635
- data.f_address = data.f_residential_area +
636
- data.f_building + data.f_building_suffix
637
- + data.f_unit + data.f_unit_suffix
638
- + data.f_floor + data.f_floor_suffix
639
- + data.f_room
640
- data.f_slice_area = '荣成港华燃气'
641
- data.f_area_code = '01'
642
- resultlist.push(data)
643
- }
644
- }
645
- }
646
- }
647
- this.addresslist=resultlist
648
- } catch (e) {
649
- console.log(e)
650
- this.$showAlert('输出数据有误,请检查', 'warning', 2000)
651
- }
652
- },
653
- //保存多个
654
- async confirmall(){
655
- if(this.model.f_unit_start>this.model.f_units || this.model.f_unit_end>this.model.f_units){
656
- this.$showAlert('你的起始单元或者截至单元输入不在范围内', 'warning', 2000)
657
- return
658
- }
659
- this.dealaddlist()
660
- if(this.addresslist.length>0){
661
- let msg = {
662
- resolveMsg: '地址保存成功',
663
- rejectMsg: '地址保存失败'
664
- }
665
- this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
666
- if (res === 'confirm') {
667
- this.$resetpost('rs/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
668
- this.cleardara()
669
- this.$dispatch('confirm')
670
- })
671
- }
672
- })
673
- }
674
- },
675
- //保存
676
- async confirm(){
677
- if(this.onedata=='one'){
678
- await this.saveonedata()
679
- }
680
- this.cleardara()
681
- this.$dispatch('confirm')
682
- },
683
- //保存一户信息
684
- async saveonedata(){
685
- this.model.f_create_person= this.$login.f.name
686
- this.model.f_filialeid = this.f_filialeids
687
- this.model.f_operator = this.$login.f.name
688
- this.model.f_operatorid = this.$login.f.id
689
- this.model.f_orgid = this.$login.f.orgid
690
- this.model.f_orgname = this.$login.f.orgs
691
- this.model.f_depid = this.$login.f.depids
692
- this.model.f_depname = this.$login.f.deps
693
- this.model.f_slice_area = '荣成港华燃气'
694
- this.model.f_area_code = '01'
695
- if (this.usertype) {
696
- //非民用
697
- this.model.f_special='1'
698
- this.model.f_building_suffix=''
699
- this.model.f_unit_suffix=''
700
- this.model.f_floor_suffix=''
701
- this.model.f_room_suffix=''
702
- this.model.f_pcd = '山东省威海市荣成市'
703
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
704
- } else {
705
- //民用
706
- this.model.f_pcd = '山东省威海市荣成市'
707
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
708
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
709
- this.model.f_address = 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
710
- }
711
- // console.log("查看f_street",tis.model)
712
- await this.$resetpost('rs/logic/address_updateuseraddress', this.model)
713
- },
714
- cancel(){
715
- this.cleardara()
716
- this.$dispatch('cancel')
717
- },
718
- cleardara(){
719
- this.model= {
720
- f_pcd_id: '',
721
- f_street_id: '',
722
- f_residential_area_id: '',
723
- f_pcd: '',
724
- f_comments:'',
725
- f_street: '',
726
- f_residential_area: '',
727
- f_slice_area: '',
728
- f_building: '',
729
- f_building_start: '',
730
- f_building_end: '',
731
- f_building_prefix: '',
732
- f_building_suffix: this.config.f_building_suffix,
733
- f_unit: '',
734
- f_unit_start: '',
735
- f_unit_end: '',
736
- f_unit_prefix: '',
737
- f_unit_suffix: this.config.f_unit_suffix,
738
- f_floor: '',
739
- f_floor_start: '',
740
- f_floor_end: '',
741
- f_floor_prefix: '',
742
- f_floor_suffix: this.config.f_floor_suffix,
743
- f_room: '',
744
- f_room_start: '',
745
- f_room_end: '',
746
- f_room_prefix: '',
747
- f_room_suffix: this.config.f_room_suffix,
748
- //详细地址
749
- f_address: '',
750
- //单位名称
751
- f_company: '',
752
- //单位地址
753
- f_company_address: '',
754
- //门牌类型
755
- f_address_type:''
756
- }
757
- // this.pcdslist = []
758
- // this.streetslist = []
759
- // this.areaslist = []
760
- },
761
-
762
- //根据名字找数据
763
- findbyid(list,name){
764
- var result
765
- list.forEach((row, n) => {
766
- if(name==row.value){
767
- result= row.data
768
- }
769
- })
770
- return result
771
- },
772
- },
773
- watch: {
774
- //分公司变化
775
- 'f_filialeids'(){
776
- if (this.model.f_filialeid) {
777
- if (this.model.f_filialeid != this.f_filialeids) {
778
- this.$dispatch('cancel')
779
- }
780
- }
781
- this.cleardara()
782
- this.initdata()
783
- },
784
- 'row'(){
785
- this.onedata='one'
786
- }
787
- },
788
- computed: {
789
- //地址状态下拉框
790
- addresstate() {
791
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
792
- },
793
- //门牌类型
794
- addresstype(){
795
- return [{label: '请选择', value: ''}, ...this.$appdata.getParam('门牌类型')]
796
- }
797
- }
798
- }
799
- </script>