address-client 3.2.29 → 3.2.32

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.
@@ -28,7 +28,6 @@
28
28
  :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
29
29
  </div>
30
30
  <!--<div v-if="$parent.$parent.showrightchange" :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.useraddressShow">-->
31
-
32
31
  <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showrightchange">
33
32
  <label class="font_normal_body">楼&emsp;&emsp;号</label>
34
33
  <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
@@ -39,8 +38,12 @@
39
38
  <button class="button_search button_spacing" @click="search()" >查询</button>
40
39
  <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('民用')">添加民用</button>
41
40
  <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
41
+ <button class="button_new button_spacing" style="width: max-content" v-show="this.$login.r.includes('批量修改')" @click="$parent.$parent.modifyBatch()">批量修改</button>
42
42
  <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
43
- <button class="button_export button_spacing" @click="$parent.$parent.importAddress">导入地址</button>
43
+ <button class="button_export button_spacing" @click="$parent.$parent.importAddress('导入')">模板导入</button>
44
+ <button class="button_export button_spacing"
45
+ v-show="this.$login.r.includes('完善地址')"
46
+ @click="$parent.$parent.importAddress('完善')">完善地址</button>
44
47
  <export-excel :data="$parent.$parent.getCondition"
45
48
  :field="$parent.$parent.getfield"
46
49
  sqlurl="rs/logic/exportfile"
@@ -105,6 +108,12 @@
105
108
  condition="a.f_address like '%{}%'" placeholder="详细地址"
106
109
  :size="model.f_address ? model.f_address.length*2 : 8"/>
107
110
  </div>
111
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
112
+ <label class="font_normal_body">街道/乡镇</label>
113
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
114
+ condition="f_street like '%{}%'" placeholder="街道/乡镇"
115
+ :size="model.f_street ? model.f_street.length*2 : 6"/>
116
+ </div>
108
117
  <div :class="$parent.$parent.style" >
109
118
  <label class="font_normal_body">地址状态</label>
110
119
  <v-select :value.sync="model.f_address_state"
@@ -118,53 +127,55 @@
118
127
  </div>
119
128
  </div>
120
129
  </criteria>
121
- <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
130
+ <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" :optional="true" v-ref:grid>
122
131
  <template partial='head'>
123
- <tr>
124
- <th><nobr>序号</nobr></th>
125
- <th><nobr>用户编号</nobr></th>
126
- <th><nobr>区/镇</nobr></th>
127
- <th><nobr>片区</nobr></th>
128
- <th><nobr>社区/村委</nobr></th>
129
- <th><nobr>小区(单位)</nobr></th>
130
- <th><nobr>楼号</nobr></th>
131
- <th><nobr>单元</nobr></th>
132
- <th><nobr>楼层</nobr></th>
133
- <th><nobr>门牌号</nobr></th>
134
- <th><nobr>详细地址</nobr></th>
135
- <th><nobr>地址状态</nobr></th>
136
- <th><nobr>时间</nobr></th>
137
- <th><nobr>操作</nobr></th>
138
- </tr>
132
+ <th><nobr>序号</nobr></th>
133
+ <th><nobr>用户编号</nobr></th>
134
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>区/县</nobr></th>
135
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>片区/管理站</nobr></th>
136
+ <th><nobr>街道/乡镇</nobr></th>
137
+ <th><nobr>小区(单位)</nobr></th>
138
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼号</nobr></th>
139
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>单元</nobr></th>
140
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼层</nobr></th>
141
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>门牌号</nobr></th>
142
+ <th><nobr>详细地址</nobr></th>
143
+ <th><nobr>地址状态</nobr></th>
144
+ <th><nobr>状态</nobr></th>
145
+ <th><nobr>时间</nobr></th>
146
+ <th><nobr>备注</nobr></th>
147
+ <th><nobr>操作</nobr></th>
139
148
  </template>
140
149
  <template partial='body'>
