address-client 3.2.89 → 3.2.91

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,745 +1,745 @@
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" :class="[$v.f_user_usetype.required ? 'has-error' : 'has-success']">
120
- <label for="f_user_usetype" class="font_normal_body ">用气类型</label>
121
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_usetype"
122
- v-validate:f_user_usetype='{required: true }'>
123
- <v-select :value.sync="areamodel.f_user_usetype" :search="false"
124
- @change="userUseTypeChange()"
125
- :value-single="true"
126
- :options='userusetypes' placeholder='用气类型' close-on-select>
127
- </v-select>
128
- </div>
129
- <div class="col-sm-6 form-group" :class="[$v.f_use_institution.required ? 'has-error' : 'has-success']">
130
- <label for="f_use_institution" class="font_normal_body">用气机构</label>
131
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_use_institution"
132
- v-validate:f_use_institution='{required: true }'>
133
- <v-select :value.sync="areamodel.f_use_institution" :search="false"
134
- @change="userUseInstitutionChange()" :value-single="true"
135
- :options='useinstitutions' placeholder='用气机构' close-on-select>
136
- </v-select>
137
- </div>
138
- <div class="col-sm-6 form-group" :class="[$v.f_user_usenature.required ? 'has-error' : 'has-success']">
139
- <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
140
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_usenature"
141
- v-validate:f_user_usenature='{required: true }'>
142
- <v-select :value.sync="areamodel.f_user_usenature" :search="false"
143
- :value-single="true"
144
- :options='userusenatures' placeholder='使用性质' close-on-select>
145
- </v-select>
146
- </div>
147
- <div class="col-sm-6 form-group" style="text-align:right;">
148
- <button class="button_clear button_spacing" v-if="!configShow" @click="changeConfig()">更多默认</button>
149
- <button class="button_clear button_spacing" v-if="configShow" @click="changeConfig()">收起更多</button>
150
- </div>
151
- </div>
152
-
153
- <div v-if="!f_special && configShow" class="row">
154
- <div class="col-sm-6 form-group">
155
- <label class="font_normal_body">用户类型</label>
156
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type"
157
- >
158
- <v-select
159
- :value.sync="areamodel.f_user_type" :value-single="true"
160
- :options='usertypes' placeholder='用户类型' @change="userTypeChange"
161
- close-on-select >
162
- </v-select>
163
- </div>
164
- <div class="col-sm-6 form-group"
165
- >
166
- <label class="font_normal_body">用气性质</label>
167
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties"
168
- >
169
- <v-select
170
- :value.sync="areamodel.f_gasproperties" :value-single="true"
171
- :options='gasproperties' placeholder='用气性质'
172
- close-on-select >
173
- </v-select>
174
- </div>
175
- <div class="col-sm-6 form-group"
176
- >
177
- <label class="font_normal_body">气价类型</label>
178
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type"
179
- >
180
- <v-select
181
- :value.sync="areamodel.f_price_type" :value-single="true"
182
- :options='f_price_types' placeholder='气价类型'
183
- close-on-select >
184
- </v-select>
185
- </div>
186
- <div class="col-sm-6 form-group"
187
- >
188
- <label class="font_normal_body">气价名称</label>
189
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name"
190
- >
191
- <v-select
192
- :value.sync="areamodel.f_price_name" :value-single="true"
193
- :options='pricenames' placeholder='气价名称'
194
- close-on-select >
195
- </v-select>
196
- </div>
197
- <div class="col-sm-6 form-group"
198
- >
199
- <label class="font_normal_body">气表品牌</label>
200
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand"
201
- >
202
- <v-select
203
- :value.sync="areamodel.f_meter_brand" :value-single="true"
204
- :options='meterbrands' placeholder='气表品牌'
205
- close-on-select >
206
- </v-select>
207
- </div>
208
- <div class="col-sm-6 form-group"
209
- >
210
- <label class="font_normal_body">气表型号</label>
211
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style"
212
- >
213
- <v-select
214
- :value.sync="areamodel.f_meter_style" :value-single="true"
215
- :options='meterstyle' placeholder='气表型号'
216
- close-on-select >
217
- </v-select>
218
- </div>
219
- <div class="col-sm-6 form-group">
220
- <label class="font_normal_body">安装位置</label>
221
- <v-select
222
- :value.sync="areamodel.f_position" :value-single="true"
223
- :options='positions' placeholder='安装位置'
224
- close-on-select >
225
- </v-select>
226
- </div>
227
- <div class="col-sm-6 form-group" >
228
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
229
- <!-- <input type="text" style="width:60%" class="input_search" v-show="false"
230
- v-validate:f_meter_book='{required: true }'
231
- v-model="areamodel.f_meter_book">-->
232
- <v-select
233
- :value.sync="areamodel.f_meter_book" :value-single="true"
234
- :options='meterbooks' placeholder='抄表册'
235
- close-on-select >
236
- </v-select>
237
- </div>
238
- <div class="col-sm-6 form-group" >
239
- <label class="font_normal_body">抄&ensp;表&ensp;员</label>
240
- <!-- <input type="text" style="width:60%" class="input_search"
241
- v-validate:f_inputtor='{required: true }'
242
- v-show="false" v-model="areamodel.f_inputtor">-->
243
- <v-select
244
- :value.sync="areamodel.f_inputtor" :value-single="true"
245
- :options='inputtores' placeholder='抄表员'
246
- close-on-select >
247
- </v-select>
248
- </div>
249
- <!-- <div class="col-sm-6 form-group">
250
- <label class="font_normal_body">调&ensp;压&ensp;箱</label>
251
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_adjustable_id">
252
- <v-select
253
- :value.sync="areamodel.f_adjustable_id" :value-single="true"
254
- :options='adjustables' placeholder='调压箱'
255
- close-on-select >
256
- </v-select>
257
- </div>-->
258
- <div class="col-sm-6 form-group">
259
- <label class="font_normal_body">房屋类型</label>
260
- <v-select
261
- :value.sync="areamodel.f_house_type" :value-single="true"
262
- :options='housetypeoptions' placeholder='房屋类型'
263
- close-on-select >
264
- </v-select>
265
- </div>
266
- </div>
267
- <div v-if="f_special" class="col-sm-6 form-group">
268
- <br/>
269
- </div>
270
- </div>
271
- <div class="row auto" style="text-align:right;">
272
- <button class="button_clear button_spacing" @click="fileUpload()">附件上传</button>
273
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
274
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
275
- </div>
276
- <!-- <div class="inp_button" type="button" @click="fileUpload()" v-show="!isupload">上传图片</div>-->
277
- </div>
278
- </validator>
279
- <modal :show.sync="showUpload" v-ref:modal backdrop="false" width="80%">
280
- <header slot="modal-header" class="modal-header">
281
- <button type="button" class="close" @click="close"><span>&times;</span></button>
282
- <h4 class="modal-title">附件上传</h4>
283
- </header>
284
- <article slot="modal-body" class="modal-body" style="height: 900px">
285
- <div class="form-group">
286
- <upload :blodid="areamodel.id" isremark="true" fusetype="areamodel.f_area_address"></upload>
287
- </div>
288
- </article>
289
- <footer slot="modal-footer" class="modal-footer">
290
- </footer>
291
- </modal>
292
- </div>
293
- </template>
294
-
295
- <script>
296
- import {HttpResetClass} from 'vue-client'
297
-
298
-
299
- let initGen = async function (self) {
300
- await self.initdata()
301
- try {
302
- await self.$LoadParams.loadMeterBook(self.f_filialeids)
303
-
304
- }catch (e) {
305
-
306
- }
307
- try {
308
- await self.loadMeterBooks();
309
- }catch (e) {
310
-
311
- }
312
- }
313
-
314
- export default {
315
- title: '小区添加',
316
- data () {
317
- return {
318
- //初始化省市区数据
319
- pcdslist:[],
320
- showUpload:'',//上传标识位
321
- configShow: false,
322
- //初始化街道数据
323
- streetslist:[],
324
- //小区
325
- areamodel: {
326
- f_area_id: '',
327
- f_pcd_id:'',
328
- f_linkname:'',
329
- f_linkphone:'',
330
- f_street_id:'',
331
- f_slice_area:'',
332
- f_adjustable_id:'',
333
- f_residential_area:'',
334
- f_user_type:'',
335
- f_gasproperties:'',
336
- f_use_institution:'',
337
- f_user_usetype:'居民用气',
338
- f_user_usenature:'生活用气',
339
- f_meter_brand:'',
340
- f_price_name:'',
341
- f_area_address:'',
342
- f_price_type:'',
343
- f_meter_style:'',
344
- f_position:'',
345
- f_comments:''
346
- },
347
- useinstitutions:[],
348
- userusenatures:[],
349
- meterbrands: [],
350
- adjustables: [],
351
- sliceArea: [],
352
- safeCheckArea: [],
353
- gasproperties: [],
354
- meterbooks:[{label: '全部',value: ''}],
355
- housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
356
- }
357
- },
358
- props: ['f_filialeids','f_special', 'areatype','row','operation','isupload'],
359
- ready(){
360
- initGen(this)
361
- },
362
- methods: {
363
- // 更多默认
364
- changeConfig(){
365
- this.configShow = !this.configShow
366
- },
367
- userUseInstitutionChange () {
368
- this.userusenatures = []
369
- let str = this.areamodel.f_use_institution+ '使用性质'
370
- this.userusenatures = this.$appdata.getParam(str)
371
- },
372
- userUseTypeChange () {
373
- console.log('看看进来用户用气类型变化的方法了吗???')
374
- this.useinstitutions = []
375
- let str = this.areamodel.f_user_usetype + '机构'
376
- this.useinstitutions = this.$appdata.getParam(str)
377
- },
378
- loadMeterBooks(){
379
- this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
380
- },
381
- //初始化数据
382
- async initdata(){
383
- // 初始化参数
384
- await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
385
- await this.initSlice(this.f_filialeids)
386
- await this.initParams()
387
- // 初始化片区
388
- // await this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
389
- },
390
- // 打开文件上传对话框
391
- fileUpload() {
392
- this.showUpload = true
393
- },
394
- // 关闭文件上传对话框
395
- close() {
396
- this.showUpload = false
397
- // 将选的文件清空
398
- // this.$refs.file.$el.querySelector('input').value = ''
399
- // this.load(this)
400
- },
401
- initrow(val){
402
- this.areamodel.f_meter_book = val.f_meter_book;
403
- this.areamodel.f_adjustable_id = val.f_adjustable_id;
404
- },
405
- async initParams() {
406
- try {
407
- await this.$LoadParams.loadParam(this.f_filialeids)
408
- }catch (e) {
409
-
410
- }
411
- this.initBrands()
412
- await this.initSafeCheckArea()
413
- // this.initAdjustables()
414
- },
415
-
416
- initBrands () {
417
- let ret = []
418
- try {
419
- ret = this.$GetSaleParam.getGasbrand()
420
- } catch(e){}
421
- // let ret = this.$GetSaleParam.getGasbrand()
422
- let rs = new Array()
423
- ret.forEach((item, index) =>{
424
- rs.push({label: item.label, value: item.value.f_meter_brand})
425
- })
426
- this.meterbrands = rs
427
- },
428
- async initSafeCheckArea () {
429
- this.safeCheckArea = []
430
- let data = {
431
- items: 'id,f_check_book_name',
432
- tablename: 't_check_book',
433
- orderitem: 'id',
434
- condition: `f_orgid=${this.$login.f.orgid}`
435
- }
436
- let ret = await this.$resetpost('rs/sql/address_singleTableOrderBy',{data: data},{resolveMsg: null, rejectMsg: null,newly:true})
437
- ret.data.forEach(item => {
438
- this.safeCheckArea.push({label: item.f_check_book_name, value: item.id})
439
- })
440
- },
441
- /*
442
- initAdjustables () {
443
- let filter = this.$login.f.orgid
444
- let ret = this.$GetSaleParam.getAdjustable(filter)
445
- let arr = new Array()
446
- ret.forEach((item, index) => {
447
- arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
448
- })
449
- this.adjustables = arr
450
- },*/
451
-
452
- async initSlice (val) {
453
- if (val) {
454
- let getAllArea = await this.$resetpost('/rs/search', {
455
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
456
- userid: this.$login.f.id
457
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!',newly:true})
458
-
459
- let arr = getAllArea.data.filter((res) => {
460
- return res.parentid == val
461
- })
462
- this.sliceArea = []
463
- arr.forEach((res) => {
464
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
465
- })
466
- }
467
- },
468
-
469
- //初始化省市区,添加街道
470
- async initpcds(pconditon){
471
- this.pcdslist = []
472
- let HttpReset = new HttpResetClass()
473
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTable', {
474
- data: {
475
- items: '*',
476
- tablename: 't_pcd',
477
- condition: pconditon
478
- }
479
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
480
- let redata = []
481
- req.data.forEach((row, n) => {
482
- redata[n] = {
483
- label: row.f_pcd,
484
- value: row.id,
485
- data:row,
486
- id:row.id
487
- }
488
- })
489
- this.pcdslist=redata
490
- },
491
- //初始化街道 添加小区
492
- async initstreets(pconditon){
493
- this.streetslist = []
494
- let HttpReset = new HttpResetClass()
495
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
496
- data: {
497
- items: '*',
498
- tablename: 't_street',
499
- orderitem: 'id',
500
- condition: pconditon
501
- }
502
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
503
- let redata = []
504
- req.data.forEach((row, n) => {
505
- redata[n] = {
506
- label: row.f_street,
507
- value: row.id,
508
- data:row,
509
- id:row.id
510
- }
511
- })
512
- this.streetslist=redata
513
- },
514
- async areaidChange () {
515
- // 验证小区编号是否已存在
516
- let param = {
517
- id: this.areamodel.id,
518
- f_area_id: this.areamodel.f_area_id,
519
- f_filialeid: this.f_filialeids
520
- }
521
- let res = await this.$resetpost('rs/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
522
- console.log('验证小区是否存在', res)
523
- if (res.data) {
524
- this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
525
- this.areamodel.f_area_id = ''
526
- }
527
- },
528
- //根据名字找数据
529
- findbyid(list,name){
530
- var result
531
- list.forEach((row, n) => {
532
- if(name==row.id){
533
- result= row.data
534
- }
535
- })
536
- return result
537
- },
538
- userTypeChange () {
539
- this.gasproperties = []
540
- if (this.areamodel.f_user_type) {
541
- this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
542
- }
543
- },
544
- //省/市/区变化
545
- async pcdChange(val){
546
- if(val){
547
- //那就把街道数据重新组织一下
548
- await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
549
- if(this.areamodel.f_street_id){
550
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
551
- let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
552
- if(pcd_id!=val){
553
- this.areamodel.f_street_id=''
554
- }
555
- } else {
556
- this.areamodel.f_street_id=''
557
- }
558
-
559
- }
560
- }
561
- this.$resetValidation()
562
- },
563
- //街道变化
564
- streetChange(val){
565
- if(val&&this.operation=='add'){
566
- // if(this.areamodel.f_pcd_id.length==0){
567
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
568
- console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
569
- console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
570
- this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
571
- }
572
- // }
573
- }
574
- this.$resetValidation()
575
- },
576
- //保存
577
- async confirm(){
578
- await this.savearea()
579
- this.cleardara()
580
- this.$dispatch('confirm')
581
- },
582
- //保存小区
583
- async savearea(){
584
- if(this.f_special){
585
- this.areamodel.f_special='1'
586
- }
587
- this.areamodel.f_filialeid = this.f_filialeids
588
- this.areamodel.f_operator = this.$login.f.name
589
- this.areamodel.f_operatorid = this.$login.f.id
590
- this.areamodel.f_orgid = this.$login.f.orgid
591
- this.areamodel.f_orgname = this.$login.f.orgs
592
- this.areamodel.f_depid = this.$login.f.depids
593
- this.areamodel.f_depname = this.$login.f.deps
594
- if (this.areamodel.slice_area) {
595
- if (this.areamodel.slice_area.length > 0) {
596
- this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
597
- this.areamodel.f_area_code = this.areamodel.slice_area[0].code
598
- }
599
- }
600
- this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
601
- this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
602
-
603
- await this.$resetpost('rs/logic/address_updatearea', this.areamodel)
604
- },
605
- cleardara(){
606
- this.areamodel= {
607
- f_area_id: '',
608
- f_pcd_id:'',
609
- f_street_id:'',
610
- f_slice_area:'',
611
- f_linkname:'',
612
- f_linkphone:'',
613
- f_adjustable_id:'',
614
- f_use_institution:'',
615
- f_user_usetype:'居民用气',
616
- f_user_usenature:'生活用气',
617
- f_residential_area:'',
618
- f_user_type:'',
619
- f_gasproperties:'',
620
- f_area_address:'',
621
- f_meter_brand:'',
622
- f_price_name:'',
623
- f_price_type:'',
624
- f_meter_style:'',
625
- f_position:'',
626
- f_comments:''
627
- }
628
- },
629
- cancel(){
630
- this.cleardara()
631
- this.$dispatch('cancel')
632
- },
633
- },
634
- watch: {
635
- 'areatype'(){
636
- this.initdata()
637
- },
638
- 'areamodel.f_pcd_id'(){
639
- // if (!this.areamodel.f_area_address) {
640
- if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
641
- if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
642
- 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
643
- }
644
- }
645
- // }
646
- },
647
- 'areamodel.f_street_id'(){
648
- // if (!this.areamodel.f_area_address) {
649
- if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
650
- if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
651
- 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
652
- }
653
- }
654
- // }
655
- },
656
- 'f_filialeids'(){
657
- if (this.areamodel.f_filialeid) {
658
- if (this.areamodel.f_filialeid != this.f_filialeids) {
659
- this.$dispatch('cancel')
660
- }
661
- }
662
- this.cleardara()
663
- this.initdata()
664
- }
665
- },
666
- computed: {
667
- userusetypes () {
668
- return this.$appdata.getParam('用气类型')
669
- },
670
- usertypes () {
671
- return this.$appdata.getParam('用户类型')
672
- },
673
- f_price_types () {
674
- return this.$appdata.getParam('气价类型')
675
- },
676
- meterstyle () {
677
- let ret = this.$GetSaleParam.getGasbrand()
678
- let rs = new Array()
679
- if(this.areamodel.f_meter_brand) {
680
- ret.forEach((item, index) => {
681
- if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
682
- item.value.gasmodel.forEach((item1, index) =>{
683
- rs.push({label: item1.label, value:item1.label})
684
- })
685
- }
686
- })
687
- }
688
- return rs
689
- },
690
- pricenames () {
691
- let rs = new Array()
692
- if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
693
- let params = {
694
- f_user_type: this.areamodel.f_user_type,
695
- f_gasproperties: this.areamodel.f_gasproperties,
696
- f_price_type: this.areamodel.f_price_type,
697
- filter: this.f_filialeids
698
- }
699
- let ret = this.$GetSaleParam.getPrice(params)
700
- ret.forEach((item, index) => {
701
- rs.push({label: item.label, value: item.value.f_price_name})
702
- })
703
- }
704
- if (rs.length == 0) {
705
- this.areamodel.f_price_name = ''
706
- }
707
- return rs
708
- },
709
- positions () {
710
- return this.$appdata.getParam('安装位置')
711
- },
712
- inputtores () {
713
- // 获取抄表员
714
- let rs = new Array()
715
- if (this.$login.f.f_gasman.length > 0) {
716
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
717
- let temp = {
718
- label: this.$login.f.f_gasman[i].name,
719
- value: this.$login.f.f_gasman[i].name
720
- }
721
- rs.push(temp)
722
- }
723
- }
724
- return rs
725
- },
726
- },
727
- }
728
- </script>
729
- <style>
730
- .box {
731
- width: 727px;
732
- height: 175px;
733
- border-radius: 2px;
734
- background-color: #fafafa;
735
- border: 1px solid #999999;
736
- margin-top: 13px;
737
- }
738
- .datapanel {
739
- color: #333;
740
- background-color: white;
741
- box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
742
- padding: 10px 30px 10px 30px;
743
- border-radius:15px;
744
- }
745
- </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" :class="[$v.f_user_usetype.required ? 'has-error' : 'has-success']">
120
+ <label for="f_user_usetype" class="font_normal_body ">用气类型</label>
121
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_usetype"
122
+ v-validate:f_user_usetype='{required: true }'>
123
+ <v-select :value.sync="areamodel.f_user_usetype" :search="false"
124
+ @change="userUseTypeChange()"
125
+ :value-single="true"
126
+ :options='userusetypes' placeholder='用气类型' close-on-select>
127
+ </v-select>
128
+ </div>
129
+ <div class="col-sm-6 form-group" :class="[$v.f_use_institution.required ? 'has-error' : 'has-success']">
130
+ <label for="f_use_institution" class="font_normal_body">用气机构</label>
131
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_use_institution"
132
+ v-validate:f_use_institution='{required: true }'>
133
+ <v-select :value.sync="areamodel.f_use_institution" :search="false"
134
+ @change="userUseInstitutionChange()" :value-single="true"
135
+ :options='useinstitutions' placeholder='用气机构' close-on-select>
136
+ </v-select>
137
+ </div>
138
+ <div class="col-sm-6 form-group" :class="[$v.f_user_usenature.required ? 'has-error' : 'has-success']">
139
+ <label for="f_user_usenature" class="font_normal_body ">使用性质</label>
140
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_usenature"
141
+ v-validate:f_user_usenature='{required: true }'>
142
+ <v-select :value.sync="areamodel.f_user_usenature" :search="false"
143
+ :value-single="true"
144
+ :options='userusenatures' placeholder='使用性质' close-on-select>
145
+ </v-select>
146
+ </div>
147
+ <div class="col-sm-6 form-group" style="text-align:right;">
148
+ <button class="button_clear button_spacing" v-if="!configShow" @click="changeConfig()">更多默认</button>
149
+ <button class="button_clear button_spacing" v-if="configShow" @click="changeConfig()">收起更多</button>
150
+ </div>
151
+ </div>
152
+
153
+ <div v-if="!f_special && configShow" class="row">
154
+ <div class="col-sm-6 form-group">
155
+ <label class="font_normal_body">用户类型</label>
156
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type"
157
+ >
158
+ <v-select
159
+ :value.sync="areamodel.f_user_type" :value-single="true"
160
+ :options='usertypes' placeholder='用户类型' @change="userTypeChange"
161
+ close-on-select >
162
+ </v-select>
163
+ </div>
164
+ <div class="col-sm-6 form-group"
165
+ >
166
+ <label class="font_normal_body">用气性质</label>
167
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties"
168
+ >
169
+ <v-select
170
+ :value.sync="areamodel.f_gasproperties" :value-single="true"
171
+ :options='gasproperties' placeholder='用气性质'
172
+ close-on-select >
173
+ </v-select>
174
+ </div>
175
+ <div class="col-sm-6 form-group"
176
+ >
177
+ <label class="font_normal_body">气价类型</label>
178
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type"
179
+ >
180
+ <v-select
181
+ :value.sync="areamodel.f_price_type" :value-single="true"
182
+ :options='f_price_types' placeholder='气价类型'
183
+ close-on-select >
184
+ </v-select>
185
+ </div>
186
+ <div class="col-sm-6 form-group"
187
+ >
188
+ <label class="font_normal_body">气价名称</label>
189
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name"
190
+ >
191
+ <v-select
192
+ :value.sync="areamodel.f_price_name" :value-single="true"
193
+ :options='pricenames' placeholder='气价名称'
194
+ close-on-select >
195
+ </v-select>
196
+ </div>
197
+ <div class="col-sm-6 form-group"
198
+ >
199
+ <label class="font_normal_body">气表品牌</label>
200
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand"
201
+ >
202
+ <v-select
203
+ :value.sync="areamodel.f_meter_brand" :value-single="true"
204
+ :options='meterbrands' placeholder='气表品牌'
205
+ close-on-select >
206
+ </v-select>
207
+ </div>
208
+ <div class="col-sm-6 form-group"
209
+ >
210
+ <label class="font_normal_body">气表型号</label>
211
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style"
212
+ >
213
+ <v-select
214
+ :value.sync="areamodel.f_meter_style" :value-single="true"
215
+ :options='meterstyle' placeholder='气表型号'
216
+ close-on-select >
217
+ </v-select>
218
+ </div>
219
+ <div class="col-sm-6 form-group">
220
+ <label class="font_normal_body">安装位置</label>
221
+ <v-select
222
+ :value.sync="areamodel.f_position" :value-single="true"
223
+ :options='positions' placeholder='安装位置'
224
+ close-on-select >
225
+ </v-select>
226
+ </div>
227
+ <div class="col-sm-6 form-group" >
228
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
229
+ <!-- <input type="text" style="width:60%" class="input_search" v-show="false"
230
+ v-validate:f_meter_book='{required: true }'
231
+ v-model="areamodel.f_meter_book">-->
232
+ <v-select
233
+ :value.sync="areamodel.f_meter_book" :value-single="true"
234
+ :options='meterbooks' placeholder='抄表册'
235
+ close-on-select >
236
+ </v-select>
237
+ </div>
238
+ <div class="col-sm-6 form-group" >
239
+ <label class="font_normal_body">抄&ensp;表&ensp;员</label>
240
+ <!-- <input type="text" style="width:60%" class="input_search"
241
+ v-validate:f_inputtor='{required: true }'
242
+ v-show="false" v-model="areamodel.f_inputtor">-->
243
+ <v-select
244
+ :value.sync="areamodel.f_inputtor" :value-single="true"
245
+ :options='inputtores' placeholder='抄表员'
246
+ close-on-select >
247
+ </v-select>
248
+ </div>
249
+ <!-- <div class="col-sm-6 form-group">
250
+ <label class="font_normal_body">调&ensp;压&ensp;箱</label>
251
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_adjustable_id">
252
+ <v-select
253
+ :value.sync="areamodel.f_adjustable_id" :value-single="true"
254
+ :options='adjustables' placeholder='调压箱'
255
+ close-on-select >
256
+ </v-select>
257
+ </div>-->
258
+ <div class="col-sm-6 form-group">
259
+ <label class="font_normal_body">房屋类型</label>
260
+ <v-select
261
+ :value.sync="areamodel.f_house_type" :value-single="true"
262
+ :options='housetypeoptions' placeholder='房屋类型'
263
+ close-on-select >
264
+ </v-select>
265
+ </div>
266
+ </div>
267
+ <div v-if="f_special" class="col-sm-6 form-group">
268
+ <br/>
269
+ </div>
270
+ </div>
271
+ <div class="row auto" style="text-align:right;">
272
+ <button class="button_clear button_spacing" @click="fileUpload()">附件上传</button>
273
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
274
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
275
+ </div>
276
+ <!-- <div class="inp_button" type="button" @click="fileUpload()" v-show="!isupload">上传图片</div>-->
277
+ </div>
278
+ </validator>
279
+ <modal :show.sync="showUpload" v-ref:modal backdrop="false" width="80%">
280
+ <header slot="modal-header" class="modal-header">
281
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
282
+ <h4 class="modal-title">附件上传</h4>
283
+ </header>
284
+ <article slot="modal-body" class="modal-body" style="height: 900px">
285
+ <div class="form-group">
286
+ <upload :blodid="areamodel.id" isremark="true" fusetype="areamodel.f_area_address"></upload>
287
+ </div>
288
+ </article>
289
+ <footer slot="modal-footer" class="modal-footer">
290
+ </footer>
291
+ </modal>
292
+ </div>
293
+ </template>
294
+
295
+ <script>
296
+ import {HttpResetClass} from 'vue-client'
297
+
298
+
299
+ let initGen = async function (self) {
300
+ await self.initdata()
301
+ try {
302
+ await self.$LoadParams.loadMeterBook(self.f_filialeids)
303
+
304
+ }catch (e) {
305
+
306
+ }
307
+ try {
308
+ await self.loadMeterBooks();
309
+ }catch (e) {
310
+
311
+ }
312
+ }
313
+
314
+ export default {
315
+ title: '小区添加',
316
+ data () {
317
+ return {
318
+ //初始化省市区数据
319
+ pcdslist:[],
320
+ showUpload:'',//上传标识位
321
+ configShow: false,
322
+ //初始化街道数据
323
+ streetslist:[],
324
+ //小区
325
+ areamodel: {
326
+ f_area_id: '',
327
+ f_pcd_id:'',
328
+ f_linkname:'',
329
+ f_linkphone:'',
330
+ f_street_id:'',
331
+ f_slice_area:'',
332
+ f_adjustable_id:'',
333
+ f_residential_area:'',
334
+ f_user_type:'',
335
+ f_gasproperties:'',
336
+ f_use_institution:'',
337
+ f_user_usetype:'居民用气',
338
+ f_user_usenature:'生活用气',
339
+ f_meter_brand:'',
340
+ f_price_name:'',
341
+ f_area_address:'',
342
+ f_price_type:'',
343
+ f_meter_style:'',
344
+ f_position:'',
345
+ f_comments:''
346
+ },
347
+ useinstitutions:[],
348
+ userusenatures:[],
349
+ meterbrands: [],
350
+ adjustables: [],
351
+ sliceArea: [],
352
+ safeCheckArea: [],
353
+ gasproperties: [],
354
+ meterbooks:[{label: '全部',value: ''}],
355
+ housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
356
+ }
357
+ },
358
+ props: ['f_filialeids','f_special', 'areatype','row','operation','isupload'],
359
+ ready(){
360
+ initGen(this)
361
+ },
362
+ methods: {
363
+ // 更多默认
364
+ changeConfig(){
365
+ this.configShow = !this.configShow
366
+ },
367
+ userUseInstitutionChange () {
368
+ this.userusenatures = []
369
+ let str = this.areamodel.f_use_institution+ '使用性质'
370
+ this.userusenatures = this.$appdata.getParam(str)
371
+ },
372
+ userUseTypeChange () {
373
+ console.log('看看进来用户用气类型变化的方法了吗???')
374
+ this.useinstitutions = []
375
+ let str = this.areamodel.f_user_usetype + '机构'
376
+ this.useinstitutions = this.$appdata.getParam(str)
377
+ },
378
+ loadMeterBooks(){
379
+ this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
380
+ },
381
+ //初始化数据
382
+ async initdata(){
383
+ // 初始化参数
384
+ await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
385
+ await this.initSlice(this.f_filialeids)
386
+ await this.initParams()
387
+ // 初始化片区
388
+ // await this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
389
+ },
390
+ // 打开文件上传对话框
391
+ fileUpload() {
392
+ this.showUpload = true
393
+ },
394
+ // 关闭文件上传对话框
395
+ close() {
396
+ this.showUpload = false
397
+ // 将选的文件清空
398
+ // this.$refs.file.$el.querySelector('input').value = ''
399
+ // this.load(this)
400
+ },
401
+ initrow(val){
402
+ this.areamodel.f_meter_book = val.f_meter_book;
403
+ this.areamodel.f_adjustable_id = val.f_adjustable_id;
404
+ },
405
+ async initParams() {
406
+ try {
407
+ await this.$LoadParams.loadParam(this.f_filialeids)
408
+ }catch (e) {
409
+
410
+ }
411
+ this.initBrands()
412
+ await this.initSafeCheckArea()
413
+ // this.initAdjustables()
414
+ },
415
+
416
+ initBrands () {
417
+ let ret = []
418
+ try {
419
+ ret = this.$GetSaleParam.getGasbrand()
420
+ } catch(e){}
421
+ // let ret = this.$GetSaleParam.getGasbrand()
422
+ let rs = new Array()
423
+ ret.forEach((item, index) =>{
424
+ rs.push({label: item.label, value: item.value.f_meter_brand})
425
+ })
426
+ this.meterbrands = rs
427
+ },
428
+ async initSafeCheckArea () {
429
+ this.safeCheckArea = []
430
+ let data = {
431
+ items: 'id,f_check_book_name',
432
+ tablename: 't_check_book',
433
+ orderitem: 'id',
434
+ condition: `f_orgid=${this.$login.f.orgid}`
435
+ }
436
+ let ret = await this.$resetpost('rs/sql/address_singleTableOrderBy',{data: data},{resolveMsg: null, rejectMsg: null,newly:true})
437
+ ret.data.forEach(item => {
438
+ this.safeCheckArea.push({label: item.f_check_book_name, value: item.id})
439
+ })
440
+ },
441
+ /*
442
+ initAdjustables () {
443
+ let filter = this.$login.f.orgid
444
+ let ret = this.$GetSaleParam.getAdjustable(filter)
445
+ let arr = new Array()
446
+ ret.forEach((item, index) => {
447
+ arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
448
+ })
449
+ this.adjustables = arr
450
+ },*/
451
+
452
+ async initSlice (val) {
453
+ if (val) {
454
+ let getAllArea = await this.$resetpost('/rs/search', {
455
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
456
+ userid: this.$login.f.id
457
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!',newly:true})
458
+
459
+ let arr = getAllArea.data.filter((res) => {
460
+ return res.parentid == val
461
+ })
462
+ this.sliceArea = []
463
+ arr.forEach((res) => {
464
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
465
+ })
466
+ }
467
+ },
468
+
469
+ //初始化省市区,添加街道
470
+ async initpcds(pconditon){
471
+ this.pcdslist = []
472
+ let HttpReset = new HttpResetClass()
473
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTable', {
474
+ data: {
475
+ items: '*',
476
+ tablename: 't_pcd',
477
+ condition: pconditon
478
+ }
479
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
480
+ let redata = []
481
+ req.data.forEach((row, n) => {
482
+ redata[n] = {
483
+ label: row.f_pcd,
484
+ value: row.id,
485
+ data:row,
486
+ id:row.id
487
+ }
488
+ })
489
+ this.pcdslist=redata
490
+ },
491
+ //初始化街道 添加小区
492
+ async initstreets(pconditon){
493
+ this.streetslist = []
494
+ let HttpReset = new HttpResetClass()
495
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
496
+ data: {
497
+ items: '*',
498
+ tablename: 't_street',
499
+ orderitem: 'id',
500
+ condition: pconditon
501
+ }
502
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
503
+ let redata = []
504
+ req.data.forEach((row, n) => {
505
+ redata[n] = {
506
+ label: row.f_street,
507
+ value: row.id,
508
+ data:row,
509
+ id:row.id
510
+ }
511
+ })
512
+ this.streetslist=redata
513
+ },
514
+ async areaidChange () {
515
+ // 验证小区编号是否已存在
516
+ let param = {
517
+ id: this.areamodel.id,
518
+ f_area_id: this.areamodel.f_area_id,
519
+ f_filialeid: this.f_filialeids
520
+ }
521
+ let res = await this.$resetpost('rs/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
522
+ console.log('验证小区是否存在', res)
523
+ if (res.data) {
524
+ this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
525
+ this.areamodel.f_area_id = ''
526
+ }
527
+ },
528
+ //根据名字找数据
529
+ findbyid(list,name){
530
+ var result
531
+ list.forEach((row, n) => {
532
+ if(name==row.id){
533
+ result= row.data
534
+ }
535
+ })
536
+ return result
537
+ },
538
+ userTypeChange () {
539
+ this.gasproperties = []
540
+ if (this.areamodel.f_user_type) {
541
+ this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
542
+ }
543
+ },
544
+ //省/市/区变化
545
+ async pcdChange(val){
546
+ if(val){
547
+ //那就把街道数据重新组织一下
548
+ await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
549
+ if(this.areamodel.f_street_id){
550
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
551
+ let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
552
+ if(pcd_id!=val){
553
+ this.areamodel.f_street_id=''
554
+ }
555
+ } else {
556
+ this.areamodel.f_street_id=''
557
+ }
558
+
559
+ }
560
+ }
561
+ this.$resetValidation()
562
+ },
563
+ //街道变化
564
+ streetChange(val){
565
+ if(val&&this.operation=='add'){
566
+ // if(this.areamodel.f_pcd_id.length==0){
567
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
568
+ console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
569
+ console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
570
+ this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
571
+ }
572
+ // }
573
+ }
574
+ this.$resetValidation()
575
+ },
576
+ //保存
577
+ async confirm(){
578
+ await this.savearea()
579
+ this.cleardara()
580
+ this.$dispatch('confirm')
581
+ },
582
+ //保存小区
583
+ async savearea(){
584
+ if(this.f_special){
585
+ this.areamodel.f_special='1'
586
+ }
587
+ this.areamodel.f_filialeid = this.f_filialeids
588
+ this.areamodel.f_operator = this.$login.f.name
589
+ this.areamodel.f_operatorid = this.$login.f.id
590
+ this.areamodel.f_orgid = this.$login.f.orgid
591
+ this.areamodel.f_orgname = this.$login.f.orgs
592
+ this.areamodel.f_depid = this.$login.f.depids
593
+ this.areamodel.f_depname = this.$login.f.deps
594
+ if (this.areamodel.slice_area) {
595
+ if (this.areamodel.slice_area.length > 0) {
596
+ this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
597
+ this.areamodel.f_area_code = this.areamodel.slice_area[0].code
598
+ }
599
+ }
600
+ this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
601
+ this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
602
+
603
+ await this.$resetpost('rs/logic/address_updatearea', this.areamodel)
604
+ },
605
+ cleardara(){
606
+ this.areamodel= {
607
+ f_area_id: '',
608
+ f_pcd_id:'',
609
+ f_street_id:'',
610
+ f_slice_area:'',
611
+ f_linkname:'',
612
+ f_linkphone:'',
613
+ f_adjustable_id:'',
614
+ f_use_institution:'',
615
+ f_user_usetype:'居民用气',
616
+ f_user_usenature:'生活用气',
617
+ f_residential_area:'',
618
+ f_user_type:'',
619
+ f_gasproperties:'',
620
+ f_area_address:'',
621
+ f_meter_brand:'',
622
+ f_price_name:'',
623
+ f_price_type:'',
624
+ f_meter_style:'',
625
+ f_position:'',
626
+ f_comments:''
627
+ }
628
+ },
629
+ cancel(){
630
+ this.cleardara()
631
+ this.$dispatch('cancel')
632
+ },
633
+ },
634
+ watch: {
635
+ 'areatype'(){
636
+ this.initdata()
637
+ },
638
+ 'areamodel.f_pcd_id'(){
639
+ // if (!this.areamodel.f_area_address) {
640
+ if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
641
+ if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
642
+ 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
643
+ }
644
+ }
645
+ // }
646
+ },
647
+ 'areamodel.f_street_id'(){
648
+ // if (!this.areamodel.f_area_address) {
649
+ if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
650
+ if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
651
+ 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
652
+ }
653
+ }
654
+ // }
655
+ },
656
+ 'f_filialeids'(){
657
+ if (this.areamodel.f_filialeid) {
658
+ if (this.areamodel.f_filialeid != this.f_filialeids) {
659
+ this.$dispatch('cancel')
660
+ }
661
+ }
662
+ this.cleardara()
663
+ this.initdata()
664
+ }
665
+ },
666
+ computed: {
667
+ userusetypes () {
668
+ return this.$appdata.getParam('用气类型')
669
+ },
670
+ usertypes () {
671
+ return this.$appdata.getParam('用户类型')
672
+ },
673
+ f_price_types () {
674
+ return this.$appdata.getParam('气价类型')
675
+ },
676
+ meterstyle () {
677
+ let ret = this.$GetSaleParam.getGasbrand()
678
+ let rs = new Array()
679
+ if(this.areamodel.f_meter_brand) {
680
+ ret.forEach((item, index) => {
681
+ if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
682
+ item.value.gasmodel.forEach((item1, index) =>{
683
+ rs.push({label: item1.label, value:item1.label})
684
+ })
685
+ }
686
+ })
687
+ }
688
+ return rs
689
+ },
690
+ pricenames () {
691
+ let rs = new Array()
692
+ if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
693
+ let params = {
694
+ f_user_type: this.areamodel.f_user_type,
695
+ f_gasproperties: this.areamodel.f_gasproperties,
696
+ f_price_type: this.areamodel.f_price_type,
697
+ filter: this.f_filialeids
698
+ }
699
+ let ret = this.$GetSaleParam.getPrice(params)
700
+ ret.forEach((item, index) => {
701
+ rs.push({label: item.label, value: item.value.f_price_name})
702
+ })
703
+ }
704
+ if (rs.length == 0) {
705
+ this.areamodel.f_price_name = ''
706
+ }
707
+ return rs
708
+ },
709
+ positions () {
710
+ return this.$appdata.getParam('安装位置')
711
+ },
712
+ inputtores () {
713
+ // 获取抄表员
714
+ let rs = new Array()
715
+ if (this.$login.f.f_gasman.length > 0) {
716
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
717
+ let temp = {
718
+ label: this.$login.f.f_gasman[i].name,
719
+ value: this.$login.f.f_gasman[i].name
720
+ }
721
+ rs.push(temp)
722
+ }
723
+ }
724
+ return rs
725
+ },
726
+ },
727
+ }
728
+ </script>
729
+ <style>
730
+ .box {
731
+ width: 727px;
732
+ height: 175px;
733
+ border-radius: 2px;
734
+ background-color: #fafafa;
735
+ border: 1px solid #999999;
736
+ margin-top: 13px;
737
+ }
738
+ .datapanel {
739
+ color: #333;
740
+ background-color: white;
741
+ box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
742
+ padding: 10px 30px 10px 30px;
743
+ border-radius:15px;
744
+ }
745
+ </style>