address-client 3.0.26-aode → 3.0.26-qtx

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.
@@ -15,7 +15,7 @@
15
15
  :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
16
16
  <label class="font_normal_body">省&ensp;市&ensp;区</label>
17
17
  <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"
18
- >
18
+ >
19
19
  <v-select :value.sync="model.f_pcd_id" :value-single="true"
20
20
  :options='pcdslist' placeholder='请选择'
21
21
  close-on-select search="true" @change="pcdChange" :disabled="!usertype">
@@ -26,7 +26,7 @@
26
26
  :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
27
27
  <label class="font_normal_body">街道名称</label>
28
28
  <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
29
- >
29
+ >
30
30
  <v-select :value.sync="model.f_street_id" :value-single="true"
31
31
  :options='streetslist' placeholder='请选择'
32
32
  close-on-select search="true" :disabled="!usertype">
@@ -55,12 +55,19 @@
55
55
  </v-select>
56
56
  </div>
57
57
 
58
+ <div class="col-sm-6 form-group " v-if="usertype"
59
+ :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
60
+ <label class="font_normal_body">小区名称</label>
61
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
62
+ v-validate:f_residential_area_id='{required: true }'>
63
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
64
+ :options='areaslist' placeholder='请选择'
65
+ close-on-select search="true">
66
+ </v-select>
67
+ </div>
58
68
 
59
-
60
- <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">
69
+ <div class="col-sm-6 form-group">
61
70
  <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
71
  <v-select :value.sync="model.slice_area" v-model="model.slice_area"
65
72
  :options='sliceArea' placeholder='片区/管理站' filer-key="name"
66
73
  close-on-select v-ref:slice>
@@ -97,27 +104,27 @@
97
104
  </div>
98
105
  <div class="col-sm-6 form-group">
99
106
  <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>
107
+ <v-select :value.sync="model.f_address_state" :value-single="true"
108
+ class="select_list select"
109
+ condition="f_address_state = '{}'"
110
+ :options='addresstate' placeholder='地址状态'
111
+ close-on-select>
112
+ </v-select>
113
+ </div>
114
+ <div v-if="usertype" class="col-sm-12 form-group "
115
+ :class="[$v.f_address.required ? 'has-error' : 'has-success']">
116
+ <label for="f_address" class="font_normal_body">详细地址</label>
117
+ <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
118
+ v-validate:f_address='{required: true }'/>
119
+ </div>
120
+ <div class="col-sm-12 form-group">
121
+ <label class="font_normal_body " >备&emsp;&emsp;注</label>
122
+ <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
123
+ </div>
124
+ <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
125
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
126
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
127
+ </div>
121
128
 
122
129
  </div>
123
130
  <!--批量录入-->
@@ -126,7 +133,7 @@
126
133
  :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
127
134
  <label class="font_normal_body">省&ensp;市&ensp;区</label>
128
135
  <input type="text" style="width:60%" v-show="false" v-model="model.f_pcd_id"
129
- >
136
+ >
130
137
  <v-select :value.sync="model.f_pcd_id" :value-single="true"
131
138
  :options='pcdslist' placeholder='请选择'
132
139
  close-on-select search="true" @change="pcdChange" :disabled="!usertype">
@@ -136,7 +143,7 @@
136
143
  :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
137
144
  <label class="font_normal_body">街&emsp;&emsp;道</label>
138
145
  <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id"
139
- >
146
+ >
140
147
  <v-select :value.sync="model.f_street_id" :value-single="true"
141
148
  :options='streetslist' placeholder='请选择'
142
149
  close-on-select search="true" :disabled="!usertype">
@@ -153,10 +160,8 @@
153
160
  close-on-select search="true">
154
161
  </v-select>
155
162
  </div>
156
- <div class="col-sm-6 form-group " :class="[$v.slice.required ? 'has-error' : 'has-success']">
163
+ <div class="col-sm-6 form-group">
157
164
  <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
