address-client 3.2.6 → 3.2.10

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.
@@ -39,6 +39,7 @@
39
39
  <button class="button_search button_spacing" @click="search()" >查询</button>
40
40
  <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('民用')">添加民用</button>
41
41
  <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
42
+ <button class="button_new button_spacing" style="width: max-content" v-show="this.$login.r.includes('批量修改')" @click="$parent.$parent.modifyBatch()">批量修改</button>
42
43
  <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
43
44
  <button class="button_export button_spacing" @click="$parent.$parent.importAddress">导入地址</button>
44
45
  <export-excel :data="$parent.$parent.getCondition"
@@ -124,9 +125,8 @@
124
125
  </div>
125
126
  </div>
126
127
  </criteria>
127
- <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
128
+ <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" :optional="true" v-ref:grid>
128
129
  <template partial='head'>
129
- <tr>
130
130
  <th><nobr>序号</nobr></th>
131
131
  <th><nobr>用户编号</nobr></th>
132
132
  <th><nobr>区/县</nobr></th>
@@ -137,10 +137,8 @@
137
137
  <th><nobr>地址状态</nobr></th>
138
138
  <th><nobr>时间</nobr></th>
139
139
  <th><nobr>操作</nobr></th>
140
- </tr>
141
140
  </template>
142
141
  <template partial='body'>
143
- <tr>
144
142
  <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
145
143
  <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
146
144
  <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
@@ -156,7 +154,6 @@
156
154
  <button type="button" name="button" class="btn btn-link"
157
155
  @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
158
156
  </td>
159
- </tr>
160
157
  </template>
161
158
  <template partial='foot'></template>
162
159
  </data-grid>
@@ -174,11 +171,58 @@
174
171
  </article>
175
172
  <footer slot="modal-footer" class="modal-footer"></footer>
176
173
  </modal>
177
- </template>
174
+
175
+ <modal :show.sync="showModify" large backdrop="false" :width="900">
176
+ <header slot="modal-header" class="modal-header">
177
+ </header>
178
+ <article slot="modal-body" class="modal-body">
179
+
180
+ <validator name='v'>
181
+ <div class="auto select-overspread form-horizontal">
182
+ <div class="col-sm-6 form-group">
183
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
184
+ <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id">
185
+ <v-select
186
+ :value.sync="areamodel.f_pcd_id" :value-single="true"
187
+ :options='pcdslist' placeholder='请选择'
188
+ close-on-select search="true" @change="pcdChange">
189
+ </v-select>
190
+ </div>
191
+ <div class="col-sm-6 form-group"
192
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
193
+ <label class="font_normal_body">街道名称</label>
194
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
195
+ v-validate:f_street_id='{required: true }'>
196
+ <v-select
197
+ :value.sync="areamodel.f_street_id" :value-single="true"
198
+ :options='streetslist' placeholder='请选择'
199
+ close-on-select search="true" @change="streetChange">
200
+ </v-select>
201
+ </div>
202
+ <div class="col-sm-6 form-group " v-if="showModify"
203
+ :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
204
+ <label class="font_normal_body">小区名称</label>
205
+ <input type="text" style="width:41%" v-show="false" v-model="areamodel.f_residential_area_id"
206
+ v-validate:f_area_id='{required: true }'>
207
+ <v-select :value.sync="areamodel.f_residential_area_id" :value-single="true"
208
+ :options='areaslist' placeholder='请选择'
209
+ @change=""
210
+ close-on-select search="true">
211
+ </v-select>
212
+ </div>
213
+ </div>
214
+ </validator>
215
+
216
+ </article>
217
+ <footer slot="modal-footer" class="modal-footer">
218
+ <button v-show="showModify" type="button" class="button_search button_spacing" @click='confirmModify()' :disabled='!$v.valid'>确认</button>
219
+ <button v-show="showModify" type="button" class="button_clear button_spacing" @click='cancelModify()'>取消</button>
220
+ </footer>
221
+ </modal></template>
178
222
 
179
223
  <script>
