manage-client 3.2.215 → 3.2.217

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