address-client 3.2.111-3 → 3.2.111-5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "address-client",
3
- "version": "3.2.111-3",
3
+ "version": "3.2.111-5",
4
4
  "description": "地址管理前台组件",
5
5
  "author": "wanbochao",
6
6
  "license": "ISC",
@@ -99,21 +99,21 @@
99
99
  <label for="f_address" class="font_normal_body">楼&emsp;&emsp;号</label>
100
100
  <input type="text" style="width:40%" v-model="model.f_building" class="input_search"
101
101
  placeholder="楼号"/>
102
- <input type="text" style="width:20%" v-model="model.f_building_suffix" class="input_search" disabled
102
+ <input type="text" style="width:20%" value="" class="input_search" disabled
103
103
  />
104
104
 
105
105
  </div>
106
106
  <div v-if="!usertype" class="col-sm-6 form-group ">
107
107
  <label for="f_address" class="font_normal_body">单&emsp;&emsp;元</label>
108
108
  <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
109
- <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search" disabled
109
+ <input type="text" style="width:20%" value="单元" class="input_search" disabled
110
110
  />
111
111
  </div>
112
112
  <div v-if="!usertype" class="col-sm-6 form-group ">
113
113
  <label for="f_address" class="font_normal_body">楼&emsp;&emsp;层</label>
114
114
  <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
115
115
  placeholder="楼层" />
116
- <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
116
+ <input type="text" style="width:20%" value="" class="input_search" disabled
117
117
  />
118
118
  </div>
119
119
  <div v-if="!usertype" class="col-sm-6 form-group "
@@ -121,7 +121,7 @@
121
121
  <label for="f_address" class="font_normal_body">门&ensp;牌&ensp;号</label>
122
122
  <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
123
123
  v-validate:f_room='{required: true }'/>
124
- <input type="text" style="width:20%" v-model="model.f_room_suffix" class="input_search" disabled
124
+ <input type="text" style="width:20%" value="" class="input_search" disabled
125
125
  />
126
126
  </div>
127
127
  <div class="col-sm-6 form-group">
@@ -215,15 +215,15 @@
215
215
  close-on-select search="true">
216
216
  </v-select>
217
217
  </div>
218
- <!-- <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">-->
219
- <!-- <label class="font_normal_body">片&emsp;&emsp;区</label>-->
220
- <!-- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"-->
221
- <!-- >-->
222
- <!-- <v-select :value.sync="model.f_slice_area" v-model="model.f_slice_area" :value-single="true"-->
223
- <!-- :options='sliceArea' placeholder='片区/管理站' filer-key="name"-->
224
- <!-- close-on-select v-ref:slice>-->
225
- <!-- </v-select>-->
226
- <!-- </div>-->
218
+ <!-- <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">-->
219
+ <!-- <label class="font_normal_body">片&emsp;&emsp;区</label>-->
220
+ <!-- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"-->
221
+ <!-- >-->
222
+ <!-- <v-select :value.sync="model.f_slice_area" v-model="model.f_slice_area" :value-single="true"-->
223
+ <!-- :options='sliceArea' placeholder='片区/管理站' filer-key="name"-->
224
+ <!-- close-on-select v-ref:slice>-->
225
+ <!-- </v-select>-->
226
+ <!-- </div>-->
227
227
  <div class="col-sm-6 form-group "
228
228
  :class="[$v.f_area_period.integernum || $v.f_area_period.dctest ?'has-error' : 'has-success']">
229
229
  <label for="f_address" class="font_normal_body">区(期)数</label>
@@ -237,7 +237,7 @@
237
237
  <input type="text" style="width:25%"
238
238
  v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
239
239
  v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
240
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search" disabled/>
240
+ <input type="text" style="width:17%" value="" class="input_search" disabled/>
241
241
  </div>
242
242
  <div class="col-sm-6 form-group "
243
243
  :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
@@ -246,7 +246,7 @@
246
246
  <input type="text" style="width:25%"
247
247
  v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
248
248
  v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
249
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search" disabled
249
+ <input type="text" style="width:17%" value="" class="input_search" disabled
250
250
  />
251
251
  </div>
252
252
  <div class="col-sm-6 form-group "
@@ -256,7 +256,7 @@
256
256
  <input type="text" style="width:25%"
257
257
  v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
258
258
  v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
259
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" disabled/>
259
+ <input type="text" style="width:17%" value="单元" class="input_search" disabled/>
260
260
  </div>
261
261
  <div class="col-sm-6 form-group "
262
262
  :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
@@ -265,7 +265,7 @@
265
265
  <input type="text" style="width:25%"
266
266
  v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
267
267
  v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
268
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" disabled/>
268
+ <input type="text" style="width:17%" value="单元" class="input_search" disabled/>
269
269
  </div>
270
270
  <div class="col-sm-6 form-group "
271
271
  :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
@@ -274,7 +274,7 @@
274
274
  <input type="text" style="width:25%"
275
275
  v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
276
276
  v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
277
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
277
+ <input type="text" style="width:17%" value="" class="input_search"/>
278
278
  </div>
279
279
  <div class="col-sm-6 form-group "
280
280
  :class="[$v.f_floor_end.integernum ||$v.f_floor_end.dctest ? 'has-error' : 'has-success']">
@@ -283,7 +283,7 @@
283
283
  <input type="text" style="width:25%" v-model="model.f_floor_end"
284
284
  v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
285
285
  class="input_search" placeholder="楼层"/>
286
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
286
+ <input type="text" style="width:17%" value="" class="input_search"/>
287
287
  </div>