180
224
  import { PagedList } from 'vue-client'
181
-
225
+ import {HttpResetClass} from 'vue-client'
182
226
 
183
227
  let readyGen = async function (self) {
184
228
  self.getfield = self.config.excelHeaders
@@ -218,7 +262,25 @@
218
262
 
219
263
  //文件上传弹框
220
264
  showFile: false,
221
- showrightchange:true
265
+ showrightchange:true,
266
+ showrightchange:true,
267
+ showModify: false,
268
+ //小区
269
+ areamodel: {
270
+ f_area_id: '',
271
+ f_pcd_id:'',
272
+ f_street_id:'',
273
+ f_residential_area:'',
274
+ f_residential_area_id:''
275
+ },
276
+ //初始化省市区数据
277
+ pcdslist:[],
278
+ //初始化街道数据
279
+ streetslist:[],
280
+ //初始化街道数据
281
+ areaslist:[],
282
+ // 要修改的用户信息
283
+ userInfos: []
222
284
  }
223
285
  },
224
286
  title: '地址列表',
@@ -234,6 +296,9 @@
234
296
  ready(){
235
297
  readyGen(this)
236
298
  this.search()
299
+ this.initpcds(`f_filialeid = '${this.f_filialeids}'`)
300
+ this.initareas(`f_filialeid = '${this.f_filialeids}'`)
301
+ this.$refs.paged.$refs.grid.selectInit()
237
302
  },
