address-client 3.0.34-aodeToV4 → 3.0.35-aodeToV4

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