address-client 3.2.45 → 3.2.46

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,679 +1,679 @@
1
- <template>
2
- <div class="span">
3
- <validator name='v'>
4
- <div class="form-horizontal select-overspread container-fluid" style="overflow-y: auto">
5
- <div class="row auto">
6
- <div class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
7
- <span v-if="operation=='add'&&!f_specia">添加{{areatype}}</span>
8
- <span v-if="operation=='modify'&&!f_special">修改【{{areamodel.f_residential_area}}】小区</span>
9
- <span v-if="operation=='add'&&f_specia">添加{{areatype}}</span>
10
- <span v-if="operation=='modify'&&f_special">修改【{{areamodel.f_residential_area}}】单位</span>
11
- </div>
12
- <!--基本小区(单位)信息-->
13
- <div class="col-sm-6 form-group">
14
- <label class="font_normal_body">小区编号</label>
15
- <input type="text" class="input_search" style="width:60%" v-model="areamodel.f_area_id"
16
- @blur="areaidChange" placeholder="小区编号">
17
- </div>
18
-
19
- <div class="col-sm-6 form-group"
20
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
21
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
22
- <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id"
23
- v-validate:f_pcd_id='{required: true }'>
24
- <v-select
25
- :value.sync="areamodel.f_pcd_id" :value-single="true"
26
- :options='pcdslist' placeholder='请选择'
27
- close-on-select search="true" @change="pcdChange">
28
- </v-select>
29
- </div>
30
- <div class="col-sm-6 form-group"
31
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
32
- <label class="font_normal_body">街道名称</label>
33
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
34
- v-validate:f_street_id='{required: true }'>
35
- <v-select
36
- :value.sync="areamodel.f_street_id" :value-single="true"
37
- :options='streetslist' placeholder='请选择'
38
- close-on-select search="true" @change="streetChange">
39
- </v-select>
40
- </div>
41
- <div class="col-sm-6 form-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
42
- <label class="font_normal_body">片&emsp;&emsp;区</label>
43
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
44
- v-validate:slice='{required: true }'>
45
- <v-select :value.sync="areamodel.slice_area" v-model="areamodel.slice_area"
46
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
47
- close-on-select v-ref:slice>
48
- </v-select>
49
- </div>
50
- <!--小区(特殊)信息-->
51
- <div v-if="!f_special"
52
- class="col-sm-6 form-group"
53
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
54
- <label class="font_normal_body">小区名称</label>
55
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
56
- class="form-control" placeholder="小区名称"
57
- v-validate:f_residential_area='{required: true }'>
58
- </div>
59
- <div class="col-sm-6 form-group"
60
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
61
- <label class="font_normal_body">安检片区</label>
62
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_check_book_id"
63
- v-validate:f_street_id='{required: true }'>
64
- <v-select
65
- :value.sync="areamodel.f_check_book_id" :value-single="true"
66
- :options='safeCheckArea' placeholder='请选择'
67
- close-on-select search="true">
68
- </v-select>
69
- </div>
70
- <div v-if="!f_special"
71
- class="col-sm-12 form-group">
72
- <label class="font_normal_body">小区地址</label>
73
- <input type="text" style="width:80%" class="input_search" v-model="areamodel.f_area_address"
74
- class="form-control" placeholder="小区地址">
75
- </div>
76
- <!--单位(特殊)信息-->
77
- <div v-if="f_special"
78
- class="col-sm-6 form-group"
79
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
80
- <label class="font_normal_body">单位名称</label>
81
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
82
- class="form-control" placeholder="单位名称"
83
- v-validate:f_residential_area='{required: true }'>
84
- </div>
85
- <div v-if="f_special"
86
- class="col-sm-12 form-group">
87
- <label class="font_normal_body">单位地址</label>
88
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_area_address"
89
- class="form-control" placeholder="单位地址">
90
- </div>
91
- <div
92
- class="col-sm-6 form-group"
93
- :class="[$v.f_linkname.required ? 'has-error' : 'has-success']">
94
- <label class="font_normal_body">联&ensp;系&ensp;人</label>
95
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkname"
96
- class="form-control" placeholder="联系人"
97
- v-validate:f_linkname='{required: true }'>
98
- </div>
99
- <div
100
- class="col-sm-6 form-group"
101
- :class="[$v.f_linkphone.required ? 'has-error' : 'has-success']">
102
- <label class="font_normal_body">联系电话</label>
103
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkphone"
104
- class="form-control" placeholder="联系电话"
105
- v-validate:f_linkphone='{required: true }'>
106
- </div>
107
- <div class="col-sm-12 form-group">
108
- <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
109
- <textarea class="input_textarea" rows="3" style="margin-top:20px;width:80%;height: auto;" v-model="areamodel.f_comments"></textarea>
110
- </div>
111
- <div class="col-sm-12 form-group">
112
- <br/>
113
- </div>
114
- <!--表具信息-->
115
- <div v-if="!f_special" class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
116
- <span >默认表具信息</span>
117
- </div>
118
- <div v-if="!f_special" class="row">
119
- <div class="col-sm-6 form-group">
120
- <label class="font_normal_body">用户类型</label>
121
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type"
122
- >
123
- <v-select
124
- :value.sync="areamodel.f_user_type" :value-single="true"
125
- :options='usertypes' placeholder='用户类型' @change="userTypeChange"
126
- close-on-select >
127
- </v-select>
128
- </div>
129
- <div class="col-sm-6 form-group"
130
- >
131
- <label class="font_normal_body">用气性质</label>
132
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties"
133
- >
134
- <v-select
135
- :value.sync="areamodel.f_gasproperties" :value-single="true"
136
- :options='gasproperties' placeholder='用气性质'
137
- close-on-select >
138
- </v-select>
139
- </div>
140
- <div class="col-sm-6 form-group"
141
- >
142
- <label class="font_normal_body">气价类型</label>
143
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type"
144
- >
145
- <v-select
146
- :value.sync="areamodel.f_price_type" :value-single="true"
147
- :options='f_price_types' placeholder='气价类型'
148
- close-on-select >
149
- </v-select>
150
- </div>
151
- <div class="col-sm-6 form-group"
152
- >
153
- <label class="font_normal_body">气价名称</label>
154
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name"
155
- >
156
- <v-select
157
- :value.sync="areamodel.f_price_name" :value-single="true"
158
- :options='pricenames' placeholder='气价名称'
159
- close-on-select >
160
- </v-select>
161
- </div>
162
- <div class="col-sm-6 form-group"
163
- >
164
- <label class="font_normal_body">气表品牌</label>
165
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand"
166
- >
167
- <v-select
168
- :value.sync="areamodel.f_meter_brand" :value-single="true"
169
- :options='meterbrands' placeholder='气表品牌'
170
- close-on-select >
171
- </v-select>
172
- </div>
173
- <div class="col-sm-6 form-group"
174
- >
175
- <label class="font_normal_body">气表型号</label>
176
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style"
177
- >
178
- <v-select
179
- :value.sync="areamodel.f_meter_style" :value-single="true"
180
- :options='meterstyle' placeholder='气表型号'
181
- close-on-select >
182
- </v-select>
183
- </div>
184
- <div class="col-sm-6 form-group">
185
- <label class="font_normal_body">安装位置</label>
186
- <v-select
187
- :value.sync="areamodel.f_position" :value-single="true"
188
- :options='positions' placeholder='安装位置'
189
- close-on-select >
190
- </v-select>
191
- </div>
192
- <div class="col-sm-6 form-group" >
193
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
194
- <!-- <input type="text" style="width:60%" class="input_search" v-show="false"
195
- v-validate:f_meter_book='{required: true }'
196
- v-model="areamodel.f_meter_book">-->
197
- <v-select
198
- :value.sync="areamodel.f_meter_book" :value-single="true"
199
- :options='meterbooks' placeholder='抄表册'
200
- close-on-select >
201
- </v-select>
202
- </div>
203
- <div class="col-sm-6 form-group" >
204
- <label class="font_normal_body">抄&ensp;表&ensp;员</label>
205
- <!-- <input type="text" style="width:60%" class="input_search"
206
- v-validate:f_inputtor='{required: true }'
207
- v-show="false" v-model="areamodel.f_inputtor">-->
208
- <v-select
209
- :value.sync="areamodel.f_inputtor" :value-single="true"
210
- :options='inputtores' placeholder='抄表员'
211
- close-on-select >
212
- </v-select>
213
- </div>
214
- <!-- <div class="col-sm-6 form-group">
215
- <label class="font_normal_body">调&ensp;压&ensp;箱</label>
216
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_adjustable_id">
217
- <v-select
218
- :value.sync="areamodel.f_adjustable_id" :value-single="true"
219
- :options='adjustables' placeholder='调压箱'
220
- close-on-select >
221
- </v-select>
222
- </div>-->
223
- <div class="col-sm-6 form-group">
224
- <label class="font_normal_body">房屋类型</label>
225
- <v-select
226
- :value.sync="areamodel.f_house_type" :value-single="true"
227
- :options='housetypeoptions' placeholder='房屋类型'
228
- close-on-select >
229
- </v-select>
230
- </div>
231
- </div>
232
- <div v-if="f_special" class="col-sm-6 form-group">
233
- <br/>
234
- </div>
235
- </div>
236
- <div class="row auto" style="text-align:right;">
237
- <button class="button_clear button_spacing" @click="fileUpload()">附件上传</button>
238
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
239
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
240
- </div>
241
- <!-- <div class="inp_button" type="button" @click="fileUpload()" v-show="!isupload">上传图片</div>-->
242
- </div>
243
- </validator>
244
- <modal :show.sync="showUpload" v-ref:modal backdrop="false" width="80%">
245
- <header slot="modal-header" class="modal-header">
246
- <button type="button" class="close" @click="close"><span>&times;</span></button>
247
- <h4 class="modal-title">附件上传</h4>
248
- </header>
249
- <article slot="modal-body" class="modal-body" style="height: 900px">
250
- <div class="form-group">
251
- <upload :blodid="areamodel.id" isremark="true" fusetype="areamodel.f_area_address"></upload>
252
- </div>
253
- </article>
254
- <footer slot="modal-footer" class="modal-footer">
255
- </footer>
256
- </modal>
257
- </div>
258
- </template>
259
-
260
- <script>
261
- import {HttpResetClass} from 'vue-client'
262
-
263
-
264
- let initGen = async function (self) {
265
- await self.initdata()
266
- await self.$LoadParams.loadMeterBook(self.f_filialeids)
267
- await self.loadMeterBooks();
268
- }
269
-
270
- export default {
271
- title: '小区添加',
272
- data () {
273
- return {
274
- //初始化省市区数据
275
- pcdslist:[],
276
- showUpload:'',//上传标识位
277
- //初始化街道数据
278
- streetslist:[],
279
- //小区
280
- areamodel: {
281
- f_area_id: '',
282
- f_pcd_id:'',
283
- f_linkname:'',
284
- f_linkphone:'',
285
- f_street_id:'',
286
- f_slice_area:'',
287
- f_adjustable_id:'',
288
- f_residential_area:'',
289
- f_user_type:'',
290
- f_gasproperties:'',
291
- f_meter_brand:'',
292
- f_price_name:'',
293
- f_area_address:'',
294
- f_price_type:'',
295
- f_meter_style:'',
296
- f_position:'',
297
- f_comments:''
298
- },
299
-
300
- meterbrands: [],
301
- adjustables: [],
302
- sliceArea: [],
303
- safeCheckArea: [],
304
- gasproperties: [],
305
- meterbooks:[{label: '全部',value: ''}],
306
- housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
307
- }
308
- },
309
- props: ['f_filialeids','f_special', 'areatype','row','operation','isupload'],
310
- ready(){
311
-
312
- // initGen(this)
313
-
314
- },
315
- methods: {
316
- loadMeterBooks(){
317
- this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
318
- },
319
- //初始化数据
320
- async initdata(){
321
- // 初始化参数
322
- await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
323
- await this.initSlice(this.f_filialeids)
324
- await this.initParams()
325
-
326
- // 初始化片区
327
-
328
-
329
- // await this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
330
- },
331
- // 打开文件上传对话框
332
- fileUpload() {
333
- this.showUpload = true
334
- },
335
- // 关闭文件上传对话框
336
- close() {
337
- this.showUpload = false
338
- // 将选的文件清空
339
- // this.$refs.file.$el.querySelector('input').value = ''
340
- // this.load(this)
341
- },
342
- initrow(val){
343
- this.areamodel.f_meter_book = val.f_meter_book;
344
- this.areamodel.f_adjustable_id = val.f_adjustable_id;
345
- },
346
- async initParams() {
347
- await this.$LoadParams.loadParam(this.f_filialeids)
348
- this.initBrands()
349
- this.initSafeCheckArea()
350
- // this.initAdjustables()
351
- },
352
-
353
- initBrands () {
354
- let ret = this.$GetSaleParam.getGasbrand()
355
- let rs = new Array()
356
- ret.forEach((item, index) =>{
357
- rs.push({label: item.label, value: item.value.f_meter_brand})
358
- })
359
- this.meterbrands = rs
360
- },
361
- async initSafeCheckArea () {
362
- this.safeCheckArea = []
363
- let data = {
364
- items: 'id,f_check_book_name',
365
- tablename: 't_check_book',
366
- orderitem: 'id',
367
- condition: `f_orgid=${this.$login.f.orgid}`
368
- }
369
- let ret = await this.$resetpost('rs/sql/address_singleTableOrderBy',{data: data},{resolveMsg: null, rejectMsg: null})
370
- ret.data.forEach(item => {
371
- this.safeCheckArea.push({label: item.f_check_book_name, value: item.id})
372
- })
373
- },
374
- /*
375
- initAdjustables () {
376
- let filter = this.$login.f.orgid
377
- let ret = this.$GetSaleParam.getAdjustable(filter)
378
- let arr = new Array()
379
- ret.forEach((item, index) => {
380
- arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
381
- })
382
- this.adjustables = arr
383
- },*/
384
-
385
- async initSlice (val) {
386
- if (val) {
387
- let getAllArea = await this.$resetpost('/rs/search', {
388
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
389
- userid: this.$login.f.id
390
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
391
-
392
- let arr = getAllArea.data.filter((res) => {
393
- return res.parentid == val
394
- })
395
- this.sliceArea = []
396
- arr.forEach((res) => {
397
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
398
- })
399
- }
400
- },
401
-
402
- //初始化省市区,添加街道
403
- async initpcds(pconditon){
404
- this.pcdslist = []
405
- let HttpReset = new HttpResetClass()
406
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTable', {
407
- data: {
408
- items: '*',
409
- tablename: 't_pcd',
410
- condition: pconditon
411
- }
412
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
413
- let redata = []
414
- req.data.forEach((row, n) => {
415
- redata[n] = {
416
- label: row.f_pcd,
417
- value: row.id,
418
- data:row,
419
- id:row.id
420
- }
421
- })
422
- this.pcdslist=redata
423
- },
424
- //初始化街道 添加小区
425
- async initstreets(pconditon){
426
- this.streetslist = []
427
- let HttpReset = new HttpResetClass()
428
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
429
- data: {
430
- items: '*',
431
- tablename: 't_street',
432
- orderitem: 'id',
433
- condition: pconditon
434
- }
435
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
436
- let redata = []
437
- req.data.forEach((row, n) => {
438
- redata[n] = {
439
- label: row.f_street,
440
- value: row.id,
441
- data:row,
442
- id:row.id
443
- }
444
- })
445
- this.streetslist=redata
446
- },
447
-
448
- async areaidChange () {
449
- // 验证小区编号是否已存在
450
-
451
- let param = {
452
- id: this.areamodel.id,
453
- f_area_id: this.areamodel.f_area_id,
454
- f_filialeid: this.f_filialeids
455
- }
456
-
457
- let res = await this.$resetpost('rs/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
458
- console.log('验证小区是否存在', res)
459
- if (res.data) {
460
- this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
461
- this.areamodel.f_area_id = ''
462
- }
463
-
464
- },
465
-
466
-
467
- //根据名字找数据
468
- findbyid(list,name){
469
- var result
470
- list.forEach((row, n) => {
471
- if(name==row.id){
472
- result= row.data
473
- }
474
- })
475
- return result
476
- },
477
- userTypeChange () {
478
- this.gasproperties = []
479
- if (this.areamodel.f_user_type) {
480
- this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
481
- }
482
- },
483
-
484
- //省/市/区变化
485
- async pcdChange(val){
486
- if(val){
487
- //那就把街道数据重新组织一下
488
- await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
489
- if(this.areamodel.f_street_id){
490
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
491
- let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
492
- if(pcd_id!=val){
493
- this.areamodel.f_street_id=''
494
- }
495
- } else {
496
- this.areamodel.f_street_id=''
497
- }
498
-
499
- }
500
- }
501
- this.$resetValidation()
502
- },
503
- //街道变化
504
- streetChange(val){
505
- if(val&&this.operation=='add'){
506
- // if(this.areamodel.f_pcd_id.length==0){
507
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
508
- console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
509
- console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
510
- this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
511
- }
512
- // }
513
- }
514
- this.$resetValidation()
515
- },
516
- //保存
517
- async confirm(){
518
- await this.savearea()
519
- this.cleardara()
520
- this.$dispatch('confirm')
521
- },
522
- //保存小区
523
- async savearea(){
524
- if(this.f_special){
525
- this.areamodel.f_special='1'
526
- }
527
- this.areamodel.f_filialeid = this.f_filialeids
528
- this.areamodel.f_operator = this.$login.f.name
529
- this.areamodel.f_operatorid = this.$login.f.id
530
- this.areamodel.f_orgid = this.$login.f.orgid
531
- this.areamodel.f_orgname = this.$login.f.orgs
532
- this.areamodel.f_depid = this.$login.f.depids
533
- this.areamodel.f_depname = this.$login.f.deps
534
- if (this.areamodel.slice_area) {
535
- if (this.areamodel.slice_area.length > 0) {
536
- this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
537
- this.areamodel.f_area_code = this.areamodel.slice_area[0].code
538
- }
539
- }
540
- this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
541
- this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
542
-
543
- await this.$resetpost('rs/logic/address_updatearea', this.areamodel)
544
- },
545
- cleardara(){
546
- this.areamodel= {
547
- f_area_id: '',
548
- f_pcd_id:'',
549
- f_street_id:'',
550
- f_slice_area:'',
551
- f_linkname:'',
552
- f_linkphone:'',
553
- f_adjustable_id:'',
554
- f_residential_area:'',
555
- f_user_type:'',
556
- f_gasproperties:'',
557
- f_area_address:'',
558
- f_meter_brand:'',
559
- f_price_name:'',
560
- f_price_type:'',
561
- f_meter_style:'',
562
- f_position:'',
563
- f_comments:''
564
- }
565
- },
566
- cancel(){
567
- this.cleardara()
568
- this.$dispatch('cancel')
569
- },
570
- },
571
- watch: {
572
- 'areatype'(){
573
- this.initdata()
574
- },
575
- 'areamodel.f_pcd_id'(){
576
- // if (!this.areamodel.f_area_address) {
577
- if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
578
- if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
579
- this.areamodel.f_area_address = this.areamodel.f_area_address? this.areamodel.f_area_address:this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
580
- }
581
- }
582
- // }
583
- },
584
- 'areamodel.f_street_id'(){
585
- // if (!this.areamodel.f_area_address) {
586
- if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
587
- if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
588
- this.areamodel.f_area_address = this.areamodel.f_area_address? this.areamodel.f_area_address:this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
589
- }
590
- }
591
- // }
592
- },
593
- 'f_filialeids'(){
594
- if (this.areamodel.f_filialeid) {
595
- if (this.areamodel.f_filialeid != this.f_filialeids) {
596
- this.$dispatch('cancel')
597
- }
598
- }
599
- this.cleardara()
600
- this.initdata()
601
- }
602
- },
603
- computed: {
604
- usertypes () {
605
- return this.$appdata.getParam('用户类型')
606
- },
607
- f_price_types () {
608
- return this.$appdata.getParam('气价类型')
609
- },
610
- meterstyle () {
611
- let ret = this.$GetSaleParam.getGasbrand()
612
- let rs = new Array()
613
- if(this.areamodel.f_meter_brand) {
614
- ret.forEach((item, index) => {
615
- if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
616
- item.value.gasmodel.forEach((item1, index) =>{
617
- rs.push({label: item1.label, value:item1.label})
618
- })
619
- }
620
- })
621
- }
622
- return rs
623
- },
624
- pricenames () {
625
- let rs = new Array()
626
- if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
627
- let params = {
628
- f_user_type: this.areamodel.f_user_type,
629
- f_gasproperties: this.areamodel.f_gasproperties,
630
- f_price_type: this.areamodel.f_price_type,
631
- filter: this.f_filialeids
632
- }
633
- let ret = this.$GetSaleParam.getPrice(params)
634
- ret.forEach((item, index) => {
635
- rs.push({label: item.label, value: item.value.f_price_name})
636
- })
637
- }
638
- if (rs.length == 0) {
639
- this.areamodel.f_price_name = ''
640
- }
641
- return rs
642
- },
643
- positions () {
644
- return this.$appdata.getParam('安装位置')
645
- },
646
- inputtores () {
647
- // 获取抄表员
648
- let rs = new Array()
649
- if (this.$login.f.f_gasman.length > 0) {
650
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
651
- let temp = {
652
- label: this.$login.f.f_gasman[i].name,
653
- value: this.$login.f.f_gasman[i].name
654
- }
655
- rs.push(temp)
656
- }
657
- }
658
- return rs
659
- },
660
- },
661
- }
662
- </script>
663
- <style>
664
- .box {
665
- width: 727px;
666
- height: 175px;
667
- border-radius: 2px;
668
- background-color: #fafafa;
669
- border: 1px solid #999999;
670
- margin-top: 13px;
671
- }
672
- .datapanel {
673
- color: #333;
674
- background-color: white;
675
- box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
676
- padding: 10px 30px 10px 30px;
677
- border-radius:15px;
678
- }
679
- </style>
1
+ <template>
2
+ <div class="span">
3
+ <validator name='v'>
4
+ <div class="form-horizontal select-overspread container-fluid" style="overflow-y: auto">
5
+ <div class="row auto">
6
+ <div class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
7
+ <span v-if="operation=='add'&&!f_specia">添加{{areatype}}</span>
8
+ <span v-if="operation=='modify'&&!f_special">修改【{{areamodel.f_residential_area}}】小区</span>
9
+ <span v-if="operation=='add'&&f_specia">添加{{areatype}}</span>
10
+ <span v-if="operation=='modify'&&f_special">修改【{{areamodel.f_residential_area}}】单位</span>
11
+ </div>
12
+ <!--基本小区(单位)信息-->
13
+ <div class="col-sm-6 form-group">
14
+ <label class="font_normal_body">小区编号</label>
15
+ <input type="text" class="input_search" style="width:60%" v-model="areamodel.f_area_id"
16
+ @blur="areaidChange" placeholder="小区编号">
17
+ </div>
18
+
19
+ <div class="col-sm-6 form-group"
20
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
21
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
22
+ <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id"
23
+ v-validate:f_pcd_id='{required: true }'>
24
+ <v-select
25
+ :value.sync="areamodel.f_pcd_id" :value-single="true"
26
+ :options='pcdslist' placeholder='请选择'
27
+ close-on-select search="true" @change="pcdChange">
28
+ </v-select>
29
+ </div>
30
+ <div class="col-sm-6 form-group"
31
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
32
+ <label class="font_normal_body">街道名称</label>
33
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
34
+ v-validate:f_street_id='{required: true }'>
35
+ <v-select
36
+ :value.sync="areamodel.f_street_id" :value-single="true"
37
+ :options='streetslist' placeholder='请选择'
38
+ close-on-select search="true" @change="streetChange">
39
+ </v-select>
40
+ </div>
41
+ <div class="col-sm-6 form-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
42
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
43
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
44
+ v-validate:slice='{required: true }'>
45
+ <v-select :value.sync="areamodel.slice_area" v-model="areamodel.slice_area"
46
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
47
+ close-on-select v-ref:slice>
48
+ </v-select>
49
+ </div>
50
+ <!--小区(特殊)信息-->
51
+ <div v-if="!f_special"
52
+ class="col-sm-6 form-group"
53
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
54
+ <label class="font_normal_body">小区名称</label>
55
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
56
+ class="form-control" placeholder="小区名称"
57
+ v-validate:f_residential_area='{required: true }'>
58
+ </div>
59
+ <div class="col-sm-6 form-group"
60
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
61
+ <label class="font_normal_body">安检片区</label>
62
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_check_book_id"
63
+ v-validate:f_street_id='{required: true }'>
64
+ <v-select
65
+ :value.sync="areamodel.f_check_book_id" :value-single="true"
66
+ :options='safeCheckArea' placeholder='请选择'
67
+ close-on-select search="true">
68
+ </v-select>
69
+ </div>
70
+ <div v-if="!f_special"
71
+ class="col-sm-12 form-group">
72
+ <label class="font_normal_body">小区地址</label>
73
+ <input type="text" style="width:80%" class="input_search" v-model="areamodel.f_area_address"
74
+ class="form-control" placeholder="小区地址">
75
+ </div>
76
+ <!--单位(特殊)信息-->
77
+ <div v-if="f_special"
78
+ class="col-sm-6 form-group"
79
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
80
+ <label class="font_normal_body">单位名称</label>
81
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
82
+ class="form-control" placeholder="单位名称"
83
+ v-validate:f_residential_area='{required: true }'>
84
+ </div>
85
+ <div v-if="f_special"
86
+ class="col-sm-12 form-group">
87
+ <label class="font_normal_body">单位地址</label>
88
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_area_address"
89
+ class="form-control" placeholder="单位地址">
90
+ </div>
91
+ <div
92
+ class="col-sm-6 form-group"
93
+ :class="[$v.f_linkname.required ? 'has-error' : 'has-success']">
94
+ <label class="font_normal_body">联&ensp;系&ensp;人</label>
95
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkname"
96
+ class="form-control" placeholder="联系人"
97
+ v-validate:f_linkname='{required: true }'>
98
+ </div>
99
+ <div
100
+ class="col-sm-6 form-group"
101
+ :class="[$v.f_linkphone.required ? 'has-error' : 'has-success']">
102
+ <label class="font_normal_body">联系电话</label>
103
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkphone"
104
+ class="form-control" placeholder="联系电话"
105
+ v-validate:f_linkphone='{required: true }'>
106
+ </div>
107
+ <div class="col-sm-12 form-group">
108
+ <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
109
+ <textarea class="input_textarea" rows="3" style="margin-top:20px;width:80%;height: auto;" v-model="areamodel.f_comments"></textarea>
110
+ </div>
111
+ <div class="col-sm-12 form-group">
112
+ <br/>
113
+ </div>
114
+ <!--表具信息-->
115
+ <div v-if="!f_special" class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
116
+ <span >默认表具信息</span>
117
+ </div>
118
+ <div v-if="!f_special" class="row">
119
+ <div class="col-sm-6 form-group">
120
+ <label class="font_normal_body">用户类型</label>
121
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type"
122
+ >
123
+ <v-select
124
+ :value.sync="areamodel.f_user_type" :value-single="true"
125
+ :options='usertypes' placeholder='用户类型' @change="userTypeChange"
126
+ close-on-select >
127
+ </v-select>
128
+ </div>
129
+ <div class="col-sm-6 form-group"
130
+ >
131
+ <label class="font_normal_body">用气性质</label>
132
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties"
133
+ >
134
+ <v-select
135
+ :value.sync="areamodel.f_gasproperties" :value-single="true"
136
+ :options='gasproperties' placeholder='用气性质'
137
+ close-on-select >
138
+ </v-select>
139
+ </div>
140
+ <div class="col-sm-6 form-group"
141
+ >
142
+ <label class="font_normal_body">气价类型</label>
143
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type"
144
+ >
145
+ <v-select
146
+ :value.sync="areamodel.f_price_type" :value-single="true"
147
+ :options='f_price_types' placeholder='气价类型'
148
+ close-on-select >
149
+ </v-select>
150
+ </div>
151
+ <div class="col-sm-6 form-group"
152
+ >
153
+ <label class="font_normal_body">气价名称</label>
154
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name"
155
+ >
156
+ <v-select
157
+ :value.sync="areamodel.f_price_name" :value-single="true"
158
+ :options='pricenames' placeholder='气价名称'
159
+ close-on-select >
160
+ </v-select>
161
+ </div>
162
+ <div class="col-sm-6 form-group"
163
+ >
164
+ <label class="font_normal_body">气表品牌</label>
165
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand"
166
+ >
167
+ <v-select
168
+ :value.sync="areamodel.f_meter_brand" :value-single="true"
169
+ :options='meterbrands' placeholder='气表品牌'
170
+ close-on-select >
171
+ </v-select>
172
+ </div>
173
+ <div class="col-sm-6 form-group"
174
+ >
175
+ <label class="font_normal_body">气表型号</label>
176
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style"
177
+ >
178
+ <v-select
179
+ :value.sync="areamodel.f_meter_style" :value-single="true"
180
+ :options='meterstyle' placeholder='气表型号'
181
+ close-on-select >
182
+ </v-select>
183
+ </div>
184
+ <div class="col-sm-6 form-group">
185
+ <label class="font_normal_body">安装位置</label>
186
+ <v-select
187
+ :value.sync="areamodel.f_position" :value-single="true"
188
+ :options='positions' placeholder='安装位置'
189
+ close-on-select >
190
+ </v-select>
191
+ </div>
192
+ <div class="col-sm-6 form-group" >
193
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
194
+ <!-- <input type="text" style="width:60%" class="input_search" v-show="false"
195
+ v-validate:f_meter_book='{required: true }'
196
+ v-model="areamodel.f_meter_book">-->
197
+ <v-select
198
+ :value.sync="areamodel.f_meter_book" :value-single="true"
199
+ :options='meterbooks' placeholder='抄表册'
200
+ close-on-select >
201
+ </v-select>
202
+ </div>
203
+ <div class="col-sm-6 form-group" >
204
+ <label class="font_normal_body">抄&ensp;表&ensp;员</label>
205
+ <!-- <input type="text" style="width:60%" class="input_search"
206
+ v-validate:f_inputtor='{required: true }'
207
+ v-show="false" v-model="areamodel.f_inputtor">-->
208
+ <v-select
209
+ :value.sync="areamodel.f_inputtor" :value-single="true"
210
+ :options='inputtores' placeholder='抄表员'
211
+ close-on-select >
212
+ </v-select>
213
+ </div>
214
+ <!-- <div class="col-sm-6 form-group">
215
+ <label class="font_normal_body">调&ensp;压&ensp;箱</label>
216
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_adjustable_id">
217
+ <v-select
218
+ :value.sync="areamodel.f_adjustable_id" :value-single="true"
219
+ :options='adjustables' placeholder='调压箱'
220
+ close-on-select >
221
+ </v-select>
222
+ </div>-->
223
+ <div class="col-sm-6 form-group">
224
+ <label class="font_normal_body">房屋类型</label>
225
+ <v-select
226
+ :value.sync="areamodel.f_house_type" :value-single="true"
227
+ :options='housetypeoptions' placeholder='房屋类型'
228
+ close-on-select >
229
+ </v-select>
230
+ </div>
231
+ </div>
232
+ <div v-if="f_special" class="col-sm-6 form-group">
233
+ <br/>
234
+ </div>
235
+ </div>
236
+ <div class="row auto" style="text-align:right;">
237
+ <button class="button_clear button_spacing" @click="fileUpload()">附件上传</button>
238
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
239
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
240
+ </div>
241
+ <!-- <div class="inp_button" type="button" @click="fileUpload()" v-show="!isupload">上传图片</div>-->
242
+ </div>
243
+ </validator>
244
+ <modal :show.sync="showUpload" v-ref:modal backdrop="false" width="80%">
245
+ <header slot="modal-header" class="modal-header">
246
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
247
+ <h4 class="modal-title">附件上传</h4>
248
+ </header>
249
+ <article slot="modal-body" class="modal-body" style="height: 900px">
250
+ <div class="form-group">
251
+ <upload :blodid="areamodel.id" isremark="true" fusetype="areamodel.f_area_address"></upload>
252
+ </div>
253
+ </article>
254
+ <footer slot="modal-footer" class="modal-footer">
255
+ </footer>
256
+ </modal>
257
+ </div>
258
+ </template>
259
+
260
+ <script>
261
+ import {HttpResetClass} from 'vue-client'
262
+
263
+
264
+ let initGen = async function (self) {
265
+ await self.initdata()
266
+ await self.$LoadParams.loadMeterBook(self.f_filialeids)
267
+ await self.loadMeterBooks();
268
+ }
269
+
270
+ export default {
271
+ title: '小区添加',
272
+ data () {
273
+ return {
274
+ //初始化省市区数据
275
+ pcdslist:[],
276
+ showUpload:'',//上传标识位
277
+ //初始化街道数据
278
+ streetslist:[],
279
+ //小区
280
+ areamodel: {
281
+ f_area_id: '',
282
+ f_pcd_id:'',
283
+ f_linkname:'',
284
+ f_linkphone:'',
285
+ f_street_id:'',
286
+ f_slice_area:'',
287
+ f_adjustable_id:'',
288
+ f_residential_area:'',
289
+ f_user_type:'',
290
+ f_gasproperties:'',
291
+ f_meter_brand:'',
292
+ f_price_name:'',
293
+ f_area_address:'',
294
+ f_price_type:'',
295
+ f_meter_style:'',
296
+ f_position:'',
297
+ f_comments:''
298
+ },
299
+
300
+ meterbrands: [],
301
+ adjustables: [],
302
+ sliceArea: [],
303
+ safeCheckArea: [],
304
+ gasproperties: [],
305
+ meterbooks:[{label: '全部',value: ''}],
306
+ housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
307
+ }
308
+ },
309
+ props: ['f_filialeids','f_special', 'areatype','row','operation','isupload'],
310
+ ready(){
311
+
312
+ // initGen(this)
313
+
314
+ },
315
+ methods: {
316
+ loadMeterBooks(){
317
+ this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
318
+ },
319
+ //初始化数据
320
+ async initdata(){
321
+ // 初始化参数
322
+ await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
323
+ await this.initSlice(this.f_filialeids)
324
+ await this.initParams()
325
+
326
+ // 初始化片区
327
+
328
+
329
+ // await this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
330
+ },
331
+ // 打开文件上传对话框
332
+ fileUpload() {
333
+ this.showUpload = true
334
+ },
335
+ // 关闭文件上传对话框
336
+ close() {
337
+ this.showUpload = false
338
+ // 将选的文件清空
339
+ // this.$refs.file.$el.querySelector('input').value = ''
340
+ // this.load(this)
341
+ },
342
+ initrow(val){
343
+ this.areamodel.f_meter_book = val.f_meter_book;
344
+ this.areamodel.f_adjustable_id = val.f_adjustable_id;
345
+ },
346
+ async initParams() {
347
+ await this.$LoadParams.loadParam(this.f_filialeids)
348
+ this.initBrands()
349
+ this.initSafeCheckArea()
350
+ // this.initAdjustables()
351
+ },
352
+
353
+ initBrands () {
354
+ let ret = this.$GetSaleParam.getGasbrand()
355
+ let rs = new Array()
356
+ ret.forEach((item, index) =>{
357
+ rs.push({label: item.label, value: item.value.f_meter_brand})
358
+ })
359
+ this.meterbrands = rs
360
+ },
361
+ async initSafeCheckArea () {
362
+ this.safeCheckArea = []
363
+ let data = {
364
+ items: 'id,f_check_book_name',
365
+ tablename: 't_check_book',
366
+ orderitem: 'id',
367
+ condition: `f_orgid=${this.$login.f.orgid}`
368
+ }
369
+ let ret = await this.$resetpost('rs/sql/address_singleTableOrderBy',{data: data},{resolveMsg: null, rejectMsg: null})
370
+ ret.data.forEach(item => {
371
+ this.safeCheckArea.push({label: item.f_check_book_name, value: item.id})
372
+ })
373
+ },
374
+ /*
375
+ initAdjustables () {
376
+ let filter = this.$login.f.orgid
377
+ let ret = this.$GetSaleParam.getAdjustable(filter)
378
+ let arr = new Array()
379
+ ret.forEach((item, index) => {
380
+ arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
381
+ })
382
+ this.adjustables = arr
383
+ },*/
384
+
385
+ async initSlice (val) {
386
+ if (val) {
387
+ let getAllArea = await this.$resetpost('/rs/search', {
388
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
389
+ userid: this.$login.f.id
390
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
391
+
392
+ let arr = getAllArea.data.filter((res) => {
393
+ return res.parentid == val
394
+ })
395
+ this.sliceArea = []
396
+ arr.forEach((res) => {
397
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
398
+ })
399
+ }
400
+ },
401
+
402
+ //初始化省市区,添加街道
403
+ async initpcds(pconditon){
404
+ this.pcdslist = []
405
+ let HttpReset = new HttpResetClass()
406
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTable', {
407
+ data: {
408
+ items: '*',
409
+ tablename: 't_pcd',
410
+ condition: pconditon
411
+ }
412
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
413
+ let redata = []
414
+ req.data.forEach((row, n) => {
415
+ redata[n] = {
416
+ label: row.f_pcd,
417
+ value: row.id,
418
+ data:row,
419
+ id:row.id
420
+ }
421
+ })
422
+ this.pcdslist=redata
423
+ },
424
+ //初始化街道 添加小区
425
+ async initstreets(pconditon){
426
+ this.streetslist = []
427
+ let HttpReset = new HttpResetClass()
428
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
429
+ data: {
430
+ items: '*',
431
+ tablename: 't_street',
432
+ orderitem: 'id',
433
+ condition: pconditon
434
+ }
435
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
436
+ let redata = []
437
+ req.data.forEach((row, n) => {
438
+ redata[n] = {
439
+ label: row.f_street,
440
+ value: row.id,
441
+ data:row,
442
+ id:row.id
443
+ }
444
+ })
445
+ this.streetslist=redata
446
+ },
447
+
448
+ async areaidChange () {
449
+ // 验证小区编号是否已存在
450
+
451
+ let param = {
452
+ id: this.areamodel.id,
453
+ f_area_id: this.areamodel.f_area_id,
454
+ f_filialeid: this.f_filialeids
455
+ }
456
+
457
+ let res = await this.$resetpost('rs/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
458
+ console.log('验证小区是否存在', res)
459
+ if (res.data) {
460
+ this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
461
+ this.areamodel.f_area_id = ''
462
+ }
463
+
464
+ },
465
+
466
+
467
+ //根据名字找数据
468
+ findbyid(list,name){
469
+ var result
470
+ list.forEach((row, n) => {
471
+ if(name==row.id){
472
+ result= row.data
473
+ }
474
+ })
475
+ return result
476
+ },
477
+ userTypeChange () {
478
+ this.gasproperties = []
479
+ if (this.areamodel.f_user_type) {
480
+ this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
481
+ }
482
+ },
483
+
484
+ //省/市/区变化
485
+ async pcdChange(val){
486
+ if(val){
487
+ //那就把街道数据重新组织一下
488
+ await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
489
+ if(this.areamodel.f_street_id){
490
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
491
+ let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
492
+ if(pcd_id!=val){
493
+ this.areamodel.f_street_id=''
494
+ }
495
+ } else {
496
+ this.areamodel.f_street_id=''
497
+ }
498
+
499
+ }
500
+ }
501
+ this.$resetValidation()
502
+ },
503
+ //街道变化
504
+ streetChange(val){
505
+ if(val&&this.operation=='add'){
506
+ // if(this.areamodel.f_pcd_id.length==0){
507
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
508
+ console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
509
+ console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
510
+ this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
511
+ }
512
+ // }
513
+ }
514
+ this.$resetValidation()
515
+ },
516
+ //保存
517
+ async confirm(){
518
+ await this.savearea()
519
+ this.cleardara()
520
+ this.$dispatch('confirm')
521
+ },
522
+ //保存小区
523
+ async savearea(){
524
+ if(this.f_special){
525
+ this.areamodel.f_special='1'
526
+ }
527
+ this.areamodel.f_filialeid = this.f_filialeids
528
+ this.areamodel.f_operator = this.$login.f.name
529
+ this.areamodel.f_operatorid = this.$login.f.id
530
+ this.areamodel.f_orgid = this.$login.f.orgid
531
+ this.areamodel.f_orgname = this.$login.f.orgs
532
+ this.areamodel.f_depid = this.$login.f.depids
533
+ this.areamodel.f_depname = this.$login.f.deps
534
+ if (this.areamodel.slice_area) {
535
+ if (this.areamodel.slice_area.length > 0) {
536
+ this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
537
+ this.areamodel.f_area_code = this.areamodel.slice_area[0].code
538
+ }
539
+ }
540
+ this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
541
+ this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
542
+
543
+ await this.$resetpost('rs/logic/address_updatearea', this.areamodel)
544
+ },
545
+ cleardara(){
546
+ this.areamodel= {
547
+ f_area_id: '',
548
+ f_pcd_id:'',
549
+ f_street_id:'',
550
+ f_slice_area:'',
551
+ f_linkname:'',
552
+ f_linkphone:'',
553
+ f_adjustable_id:'',
554
+ f_residential_area:'',
555
+ f_user_type:'',
556
+ f_gasproperties:'',
557
+ f_area_address:'',
558
+ f_meter_brand:'',
559
+ f_price_name:'',
560
+ f_price_type:'',
561
+ f_meter_style:'',
562
+ f_position:'',
563
+ f_comments:''
564
+ }
565
+ },
566
+ cancel(){
567
+ this.cleardara()
568
+ this.$dispatch('cancel')
569
+ },
570
+ },
571
+ watch: {
572
+ 'areatype'(){
573
+ this.initdata()
574
+ },
575
+ 'areamodel.f_pcd_id'(){
576
+ // if (!this.areamodel.f_area_address) {
577
+ if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
578
+ if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
579
+ this.areamodel.f_area_address = this.areamodel.f_area_address? this.areamodel.f_area_address:this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
580
+ }
581
+ }
582
+ // }
583
+ },
584
+ 'areamodel.f_street_id'(){
585
+ // if (!this.areamodel.f_area_address) {
586
+ if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
587
+ if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
588
+ this.areamodel.f_area_address = this.areamodel.f_area_address? this.areamodel.f_area_address:this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
589
+ }
590
+ }
591
+ // }
592
+ },
593
+ 'f_filialeids'(){
594
+ if (this.areamodel.f_filialeid) {
595
+ if (this.areamodel.f_filialeid != this.f_filialeids) {
596
+ this.$dispatch('cancel')
597
+ }
598
+ }
599
+ this.cleardara()
600
+ this.initdata()
601
+ }
602
+ },
603
+ computed: {
604
+ usertypes () {
605
+ return this.$appdata.getParam('用户类型')
606
+ },
607
+ f_price_types () {
608
+ return this.$appdata.getParam('气价类型')
609
+ },
610
+ meterstyle () {
611
+ let ret = this.$GetSaleParam.getGasbrand()
612
+ let rs = new Array()
613
+ if(this.areamodel.f_meter_brand) {
614
+ ret.forEach((item, index) => {
615
+ if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
616
+ item.value.gasmodel.forEach((item1, index) =>{
617
+ rs.push({label: item1.label, value:item1.label})
618
+ })
619
+ }
620
+ })
621
+ }
622
+ return rs
623
+ },
624
+ pricenames () {
625
+ let rs = new Array()
626
+ if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
627
+ let params = {
628
+ f_user_type: this.areamodel.f_user_type,
629
+ f_gasproperties: this.areamodel.f_gasproperties,
630
+ f_price_type: this.areamodel.f_price_type,
631
+ filter: this.f_filialeids
632
+ }
633
+ let ret = this.$GetSaleParam.getPrice(params)
634
+ ret.forEach((item, index) => {
635
+ rs.push({label: item.label, value: item.value.f_price_name})
636
+ })
637
+ }
638
+ if (rs.length == 0) {
639
+ this.areamodel.f_price_name = ''
640
+ }
641
+ return rs
642
+ },
643
+ positions () {
644
+ return this.$appdata.getParam('安装位置')
645
+ },
646
+ inputtores () {
647
+ // 获取抄表员
648
+ let rs = new Array()
649
+ if (this.$login.f.f_gasman.length > 0) {
650
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
651
+ let temp = {
652
+ label: this.$login.f.f_gasman[i].name,
653
+ value: this.$login.f.f_gasman[i].name
654
+ }
655
+ rs.push(temp)
656
+ }
657
+ }
658
+ return rs
659
+ },
660
+ },
661
+ }
662
+ </script>
663
+ <style>
664
+ .box {
665
+ width: 727px;
666
+ height: 175px;
667
+ border-radius: 2px;
668
+ background-color: #fafafa;
669
+ border: 1px solid #999999;
670
+ margin-top: 13px;
671
+ }
672
+ .datapanel {
673
+ color: #333;
674
+ background-color: white;
675
+ box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
676
+ padding: 10px 30px 10px 30px;
677
+ border-radius:15px;
678
+ }
679
+ </style>