238
303
  methods: {
239
304
  getotherfooter() {
@@ -311,11 +376,177 @@
311
376
  //清空
312
377
  clear(){
313
378
  this.$refs.paged.$refs.cri.model = {}
379
+ this.$refs.paged.$refs.grid.selectInit()
314
380
  },
315
381
  getorg (val) {
316
382
  this.f_orgid = this.$login.convertToIn(val)
317
383
  this.f_filialeids = val[0]
318
- }
384
+ },
385
+ async modifyBatch () {
386
+ if (this.f_filialeids) {
387
+ if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
388
+ this.areamodel.f_pcd_id = this.$refs.paged.$refs.grid.getRowData()[0].f_pcd_id
389
+ this.showModify = true
390
+ } else {
391
+ this.$showAlert('请至少选择一项!', 'warning', 2000)
392
+ }
393
+ }else {
394
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
395
+ }
396
+ },
397
+ confirmModify () {
398
+ this.userInfos = []
399
+ this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
400
+ this.userInfos[n] = {
401
+ userid: row.id,
402
+ f_residential_area: row.f_residential_area,
403
+ f_street: row.f_street,
404
+ f_address: row.f_address,
405
+ 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:'')
406
+ }
407
+ })
408
+ let modifyBatchData = {
409
+ userInfos: this.userInfos,
410
+ f_pcd_id: this.areamodel.f_pcd_id,
411
+ f_residential_area_id: this.areamodel.f_residential_area_id,
412
+ f_street_id: this.areamodel.f_street_id,
413
+ f_operator: this.$login.f.name,
414
+ f_operatorid: this.$login.f.id,
415
+ f_orgid: this.$login.f.orgid,
416
+ f_orgname: this.$login.f.orgs,
417
+ f_depid: this.$login.f.depids,
418
+ f_depname: this.$login.f.deps,
419
+ f_filialeid: this.f_filialeids
420
+ }
421
+ this.$resetpost('rs/logic/modifyBatch',modifyBatchData)
422
+ this.initpcds(`f_filialeid = '${this.f_filialeids}'`)
423
+ this.showModify = false
424
+ this.$refs.paged.$refs.grid.selectInit()
425
+ this.$refs.paged.$refs.cri.search()
426
+ },
427
+ cancelModify() {
428
+ this.initpcds(`f_filialeid = '${this.f_filialeids}'`)
429
+ this.showModify = false
430
+ this.$refs.paged.$refs.grid.selectInit()
431
+ },
432
+
433
+ //初始化省市区,添加街道
434
+ async initpcds(pconditon){
435
+ this.pcdslist = []
436
+ let HttpReset = new HttpResetClass()
437
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
438
+ data: {
439
+ items: '*',
440
+ tablename: 't_pcd',
441
+ orderitem: 'id',
442
+ condition: pconditon
443
+ }
444
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
445
+ let redata = []
446
+ req.data.forEach((row, n) => {
447
+ redata[n] = {
448
+ label: row.f_pcd,
449
+ value: row.id,
450
+ data:row,
451
+ id:row.id
452
+ }
453
+ })
454
+ this.pcdslist=redata
455
+ },
456
+
457
+ //初始化街道
458
+ async initstreets(pconditon){
459
+ this.streetslist = []
460
+ let HttpReset = new HttpResetClass()
461
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
462
+ data: {
463
+ items: '*',
464
+ tablename: 't_street',
465
+ orderitem: 'id',
466
+ condition: pconditon
467
+ }
468
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
469
+ let redata = []
470
+ req.data.forEach((row, n) => {
471
+ redata[n] = {
472
+ label: row.f_street,
473
+ value: row.id,
474
+ data:row,
475
+ id:row.id
476
+ }
477
+ })
478
+ this.streetslist=redata
479
+ },
480
+ //初始化小区
481
+ async initareas(pconditon){
482
+ this.areaslist = []
483
+ let HttpReset = new HttpResetClass()
484
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
485
+ data: {
486
+ items: '*',
487
+ tablename: 't_area',
488
+ orderitem: 'id',
489
+ condition: pconditon
490
+ }
491
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
492
+ let redata = []
493
+ req.data.forEach((row) => {
494
+ redata.push({
495
+ label: row.f_residential_area,
496
+ value: row.id,
497
+ data: row,
498
+ id: row.id
499
+ })
500
+ })
501
+ this.areaslist=redata
502
+ },
503
+
504
+
505
+ //省/市/区变化
506
+ async pcdChange(val){
507
+ if(val){
508
+ //那就把街道数据重新组织一下
509
+ await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
510
+ if(this.areamodel.f_street_id){
511
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
512
+ let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
513
+ if(pcd_id!=val){
514
+ this.areamodel.f_street_id=''
515
+ }
516
+ } else {
517
+ this.areamodel.f_street_id=''
518
+ }
519
+ }
520
+ }
521
+ this.$resetValidation()
522
+ },
523
+ //街道变化
524
+ async streetChange(val){
525
+ if(val){
526
+ await this.initareas(` f_filialeid = '${this.f_filialeids}' and f_street_id ='${val}' `)
527
+ if(this.areamodel.f_area_id){
528
+ if (this.findbyid(this.areaslist,this.areamodel.f_area_id)) {
529
+ let street_id=this.findbyid(this.areaslist,this.areamodel.f_area_id).f_street_id
530
+ if(street_id!=val){
531
+ this.areamodel.f_area_id=''
532
+ }
533
+ } else {
534
+ this.areamodel.f_area_id=''
535
+ }
536
+ }
537
+ }
538
+ this.$resetValidation()
539
+ },
540
+ //根据名字找数据
541
+ findbyid(list,name){
542
+ var result
543
+ list.forEach((row, n) => {
544
+ if(name==row.id){
545
+ result= row.data
546
+ }
547
+ })
548
+ return result
549
+ },
319
550
  },