165
  <v-select :value.sync="model.slice_area" v-model="model.slice_area"
161
166
  :options='sliceArea' placeholder='片区/管理站' filer-key="name"
162
167
  close-on-select v-ref:slice>
@@ -336,137 +341,186 @@
336
341
  },
337
342
  methods: {
338
343
  async initdata(){
339
- this.model.f_address_state = ['已通气']
340
- this.initAreas(this.f_filialeids)
341
- // 添加特殊地址选省市区
344
+ this.model.f_address_state = ['已通气']
345
+ this.initAreas(this.f_filialeids)
346
+ // 添加特殊地址选省市区
342
347
 
343
- this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
344
- this.initstreets(` f_filialeid = '${this.f_filialeids}' `)
345
- this.initareas(` f_filialeid = '${this.f_filialeids}'`)
348
+ this.initpcds(` f_orgid = '${this.f_filialeids}'`)
349
+ this.initstreets(` f_orgid = '${this.f_filialeids}' `)
350
+ this.initareas(` f_orgid = '${this.f_filialeids}'`)
346
351
 
347
- },
352
+ },
348
353
 
349
- // 初始化片区
350
- async initAreas (val) {
351
- if (val) {
352
- this.sliceArea = [];
353
- let getAllArea = await this.$resetpost('/rs/sql/address_singleTableOrderBy', {
354
- data:{
355
- items: '*',
356
- tablename: 't_zone',
357
- orderitem: 'id',
358
- condition: ` parentid = ${val}`
359
- }
360
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
354
+ // 初始化片区
355
+ async initAreas (val) {
356
+ if (val) {
357
+ let getAllArea = await this.$resetpost('/rs/search', {
358
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
359
+ userid: this.$login.f.id
360
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
361
361
 
362
- if(getAllArea.data){
363
- getAllArea.data.forEach((res) => {
364
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
362
+ let arr = getAllArea.data.filter((res) => {
363
+ return res.parentid == val
364
+ })
365
+ console.log('过滤之后的片区', arr)
366
+ this.sliceArea = []
367
+ arr.forEach((res) => {
368
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
369
+ })
370
+ }
371
+ },
372
+ //初始化省市区,添加街道
373
+ async initpcds(pconditon){
374
+ this.pcdslist = []
375
+ let HttpReset = new HttpResetClass()
376
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
377
+ data: {
378
+ items: '*',
379
+ tablename: 't_pcd',
380
+ orderitem: 'id',
381
+ condition: pconditon
382
+ }
383
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
384
+ let redata = []
385
+ req.data.forEach((row, n) => {
386
+ redata[n] = {
387
+ label: row.f_pcd,
388
+ value: row.id,
389
+ data:row,
390
+ id:row.id
391
+ }
365
392
  })
366
- }
367
- }
368
- },
369
- //初始化省市区,添加街道
370
- async initpcds(pconditon){
371
- this.pcdslist = []
372
- let HttpReset = new HttpResetClass()
373
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
374
- data: {
375
- items: '*',
376
- tablename: 't_pcd',
377
- orderitem: 'id',
378
- condition: pconditon
379
- }
380
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
381
- let redata = []
382
- req.data.forEach((row, n) => {
383
- redata[n] = {
384
- label: row.f_pcd,
385
- value: row.id,
386
- data:row,
387
- id:row.id
388
- }
389
- })
390
- this.pcdslist=redata
391
- },
392
- //初始化街道 添加小区
393
- async initstreets(pconditon){
394
- this.streetslist = []
395
- let HttpReset = new HttpResetClass()
396
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
397
- data: {
398
- items: '*',
399
- tablename: 't_street',
400
- orderitem: 'id',
401
- condition: pconditon
402
- }
403
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
404
- let redata = []
405
- req.data.forEach((row, n) => {
406
- redata[n] = {
407
- label: row.f_street,
408
- value: row.id,
409
- data:row,
410
- id:row.id
411
- }
412
- })
413
- this.streetslist=redata
414
- },
415
- //初始化小区添加小区
416
- async initareas(pconditon){
417
- // if(this.usertype){
418
- // pconditon=pconditon+` and f_special='1' `
419
- // }
420
- this.areaslist = []
421
- let HttpReset = new HttpResetClass()
422
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
423
- data: {
424
- items: '*',
425
- tablename: 't_area',
426
- orderitem: 'id',
427
- condition: pconditon
428
- }
429
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
430
- let redata = []
431
- req.data.forEach((row) => {
432
- redata.push({
433
- label: row.f_residential_area,
434
- value: row.id,
435
- data: row,
436
- id: row.id
437
- })
438
- })
439
- this.areaslist=redata
440
- },
441
- //省/市/区变化
442
- async pcdChange(val){
443
- // 只有添加特殊地址时才级联
444
- if (!this.usertype) {
445
- return
446
- }else{
447
- this.model.f_address=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
448
- }
449
- console.log("省/市/区变化",val)
450
- if(val){
451
- //那就把[小区,街道]重新组织一下
452
- await this.initstreets(` f_pcd_id ='${val}' `)
453
- if(this.model.f_street_id){
454
- if (this.findbyid(this.streetslist,this.model.f_street_id)) {
455
- let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
456
- if(pcd_id!=val){
457
- this.model.f_street_id=''
393
+ this.pcdslist=redata
394
+ },
395
+ //初始化街道 添加小区
396
+ async initstreets(pconditon){
397
+ this.streetslist = []
398
+ let HttpReset = new HttpResetClass()
399
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
400
+ data: {
401
+ items: '*',
402
+ tablename: 't_street',
403
+ orderitem: 'id',
404
+ condition: pconditon
458
405
  }
459
- } else {
460
- this.model.f_street_id=''
406
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
407
+ let redata = []
408
+ req.data.forEach((row, n) => {
409
+ redata[n] = {
410
+ label: row.f_street,
411
+ value: row.id,
412
+ data:row,
413
+ id:row.id
414
+ }
415
+ })
416
+ this.streetslist=redata
417
+ },
418
+ //初始化小区添加小区
419
+ async initareas(pconditon){
420
+ // if(this.usertype){
421
+ // pconditon=pconditon+` and f_special='1' `
422
+ // }
423
+ this.areaslist = []
424
+ let HttpReset = new HttpResetClass()
425
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
426
+ data: {
427
+ items: '*',
428
+ tablename: 't_area',
429
+ orderitem: 'id',
430
+ condition: pconditon
431
+ }
432
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
433
+ let redata = []
434
+ req.data.forEach((row) => {
435
+ redata.push({
436
+ label: row.f_residential_area,
437
+ value: row.id,
438
+ data: row,
439
+ id: row.id
440
+ })
441
+ })
442
+ this.areaslist=redata
443
+ },
444
+ //省/市/区变化
445
+ async pcdChange(val){
446
+ // 只有添加特殊地址时才级联
447
+ if (!this.usertype) {
448
+ return
461
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
+ }
462
463
 
463
- //那就把[小区,街道]重新组织一下
464
- if (this.model.f_street_id) {
465
- await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
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
+ let selectArea // 选中的小区数据
488
+ for (let row of this.areaslist) {
489
+ if (val == row.value) {
490
+ selectArea = row.data
491
+ break
492
+ }
493
+ }
494
+ if (selectArea) {
495
+ this.model.f_street_id = selectArea.f_street_id
496
+ this.model.f_pcd_id = selectArea.f_pcd_id
497
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
498
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
499
+ this.model.slice_area = [{name: selectArea.f_slice_area, code: selectArea.f_area_code}]
500
+ }
501
+ this.$nextTick(() => {
502
+ this.$resetValidation()
503
+ })
504
+ },
505
+ //街道变化
506
+ async streetChange(val){
507
+ console.log("街道变化",val)
508
+ if(this.streetslist[0]) {
509
+ var street=''
510
+ this.streetslist.forEach((item)=>{
511
+ if(item.id===val){
512
+ street=item.label
513
+ }
514
+ })
515
+ this.model.f_address = street
516
+ }
517
+ if(val){
518
+ //那就把[小区]重新组织一下
519
+ await this.initareas(` f_street_id ='${val}' `)
466
520
  if(this.model.f_residential_area_id){
467
521
  if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
468
- let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
469
- if(pcd_id!=val){
522
+ let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
523
+ if(street_id!=val){
470
524
  this.model.f_residential_area_id=''
471
525
  }
472
526
  } else {
@@ -475,264 +529,205 @@
475
529
 
476
530
  }
477
531
  }
478
- }
479
- }
480
- this.$resetValidation()
481
- },
482
- //小区变化
483
- areaChange(val){
484
- console.log("小区变化",val)
532
+ this.$resetValidation()
533
+ },
485
534
 
486
- // 选择小区后级联出省市区和街道
487
- let selectArea // 选中的小区数据
488
- for (let row of this.areaslist) {
489
- if (val == row.value) {
490
- selectArea = row.data
535
+ getorg (val) {
536
+ this.f_orgid = val[0]
537
+ },
491
538
 
492
- break
493
- }
494
- }
495
- if (selectArea) {
496
- this.model.f_street_id = selectArea.f_street_id
497
- this.model.f_pcd_id = selectArea.f_pcd_id
498
- this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
499
- this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
500
- this.model.slice_area = [{name: selectArea.f_slice_area, code: selectArea.f_area_code}]
501
- }
502
- this.$nextTick(() => {
503
- this.$resetValidation()
504
- })
505
- },
506
- //街道变化
507
- async streetChange(val){
508
- console.log("街道变化",val)
509
- if(this.streetslist[0]) {
510
- var street=''
511
- this.streetslist.forEach((item)=>{
512
- if(item.id===val){
513
- street=item.label
514
- }
515
- })
516
- if(this.usertype && this.findbyid(this.pcdslist,this.model.f_pcd_id)!= null){
517
- this.model.f_address =this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd+street
518
- }else{
519
- this.model.f_address = street
520
- }
521
-
522
- }
523
- if(val){
524
- //那就把[小区]重新组织一下
525
- await this.initareas(` f_street_id ='${val}' `)
526
- if(this.model.f_residential_area_id){
527
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
528
- let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
529
- if(street_id!=val){
530
- this.model.f_residential_area_id=''
531
- }
532
- } else {
533
- this.model.f_residential_area_id=''
534
- }
535
-
536
- }
537
- }
538
- this.$resetValidation()
539
- },
540
-
541
- getorg (val) {
542
- this.f_orgid = val[0]
543
- },
544
-
545
- //处理批量地址信息
546
- dealaddlist(){
547
- try {
548
- var resultlist=[]
549
- for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
550
- for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
551
- for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
552
- for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
553
- //预备一个空的json
554
- console.log('批量', this.model)
555
- let data=Object.assign({},this.model)
556
- data.f_create_person= this.$login.f.name
557
- data.f_building= data.f_building_prefix + i
558
- data.f_unit= data.f_unit_prefix + j
559
- data.f_floor= data.f_floor_prefix + m
560
- // 目前房号都按两位处理 如: 101室 201室 110室
561
- if ((n+'').length == 1) {
562
- data.f_room = data.f_room_prefix + m + '0' + n
563
- } else {
564
- data.f_room = data.f_room_prefix + m + '' + n
565
- }
566
- data.f_filialeid = this.f_filialeids
567
- data.f_operator = this.$login.f.name
568
- data.f_operatorid = this.$login.f.id
569
- data.f_orgid = this.$login.f.orgid
570
- data.f_orgname = this.$login.f.orgs
571
- data.f_depid = this.$login.f.depids
572
- data.f_depname = this.$login.f.deps
573
- data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
574
- data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
575
- data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
576
- data.f_address = data.f_street
577
- + data.f_residential_area +
578
- data.f_building + data.f_building_suffix
579
- + data.f_unit + data.f_unit_suffix
580
- + data.f_floor + data.f_floor_suffix
581
- + data.f_room + data.f_room_suffix
582
- if (this.model.slice_area) {
583
- if (this.model.slice_area.length > 0) {
584
- data.f_slice_area = this.model.slice_area[0].name
585
- data.f_area_code = this.model.slice_area[0].code
539
+ //处理批量地址信息
540
+ dealaddlist(){
541
+ try {
542
+ var resultlist=[]
543
+ for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
544
+ for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
545
+ for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
546
+ for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
547
+ //预备一个空的json
548
+ console.log('批量', this.model)
549
+ let data=Object.assign({},this.model)
550
+ data.f_create_person= this.$login.f.name
551
+ data.f_building= data.f_building_prefix + i
552
+ data.f_unit= data.f_unit_prefix + j
553
+ data.f_floor= data.f_floor_prefix + m
554
+ // 目前房号都按两位处理 如: 101室 201室 110室
555
+ if ((n+'').length == 1) {
556
+ data.f_room = data.f_room_prefix + m + '0' + n
557
+ } else {
558
+ data.f_room = data.f_room_prefix + m + '' + n
559
+ }
560
+ data.f_filialeid = this.f_filialeids
561
+ data.f_operator = this.$login.f.name
562
+ data.f_operatorid = this.$login.f.id
563
+ data.f_orgid = this.$login.f.orgid
564
+ data.f_orgname = this.$login.f.orgs
565
+ data.f_depid = this.$login.f.depids
566
+ data.f_depname = this.$login.f.deps
567
+ data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
568
+ data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
569
+ data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
570
+ data.f_address = data.f_street
571
+ + data.f_residential_area +
572
+ data.f_building + data.f_building_suffix
573
+ + data.f_unit + data.f_unit_suffix
574
+ + data.f_floor + data.f_floor_suffix
575
+ + data.f_room + data.f_room_suffix
576
+ if (this.model.slice_area) {
577
+ if (this.model.slice_area.length > 0) {
578
+ data.f_slice_area = this.model.slice_area[0].name
579
+ data.f_area_code = this.model.slice_area[0].code
580
+ }
581
+ }
582
+ resultlist.push(data)
586
583
  }
587
584
  }
588
- resultlist.push(data)
589
585
  }
590
586
  }
587
+ this.addresslist=resultlist
588
+ } catch (e) {
589
+ console.log(e)
590
+ this.$showAlert('输出数据有误,请检查', 'warning', 2000)
591
591
  }
592
- }
593
- this.addresslist=resultlist
594
- } catch (e) {
595
- console.log(e)
596
- this.$showAlert('输出数据有误,请检查', 'warning', 2000)
597
- }
598
- },
599
- //保存多个
600
- async confirmall(){
601
- this.dealaddlist()
602
- if(this.addresslist.length>0){
603
- let msg = {
604
- resolveMsg: '地址保存成功',
605
- rejectMsg: '地址保存失败'
606
- }
607
- this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
608
- if (res === 'confirm') {
609
- this.$resetpost('rs/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
610
- this.cleardara()
611
- this.$dispatch('confirm')
612
- })
613
- }
614
- })
615
- }
616
- },
617
- //保存
618
- async confirm(){
619
- if(this.onedata=='one'){
620
- await this.saveonedata()
621
- }
622
- this.cleardara()
623
- this.$dispatch('confirm')
624
- },
625
- //保存一户信息
626
- async saveonedata(){
627
- this.model.f_create_person= this.$login.f.name
628
- this.model.f_filialeid = this.f_filialeids
629
- this.model.f_operator = this.$login.f.name
630
- this.model.f_operatorid = this.$login.f.id
631
- this.model.f_orgid = this.$login.f.orgid
632
- this.model.f_orgname = this.$login.f.orgs
633
- this.model.f_depid = this.$login.f.depids
634
- this.model.f_depname = this.$login.f.deps
635
- if (this.model.slice_area) {
636
- if (this.model.slice_area.length > 0) {
637
- this.model.f_slice_area = this.model.slice_area[0].name
638
- this.model.f_area_code = this.model.slice_area[0].code
639
- }
640
- }
641
- if (this.usertype) {
642
- //非民用
643
- this.model.f_special='1'
644
- this.model.f_building_suffix=''
645
- this.model.f_unit_suffix=''
646
- this.model.f_floor_suffix=''
647
- this.model.f_room_suffix=''
648
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
649
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
650
- } else {
651
- //民用
652
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
653
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
654
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
655
- 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
656
- }
657
- await this.$resetpost('rs/logic/address_updateuseraddress', this.model)
658
- },
659
- cancel(){
660
- this.cleardara()
661
- this.$dispatch('cancel')
662
- },
663
- cleardara(){
664
- this.model= {
665
- f_pcd_id: '',
666
- f_street_id: '',
667
- f_residential_area_id: '',
668
- f_pcd: '',
669
- f_comments:'',
670
- f_street: '',
671
- f_residential_area: '',
672
- f_slice_area: '',
673
- f_building: '',
674
- f_building_start: '',
675
- f_building_end: '',
676
- f_building_prefix: '',
677
- f_building_suffix: this.config.f_building_suffix,
678
- f_unit: '',
679
- f_unit_start: '',
680
- f_unit_end: '',
681
- f_unit_prefix: '',
682
- f_unit_suffix: this.config.f_unit_suffix,
683
- f_floor: '',
684
- f_floor_start: '',
685
- f_floor_end: '',
686
- f_floor_prefix: '',
687
- f_floor_suffix: this.config.f_floor_suffix,
688
- f_room: '',
689
- f_room_start: '',
690
- f_room_end: '',
691
- f_room_prefix: '',
692
- f_room_suffix: this.config.f_room_suffix,
693
- //详细地址
694
- f_address: '',
695
- //单位名称
696
- f_company: '',
697
- //单位地址
698
- f_company_address: '',
699
- }
700
- // this.pcdslist = []
701
- // this.streetslist = []
702
- // this.areaslist = []
703
- },
592
+ },
593
+ //保存多个
594
+ async confirmall(){
595
+ this.dealaddlist()
596
+ if(this.addresslist.length>0){
597
+ let msg = {
598
+ resolveMsg: '地址保存成功',
599
+ rejectMsg: '地址保存失败'
600
+ }
601
+ this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
602
+ if (res === 'confirm') {
603
+ this.$resetpost('rs/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
604
+ this.cleardara()
605
+ this.$dispatch('confirm')
606
+ })
607
+ }
608
+ })
609
+ }
610
+ },
611
+ //保存
612
+ async confirm(){
613
+ if(this.onedata=='one'){
614
+ await this.saveonedata()
615
+ }
616
+ this.cleardara()
617
+ this.$dispatch('confirm')
618
+ },
619
+ //保存一户信息
620
+ async saveonedata(){
621
+ this.model.f_create_person= this.$login.f.name
622
+ this.model.f_filialeid = this.f_filialeids
623
+ this.model.f_operator = this.$login.f.name
624
+ this.model.f_operatorid = this.$login.f.id
625
+ this.model.f_orgid = this.$login.f.orgid
626
+ this.model.f_orgname = this.$login.f.orgs
627
+ this.model.f_depid = this.$login.f.depids
628
+ this.model.f_depname = this.$login.f.deps
629
+ if (this.model.slice_area) {
630
+ if (this.model.slice_area.length > 0) {
631
+ this.model.f_slice_area = this.model.slice_area[0].name
632
+ this.model.f_area_code = this.model.slice_area[0].code
633
+ }
634
+ }
635
+ if (this.usertype) {
636
+ //非民用
637
+ this.model.f_special='1'
638
+ this.model.f_building_suffix=''
639
+ this.model.f_unit_suffix=''
640
+ this.model.f_floor_suffix=''
641
+ this.model.f_room_suffix=''
642
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
643
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
644
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
645
+ } else {
646
+ //民用
647
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
648
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
649
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
650
+ 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
651
+ }
652
+ await this.$resetpost('rs/logic/address_updateuseraddress', this.model)
653
+ },
654
+ cancel(){
655
+ this.cleardara()
656
+ this.$dispatch('cancel')
657
+ },
658
+ cleardara(){
659
+ this.model= {
660
+ f_pcd_id: '',
661
+ f_street_id: '',
662
+ f_residential_area_id: '',
663
+ f_pcd: '',
664
+ f_comments:'',
665
+ f_street: '',
666
+ f_residential_area: '',
667
+ f_slice_area: '',
668
+ f_building: '',
669
+ f_building_start: '',
670
+ f_building_end: '',
671
+ f_building_prefix: '',
672
+ f_building_suffix: this.config.f_building_suffix,
673
+ f_unit: '',
674
+ f_unit_start: '',
675
+ f_unit_end: '',
676
+ f_unit_prefix: '',
677
+ f_unit_suffix: this.config.f_unit_suffix,
678
+ f_floor: '',
679
+ f_floor_start: '',
680
+ f_floor_end: '',
681
+ f_floor_prefix: '',
682
+ f_floor_suffix: this.config.f_floor_suffix,
683
+ f_room: '',
684
+ f_room_start: '',
685
+ f_room_end: '',
686
+ f_room_prefix: '',
687
+ f_room_suffix: this.config.f_room_suffix,
688
+ //详细地址
689
+ f_address: '',
690
+ //单位名称
691
+ f_company: '',
692
+ //单位地址
693
+ f_company_address: '',
694
+ }
695
+ // this.pcdslist = []
696
+ // this.streetslist = []
697
+ // this.areaslist = []
698
+ },
704
699
 