288
288
  <div class="col-sm-6 form-group "
289
289
  :class="[$v.f_room_start.integernum || $v.f_room_start.dctest ? 'has-error' : 'has-success']">
@@ -293,7 +293,7 @@
293
293
  class="input_search" placeholder="门牌号"
294
294
  v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
295
295
  />
296
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search" disabled/>
296
+ <input type="text" style="width:17%" value="" class="input_search" disabled/>
297
297
  </div>
298
298
  <div class="col-sm-6 form-group "
299
299
  :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
@@ -301,7 +301,7 @@
301
301
  <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
302
302
  <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
303
303
  v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
304
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search" disabled/>
304
+ <input type="text" style="width:17%" value="" class="input_search" disabled/>
305
305
  </div>
306
306
  <div class="col-sm-6 form-group">
307
307
  <label class="font_normal_body">地址状态</label>
@@ -329,590 +329,593 @@
329
329
  </div>
330
330
  </validator>
331
331
 
332
- <!-- <modal v-if="isshow" :show.sync="isshow" large backdrop="false" :width="900">-->
333
- <!-- <header slot="modal-header" class="modal-header">-->
334
- <!-- </header>-->
335
- <!-- <article slot="modal-body" class="modal-body">-->
336
- <!-- <amap-location :islocationclearmark="false" dom="addboxmap" v-ref:positionInfo @getmylocation="getmylocation"></amap-location>-->
337
- <!-- </article>-->
338
- <!-- <footer slot="modal-footer" class="modal-footer">-->
339
- <!-- <button v-show="isshow" type="button" class="button_search button_spacing" @click='confirmLocation'>确认</button>-->
340
- <!-- <button v-show="isshow" type="button" class="button_clear button_spacing" @click='closeModal'>取消</button>-->
341
- <!-- </footer>-->
342
- <!-- </modal>-->
332
+ <!-- <modal v-if="isshow" :show.sync="isshow" large backdrop="false" :width="900">-->
333
+ <!-- <header slot="modal-header" class="modal-header">-->
334
+ <!-- </header>-->
335
+ <!-- <article slot="modal-body" class="modal-body">-->
336
+ <!-- <amap-location :islocationclearmark="false" dom="addboxmap" v-ref:positionInfo @getmylocation="getmylocation"></amap-location>-->
337
+ <!-- </article>-->
338
+ <!-- <footer slot="modal-footer" class="modal-footer">-->
339
+ <!-- <button v-show="isshow" type="button" class="button_search button_spacing" @click='confirmLocation'>确认</button>-->
340
+ <!-- <button v-show="isshow" type="button" class="button_clear button_spacing" @click='closeModal'>取消</button>-->
341
+ <!-- </footer>-->
342
+ <!-- </modal>-->
343
343
 
344
344
  </div>
345
345
  </template>
346
346
 
347
347
  <script>
348
- import {HttpResetClass} from 'vue-client'
348
+ import {HttpResetClass} from 'vue-client'
349
349
 
350
- let getAreaConfig = async function (self) {
351
- // 获取气价里面的配置
352
- await self.$getConfig(self, 'UserAddress')
353
- console.log('原地址配置',self.config)
354
- console.log('获取地址配置',self.config)
355
- Object.assign(self.model, self.config)
356
- }
350
+ let getAreaConfig = async function (self) {
351
+ // 获取气价里面的配置
352
+ await self.$getConfig(self, 'UserAddress')
353
+ console.log('原地址配置',self.config)
354
+ console.log('获取地址配置',self.config)
355
+ Object.assign(self.model, self.config)
356
+ }
357
357
 
