address-client 3.0.24-9 → 3.0.24-aode

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