320
551
  events: {
321
552
  onFileUpload: async function (file, res) {
@@ -40,6 +40,7 @@
40
40
  </div>
41
41
  <div class="col-sm-4 form-group button-range">
42
42
  <button class="button_search button_spacing" @click="search()" >查询</button>
43
+ <button class="button_search button_spacing" @click="$parent.$parent.batchDelete()">批量删除</button>
43
44
  <button v-if="!$parent.$parent.f_special" class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('小区')">添加小区</button>
44
45
  <button v-if="$parent.$parent.f_special"class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('单位')">添加单位</button>
45
46
  <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
@@ -94,9 +95,8 @@
94
95
 
95
96
 
96
97
  </criteria>
97
- <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid>
98
+ <data-grid :model="model" partial='list' class="list_area table_sy" v-ref:grid :optional="true">
98
99
  <template partial='head'>
99
- <tr>
100
100
  <th><nobr>序号</nobr></th>
101
101
  <th v-if="false"><nobr>省份</nobr></th>
102
102
  <th v-if="false"><nobr>城市</nobr></th>
@@ -113,16 +113,13 @@
113
113
  <th v-if="$parent.$parent.$parent.f_special"><nobr>联系人</nobr></th>
114
114
  <th v-if="$parent.$parent.$parent.f_special"><nobr>联系电话</nobr></th>
115
115
  <!--非民用单位信息结束-->
116
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>安装位置</nobr></th>
116
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>户数</nobr></th>
117
117
  <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>片区/管理站 </nobr></th>
118
118
  <th><nobr>操作人</nobr></th>
119
119
  <th><nobr>操作日期</nobr></th>
120
120
  <th><nobr>操作</nobr></th>
121
-
122
- </tr>
123
121
  </template>
124
122
  <template partial='body'>
125
- <tr>
126
123
  <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
127
124
  <td style="text-align:center" v-if="false"><nobr>{{row.f_province}}</nobr></td>
128
125
  <td style="text-align:center" v-if="false"><nobr>{{row.f_city}}</nobr></td>
@@ -135,7 +132,7 @@
135
132
  <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkname}}</nobr></td>
136
133
  <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkphone}}</nobr></td>
137
134
  <!--非民用单位信息结束-->
138
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_position}}</nobr></td>
135
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.addressnum}}</nobr></td>
139
136
  <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
140
137
  <td style="text-align:center"><nobr>{{row.f_operator}}</nobr></td>
141
138
  <td style="text-align:center"><nobr>{{row.f_operate_date}}</nobr></td>
@@ -146,11 +143,32 @@
146
143
  style="padding: 5px 12px"
147
144
  @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
148
145
  </nobr></td>
149
- </tr>
150
146
  </template>
151
147
  <template partial='foot'></template>
152
148
  </data-grid>
153
149
  </criteria-paged>
150
+ <modal :show="showDelete" large backdrop="false" :width="900">
151
+ <header slot="modal-header" class="modal-header">
152
+ <p class="bg-info text-center" style="padding: 8px;">请选择目标小区</p>
153
+ </header>
154
+ <article slot="modal-body" class="modal-body">
155
+ <validator name='v'>
156
+ <div class="col-sm-6 form-group ">
157
+ <label class="font_normal_body">小区名称</label>
158
+ <input type="text" style="width:41%" v-show="false" v-validate:f_residential_area_id='{required: true }' v-model="areamodel.f_residential_area_id">
159
+ <v-select :value.sync="areamodel.f_residential_area_id" :value-single="true"
160
+ @change="areaChange"
161
+ :options='areaslist' placeholder='请选择'
162
+ close-on-select search="true">
163
+ </v-select>
164
+ </div>
165
+ </validator>
166
+ </article>
167
+ <footer slot="modal-footer" class="modal-footer">
168
+ <button v-show="showDelete" type="button" class="button_search button_spacing" @click='confirmDelete()' :disabled='!$v.valid'>确认</button>
169
+ <button v-show="showDelete" type="button" class="button_clear button_spacing" @click='cancelDelete()'>取消</button>
170
+ </footer>
171
+ </modal>
154
172
  </div>
155
173
  </template>
156
174
 
@@ -171,7 +189,20 @@
171
189
  f_orgid: '',
172
190
  handmonth:[{label:'全部',value:''},{label:'单月',value:'单月'},{label:'双月',value:'双月'}],
