address-client 3.2.18 → 3.2.19

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