358
- export default {
359
- title: '用户地址添加',
360
- data () {
361
- return {
362
- //模态框是否显示
363
- isshow: false,
364
- //接收位置
365
- templng: '', //临时经度
366
- templat: '' , //临时纬度
358
+ export default {
359
+ title: '用户地址添加',
360
+ data () {
361
+ return {
362
+ //模态框是否显示
363
+ isshow: false,
364
+ //接收位置
365
+ templng: '', //临时经度
366
+ templat: '' , //临时纬度
367
367
 
368
- //初始化省市区数据
369
- pcdslist:[],
370
- //初始化街道数据
371
- streetslist:[],
372
- //初始化街道数据
373
- areaslist:[],
374
- iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'},{label:'全部',value:''}],
375
- config:{
376
- hasnumber:false,
377
- f_building_suffix: '号楼',
378
- f_unit_suffix: '单元',
379
- f_floor_suffix: '层',
380
- f_room_suffix: '室'
381
- },
382
- model: {
383
- f_pcd_id: '',
384
- f_street_id: '',
385
- f_comments1:'',
386
- f_comments:'',
387
- f_residential_area_id: '',
388
- f_pcd: '',
389
- f_street: '',
390
- f_residential_area: '',
391
- f_slice_area: '',
392
- slice_area:'',
393
- f_building: '',
394
- f_area_period: '',
395
- f_building_start: '',
396
- f_building_end: '',
397
- f_building_suffix: '幢',
398
- f_unit: '',
399
- f_unit_start: '',
400
- f_unit_end: '',
401
- f_unit_suffix: '单元',
402
- f_floor: '',
403
- f_floor_start: '',
404
- f_floor_end: '',
405
- f_floor_suffix: '',
406
- f_room: '',
407
- f_room_start: '',
408
- f_room_end: '',
409
- f_room_suffix: '室',
410
- //详细地址
411
- f_address: '',
412
- //单位名称
413
- f_company: '',
414
- //单位地址
415
- f_company_address: '',
416
- f_lng: '', //经度
417
- f_lat: '' //纬度
418
- },
419
- //判读是否为单个数据录入
420
- onedata: 'one',
421
- //选中所有地址
422
- addresslist: [],
423
- usertype:false,
368
+ //初始化省市区数据
369
+ pcdslist:[],
370
+ //初始化街道数据
371
+ streetslist:[],
372
+ //初始化街道数据
373
+ areaslist:[],
374
+ iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'},{label:'全部',value:''}],
375
+ config:{
376
+ hasnumber:false,
377
+ f_building_suffix: '',
378
+ f_unit_suffix: '单元',
379
+ f_floor_suffix: '层',
380
+ f_room_suffix: '室'
381
+ },
382
+ model: {
383
+ f_pcd_id: '',
384
+ f_street_id: '',
385
+ f_comments1:'',
386
+ f_comments:'',
387
+ f_residential_area_id: '',
388
+ f_pcd: '',
389
+ f_street: '',
390
+ f_residential_area: '',
391
+ f_slice_area: '',
392
+ slice_area:'',
393
+ f_building: '',
394
+ f_area_period: '',
395
+ f_building_start: '',
396
+ f_building_end: '',
397
+ f_building_suffix: '幢',
398
+ f_unit: '',
399
+ f_unit_start: '',
400
+ f_unit_end: '',
401
+ f_unit_suffix: '单元',
402
+ f_floor: '',
403
+ f_floor_start: '',
404
+ f_floor_end: '',
405
+ f_floor_suffix: '',
406
+ f_room: '',
407
+ f_room_start: '',
408
+ f_room_end: '',
409
+ f_room_suffix: '室',
410
+ //详细地址
411
+ f_address: '',
412
+ //单位名称
413
+ f_company: '',
414
+ //单位地址
415
+ f_company_address: '',
416
+ f_lng: '', //经度
417
+ f_lat: '' //纬度
418
+ },
419
+ //判读是否为单个数据录入
420
+ onedata: 'one',
421
+ //选中所有地址
422
+ addresslist: [],
423
+ usertype:false,
424
424
 
425
- // 公司信息
426
- curorgid: [this.$login.f.orgid],
425
+ // 公司信息
426
+ curorgid: [this.$login.f.orgid],
427
427
 
428
- f_orgid: '',
428
+ f_orgid: '',
429
429
 
430
- sliceArea: []
430
+ sliceArea: []
431
+ }
432
+ },
433
+ props: ['f_filialeids', 'row','operation','usertype'],
434
+ ready(){
435
+ this.initdata()
436
+ getAreaConfig(this)
437
+ this.model.f_building_suffix=this.config.f_building_suffix
438
+ this.model.f_unit_suffix=this.config.f_unit_suffix
439
+ this.model.f_floor_suffix=this.config.f_floor_suffix
440
+ this.model.f_room_suffix=this.config.f_room_suffix
441
+ },
442
+ methods: {
443
+ async changecity(){
444
+ this.areaslist = []
445
+ // this.model.f_residential_area_id = null
446
+ // this.model.f_residential_area = null
447
+ let condition = `a.f_orgid = '${this.$login.f.orgid}'`
448
+ if(this.model.f_iscity) {
449
+ condition = condition + ` and f_iscity = '${this.model.f_iscity}'`
431
450
  }
432
- },
433
- props: ['f_filialeids', 'row','operation','usertype'],
434
- ready(){
435
- this.initdata()
436
- getAreaConfig(this)
437
- this.model.f_building_suffix=this.config.f_building_suffix
438
- this.model.f_unit_suffix=this.config.f_unit_suffix
439
- this.model.f_floor_suffix=this.config.f_floor_suffix
440
- this.model.f_room_suffix=this.config.f_room_suffix
441
- },
442
- methods: {
443
- async changecity(){
444
- this.areaslist = []
445
- // this.model.f_residential_area_id = null
446
- // this.model.f_residential_area = null
447
- let condition = `a.f_orgid = '${this.$login.f.orgid}'`
448
- if(this.model.f_iscity) {
449
- condition = condition + ` and f_iscity = '${this.model.f_iscity}'`
451
+ let req = await this.$resetpost('api/af-revenue/sql/address_getresidential', {
452
+ data: {
453
+ condition: condition
450
454
  }
451
- let req = await this.$resetpost('api/af-revenue/sql/address_getresidential', {
452
- data: {
453
- condition: condition
454
- }
455
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
456
- let redata = []
457
- req.data.forEach((row) => {
458
- redata.push({
459
- label: row.f_residential_area,
460
- value: row.id,
461
- data: row,
462
- id: row.id
463
- })
455
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
456
+ let redata = []
457
+ req.data.forEach((row) => {
458
+ redata.push({
459
+ label: row.f_residential_area,
460
+ value: row.id,
461
+ data: row,
462
+ id: row.id
464
463
  })
465
- this.areaslist=redata
466
- },
467
- standardyanzheng() {
468
- console.log(this.model.f_standard_number.length)
469
- if (this.model.f_standard_number.length != 2){
470
- this.$showAlert('请输入正确的位数', 'warning', 2000)
471
- this.model.f_standard_number = ''
472
- }
473
- },
474
- contractsyanzheng(){
475
- console.log(this.model.f_contracts_number.length)
476
- if (this.model.f_contracts_number.length != 5){
477
- this.$showAlert('请输入正确的位数', 'warning', 2000)
478
- this.model.f_contracts_number = ''
479
- }
480
- },
481
- async initdata(){
482
- this.model.f_address_state = '已通气'
483
- this.initAreas(this.f_filialeids)
484
- // 添加特殊地址选省市区
485
- this.initpcds(` f_orgid = '${this.$login.f.orgid}'`)
486
- this.initstreets(` f_orgid = '${this.$login.f.orgid}' `)
487
- this.initareas(` f_orgid = '${this.$login.f.orgid}'`)
464
+ })
465
+ this.areaslist=redata
466
+ },
467
+ standardyanzheng() {
468
+ console.log(this.model.f_standard_number.length)
469
+ if (this.model.f_standard_number.length != 2){
470
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
471
+ this.model.f_standard_number = ''
472
+ }
473
+ },
474
+ contractsyanzheng(){
475
+ console.log(this.model.f_contracts_number.length)
476
+ if (this.model.f_contracts_number.length != 5){
477
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
478
+ this.model.f_contracts_number = ''
479
+ }
480
+ },
481
+ async initdata(){
482
+ this.model.f_address_state = '已通气'
483
+ this.initAreas(this.f_filialeids)
484
+ // 添加特殊地址选省市区
485
+ this.initpcds(` f_orgid = '${this.$login.f.orgid}'`)
486
+ this.initstreets(` f_orgid = '${this.$login.f.orgid}' `)
487
+ this.initareas(` f_orgid = '${this.$login.f.orgid}'`)
488
488
 
489
- },
489
+ },
490
490
 
491
- // 初始化片区
492
- async initAreas (val) {
493
- if (val) {
494
- let getAllArea = await this.$resetpost('/rs/search', {
495
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
496
- userid: this.$login.f.id
497
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
498
- let arr = getAllArea.data.filter((res) => {
499
- return res.parentid == val
500
- })
501
- console.log('过滤之后的片区', arr)
502
- this.sliceArea = []
503
- arr.forEach((res) => {
504
- this.sliceArea.push({label: res.name, value: res.name})
505
- })
506
- }
507
- },
508
- //初始化省市区,添加街道
509
- async initpcds(pconditon){
510
- this.pcdslist = []
511
- let HttpReset = new HttpResetClass()
512
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
513
- data: {
514
- items: '*',
515
- tablename: 't_pcd',
516
- orderitem: 'id',
517
- condition: pconditon
518
- }
519
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
520
- let redata = []
521
- req.data.forEach((row, n) => {
522
- redata[n] = {
523
- label: row.f_pcd,
524
- value: row.id,
525
- data:row,
526
- id:row.id
527
- }
491
+ // 初始化片区
492
+ async initAreas (val) {
493
+ if (val) {
494
+ let getAllArea = await this.$resetpost('/rs/search', {
495
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
496
+ userid: this.$login.f.id
497
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
498
+ let arr = getAllArea.data.filter((res) => {
499
+ return res.parentid == val
528
500
  })
529
- this.pcdslist=redata
530
- },
531
- //初始化街道 添加小区
532
- async initstreets(pconditon){
533
- this.streetslist = []
534
- let HttpReset = new HttpResetClass()
535
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
536
- data: {
537
- items: '*',
538
- tablename: 't_street',
539
- orderitem: 'id',
540
- condition: pconditon
541
- }
542
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
543
- let redata = []
544
- req.data.forEach((row, n) => {
545
- redata[n] = {
546
- label: row.f_street,
547
- value: row.id,
548
- data:row,
549
- id:row.id
550
- }
501
+ console.log('过滤之后的片区', arr)
502
+ this.sliceArea = []
503
+ arr.forEach((res) => {
504
+ this.sliceArea.push({label: res.name, value: res.name})
551
505
  })
552
- this.streetslist=redata
553
- },
554
- //初始化小区添加小区
555
- async initareas(pconditon){
556
- // if(this.usertype){
557
- // pconditon=pconditon+` and f_special='1' `
558
- // }
559
- this.areaslist = []
560
- let HttpReset = new HttpResetClass()
561
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
562
- data: {
563
- items: '*',
564
- tablename: 't_area',
565
- orderitem: 'id',
566
- condition: pconditon
567
- }
568
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
569
- let redata = []
570
- req.data.forEach((row) => {
571
- if(!row.f_residential_area.includes('L')) {
506
+ }
507
+ },
508
+ //初始化省市区,添加街道
509
+ async initpcds(pconditon){
510
+ this.pcdslist = []
511
+ let HttpReset = new HttpResetClass()
512
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
513
+ data: {
514
+ items: '*',
515
+ tablename: 't_pcd',
516
+ orderitem: 'id',
517
+ condition: pconditon
518
+ }
519
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
520
+ let redata = []
521
+ req.data.forEach((row, n) => {
522
+ redata[n] = {
523
+ label: row.f_pcd,
524
+ value: row.id,
525
+ data:row,
526
+ id:row.id
527
+ }
528
+ })
529
+ this.pcdslist=redata
530
+ },
531
+ //初始化街道 添加小区
532
+ async initstreets(pconditon){
533
+ this.streetslist = []
534
+ let HttpReset = new HttpResetClass()
535
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
536
+ data: {
537
+ items: '*',
538
+ tablename: 't_street',
539
+ orderitem: 'id',
540
+ condition: pconditon
541
+ }
542
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
543
+ let redata = []
544
+ req.data.forEach((row, n) => {
545
+ redata[n] = {
546
+ label: row.f_street,
547
+ value: row.id,
548
+ data:row,
549
+ id:row.id
550
+ }
551
+ })
552
+ this.streetslist=redata
553
+ },
554
+ //初始化小区添加小区
555
+ async initareas(pconditon){
556
+ // if(this.usertype){
557
+ // pconditon=pconditon+` and f_special='1' `
558
+ // }
559
+ this.areaslist = []
560
+ let HttpReset = new HttpResetClass()
561
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
562
+ data: {
563
+ items: '*',
564
+ tablename: 't_area',
565
+ orderitem: 'id',
566
+ condition: pconditon
567
+ }
568
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
569
+ let redata = []
570
+ req.data.forEach((row) => {
571
+ if(!row.f_residential_area.includes('L')) {
572
572
  redata.push({
573
573
  label: row.f_residential_area,
574
574
  value: row.id,
575
575
  data: row,
576
576
  id: row.id
577
577
  })}
578
- })
579
- this.areaslist=redata
580
- this.areaChange(this.model.f_residential_area_id)
581
- },
582
- //省/市/区变化
583
- async pcdChange(val){
584
- // 只有添加特殊地址时才级联
585
- if (!this.usertype) {
586
- return
587
- }
588
- console.log("省/市/区变化",val)
589
- if(val){
590
- //那就把[小区,街道]重新组织一下
591
- await this.initstreets(` f_pcd_id ='${val}' `)
592
- if(this.model.f_street_id){
593
- if (this.findbyid(this.streetslist,this.model.f_street_id)) {
594
- let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
595
- if(pcd_id!=val){
596
- this.model.f_street_id=''
597
- }
598
- } else {
578
+ })
579
+ this.areaslist=redata
580
+ this.areaChange(this.model.f_residential_area_id)
581
+ },
582
+ //省/市/区变化
583
+ async pcdChange(val){
584
+ // 只有添加特殊地址时才级联
585
+ if (!this.usertype) {
586
+ return
587
+ }
588
+ console.log("省/市/区变化",val)
589
+ if(val){
590
+ //那就把[小区,街道]重新组织一下
591
+ await this.initstreets(` f_pcd_id ='${val}' `)
592
+ if(this.model.f_street_id){
593
+ if (this.findbyid(this.streetslist,this.model.f_street_id)) {
594
+ let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
595
+ if(pcd_id!=val){
599
596
  this.model.f_street_id=''
600
597
  }
598
+ } else {
599
+ this.model.f_street_id=''
600
+ }
601
601
 
602
- //那就把[小区,街道]重新组织一下
603
- if (this.model.f_street_id) {
604
- await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
605
- if(this.model.f_residential_area_id){
606
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
607
- let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
608
- if(pcd_id!=val){
609
- this.model.f_residential_area_id=''
610
- }
611
- } else {
602
+ //那就把[小区,街道]重新组织一下
603
+ if (this.model.f_street_id) {
604
+ await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
605
+ if(this.model.f_residential_area_id){
606
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
607
+ let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
608
+ if(pcd_id!=val){
612
609
  this.model.f_residential_area_id=''
613
610
  }
614
-
611
+ } else {
612
+ this.model.f_residential_area_id=''
615
613
  }
614
+
616
615
  }
617
616
  }
618
617
  }
618
+ }
619
+ this.$resetValidation()
620
+ },
621
+ //小区变化
622
+ areaChange(val){
623
+ console.log("小区变化",val)
624
+ // 选择小区后级联出省市区和街道
625
+ let selectArea // 选中的小区数据
626
+ for (let row of this.areaslist) {
627
+ if (val == row.value) {
628
+ selectArea = row.data
629
+ break
630
+ }
631
+ }
632
+ if (selectArea) {
633
+ this.model.f_street_id = selectArea.f_street_id
634
+ this.model.f_pcd_id = selectArea.f_pcd_id
635
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
636
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
637
+ this.model.f_slice_area = selectArea.f_slice_area
638
+ // 拼接地址
639
+ this.model.f_address = `${selectArea.f_street}${selectArea.f_residential_area}`
640
+ }
641
+ this.$nextTick(() => {
619
642
  this.$resetValidation()
620
- },
621
- //小区变化
622
- areaChange(val){
623
- console.log("小区变化",val)
624
- // 选择小区后级联出省市区和街道
625
- let selectArea // 选中的小区数据
626
- for (let row of this.areaslist) {
627
- if (val == row.value) {
628
- selectArea = row.data
629
- break
643
+ })
644
+ },
645
+ //街道变化
646
+ async streetChange(val){
647
+ console.log("街道变化",val)
648
+ if(this.streetslist[0]) {
649
+ var street=''
650
+ this.streetslist.forEach((item)=>{
651
+ if(item.id===val){
652
+ street=item.label
630
653
  }
631
- }
632
- if (selectArea) {
633
- this.model.f_street_id = selectArea.f_street_id
634
- this.model.f_pcd_id = selectArea.f_pcd_id
635
- this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
636
- this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
637
- this.model.f_slice_area = selectArea.f_slice_area
638
- // 拼接地址
639
- this.model.f_address = `${selectArea.f_street}${selectArea.f_residential_area}`
640
- }
641
- this.$nextTick(() => {
642
- this.$resetValidation()
643
654
  })
644
- },
645
- //街道变化
646
- async streetChange(val){
647
- console.log("街道变化",val)
648
- if(this.streetslist[0]) {
649
- var street=''
650
- this.streetslist.forEach((item)=>{
651
- if(item.id===val){
652
- street=item.label
653
- }
654
- })
655
- this.model.f_address = street
656
- }
657
- if(val){
658
- //那就把[小区]重新组织一下
659
- await this.initareas(` f_street_id ='${val}' `)
660
- if(this.model.f_residential_area_id){
661
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
662
- let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
663
- if(street_id!=val){
664
- this.model.f_residential_area_id=''
665
- }
666
- } else {
655
+ this.model.f_address = street
656
+ }
657
+ if(val){
658
+ //那就把[小区]重新组织一下
659
+ await this.initareas(` f_street_id ='${val}' `)
660
+ if(this.model.f_residential_area_id){
661
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
662
+ let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
663
+ if(street_id!=val){
667
664
  this.model.f_residential_area_id=''
668
665
  }
669
-
666
+ } else {
667
+ this.model.f_residential_area_id=''
670
668
  }
669
+
671
670
  }
672
- this.$resetValidation()
673
- },
671
+ }
672
+ this.$resetValidation()
673
+ },
674
674
 
675
- getorg (val) {
676
- this.f_orgid = val[0]
677
- },
675
+ getorg (val) {
676
+ this.f_orgid = val[0]
677
+ },
678
678
 
679
- //处理批量地址信息
680
- dealaddlist(){
681
- try {
682
- var resultlist=[]
683
- for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
684
- for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
685
- for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
686
- for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
687
- //预备一个空的json
688
- console.log('批量', this.model)
689
- let data=Object.assign({},this.model)
690
- data.f_create_person= this.$login.f.name
691
- data.f_building= data.f_building_prefix + i
692
- data.f_unit= data.f_unit_prefix + j
693
- data.f_floor= data.f_floor_prefix + m
694
- // 目前房号都按两位处理 如: 101室 201室 110室
695
- if ((n+'').length == 1) {
696
- data.f_room = data.f_room_prefix + m + '0' + n
697
- } else {
698
- data.f_room = data.f_room_prefix + m + '' + n
699
- }
700
- data.f_filialeid = this.f_filialeids
701
- data.f_operator = this.$login.f.name
702
- data.f_operatorid = this.$login.f.id
703
- data.f_orgid = this.$login.f.orgid
704
- data.f_orgname = this.$login.f.orgs
705
- data.f_depid = this.$login.f.depids
706
- data.f_depname = this.$login.f.deps
707
- data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
708
- data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
709
- data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
710
- data.f_address = data.f_street
711
- + data.f_residential_area + data.f_area_period +
712
- data.f_building + data.f_building_suffix
713
- + data.f_unit + data.f_unit_suffix
714
- + data.f_floor + data.f_floor_suffix
715
- + data.f_room + data.f_room_suffix
716
- if (this.model.slice_area) {
717
- data.f_slice_area = this.model.slice_area
679
+ //处理批量地址信息
680
+ dealaddlist(){
681
+ try {
682
+ var resultlist=[]
683
+ for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
684
+ for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
685
+ for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
686
+ for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
687
+ //预备一个空的json
688
+ console.log('批量', this.model)
689
+ let data=Object.assign({},this.model)
690
+ data.f_create_person= this.$login.f.name
691
+ data.f_building= data.f_building_prefix + i
692
+ data.f_unit= data.f_unit_prefix + j
693
+ data.f_floor= data.f_floor_prefix + m
694
+ // 目前房号都按两位处理 如: 101室 201室 110室
695
+ if ((n+'').length == 1) {
696
+ data.f_room = data.f_room_prefix + m + '0' + n
697
+ } else {
698
+ data.f_room = data.f_room_prefix + m + '' + n
699
+ }
700
+ data.f_filialeid = this.f_filialeids
701
+ data.f_operator = this.$login.f.name
702
+ data.f_operatorid = this.$login.f.id
703
+ data.f_orgid = this.$login.f.orgid
704
+ data.f_orgname = this.$login.f.orgs
705
+ data.f_depid = this.$login.f.depids
706
+ data.f_depname = this.$login.f.deps
707
+ data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
708
+ data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
709
+ data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
710
+ data.f_address = data.f_residential_area + data.f_area_period +
711
+ data.f_building + data.f_building_suffix
712
+ + data.f_unit + data.f_unit_suffix
713
+ + data.f_floor + data.f_floor_suffix
714
+ + data.f_room + data.f_room_suffix
715
+ if (this.model.slice_area) {
716
+ data.f_slice_area = this.model.slice_area
718
717
 
719
- }
720
- resultlist.push(data)
721
718
  }
719
+ resultlist.push(data)
722
720
  }
723
721
  }
724
722
  }
725
- this.addresslist=resultlist
726
- } catch (e) {
727
- console.log(e)
728
- this.$showAlert('输出数据有误,请检查', 'warning', 2000)
729
723
  }
730
- },
731
- //保存多个
732
- async confirmall(){
733
- this.dealaddlist()
734
- if(this.addresslist.length>0){
735
- let msg = {
736
- resolveMsg: '地址保存成功',
737
- rejectMsg: '地址保存失败'
738
- }
739
- this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
740
- if (res === 'confirm') {
741
- this.$resetpost('api/af-revenue/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
742
- this.cleardara()
743
- this.$dispatch('confirm')
744
- })
745
- }
746
- })
747
- }
748
- },
749
- //保存
750
- async confirm(){
751
- if(this.onedata=='one'){
752
- await this.saveonedata()
753
- }
754
- this.cleardara()
755
- this.$dispatch('confirm')
756
- },
757
- //保存一户信息
758
- async saveonedata(){
759
- this.model.f_create_person= this.$login.f.name
760
- this.model.f_filialeid = this.f_filialeids
761
- this.model.f_operator = this.$login.f.name
762
- this.model.f_operatorid = this.$login.f.id
763
- this.model.f_orgid = this.$login.f.orgid
764
- this.model.f_orgname = this.$login.f.orgs
765
- this.model.f_depid = this.$login.f.depids
766
- this.model.f_depname = this.$login.f.deps
767
- console.log("片区:",this.model.f_slice_area)
768
- if (this.usertype) {
769
- //非民用
770
- this.model.f_special='1'
771
- this.model.f_building_suffix=''
772
- this.model.f_unit_suffix=''
773
- this.model.f_floor_suffix=''
774
- this.model.f_room_suffix=''
775
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
776
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
777
- this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
778
- } else {
779
- //民用
780
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
781
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
782
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
783
- this.model.f_address = this.model.f_street + this.model.f_residential_area + this.model.f_area_period + (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
784
- }
785
- await this.$resetpost('api/af-revenue/logic/address_updateuseraddress', this.model)
786
- },
787
- cancel(){
788
- this.cleardara()
789
- this.$dispatch('cancel')
790
- },
791
- cleardara(){
792
- this.model= {
793
- f_pcd_id: '',
794
- f_street_id: '',
795
- f_iscity:'市区',
796
- f_residential_area_id: '',
797
- f_pcd: '',
798
- f_comment1:'',
799
- f_comments:'',
800
- f_street: '',
801
- f_residential_area: '',
802
- f_slice_area: '',
803
- slice_area: '',
804
- f_building: '',
805
- f_area_period: '',
806
- f_building_start: '',
807
- f_building_end: '',
808
- f_building_prefix: '',
809
- f_building_suffix: '幢',
810
- f_unit: '',
811
- f_unit_start: '',
812
- f_unit_end: '',
813
- f_unit_prefix: '',
814
- f_unit_suffix: '单元',
815
- f_floor: '',
816
- f_floor_start: '',
817
- f_floor_end: '',
818
- f_floor_prefix: '',
819
- f_floor_suffix: this.config.f_floor_suffix,
820
- f_room: '',
821
- f_room_start: '',
822
- f_room_end: '',
823
- f_room_prefix: '',
824
- f_room_suffix: '室',
825
- //详细地址
826
- f_address: '',
827
- //单位名称
828
- f_company: '',
829
- //单位地址
830
- f_company_address: '',
831
- f_lng: '',
832
- f_lat: ''
724
+ this.addresslist=resultlist
725
+ } catch (e) {
726
+ console.log(e)
727
+ this.$showAlert('输出数据有误,请检查', 'warning', 2000)
728
+ }
729
+ },
730
+ //保存多个
731
+ async confirmall(){
732
+ this.dealaddlist()
733
+ if(this.addresslist.length>0){
734
+ let msg = {
735
+ resolveMsg: '地址保存成功',
736
+ rejectMsg: '地址保存失败'
833
737
  }
834
- // this.pcdslist = []
835
- // this.streetslist = []
836
- // this.areaslist = []
837
- },
838
-
839
- //根据名字找数据
840
- findbyid(list,name){
841
- var result
842
- list.forEach((row, n) => {
843
- if(name==row.value){
844
- result= row.data
738
+ this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
739
+ if (res === 'confirm') {
740
+ this.$resetpost('api/af-revenue/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
741
+ this.cleardara()
742
+ this.$dispatch('confirm')
743
+ })
845
744
  }
846
745
  })
847
- return result
848
- },
849
- openModal () {
850
- try{
851
- let map = new AMap.Map('addboxmap', {
852
- zoom: 12,
853
- resizeEnable: true, // 如果center属性缺省,地图默认定位到用户所在城市的中心
854
- viewMode: '2D', //设置地图模式
855
- lang: 'zh_cn', //设置地图语言类型
856
- zindex: 99999
857
- })
858
- console.log('map',map)
859
- if (map) {
860
- this.isshow = true
861
- }
862
- }catch (e) {
863
- this.isshow = false
864
- console.log('这里报错了。。。。。',e)
746
+ }
747
+ },
748
+ //保存
749
+ async confirm(){
750
+ if(this.onedata=='one'){
751
+ await this.saveonedata()
752
+ }
753
+ this.cleardara()
754
+ this.$dispatch('confirm')
755
+ },
756
+ //保存一户信息
757
+ async saveonedata(){
758
+ this.model.f_create_person= this.$login.f.name
759
+ this.model.f_filialeid = this.f_filialeids
760
+ this.model.f_operator = this.$login.f.name
761
+ this.model.f_operatorid = this.$login.f.id
762
+ this.model.f_orgid = this.$login.f.orgid
763
+ this.model.f_orgname = this.$login.f.orgs
764
+ this.model.f_depid = this.$login.f.depids
765
+ this.model.f_depname = this.$login.f.deps
766
+ console.log("片区:",this.model.f_slice_area)
767
+ this.model.f_building_suffix=this.config.f_building_suffix
768
+ this.model.f_unit_suffix=this.config.f_unit_suffix
769
+ this.model.f_floor_suffix=this.config.f_floor_suffix
770
+ this.model.f_room_suffix=this.config.f_room_suffix
771
+ if (this.usertype) {
772
+ //非民用
773
+ this.model.f_special='1'
774
+ this.model.f_building_suffix=''
775
+ this.model.f_unit_suffix=''
776
+ this.model.f_floor_suffix=''
777
+ this.model.f_room_suffix=''
778
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
779
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
780
+ this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
781
+ } else {
782
+ //民用
783
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
784
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
785
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
786
+ this.model.f_address = this.model.f_residential_area + (this.model.f_area_period?this.model.f_area_period :'') + (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
787
+ }
788
+ await this.$resetpost('api/af-revenue/logic/address_updateuseraddress', this.model)
789
+ },
790
+ cancel(){
791
+ this.cleardara()
792
+ this.$dispatch('cancel')
793
+ },
794
+ cleardara(){
795
+ this.model= {
796
+ f_pcd_id: '',
797
+ f_street_id: '',
798
+ f_iscity:'市区',
799
+ f_residential_area_id: '',
800
+ f_pcd: '',
801
+ f_comment1:'',
802
+ f_comments:'',
803
+ f_street: '',
804
+ f_residential_area: '',
805
+ f_slice_area: '',
806
+ slice_area: '',
807
+ f_building: '',
808
+ f_area_period: '',
809
+ f_building_start: '',
810
+ f_building_end: '',
811
+ f_building_prefix: '',
812
+ f_building_suffix: '幢',
813
+ f_unit: '',
814
+ f_unit_start: '',
815
+ f_unit_end: '',
816
+ f_unit_prefix: '',
817
+ f_unit_suffix: '单元',
818
+ f_floor: '',
819
+ f_floor_start: '',
820
+ f_floor_end: '',
821
+ f_floor_prefix: '',
822
+ f_floor_suffix: this.config.f_floor_suffix,
823
+ f_room: '',
824
+ f_room_start: '',
825
+ f_room_end: '',
826
+ f_room_prefix: '',
827
+ f_room_suffix: '室',
828
+ //详细地址
829
+ f_address: '',
830
+ //单位名称
831
+ f_company: '',
832
+ //单位地址
833
+ f_company_address: '',
834
+ f_lng: '',
835
+ f_lat: ''
836
+ }
837
+ // this.pcdslist = []
838
+ // this.streetslist = []
839
+ // this.areaslist = []
840
+ },
841
+
842
+ //根据名字找数据
843
+ findbyid(list,name){
844
+ var result
845
+ list.forEach((row, n) => {
846
+ if(name==row.value){
847
+ result= row.data
865
848
  }
866
- },
867
- closeModal () {
868
- this.isshow = false;
869
- },
870
- getmylocation (res) {
871
- this.templng = res.position.lng
872
- this.templat = res.position.lat
873
- },
874
- confirmLocation () {
875
- this.model.f_lat = this.templat
876
- this.model.f_lng = this.templng
849
+ })
850
+ return result
851
+ },
852
+ openModal () {
853
+ try{
854
+ let map = new AMap.Map('addboxmap', {
855
+ zoom: 12,
856
+ resizeEnable: true, // 如果center属性缺省,地图默认定位到用户所在城市的中心
857
+ viewMode: '2D', //设置地图模式
858
+ lang: 'zh_cn', //设置地图语言类型
859
+ zindex: 99999
860
+ })
861
+ console.log('map',map)
862
+ if (map) {
863
+ this.isshow = true
864
+ }
865
+ }catch (e) {
877
866
  this.isshow = false
867
+ console.log('这里报错了。。。。。',e)
878
868
  }
879
869
  },
880
- watch: {
881
- //分公司变化
882
- 'f_filialeids'(){
883
- if (this.model.f_filialeid) {
884
- if (this.model.f_filialeid != this.f_filialeids) {
885
- this.$dispatch('cancel')
886
- }
870
+ closeModal () {
871
+ this.isshow = false;
872
+ },
873
+ getmylocation (res) {
874
+ this.templng = res.position.lng
875
+ this.templat = res.position.lat
876
+ },
877
+ confirmLocation () {
878
+ this.model.f_lat = this.templat
879
+ this.model.f_lng = this.templng
880
+ this.isshow = false
881
+ }
882
+ },
883
+ watch: {
884
+ //分公司变化
885
+ 'f_filialeids'(){
886
+ if (this.model.f_filialeid) {
887
+ if (this.model.f_filialeid != this.f_filialeids) {
888
+ this.$dispatch('cancel')
887
889
  }
888
- this.cleardara()
889
- this.initdata()
890
- },
891
- 'row'(){
892
- this.onedata='one'
893
890
  }
891
+ this.cleardara()
892
+ this.initdata()
894
893
  },
895
- computed: {
896
- //地址状态下拉框
897
- addresstate() {
898
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
899
- }
894
+ 'row'(){
895
+ this.onedata='one'
896
+ }
897
+ },
898
+ computed: {
899
+ //地址状态下拉框
900
+ addresstate() {
901
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
900
902
  }
901
903
  }
904
+ }
902
905
  </script>
903
906
  <style lang="less">
904
- #userAddress{
905
- #addboxmap {
906
- height: 300px;
907
- }
908
- .glyphicon:hover {
909
- color: red;
910
- }
911
- .glyphicon {
912
- color: blue;
913
- cursor: pointer;
914
- }
907
+ #userAddress{
908
+ #addboxmap {
909
+ height: 300px;
910
+ }
911
+ .glyphicon:hover {
912
+ color: red;
913
+ }
914
+ .glyphicon {
915
+ color: blue;
916
+ cursor: pointer;
915
917
  }
918
+ }
916
919
  </style>
917
920
 
918
921