141
- <tr>
142
- <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
143
- <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
144
- <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
145
- <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
146
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
147
- <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
148
- <td style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
149
- <td style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
150
- <td style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
151
- <td style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
152
- <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
153
- <td style="text-align:center"><nobr>{{row.f_address_state}}</nobr></td>
154
- <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
155
- <td style="text-align:center">
156
- <!-- <button type="button" name="button" class="btn btn-link"
157
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
158
- <button type="button" name="button" class="btn btn-link"
159
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
160
- </td>
161
- </tr>
150
+ <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
151
+ <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
152
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
153
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
154
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
155
+ <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
156
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
157
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
158
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
159
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
160
+ <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
161
+ <td style="text-align:center"><nobr>{{row.f_address_state}}</nobr></td>
162
+ <td style="text-align:center"><nobr>{{row.f_state ==='作废'?'作废':'有效'}}</nobr></td>
163
+ <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
164
+ <td style="text-align:center"><nobr>{{row.f_comments}}</nobr></td>
165
+ <td style="text-align:center">
166
+ <!-- <button type="button" name="button" class="btn btn-link"
167
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
168
+ <button v-if="!row.f_useraddress_id" type="button" name="button" class="btn btn-danger"
169
+ style="padding: 5px 12px"
170
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
171
+ </td>
162
172
  </template>
163
173
  <template partial='foot'></template>
164
174
  </data-grid>
165
175
  </criteria-paged>
166
176
  </div>
167
- <modal :show.sync="showFile" v-ref:modal backdrop="true">
177
+ <work-busy :is-busy='isbusy'></work-busy>
178
+ <modal :show.sync="showFile" width="480px" v-ref:modal backdrop="true">
168
179
  <header slot="modal-header" class="modal-header">
169
180
  <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
170
181
  <h4 class="modal-title">选择文件</h4>
@@ -174,11 +185,60 @@
174
185
  <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
175
186
  </div>
176
187
  </article>
177
- <footer slot="modal-footer" class="modal-footer"></footer>
188
+ <footer slot="modal-footer" class="modal-footer" style="display: none"></footer>
189
+ </modal>
190
+
191
+ <modal :show.sync="showModify" large backdrop="false" :width="900">
192
+ <header slot="modal-header" class="modal-header">
193
+ </header>
194
+ <article slot="modal-body" class="modal-body">
195
+
196
+ <validator name='v'>
197
+ <div class="auto select-overspread form-horizontal">
198
+ <div class="col-sm-6 form-group">
199
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
200
+ <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id">
201
+ <v-select
202
+ :value.sync="areamodel.f_pcd_id" :value-single="true"
203
+ :options='pcdslist' placeholder='请选择'
204
+ close-on-select search="true" @change="pcdChange">
205
+ </v-select>
206
+ </div>
207
+ <div class="col-sm-6 form-group"
208
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
209
+ <label class="font_normal_body">街道名称</label>
210
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
211
+ v-validate:f_street_id='{required: true }'>
212
+ <v-select
213
+ :value.sync="areamodel.f_street_id" :value-single="true"
214
+ :options='streetslist' placeholder='请选择'
215
+ close-on-select search="true" @change="streetChange">
216
+ </v-select>
217
+ </div>
218
+ <div class="col-sm-6 form-group " v-if="showModify"
219
+ :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
220
+ <label class="font_normal_body">小区名称</label>
221
+ <input type="text" style="width:41%" v-show="false" v-model="areamodel.f_residential_area_id"
222
+ v-validate:f_area_id='{required: true }'>
223
+ <v-select :value.sync="areamodel.f_residential_area_id" :value-single="true"
224
+ :options='areaslist' placeholder='请选择'
225
+ @change=""
226
+ close-on-select search="true">
227
+ </v-select>
228
+ </div>
229
+ </div>
230
+ </validator>
231
+
232
+ </article>
233
+ <footer slot="modal-footer" class="modal-footer">
234
+ <button v-show="showModify" type="button" class="button_search button_spacing" @click='confirmModify()' :disabled='!$v.valid'>确认</button>
235
+ <button v-show="showModify" type="button" class="button_clear button_spacing" @click='cancelModify()'>取消</button>
236
+ </footer>
178
237
  </modal>
179
238
  </template>
180
239
 
181
240
  <script>
241
+ import {HttpResetClass} from 'vue-client'
182
242
  import { PagedList } from 'vue-client'
183
243
 
184
244
  let readyGen = async function (self) {
@@ -215,13 +275,32 @@
215
275
  'f_state':'状态'
216
276
  },
217
277
  },
278
+ isbusy:false,
279
+ imptype:'',
218
280
  // 公司下拉
219
281
  curorgid: [this.$login.f.orgid],
220
282
  f_orgid: '',