705
- //根据名字找数据
706
- findbyid(list,name){
707
- var result
708
- list.forEach((row, n) => {
709
- if(name==row.value){
710
- result= row.data
711
- }
712
- })
713
- return result
714
- },
715
- },
716
- watch: {
717
- //分公司变化
718
- 'f_filialeids'(){
719
- if (this.model.f_filialeid) {
720
- if (this.model.f_filialeid != this.f_filialeids) {
721
- this.$dispatch('cancel')
700
+ //根据名字找数据
701
+ findbyid(list,name){
702
+ var result
703
+ list.forEach((row, n) => {
704
+ if(name==row.value){
705
+ result= row.data
706
+ }
707
+ })
708
+ return result
709
+ },
710
+ },
711
+ watch: {
712
+ //分公司变化
713
+ 'f_filialeids'(){
714
+ if (this.model.f_filialeid) {
715
+ if (this.model.f_filialeid != this.f_filialeids) {
716
+ this.$dispatch('cancel')
717
+ }
722
718
  }
719
+ this.cleardara()
720
+ this.initdata()
721
+ },
722
+ 'row'(){
723
+ this.onedata='one'
723
724
  }
724
- this.cleardara()
725
- this.initdata()
726
725
  },
727
- 'row'(){
728
- this.onedata='one'
729
- }
730
- },
731
- computed: {
732
- //地址状态下拉框
733
- addresstate() {
734
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
726
+ computed: {
727
+ //地址状态下拉框
728
+ addresstate() {
729
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
730
+ }
735
731
  }
736
732
  }
737
- }
738
733
  </script>