173
191
  housetype:[{label:'全部',value:''},{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
174
- position:this.$appdata.getParam('安装位置')?[{label:'全部',value:''},...this.$appdata.getParam('安装位置')]:[{label:'全部',value:''}]
192
+ position:this.$appdata.getParam('安装位置')?[{label:'全部',value:''},...this.$appdata.getParam('安装位置')]:[{label:'全部',value:''}],
193
+ //初始化小区数据
194
+ areaslist:[],
195
+ // 目标小区数据
196
+ areamodel: {
197
+ f_residential_area_id: '',
198
+ f_pcd: '',
199
+ f_pcd_id: '',
200
+ f_street: '',
201
+ f_street_id: '',
202
+ f_slice_area: '',
203
+ f_residential_area: ''
204
+ },
205
+ showDelete: false,
175
206
  }
176
207
  },
177
208
  title: '小区管理',
@@ -249,7 +280,89 @@
249
280
  getorg (val) {
250
281
  this.f_orgid = this.$login.convertToIn(val)
251
282
  this.f_filialeids = val[0]
252
- }
283
+ },
284
+ async batchDelete () {
285
+ if (this.f_filialeids) {
286
+ if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
287
+ this.showDelete = true
288
+ let condition = `a.f_orgid = '${this.f_filialeids}'`
289
+ let req = await this.$resetpost('rs/sql/address_getresidential', {
290
+ data: {
291
+ condition: condition
292
+ }
293
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
294
+ let redata = []
295
+ req.data.forEach((row) => {
296
+ redata.push({
297
+ label: row.f_residential_area,
298
+ value: row.id,
299
+ data: row,
300
+ id: row.id
301
+ })
302
+ })
303
+ this.areaslist = redata
304
+ } else {
305
+ this.$showAlert('请至少选择一项!', 'warning', 2000)
306
+ }
307
+ }else {
308
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
309
+ }
310
+ },
311
+ confirmDelete () {
312
+ let msg = {
313
+ resolveMsg: '批量删除成功',
314
+ rejectMsg: '批量删除失败!'
315
+ }
316
+ let oldAreaIds = []
317
+ // 获取要批量删除的小区数据
318
+ this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
319
+ oldAreaIds[n] = row.id
320
+ })
321
+ this.$resetpost('rs/logic/batchDelete',{
322
+ data:{
323
+ areamodel:this.areamodel,
324
+ oldAreaIds:oldAreaIds,
325
+ f_operator: this.$login.f.name,
326
+ f_operatorid: this.$login.f.id,
327
+ f_orgid: this.$login.f.orgid,
328
+ f_orgname: this.$login.f.orgs,
329
+ f_depid: this.$login.f.depids,
330
+ f_depname: this.$login.f.deps
331
+ }
332
+ },msg)
333
+ this.$refs.paged.$refs.grid.selectInit()
334
+ this.$refs.paged.$refs.cri.search()
335
+ this.areamodel.f_residential_area_id = ''
336
+ this.showDelete = false
337
+ },
338
+ cancelDelete () {
339
+ this.$refs.paged.$refs.grid.selectInit()
340
+ this.$refs.paged.$refs.cri.search()
341
+ this.areamodel.f_residential_area_id = ''
342
+ this.showDelete = false
343
+ },
344
+ areaChange(val){
345
+ console.log("小区变化",val)
346
+ let selectArea // 选中的小区数据
347
+ for (let row of this.areaslist) {
348
+ if (val == row.value) {
349
+ selectArea = row.data
350
+ break
351
+ }
352
+ }
353
+ if (selectArea) {
354
+ this.areamodel.f_residential_area_id = selectArea.id
355
+ this.areamodel.f_pcd = selectArea.f_pcd
356
+ this.areamodel.f_pcd_id = selectArea.f_pcd_id
357
+ this.areamodel.f_street = selectArea.f_street
358
+ this.areamodel.f_street_id = selectArea.f_street_id
359
+ this.areamodel.f_slice_area = selectArea.f_slice_area
360
+ this.areamodel.f_residential_area = selectArea.f_residential_area
361
+ }
362
+ this.$nextTick(() => {
363
+ this.$resetValidation()
364
+ })
365
+ },
253
366
  },
254
367
  watch:{
255
368