221
-
283
+ getstate:[{label:'全部',value:''},{label:'有效',value:" = '有效' or a.f_state is null"},{label:'作废',value:" = '作废'"}],
222
284
  //文件上传弹框
223
285
  showFile: false,
224
- showrightchange:true
286
+ showrightchange:true,
287
+ showModify: false,
288
+ //小区
289
+ areamodel: {
290
+ f_area_id: '',
291
+ f_pcd_id:'',
292
+ f_street_id:'',
293
+ f_residential_area:'',
294
+ f_residential_area_id:''
295
+ },
296
+ //初始化省市区数据
297
+ pcdslist:[],
298
+ //初始化街道数据
299
+ streetslist:[],
300
+ //初始化街道数据
301
+ areaslist:[],
302
+ // 要修改的用户信息
303
+ userInfos: []
225
304
  }
226
305
  },
227
306
  title: '地址列表',
@@ -271,7 +350,8 @@
271
350
  this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
272
351
  }
273
352
  },
274
- importAddress(){
353
+ importAddress(val){
354
+ this.imptype = val
275
355
  this.showFile = true
276
356
  },
277
357
  // 关闭文件上传对话框
@@ -286,7 +366,7 @@
286
366
  this.$dispatch('modify',val)
287
367
  },
288
368
  async delete(row){
289
- if(row.id){
369
+ if(row.id >= 0){
290
370
  var id = row.id
291
371
  let userfiles = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_useraddress_id',tablename: 't_userfiles',condition: `f_useraddress_id='${id}' and f_table_state = '正常'`}},{resolveMsg: null, rejectMsg: null})
292
372
  if(userfiles.data.length){
@@ -316,21 +396,190 @@
316
396
  //清空
317
397
  clear(){
318
398
  this.$refs.paged.$refs.cri.model = {}
399
+ this.$refs.paged.$refs.grid.selectInit()
319
400
  },
320
401
  getorg (val) {
321
402
  this.f_orgid = this.$login.convertToIn(val)
322
403
  this.f_filialeids = val[0]
323
- }
404
+ },
405
+ async modifyBatch () {
406
+ if (this.f_filialeids) {
407
+ if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
408
+ this.areamodel.f_pcd_id = this.$refs.paged.$refs.grid.getRowData()[0].f_pcd_id
409
+ this.showModify = true
410
+ } else {
411
+ this.$showAlert('请至少选择一项!', 'warning', 2000)
412
+ }
413
+ }else {
414
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
415
+ }
416
+ },
417
+ confirmModify () {
418
+ this.userInfos = []
419
+ this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
420
+ this.userInfos[n] = {
421
+ userid: row.id,
422
+ f_residential_area: row.f_residential_area,
423
+ f_street: row.f_street,
424
+ f_address: row.f_address,
425
+ f_address_rest: row.f_street + row.f_residential_area + (row.f_building?row.f_building+row.f_building_suffix:'') + (row.f_unit?row.f_unit+row.f_unit_suffix:'') + (row.f_floor?row.f_floor+row.f_floor_suffix:'') + (row.f_room?row.f_room+row.f_room_suffix:'')
426
+ }
427
+ })
428
+ let modifyBatchData = {
429
+ userInfos: this.userInfos,
430
+ f_pcd_id: this.areamodel.f_pcd_id,
431
+ f_residential_area_id: this.areamodel.f_residential_area_id,
432
+ f_street_id: this.areamodel.f_street_id,
433
+ f_operator: this.$login.f.name,
434
+ f_operatorid: this.$login.f.id,
435
+ f_orgid: this.$login.f.orgid,
436
+ f_orgname: this.$login.f.orgs,
437
+ f_depid: this.$login.f.depids,
438
+ f_depname: this.$login.f.deps,
439
+ f_filialeid: this.f_filialeids
440
+ }
441
+ this.$resetpost('rs/logic/modifyBatch',modifyBatchData)
442
+ this.initpcds(`f_filialeid = '${this.f_filialeids}'`)
443
+ this.showModify = false
444
+ this.$refs.paged.$refs.grid.selectInit()
445
+ this.$refs.paged.$refs.cri.search()
446
+ },
447
+ cancelModify() {
448
+ this.initpcds(`f_filialeid = '${this.f_filialeids}'`)
449
+ this.showModify = false
450
+ this.$refs.paged.$refs.grid.selectInit()
451
+ },
452
+
453
+ //初始化省市区,添加街道
454
+ async initpcds(pconditon){
455
+ this.pcdslist = []
456
+ let HttpReset = new HttpResetClass()
457
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
458
+ data: {
459
+ items: '*',
460
+ tablename: 't_pcd',
461
+ orderitem: 'id',
462
+ condition: pconditon
463
+ }
464
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
465
+ let redata = []
466
+ req.data.forEach((row, n) => {
467
+ redata[n] = {
468
+ label: row.f_pcd,
469
+ value: row.id,
470
+ data:row,
471
+ id:row.id
472
+ }
473
+ })
474
+ this.pcdslist=redata
475
+ },
476
+
477
+ //初始化街道
478
+ async initstreets(pconditon){
479
+ this.streetslist = []
480
+ let HttpReset = new HttpResetClass()
481
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
482
+ data: {
483
+ items: '*',
484
+ tablename: 't_street',
485
+ orderitem: 'id',
486
+ condition: pconditon
487
+ }
488
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
489
+ let redata = []
490
+ req.data.forEach((row, n) => {
491
+ redata[n] = {
492
+ label: row.f_street,
493
+ value: row.id,
494
+ data:row,
495
+ id:row.id
496
+ }
497
+ })
498
+ this.streetslist=redata
499
+ },
500
+ //初始化小区
501
+ async initareas(pconditon){
502
+ this.areaslist = []
503
+ let HttpReset = new HttpResetClass()
504
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
505
+ data: {
506
+ items: '*',
507
+ tablename: 't_area',
508
+ orderitem: 'id',
509
+ condition: pconditon
510
+ }
511
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
512
+ let redata = []
513
+ req.data.forEach((row) => {
514
+ redata.push({
515
+ label: row.f_residential_area,
516
+ value: row.id,
517
+ data: row,
518
+ id: row.id
519
+ })
520
+ })
521
+ this.areaslist=redata
522
+ },
523
+
524
+
525
+ //省/市/区变化
526
+ async pcdChange(val){
527
+ if(val){
528
+ //那就把街道数据重新组织一下
529
+ await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
530
+ if(this.areamodel.f_street_id){
531
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
532
+ let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
533
+ if(pcd_id!=val){
534
+ this.areamodel.f_street_id=''
535
+ }
536
+ } else {
537
+ this.areamodel.f_street_id=''
538
+ }
539
+ }
540
+ }
541
+ this.$resetValidation()
542
+ },
543
+ //街道变化
544
+ async streetChange(val){
545
+ if(val){
546
+ await this.initareas(` f_filialeid = '${this.f_filialeids}' and f_street_id ='${val}' `)
547
+ if(this.areamodel.f_area_id){
548
+ if (this.findbyid(this.areaslist,this.areamodel.f_area_id)) {
549
+ let street_id=this.findbyid(this.areaslist,this.areamodel.f_area_id).f_street_id
550
+ if(street_id!=val){
551
+ this.areamodel.f_area_id=''
552
+ }
553
+ } else {
554
+ this.areamodel.f_area_id=''
555
+ }
556
+ }
557
+ }
558
+ this.$resetValidation()
559
+ },
560
+ //根据名字找数据
561
+ findbyid(list,name){
562
+ var result
563
+ list.forEach((row, n) => {
564
+ if(name==row.id){
565
+ result= row.data
566
+ }
567
+ })
568
+ return result
569
+ },
324
570
  },
325
571
  events: {
326
572
  onFileUpload: async function (file, res) {
573
+ this.isbusy = true
327
574
  console.log("上传完毕"+JSON.stringify(res))
328
575
  let data = {
329
576
  filepath: res.f_downloadpath,
330
- user:this.$login.f
577
+ user:this.$login.f,
578
+ type :this.imptype
331
579
  }
332
580
  console.log("filepath="+JSON.stringify(data))
333
581
  await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
582
+ this.isbusy = false
334
583
  if(res.data.type=="success"){
335
584
  this.$showAlert("导入信息:"+res.data.msg, res.data.type, 2000);
336
585
  }else{
@@ -341,6 +590,8 @@
341
590
  this.closeFile()
342
591
  //重新查询
343
592
  this.init()
593
+ }).catch(error=>{
594
+ this.isbusy = false
344
595
  })
345
596
  },
346
597
  'onFileError'(error) {