address-client 1.6.82 → 1.6.83

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,1022 +1,1019 @@
1
- <template>
2
- <div class="span" style="overflow: scroll">
3
- <validator name='v'>
4
- <div class="auto select-overspread form-horizontal" style="margin-left: -1rem;text-align: center">
5
- <div class="row auto" style="text-align: center">
6
- <div class="col-sm-12 bg-info text-center" style="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 form-input-group "
14
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
15
- <label class="font_normal_body _zoom4">省市区</label>
16
- <input type="text"
17
- style="width: 60%"
18
- v-show="false" v-model="areamodel.f_pcd_id"
19
- v-validate:f_pcd_id='{required: true }'>
20
- <v-select
21
- :value.sync="areamodel.f_pcd_id" :value-single="true"
22
- :options='pcdslist' placeholder='请选择'
23
- close-on-select search="true" @change="pcdChange">
24
- </v-select>
25
- </div>
26
- <div class="col-sm-6 form-group form-input-group ">
27
- <label class="font_normal_body _zoom4">街道名称</label>
28
- <v-select
29
- :value.sync="areamodel.f_street_id" :value-single="true"
30
- :options='streetslist' placeholder='请选择'
31
- close-on-select search="true" @change="streetChange">
32
- </v-select>
33
- </div>
34
- <div class="col-sm-6 form-group form-input-group ">
35
- <label class="font_normal_body _zoom4">所属街办</label>
36
- <v-select
37
- :value.sync="areamodel.f_block" :value-single="true"
38
- :options='blockslist' placeholder='请选择'
39
- close-on-select search="true">
40
- </v-select>
41
- </div>
42
- <div class="col-sm-6 form-group form-input-group "
43
- >
44
- <label class="font_normal_body _zoom4">片区</label>
45
- <v-select
46
- :value.sync="areamodel.f_slice_area" :value-single="true"
47
- :options='sliceArea' placeholder='片区/管理站'
48
- close-on-select>
49
- </v-select>
50
- </div>
51
- <!--小区(特殊)信息-->
52
- <div v-if="!f_special"
53
- class="col-sm-6 form-group form-input-group "
54
- :class="[$v.oldid.required ? 'has-error' : 'has-success']">
55
- <label class="font_normal_body _zoom4">小区ID</label>
56
- <input type="text"
57
- style="width: 60%"
58
- @blur="areaidCheck"
59
- v-model="areamodel.oldid" :disabled="operation=='modify'"
60
- class="form-control" placeholder="小区ID"
61
- v-validate:oldid='{required: true }'>
62
- </div>
63
- <div v-if="!f_special"
64
- class="col-sm-6 form-group form-input-group "
65
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
66
- <label class="font_normal_body _zoom4">小区名称</label>
67
- <input type="text"
68
- style="width: 60%"
69
- v-model="areamodel.f_residential_area"
70
- class="form-control" placeholder="小区名称"
71
- v-validate:f_residential_area='{required: true }'>
72
- </div>
73
- <div class="col-sm-6 form-group form-input-group "
74
- >
75
- <label class="font_normal_body _zoom4">行政区域</label>
76
- <v-select
77
- :value.sync="areamodel.f_distinct"
78
- :value-single="true"
79
- :options='distinct' placeholder='行政区域'
80
- v-model="areamodel.f_distinct"
81
- close-on-select></v-select>
82
- </div>
83
- <div class="col-sm-6 form-group form-input-group "
84
- >
85
- <label class="font_normal_body _zoom4">运营区域</label>
86
- <v-select
87
- :value.sync="areamodel.f_opera_area"
88
- :value-single="true"
89
- v-model="areamodel.f_opera_area"
90
- :options='opera_area' placeholder='运营区域'
91
- close-on-select></v-select>
92
- </div>
93
- <div class="col-sm-6 form-group form-input-group " v-if="!f_special"
94
- >
95
- <label class="font_normal_body _zoom4">小区性质</label>
96
- <v-select
97
- :value.sync="areamodel.f_residential_properties "
98
- :value-single="true"
99
- :options='residential_properties' placeholder='小区性质'
100
- v-model="areamodel.f_residential_properties"
101
- close-on-select></v-select>
102
- </div>
103
- <div class="col-sm-6 form-group form-input-group "
104
- >
105
- <label class="font_normal_body _zoom4">供暖方式</label>
106
- <v-select
107
- :value.sync="areamodel.f_heating_style"
108
- :value-single="true"
109
- v-model="areamodel.f_heating_style"
110
- :options='heating_style' placeholder='供暖方式'
111
- close-on-select></v-select>
112
- </div>
113
- <div class="col-sm-6 form-group form-input-group "
114
- >
115
- <label class="font_normal_body _zoom4">预约开户</label>
116
- <v-select
117
- :value.sync="areamodel.f_is_order"
118
- :value-single="true"
119
- v-model="areamodel.f_is_order"
120
- :options='is_order' placeholder='预约开户'
121
- close-on-select>
122
-
123
- </v-select>
124
- </div>
125
- <div class="col-sm-6 form-group form-input-group "
126
- >
127
- <label class="font_normal_body _zoom4">维修站点</label>
128
- <v-select
129
- :value.sync="areamodel.f_repair_point"
130
- v-model="areamodel.f_repair_point"
131
- :value-single="true"
132
- :options='repair_point' placeholder='维修站点'
133
- close-on-select></v-select>
134
- </div>
135
- <div v-if="!f_special" class="col-sm-12 form-group form-input-group">
136
- <label class="font_normal_body" style="width: 20%;text-align: center">小区地址</label>
137
- <input type="text"
138
- v-model="areamodel.f_area_address"
139
- class="form-control" placeholder="小区地址">
140
- </div>
141
- <!--单位(特殊)信息-->
142
- <div v-if="f_special"
143
- class="col-sm-6 form-group form-input-group "
144
- :class="[$v.oldid.required ? 'has-error' : 'has-success']">
145
- <label class="font_normal_body _zoom4">单位ID</label>
146
- <input type="text"
147
- style="width: 60%"
148
- @blur="areaidCheck"
149
- v-model="areamodel.oldid"
150
- class="form-control" placeholder="单位ID"
151
- v-validate:oldid='{required: true }'>
152
- </div>
153
- <div v-if="f_special"
154
- class="col-sm-12 form-group form-input-group "
155
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
156
- <label class="font_normal_body _zoom2">单位名称</label>
157
- <input type="text"
158
- style="width: 60%"
159
- v-model="areamodel.f_residential_area"
160
- class="form-control" placeholder="单位名称"
161
- v-validate:f_residential_area='{required: true }'>
162
- </div>
163
- <div v-if="f_special"
164
- class="col-sm-12 form-group form-input-group "
165
- >
166
- <label class="font_normal_body _zoom2">单位地址</label>
167
- <input type="text"
168
- style="width: 60%"
169
- v-model="areamodel.f_area_address"
170
- class="form-control" placeholder="单位地址">
171
- </div>
172
- <div v-if="f_special"
173
- class="col-sm-6 form-group form-input-group "
174
- >
175
- <label class="font_normal_body _zoom4">联系人</label>
176
- <input type="text"
177
- style="width: 60%"
178
- v-model="areamodel.f_linkname"
179
- class="form-control" placeholder="联系人">
180
- </div>
181
- <div v-if="f_special"
182
- class="col-sm-6 form-group form-input-group "
183
- >
184
- <label class="font_normal_body _zoom4">联系电话</label>
185
- <input type="text"
186
- style="width: 60%"
187
- v-model="areamodel.f_linkphone"
188
- class="form-control" placeholder="联系电话">
189
- </div>
190
- <!-- <div class="col-sm-12">-->
191
- <!-- <br/>-->
192
- <!-- </div>-->
193
- <!--表具信息-->
194
- <div v-if="!f_special" class="col-sm-12 bg-info text-center " style="font-size: 18px;font-weight: bold">
195
- <span>默认表具信息</span>
196
- </div>
197
- <div class="col-sm-12" v-if="!f_special">
198
- <div class="col-sm-6 form-group form-input-group "
199
- >
200
- <label class="font_normal_body _zoom4">默认卡费</label>
201
- <input type="number" v-model="areamodel.default_cardfee"
202
- style="width: 60%"
203
- class="form-control" placeholder="默认卡费">
204
- </div>
205
- <div class="col-sm-6 form-group form-input-group "
206
- >
207
- <label v-if="oldsize>0" class="font_normal_body _zoom4" style="text-align: center">剩余<br/>卡号数量</label>
208
- <label v-if="oldsize<=0" class="font_normal_body _zoom4">卡号数量</label>
209
- <input type="number" v-model="areamodel.card_size"
210
- style="width: 60%" :readonly="oldsize>0 && operation=='modify'"
211
- class="form-control" placeholder="卡号数量">
212
- </div>
213
- <div class="col-sm-6 form-group form-input-group "
214
- style="margin: 0;position: relative">
215
- <label class="font_normal_body _zoom4">起始卡号</label>
216
- <input type="text"
217
- style="width: 60%;display: inline;"
218
- readonly v-model="areamodel.card_start"
219
- class="form-control" placeholder="起始卡号">
220
- <button class="btn btn-default fr" @click="getCard()">获取</button>
221
- </div>
222
- <div class="col-sm-6 form-group form-input-group ">
223
- <label class="font_normal_body _zoom4">终止卡号</label>
224
- <input type="text"
225
- style="width: 60%"
226
- readonly v-model="areamodel.card_end"
227
- class="form-control" placeholder="终止卡号">
228
- </div>
229
- <div class="col-sm-6 form-group form-input-group "
230
- >
231
- <label class="font_normal_body _zoom4">当前卡号</label>
232
- <input type="text"
233
- style="width: 60%" readonly
234
- v-model="areamodel.card_now"
235
- class="form-control" placeholder="当前卡号">
236
- </div>
237
- <div class="col-sm-6 form-group form-input-group "
238
- :class="[$v.f_user_type.required ? 'has-error' : '']">
239
- <label class="font_normal_body _zoom4">用户类型</label>
240
- <input type="text"
241
- style="width: 60%"
242
- v-show="false" v-model="areamodel.f_user_type"
243
- v-validate:f_user_type='{required: true }'
244
- >
245
- <v-select
246
- style="width: 60%"
247
- :value.sync="areamodel.f_user_type" :value-single="true"
248
- :options='usertypes' placeholder='用户类型'
249
- close-on-select>
250
- </v-select>
251
- </div>
252
- <div class="col-sm-6 form-group form-input-group "
253
- :class="[$v.f_gasproperties.required ? 'has-error' : '']">
254
- <label class="font_normal_body _zoom4">用气性质</label>
255
- <input type="text"
256
- style="width: 60%"
257
- v-show="false"
258
- v-validate:f_gasproperties='{required: true }'
259
- v-model="areamodel.f_gasproperties"
260
- >
261
- <v-select
262
- style="width: 60%"
263
- :value.sync="areamodel.f_gasproperties" :value-single="true"
264
- :options='gasproperties' placeholder='用气性质'
265
- close-on-select>
266
- </v-select>
267
- </div>
268
- <div class="col-sm-6 form-group form-input-group "
269
- :class="[$v.f_meter_brand.required ? 'has-error' : '']">
270
- <label class="font_normal_body _zoom4">气表品牌</label>
271
- <input type="text"
272
- style="width: 60%"
273
- v-show="false"
274
- v-validate:f_meter_brand='{required: true }'
275
- v-model="areamodel.f_meter_brand">
276
- <v-select
277
- style="width: 60%"
278
- :value.sync="areamodel.f_meter_brand" :value-single="true"
279
- :options='meterbrands' placeholder='气表品牌'
280
- close-on-select>
281
- </v-select>
282
- </div>
283
- <div class="col-sm-6 form-group form-input-group "
284
- :class="[$v.f_meter_style.required ? 'has-error' : '']">
285
- <label class="font_normal_body _zoom4">气表型号</label>
286
- <input type="text"
287
- style="width: 60%"
288
- v-show="false"
289
- v-validate:f_meter_style='{required: true }' v-model="areamodel.f_meter_style"
290
- >
291
- <v-select
292
- style="width: 60%"
293
- :value.sync="areamodel.f_meter_style" :value-single="true"
294
- :options='meterstyle' placeholder='气表型号'
295
- close-on-select>
296
- </v-select>
297
- </div>
298
- <div class="col-sm-6 form-group form-input-group "
299
- :class="[$v.f_price_type.required ? 'has-error' : '']">
300
- <label class="font_normal_body _zoom4">气价类型</label>
301
- <input type="text"
302
- style="width: 60%"
303
- v-show="false"
304
- v-validate:f_price_type='{required: true }'
305
- v-model="areamodel.f_price_type"
306
- >
307
- <v-select
308
- style="width: 60%"
309
- :value.sync="areamodel.f_price_type" :value-single="true"
310
- :options='f_price_types' placeholder='气价类型'
311
- close-on-select>
312
- </v-select>
313
- </div>
314
- <div class="col-sm-6 form-group form-input-group "
315
- :class="[$v.f_price_name.required ? 'has-error' : '']">
316
- <label class="font_normal_body _zoom4">气价名称</label>
317
- <input type="text"
318
- style="width: 60%"
319
- v-show="false"
320
- v-validate:f_price_name='{required: true }'
321
- v-model="areamodel.f_price_name"
322
- >
323
- <v-select
324
- style="width: 60%"
325
- :value.sync="areamodel.f_price_name" :value-single="true"
326
- :options='pricenames' placeholder='气价名称'
327
- close-on-select>
328
- </v-select>
329
- </div>
330
- <div class="col-sm-6 form-group form-input-group " v-show="!f_special">
331
- <label class="font_normal_body _zoom4">设备类型</label>
332
- <v-select
333
- style="width: 60%" multiple
334
- :value.sync="areamodel.default_devices"
335
- v-model="areamodel.default_devices"
336
- :options='devicetypes' placeholder='设备类型'>
337
- </v-select>
338
- </div>
339
- <div class="col-sm-6 form-group form-input-group "
340
- >
341
- <label class="font_normal_body _zoom4">安装位置</label>
342
- <input type="text"
343
- style="width: 60%"
344
- v-show="false" v-model="areamodel.f_position">
345
- <v-select
346
- style="width: 60%"
347
- :value.sync="areamodel.f_position" :value-single="true"
348
- :options='positions' placeholder='安装位置'
349
- close-on-select>
350
- </v-select>
351
- </div>
352
- <div class="col-sm-6 form-group form-input-group "
353
- >
354
- <label class="font_normal_body _zoom4">抄表员</label>
355
- <input type="text"
356
- style="width: 60%"
357
- v-show="false" v-model="areamodel.f_inputtor">
358
- <v-select
359
- style="width: 60%"
360
- :value.sync="areamodel.f_inputtor" :value-single="true"
361
- :options='inputtores' placeholder='抄表员'
362
- close-on-select>
363
- </v-select>
364
- </div>
365
- <div class="col-sm-6 form-group form-input-group "
366
- >
367
- <label class="font_normal_body _zoom4">调压箱</label>
368
- <input type="text"
369
- style="width: 60%"
370
- v-show="false" v-model="areamodel.f_adjustable_id">
371
- <v-select
372
- :value.sync="areamodel.f_adjustable_id" :value-single="true"
373
- :options='adjustables' placeholder='调压箱'
374
- close-on-select>
375
- </v-select>
376
- </div>
377
- <!-- 写卡参数-->
378
- <div class="col-sm-6 form-group form-input-group "
379
- :class="[$v.is_close.required ? 'has-error' : '']">
380
- <label for="is_close" class="font_normal_body _zoom4">死表关阀</label>
381
- <input type="text"
382
- style="width: 60%"
383
- v-show="false"
384
- v-model="areamodel.is_close"
385
- v-validate:is_close='{required: true }'>
386
- <v-select
387
- style="width: 60%"
388
- :value.sync="areamodel.is_close" v-model="areamodel.is_close"
389
- :options='sbgf' placeholder='死表关阀'
390
- :value-single="true"
391
- close-on-select></v-select>
392
- </div>
393
- <div class="col-sm-6 form-group form-input-group "
394
- :class="[$v.is_close_one.required ? 'has-error' : '']">
395
- <label for="is_close_one" class="col-sm-1 font_normal_body _zoom4">第一次<br/>关阀天数</label>
396
- <input type="text"
397
- style="width: 60%"
398
- class="form-control"
399
- :value.sync="areamodel.is_close_one"
400
- v-model="areamodel.is_close_one" placeholder='第一次关阀天数'
401
- v-validate:is_close_one='{required: true }'
402
- />
403
- </div>
404
- <div class="col-sm-6 form-group form-input-group "
405
- :class="[$v.is_close_two.required ? 'has-error' : '']">
406
- <label for="is_close_one" class="col-sm-1 font_normal_body _zoom4">第二次<br/>关阀天数</label>
407
- <input type="text"
408
- style="width: 60%"
409
- class="form-control"
410
- :value.sync="areamodel.is_close_two"
411
- v-validate:is_close_two='{required: true }'
412
- v-model="areamodel.is_close_two" placeholder='第二次关阀天数'
413
- />
414
- </div>
415
- <div class="col-sm-6 form-group form-input-group "
416
- :class="[$v.is_tablelimit.required ? 'has-error' : '']">
417
- <label for="is_tablelimit" class="font_normal_body _zoom4">是否限购</label>
418
- <input type="text"
419
- style="width: 60%"
420
- v-show="false"
421
- v-model="areamodel.is_tablelimit"
422
- v-validate:is_tablelimit='{required: true }'>
423
- <v-select
424
- style="width: 60%"
425
- :value.sync="areamodel.is_tablelimit" v-model="areamodel.is_tablelimit"
426
- :options='sbgf' placeholder='是否限购'
427
- :value-single="true"
428
- close-on-select></v-select>
429
- </div>
430
- <div class="col-sm-6 form-group form-input-group "
431
- :class="[$v.is_tablelimit_gas.required ? 'has-error' : '']">
432
- <label for="is_tablelimit_gas" class="col-sm-1 font_normal_body _zoom4">上限金额</label>
433
- <input type="text"
434
- style="width: 60%"
435
- class="form-control"
436
- :value.sync="areamodel.is_tablelimit_gas"
437
- v-validate:is_tablelimit_gas='{required: true }'
438
- v-model="areamodel.is_tablelimit_gas" placeholder='上限金额'
439
- />
440
- </div>
441
- <div class="col-sm-6 form-group form-input-group "
442
- :class="[$v.price_type.required ? 'has-error' : '']">
443
- <label for="is_tablelimit" class="font_normal_body _zoom4">单价类型</label>
444
- <input type="text"
445
- style="width: 60%"
446
- v-show="false"
447
- v-model="areamodel.price_type"
448
- v-validate:price_type='{required: true }'>
449
- <v-select
450
- style="width: 60%"
451
- :value.sync="areamodel.price_type" v-model="areamodel.price_type"
452
- :options='djlx' placeholder='单价类型'
453
- :value-single="true"
454
- close-on-select></v-select>
455
- </div>
456
- <div class="col-sm-6 form-group form-input-group "
457
- :class="[$v.anjianyear.required ? 'has-error' : '']">
458
- <label for="anjianyear" class="font_normal_body _zoom4">安检年数</label>
459
- <input type="number" class="form-control"
460
- v-validate:anjianyear='{required: true }'
461
- style="width: 60%"
462
- v-model="areamodel.anjianyear" placeholder='安检年数'
463
- />
464
- </div>
465
- <div class="col-sm-6 form-group form-input-group "
466
- :class="[$v.baofeiyear.required ? 'has-error' : '']">
467
- <label for="anjianyear" class="font_normal_body _zoom4">报废年数</label>
468
- <input type="number" class="form-control"
469
- v-validate:baofeiyear='{required: true }'
470
- style="width: 60%"
471
- v-model="areamodel.baofeiyear" placeholder='报废年数'
472
- />
473
- </div>
474
- <div class="col-sm-6 form-group form-input-group "
475
- :class="[$v.onealarm.required ? 'has-error' : '']">
476
- <label for="onealarm" class="col-sm-1 font_normal_body _zoom4">第一档<br/>报警气量</label>
477
- <input type="text"
478
- style="width: 60%"
479
- class="form-control"
480
- :value.sync="areamodel.onealarm"
481
- v-validate:onealarm='{required: true }'
482
- v-model="areamodel.onealarm" placeholder='第一档报警气量'
483
- />
484
- </div>
485
- <div class="col-sm-6 form-group form-input-group "
486
- :class="[$v.twoalarm.required ? 'has-error' : '']">
487
- <label for="onealarm" class="col-sm-1 font_normal_body _zoom4">第二档<br/>报警气量</label>
488
- <input type="text"
489
- style="width: 60%"
490
- class="form-control"
491
- :value.sync="areamodel.twoalarm"
492
- v-validate:twoalarm='{required: true }'
493
- v-model="areamodel.twoalarm" placeholder='第二档报警气量'
494
- />
495
- </div>
496
- </div>
497
- <div v-if="f_special" class="col-sm-6">
498
- <br/>
499
- </div>
500
- </div>
501
- <div class="row" style="display: inline-block;margin-top: 10px;text-align: center">
502
- <button class="btn btn-default fr" @click="cancel()">取消</button>
503
- <button class="btn btn-success fr" v-if="operation!=='modify'" @click="confirm()" :disabled='!$v.valid'>保存
504
- </button>
505
- <button class="btn btn-success fr" v-if="operation==='modify'" @click="confirm()">保存</button>
506
- </div>
507
- </div>
508
- </validator>
509
- </div>
510
- </template>
511
- <style>
512
- </style>
513
-
514
- <script>
515
- import {HttpResetClass} from 'vue-client'
516
-
517
- export default {
518
- title: '小区添加',
519
- data() {
520
- return {
521
- devicetypes: this.$appdata.getParam('设备类型'),
522
- distinct: this.$appdata.getParam('行政区域'),
523
- opera_area: this.$appdata.getParam('运营区域'),
524
- repair_point: this.$appdata.getParam('维修站点'),
525
- residential_properties: this.$appdata.getParam('小区性质'),
526
- heating_style: this.$appdata.getParam('供暖方式'),
527
- blockslist: this.$appdata.getParam('所属街办'),
528
- // repair_point: [{label: '航天站', value: '航天站'},
529
- // {label: '韦曲站', value: '韦曲站'}, {label: '郭杜站', value: '郭杜站'},
530
- // {label: '沣东站', value: '沣东站'},
531
- // {label: '中心站', value: '中心站'}],
532
- is_order: [{label: '开户', value: '开户'},
533
- {label: '未开户', value: '未开户'}],
534
- //初始化省市区数据
535
- pcdslist: [],
536
- //初始化街道数据
537
- streetslist: [],
538
- sbgf: [{label: '', value: ''},
539
- {label: '', value: ''}],
540
- //单价类型
541
- djlx: [{label: '普通单价', value: '普通单价'},
542
- {label: '阶梯单价', value: '阶梯单价'}],
543
- //小区
544
- areamodel: {
545
- default_devices: [],
546
- f_repair_point: '',
547
- f_pcd_id: '',
548
- f_block: '',
549
- f_is_order: '',
550
- oldid: '',
551
- f_linkname: '',
552
- f_linkphone: '',
553
- f_street_id: '',
554
- f_opera_area: '',
555
- f_distinct: '',
556
- f_slice_area: '',
557
- f_adjustable_id: '',
558
- f_residential_area: '',
559
- f_user_type: '',
560
- f_gasproperties: '',
561
- f_meter_brand: '',
562
- f_price_name: '',
563
- f_area_address: '',
564
- f_price_type: '',
565
- f_meter_style: '',
566
- f_position: '',
567
- is_close: '是',
568
- is_close_one: 45,
569
- is_close_two: 30,
570
- is_tablelimit: '是',
571
- is_tablelimit_gas: 20000,
572
- price_type: '',
573
- anjianyear: 3,
574
- baofeiyear: 12,
575
- onealarm: 20,
576
- twoalarm: 10,
577
- f_price_id: 0,
578
- alarm: 0,
579
- constant: 0,
580
- f_gasbrand_id: 0,
581
- f_gasmodel_id: 0,
582
- default_cardfee: null,
583
- card_start: null,
584
- card_end: null,
585
- card_now: null,
586
- card_size: null,
587
- f_isic: '',
588
- },
589
- }
590
- },
591
- props: ['f_special', 'areatype', 'row', 'operation', 'oldsize'],
592
- ready() {
593
- this.initdata()
594
- },
595
- init() {
596
- this.$LoadParams.loadParam()
597
- },
598
- methods: {
599
- //初始化省市区,添加街道
600
- initpcds(pconditon) {
601
- console.log("省市区准备")
602
- let HttpReset = new HttpResetClass()
603
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=99999', {
604
- data: {
605
- items: '*',
606
- tablename: 't_pcd',
607
- orderitem: 'id desc',
608
- condition: pconditon
609
- }
610
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
611
- let redata = []
612
- req.data.forEach((row, n) => {
613
- redata[n] = {
614
- label: row.f_pcd,
615
- value: row.id,
616
- data: row,
617
- id: row.id
618
- }
619
- })
620
- this.pcdslist = redata
621
- //this.$emit('ready')
622
- })
623
- },
624
- //初始化街道 添加小区
625
- initstreets(pconditon) {
626
- console.log("街道数据准备")
627
- let HttpReset = new HttpResetClass()
628
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=99999', {
629
- data: {
630
- items: '*',
631
- tablename: 't_street',
632
- orderitem: 'id desc',
633
- condition: pconditon
634
- }
635
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
636
- let redata = []
637
- req.data.forEach((row, n) => {
638
- redata[n] = {
639
- label: row.f_street,
640
- value: row.id,
641
- data: row,
642
- id: row.id
643
- }
644
- })
645
- this.streetslist = redata
646
- //this.$emit('ready')
647
- })
648
- },
649
- //根据名字找数据
650
- findbyid(list, name) {
651
- var result
652
- list.forEach((row, n) => {
653
- if (name == row.id) {
654
- result = row.data
655
- }
656
- })
657
- return result
658
- },
659
- //初始化数据
660
- initdata() {
661
- console.log('areatype是....', this.areatype, this.row)
662
- this.initpcds(` 1=1 `)
663
- this.initstreets(` 1=1 `)
664
- },
665
- //省/市/区变化
666
- pcdChange(val) {
667
- console.log("省/市/区变化", val)
668
- if (val && this.operation == 'add') {
669
- //那就把街道数据重新组织一下
670
- this.initstreets(` f_pcd_id ='${val}' `)
671
- if (this.areamodel.f_street_id) {
672
- let pcd_id = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_pcd_id
673
- if (pcd_id != val) {
674
- this.areamodel.f_street_id = ''
675
- }
676
- }
677
- }
678
- this.$resetValidation()
679
- },
680
- //街道变化
681
- streetChange(val) {
682
- console.log("街道变化", val)
683
- if (val && this.operation == 'add') {
684
- if (this.areamodel.f_pcd_id.length == 0) {
685
- this.areamodel.f_pcd_id = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_pcd_id
686
- }
687
- }
688
-
689
- this.$resetValidation()
690
- },
691
- //保存
692
- confirm() {
693
- this.savearea()
694
- this.cleardara()
695
- this.$dispatch('confirm')
696
- },
697
- //获取当前小区档案中的最大卡号区间
698
- getCard() {
699
- if (this.oldsize > 0 && this.operation == 'modify') {
700
- this.$showAlert('剩余卡号大于0,不能获取,避免浪费卡号', 'warning', 2000)
701
- return
702
- }
703
- try {
704
- let HttpReset = new HttpResetClass()
705
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
706
- data: {
707
- items: '*',
708
- tablename: 't_area',
709
- orderitem: 'card_end desc',
710
- condition: " card_size is not null and card_end is not null and card_start is not null and f_special is null"
711
- }
712
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
713
- if (req.data.length > 0) {
714
- let card = Number(req.data[0].card_end) + 1
715
- //前面不够 补0
716
- this.areamodel.card_start = this.pad(card + "", 10)
717
- this.areamodel.card_now = this.areamodel.card_start
718
- this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
719
- } else {
720
- //默认卡号为03980000001
721
- let card = Number(this.$appdata.getSingleValue('启始卡号')) + 1
722
- this.areamodel.card_start = this.pad(card + "", 10)
723
- this.areamodel.card_now = this.areamodel.card_start
724
- this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
725
- }
726
- })
727
- } catch (error) {
728
- this.$showAlert(error, 'danger', 0)
729
- }
730
- },
731
- //前面补0
732
- pad(num, n) {
733
- while (num.length < n) {
734
- num = "0" + num
735
- }
736
- return num;
737
- },
738
- //保存小区
739
- savearea() {
740
- if (this.f_special) {
741
- this.areamodel.f_special = '1'
742
- }
743
- this.areamodel.f_operator = this.$login.f.name
744
- this.areamodel.f_filiale = this.$login.f.f_fengongsi
745
- this.areamodel.f_outlets = this.$login.f.f_parentname
746
- this.areamodel.op_id = this.$login.f.op_id
747
- this.areamodel.op_spot = this.$login.f.op_spot
748
- this.areamodel.f_orgstr = this.$login.f.orgpathstr
749
- this.areamodel.f_is_order = this.areamodel.f_is_order === '开户' ? this.areamodel.f_is_order : null
750
- this.areamodel.f_pcd = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd
751
- if (this.areamodel.f_street_id) {
752
- this.areamodel.f_street = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
753
- } else {
754
- this.areamodel.f_street = ''
755
- }
756
- let result = this.$resetpost('rs/logic/address_updatearea', this.areamodel)
757
- },
758
- cleardara() {
759
- this.areamodel = {
760
- default_devices: [],
761
- f_pcd_id: '',
762
- oldid: '',
763
- f_block: '',
764
- f_linkname: '',
765
- f_linkphone: '',
766
- f_street_id: '',
767
- f_slice_area: '',
768
- f_adjustable_id: '',
769
- f_residential_area: '',
770
- f_user_type: '',
771
- f_gasproperties: '',
772
- f_meter_brand: '',
773
- f_price_name: '',
774
- f_area_address: '',
775
- f_price_type: '',
776
- f_meter_style: '',
777
- f_position: '',
778
- is_close: '是',
779
- is_close_one: 30,
780
- is_close_two: 45,
781
- is_tablelimit: '是',
782
- is_tablelimit_gas: 20000,
783
- price_type: '',
784
- anjianyear: 3,
785
- baofeiyear: 12,
786
- onealarm: 20,
787
- twoalarm: 10,
788
- f_price_id: 0,
789
- alarm: 0,
790
- constant: 0,
791
- f_gasbrand_id: 0,
792
- f_gasmodel_id: 0,
793
- f_isic: '',
794
- default_cardfee: null,
795
- f_heating_style: '',
796
- f_residential_properties: '',
797
- card_start: null,
798
- card_end: null,
799
- card_now: null,
800
- card_size: null,
801
- }
802
- },
803
- areaidCheck(){
804
- let HttpReset = new HttpResetClass()
805
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
806
- data: {
807
- items: 'id',
808
- tablename: 't_area',
809
- orderitem: 'id desc',
810
- condition: ` oldid = '${this.areamodel.oldid}' `
811
- }
812
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
813
- if (req.data.length > 0) {
814
- this.areamodel.oldid = ''
815
- this.$showAlert('ID重复,请检查ID是否正确!','warning',1000)
816
- }
817
- })
818
- },
819
- cancel() {
820
- this.cleardara()
821
- this.$dispatch('cancel')
822
- },
823
- getpricenames() {
824
- let rs = new Array()
825
- if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
826
- let params = {
827
- f_user_type: this.areamodel.f_user_type,
828
- f_gasproperties: this.areamodel.f_gasproperties,
829
- f_price_type: this.areamodel.f_price_type,
830
- filter: this.$login.f.f_fengongsi
831
- }
832
- console.log('气价参数。,。。', params)
833
- let ret = this.$GetSaleParam.getPrice(params)
834
- ret.forEach((item, index) => {
835
- rs.push({label: item.label, value: item.value.f_price_name, f_price_id: item.value.f_price_id})
836
- })
837
- }
838
- return rs
839
- },
840
- getmeterbrands() {
841
- let ret = this.$GetSaleParam.getGasbrand()
842
- let rs = new Array()
843
- if (this.areamodel.f_user_type || this.areamodel.f_gasproperties || this.areamodel.f_price_type) {
844
- ret.forEach((item, index) => {
845
- rs.push({label: item.label, value: item.value.f_meter_brand, id: item.value.id})
846
- })
847
- console.log("气表品牌: ", rs)
848
- }
849
- return rs
850
- },
851
- getmeterstyle() {
852
- let ret = this.$GetSaleParam.getGasbrand()
853
- console.log("气表型号ret: ", ret)
854
- let rs = new Array()
855
- if (this.areamodel.f_meter_brand) {
856
- ret.forEach((item, index) => {
857
- if (this.areamodel.f_meter_brand == item.value.f_meter_brand) {
858
- item.value.gasmodel.forEach((item1, index) => {
859
- rs.push({label: item1.label, value: item1.label, id: item1.value.id})
860
- })
861
- }
862
- })
863
- }
864
- console.log("气表型号rs: ", rs)
865
- return rs
866
- },
867
- },
868
- watch: {
869
- 'areatype'() {
870
- this.initdata()
871
- },
872
- 'areamodel.f_pcd_id'() {
873
- if (this.areamodel.f_pcd_id) {
874
- if (this.areamodel.f_street_id) {
875
- 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
876
- } else {
877
- this.areamodel.f_area_address = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd
878
- }
879
- }
880
- },
881
- 'areamodel.f_meter_style'() {
882
- let arry = this.getmeterstyle()
883
- arry.forEach((row, n) => {
884
- if (this.areamodel.f_meter_style == row.value) {
885
- this.areamodel.f_gasmodel_id = row.id
886
- }
887
- })
888
- },
889
- 'areamodel.f_meter_brand'() {
890
- let arry = this.getmeterbrands()
891
- arry.forEach((row, n) => {
892
- if (this.areamodel.f_meter_brand == row.value) {
893
- this.areamodel.f_gasbrand_id = row.id
894
- }
895
- })
896
- },
897
- 'areamodel.f_price_name'(val) {
898
- if (this.areamodel.f_price_name) {
899
- if (this.areamodel.f_price_name.indexOf('民用') > -1) {
900
- this.areamodel.onealarm = 20
901
- this.areamodel.twoalarm = 10
902
- if (this.areamodel.default_devices.length === 0 && !this.f_special) this.areamodel.default_devices = ['灶具', '热水器']
903
- } else if (this.areamodel.f_price_name.indexOf('锅炉') > -1) {
904
- this.areamodel.onealarm = 200
905
- this.areamodel.twoalarm = 100
906
- if (this.areamodel.default_devices.length === 0 && !this.f_special) this.areamodel.default_devices = ['灶具', '壁挂锅炉']
907
- }
908
- }
909
- let arry = this.getpricenames()
910
- arry.forEach((row, n) => {
911
- if (this.areamodel.f_price_name == row.value) {
912
- this.areamodel.f_price_id = row.f_price_id
913
- }
914
- })
915
- },
916
- 'areamodel.f_street_id'() {
917
- if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
918
- 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
919
- }
920
- }
921
-
922
- },
923
- computed: {
924
- usertypes() {
925
- return this.$appdata.getParam('用户类型')
926
- },
927
- gasproperties() {
928
- let rs = []
929
- if (this.areamodel.f_user_type) {
930
- rs = this.$appdata.getParam(this.areamodel.f_user_type)
931
- }
932
- return rs
933
- },
934
- meterbrands() {
935
- let ret = this.$GetSaleParam.getGasbrand()
936
- let rs = new Array()
937
- if (this.areamodel.f_user_type || this.areamodel.f_gasproperties || this.areamodel.f_price_type) {
938
- ret.forEach((item, index) => {
939
- rs.push({label: item.label, value: item.value.f_meter_brand})
940
- })
941
- console.log("气表品牌: ", rs)
942
- }
943
- return rs
944
- },
945
- meterstyle() {
946
- let ret = this.$GetSaleParam.getGasbrand()
947
- console.log("气表型号ret: ", ret)
948
- let rs = new Array()
949
- if (this.areamodel.f_meter_brand) {
950
- ret.forEach((item, index) => {
951
- if (this.areamodel.f_meter_brand == item.value.f_meter_brand) {
952
- item.value.gasmodel.forEach((item1, index) => {
953
- rs.push({label: item1.label, value: item1.label})
954
- })
955
- }
956
- })
957
- }
958
- console.log("气表型号rs: ", rs)
959
- return rs
960
- },
961
- f_price_types() {
962
- return this.$appdata.getParam('气价类型')
963
- },
964
- pricenames() {
965
- let rs = new Array()
966
- if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
967
- let params = {
968
- f_user_type: this.areamodel.f_user_type,
969
- f_gasproperties: this.areamodel.f_gasproperties,
970
- f_price_type: this.areamodel.f_price_type,
971
- filter: this.$login.f.f_fengongsi
972
- }
973
- console.log('气价参数。,。。', params)
974
- let ret = this.$GetSaleParam.getPrice(params)
975
- ret.forEach((item, index) => {
976
- rs.push({label: item.label, value: item.value.f_price_name})
977
- })
978
- }
979
- return rs
980
- },
981
- positions() {
982
- return this.$appdata.getParam('安装位置')
983
- },
984
- adjustables() {
985
- let filter = this.$login.f.f_orgids
986
- let ret = this.$GetSaleParam.getAdjustable(filter)
987
- let arr = new Array()
988
- ret.forEach((item, index) => {
989
- arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
990
- })
991
- return [{label: '全部', value: ''}, ...arr]
992
- },
993
- sliceArea() {
994
- return this.$appdata.getParam('所属区域')
995
- },
996
- inputtores() {
997
- // 获取抄表员
998
- let rs = new Array()
999
- if (this.$login.f.f_gasman.length > 0) {
1000
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
1001
- let temp = {
1002
- label: this.$login.f.f_gasman[i].name,
1003
- value: this.$login.f.f_gasman[i].name
1004
- }
1005
- rs.push(temp)
1006
- }
1007
- }
1008
- return rs
1009
- },
1010
- },
1011
- }
1012
- </script>
1013
- <style>
1014
- .box {
1015
- width: 727px;
1016
- height: 175px;
1017
- border-radius: 2px;
1018
- background-color: #fafafa;
1019
- border: 1px solid #999999;
1020
- margin-top: 13px;
1021
- }
1022
- </style>
1
+ <template>
2
+ <div class="span" style="overflow: scroll">
3
+ <validator name='v'>
4
+ <div class="auto select-overspread form-horizontal" style="margin-left: -1rem;text-align: center">
5
+ <div class="row auto" style="text-align: center">
6
+ <div class="col-sm-12 bg-info text-center" style="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 form-input-group "
14
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
15
+ <label class="font_normal_body _zoom4">省市区</label>
16
+ <input type="text"
17
+ style="width: 60%"
18
+ v-show="false" v-model="areamodel.f_pcd_id"
19
+ v-validate:f_pcd_id='{required: true }'>
20
+ <v-select
21
+ :value.sync="areamodel.f_pcd_id" :value-single="true"
22
+ :options='pcdslist' placeholder='请选择'
23
+ close-on-select search="true" @change="pcdChange">
24
+ </v-select>
25
+ </div>
26
+ <div class="col-sm-6 form-group form-input-group ">
27
+ <label class="font_normal_body _zoom4">所属街办</label>
28
+ <v-select
29
+ :value.sync="areamodel.f_street_id" :value-single="true"
30
+ :options='streetslist' placeholder='请选择'
31
+ close-on-select search="true" @change="streetChange">
32
+ </v-select>
33
+ </div>
34
+ <div class="col-sm-6 form-group form-input-group ">
35
+ <label class="font_normal_body _zoom4">街道名称</label>
36
+ <input type="text" style="width: 60%"
37
+ v-model="areamodel.f_block" class="form-control" placeholder="街道名称" />
38
+ </div>
39
+ <div class="col-sm-6 form-group form-input-group "
40
+ >
41
+ <label class="font_normal_body _zoom4">片区</label>
42
+ <v-select
43
+ :value.sync="areamodel.f_slice_area" :value-single="true"
44
+ :options='sliceArea' placeholder='片区/管理站'
45
+ close-on-select>
46
+ </v-select>
47
+ </div>
48
+ <!--小区(特殊)信息-->
49
+ <div v-if="!f_special"
50
+ class="col-sm-6 form-group form-input-group "
51
+ :class="[$v.oldid.required ? 'has-error' : 'has-success']">
52
+ <label class="font_normal_body _zoom4">小区ID</label>
53
+ <input type="text"
54
+ style="width: 60%"
55
+ @blur="areaidCheck"
56
+ v-model="areamodel.oldid" :disabled="operation=='modify'"
57
+ class="form-control" placeholder="小区ID"
58
+ v-validate:oldid='{required: true }'>
59
+ </div>
60
+ <div v-if="!f_special"
61
+ class="col-sm-6 form-group form-input-group "
62
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
63
+ <label class="font_normal_body _zoom4">小区名称</label>
64
+ <input type="text"
65
+ style="width: 60%"
66
+ v-model="areamodel.f_residential_area"
67
+ class="form-control" placeholder="小区名称"
68
+ v-validate:f_residential_area='{required: true }'>
69
+ </div>
70
+ <div class="col-sm-6 form-group form-input-group "
71
+ >
72
+ <label class="font_normal_body _zoom4">行政区域</label>
73
+ <v-select
74
+ :value.sync="areamodel.f_distinct"
75
+ :value-single="true"
76
+ :options='distinct' placeholder='行政区域'
77
+ v-model="areamodel.f_distinct"
78
+ close-on-select></v-select>
79
+ </div>
80
+ <div class="col-sm-6 form-group form-input-group "
81
+ >
82
+ <label class="font_normal_body _zoom4">运营区域</label>
83
+ <v-select
84
+ :value.sync="areamodel.f_opera_area"
85
+ :value-single="true"
86
+ v-model="areamodel.f_opera_area"
87
+ :options='opera_area' placeholder='运营区域'
88
+ close-on-select></v-select>
89
+ </div>
90
+ <div class="col-sm-6 form-group form-input-group " v-if="!f_special"
91
+ >
92
+ <label class="font_normal_body _zoom4">小区性质</label>
93
+ <v-select
94
+ :value.sync="areamodel.f_residential_properties "
95
+ :value-single="true"
96
+ :options='residential_properties' placeholder='小区性质'
97
+ v-model="areamodel.f_residential_properties"
98
+ close-on-select></v-select>
99
+ </div>
100
+ <div class="col-sm-6 form-group form-input-group "
101
+ >
102
+ <label class="font_normal_body _zoom4">供暖方式</label>
103
+ <v-select
104
+ :value.sync="areamodel.f_heating_style"
105
+ :value-single="true"
106
+ v-model="areamodel.f_heating_style"
107
+ :options='heating_style' placeholder='供暖方式'
108
+ close-on-select></v-select>
109
+ </div>
110
+ <div class="col-sm-6 form-group form-input-group "
111
+ >
112
+ <label class="font_normal_body _zoom4">预约开户</label>
113
+ <v-select
114
+ :value.sync="areamodel.f_is_order"
115
+ :value-single="true"
116
+ v-model="areamodel.f_is_order"
117
+ :options='is_order' placeholder='预约开户'
118
+ close-on-select>
119
+
120
+ </v-select>
121
+ </div>
122
+ <div class="col-sm-6 form-group form-input-group "
123
+ >
124
+ <label class="font_normal_body _zoom4">维修站点</label>
125
+ <v-select
126
+ :value.sync="areamodel.f_repair_point"
127
+ v-model="areamodel.f_repair_point"
128
+ :value-single="true"
129
+ :options='repair_point' placeholder='维修站点'
130
+ close-on-select></v-select>
131
+ </div>
132
+ <div v-if="!f_special" class="col-sm-12 form-group form-input-group">
133
+ <label class="font_normal_body" style="width: 20%;text-align: center">小区地址</label>
134
+ <input type="text"
135
+ v-model="areamodel.f_area_address"
136
+ class="form-control" placeholder="小区地址">
137
+ </div>
138
+ <!--单位(特殊)信息-->
139
+ <div v-if="f_special"
140
+ class="col-sm-6 form-group form-input-group "
141
+ :class="[$v.oldid.required ? 'has-error' : 'has-success']">
142
+ <label class="font_normal_body _zoom4">单位ID</label>
143
+ <input type="text"
144
+ style="width: 60%"
145
+ @blur="areaidCheck"
146
+ v-model="areamodel.oldid"
147
+ class="form-control" placeholder="单位ID"
148
+ v-validate:oldid='{required: true }'>
149
+ </div>
150
+ <div v-if="f_special"
151
+ class="col-sm-12 form-group form-input-group "
152
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
153
+ <label class="font_normal_body _zoom2">单位名称</label>
154
+ <input type="text"
155
+ style="width: 60%"
156
+ v-model="areamodel.f_residential_area"
157
+ class="form-control" placeholder="单位名称"
158
+ v-validate:f_residential_area='{required: true }'>
159
+ </div>
160
+ <div v-if="f_special"
161
+ class="col-sm-12 form-group form-input-group "
162
+ >
163
+ <label class="font_normal_body _zoom2">单位地址</label>
164
+ <input type="text"
165
+ style="width: 60%"
166
+ v-model="areamodel.f_area_address"
167
+ class="form-control" placeholder="单位地址">
168
+ </div>
169
+ <div v-if="f_special"
170
+ class="col-sm-6 form-group form-input-group "
171
+ >
172
+ <label class="font_normal_body _zoom4">联系人</label>
173
+ <input type="text"
174
+ style="width: 60%"
175
+ v-model="areamodel.f_linkname"
176
+ class="form-control" placeholder="联系人">
177
+ </div>
178
+ <div v-if="f_special"
179
+ class="col-sm-6 form-group form-input-group "
180
+ >
181
+ <label class="font_normal_body _zoom4">联系电话</label>
182
+ <input type="text"
183
+ style="width: 60%"
184
+ v-model="areamodel.f_linkphone"
185
+ class="form-control" placeholder="联系电话">
186
+ </div>
187
+ <!-- <div class="col-sm-12">-->
188
+ <!-- <br/>-->
189
+ <!-- </div>-->
190
+ <!--表具信息-->
191
+ <div v-if="!f_special" class="col-sm-12 bg-info text-center " style="font-size: 18px;font-weight: bold">
192
+ <span>默认表具信息</span>
193
+ </div>
194
+ <div class="col-sm-12" v-if="!f_special">
195
+ <div class="col-sm-6 form-group form-input-group "
196
+ >
197
+ <label class="font_normal_body _zoom4">默认卡费</label>
198
+ <input type="number" v-model="areamodel.default_cardfee"
199
+ style="width: 60%"
200
+ class="form-control" placeholder="默认卡费">
201
+ </div>
202
+ <div class="col-sm-6 form-group form-input-group "
203
+ >
204
+ <label v-if="oldsize>0" class="font_normal_body _zoom4" style="text-align: center">剩余<br/>卡号数量</label>
205
+ <label v-if="oldsize<=0" class="font_normal_body _zoom4">卡号数量</label>
206
+ <input type="number" v-model="areamodel.card_size"
207
+ style="width: 60%" :readonly="oldsize>0 && operation=='modify'"
208
+ class="form-control" placeholder="卡号数量">
209
+ </div>
210
+ <div class="col-sm-6 form-group form-input-group "
211
+ style="margin: 0;position: relative">
212
+ <label class="font_normal_body _zoom4">起始卡号</label>
213
+ <input type="text"
214
+ style="width: 60%;display: inline;"
215
+ readonly v-model="areamodel.card_start"
216
+ class="form-control" placeholder="起始卡号">
217
+ <button class="btn btn-default fr" @click="getCard()">获取</button>
218
+ </div>
219
+ <div class="col-sm-6 form-group form-input-group ">
220
+ <label class="font_normal_body _zoom4">终止卡号</label>
221
+ <input type="text"
222
+ style="width: 60%"
223
+ readonly v-model="areamodel.card_end"
224
+ class="form-control" placeholder="终止卡号">
225
+ </div>
226
+ <div class="col-sm-6 form-group form-input-group "
227
+ >
228
+ <label class="font_normal_body _zoom4">当前卡号</label>
229
+ <input type="text"
230
+ style="width: 60%" readonly
231
+ v-model="areamodel.card_now"
232
+ class="form-control" placeholder="当前卡号">
233
+ </div>
234
+ <div class="col-sm-6 form-group form-input-group "
235
+ :class="[$v.f_user_type.required ? 'has-error' : '']">
236
+ <label class="font_normal_body _zoom4">用户类型</label>
237
+ <input type="text"
238
+ style="width: 60%"
239
+ v-show="false" v-model="areamodel.f_user_type"
240
+ v-validate:f_user_type='{required: true }'
241
+ >
242
+ <v-select
243
+ style="width: 60%"
244
+ :value.sync="areamodel.f_user_type" :value-single="true"
245
+ :options='usertypes' placeholder='用户类型'
246
+ close-on-select>
247
+ </v-select>
248
+ </div>
249
+ <div class="col-sm-6 form-group form-input-group "
250
+ :class="[$v.f_gasproperties.required ? 'has-error' : '']">
251
+ <label class="font_normal_body _zoom4">用气性质</label>
252
+ <input type="text"
253
+ style="width: 60%"
254
+ v-show="false"
255
+ v-validate:f_gasproperties='{required: true }'
256
+ v-model="areamodel.f_gasproperties"
257
+ >
258
+ <v-select
259
+ style="width: 60%"
260
+ :value.sync="areamodel.f_gasproperties" :value-single="true"
261
+ :options='gasproperties' placeholder='用气性质'
262
+ close-on-select>
263
+ </v-select>
264
+ </div>
265
+ <div class="col-sm-6 form-group form-input-group "
266
+ :class="[$v.f_meter_brand.required ? 'has-error' : '']">
267
+ <label class="font_normal_body _zoom4">气表品牌</label>
268
+ <input type="text"
269
+ style="width: 60%"
270
+ v-show="false"
271
+ v-validate:f_meter_brand='{required: true }'
272
+ v-model="areamodel.f_meter_brand">
273
+ <v-select
274
+ style="width: 60%"
275
+ :value.sync="areamodel.f_meter_brand" :value-single="true"
276
+ :options='meterbrands' placeholder='气表品牌'
277
+ close-on-select>
278
+ </v-select>
279
+ </div>
280
+ <div class="col-sm-6 form-group form-input-group "
281
+ :class="[$v.f_meter_style.required ? 'has-error' : '']">
282
+ <label class="font_normal_body _zoom4">气表型号</label>
283
+ <input type="text"
284
+ style="width: 60%"
285
+ v-show="false"
286
+ v-validate:f_meter_style='{required: true }' v-model="areamodel.f_meter_style"
287
+ >
288
+ <v-select
289
+ style="width: 60%"
290
+ :value.sync="areamodel.f_meter_style" :value-single="true"
291
+ :options='meterstyle' placeholder='气表型号'
292
+ close-on-select>
293
+ </v-select>
294
+ </div>
295
+ <div class="col-sm-6 form-group form-input-group "
296
+ :class="[$v.f_price_type.required ? 'has-error' : '']">
297
+ <label class="font_normal_body _zoom4">气价类型</label>
298
+ <input type="text"
299
+ style="width: 60%"
300
+ v-show="false"
301
+ v-validate:f_price_type='{required: true }'
302
+ v-model="areamodel.f_price_type"
303
+ >
304
+ <v-select
305
+ style="width: 60%"
306
+ :value.sync="areamodel.f_price_type" :value-single="true"
307
+ :options='f_price_types' placeholder='气价类型'
308
+ close-on-select>
309
+ </v-select>
310
+ </div>
311
+ <div class="col-sm-6 form-group form-input-group "
312
+ :class="[$v.f_price_name.required ? 'has-error' : '']">
313
+ <label class="font_normal_body _zoom4">气价名称</label>
314
+ <input type="text"
315
+ style="width: 60%"
316
+ v-show="false"
317
+ v-validate:f_price_name='{required: true }'
318
+ v-model="areamodel.f_price_name"
319
+ >
320
+ <v-select
321
+ style="width: 60%"
322
+ :value.sync="areamodel.f_price_name" :value-single="true"
323
+ :options='pricenames' placeholder='气价名称'
324
+ close-on-select>
325
+ </v-select>
326
+ </div>
327
+ <div class="col-sm-6 form-group form-input-group " v-show="!f_special">
328
+ <label class="font_normal_body _zoom4">设备类型</label>
329
+ <v-select
330
+ style="width: 60%" multiple
331
+ :value.sync="areamodel.default_devices"
332
+ v-model="areamodel.default_devices"
333
+ :options='devicetypes' placeholder='设备类型'>
334
+ </v-select>
335
+ </div>
336
+ <div class="col-sm-6 form-group form-input-group "
337
+ >
338
+ <label class="font_normal_body _zoom4">安装位置</label>
339
+ <input type="text"
340
+ style="width: 60%"
341
+ v-show="false" v-model="areamodel.f_position">
342
+ <v-select
343
+ style="width: 60%"
344
+ :value.sync="areamodel.f_position" :value-single="true"
345
+ :options='positions' placeholder='安装位置'
346
+ close-on-select>
347
+ </v-select>
348
+ </div>
349
+ <div class="col-sm-6 form-group form-input-group "
350
+ >
351
+ <label class="font_normal_body _zoom4">抄表员</label>
352
+ <input type="text"
353
+ style="width: 60%"
354
+ v-show="false" v-model="areamodel.f_inputtor">
355
+ <v-select
356
+ style="width: 60%"
357
+ :value.sync="areamodel.f_inputtor" :value-single="true"
358
+ :options='inputtores' placeholder='抄表员'
359
+ close-on-select>
360
+ </v-select>
361
+ </div>
362
+ <div class="col-sm-6 form-group form-input-group "
363
+ >
364
+ <label class="font_normal_body _zoom4">调压箱</label>
365
+ <input type="text"
366
+ style="width: 60%"
367
+ v-show="false" v-model="areamodel.f_adjustable_id">
368
+ <v-select
369
+ :value.sync="areamodel.f_adjustable_id" :value-single="true"
370
+ :options='adjustables' placeholder='调压箱'
371
+ close-on-select>
372
+ </v-select>
373
+ </div>
374
+ <!-- 写卡参数-->
375
+ <div class="col-sm-6 form-group form-input-group "
376
+ :class="[$v.is_close.required ? 'has-error' : '']">
377
+ <label for="is_close" class="font_normal_body _zoom4">死表关阀</label>
378
+ <input type="text"
379
+ style="width: 60%"
380
+ v-show="false"
381
+ v-model="areamodel.is_close"
382
+ v-validate:is_close='{required: true }'>
383
+ <v-select
384
+ style="width: 60%"
385
+ :value.sync="areamodel.is_close" v-model="areamodel.is_close"
386
+ :options='sbgf' placeholder='死表关阀'
387
+ :value-single="true"
388
+ close-on-select></v-select>
389
+ </div>
390
+ <div class="col-sm-6 form-group form-input-group "
391
+ :class="[$v.is_close_one.required ? 'has-error' : '']">
392
+ <label for="is_close_one" class="col-sm-1 font_normal_body _zoom4">第一次<br/>关阀天数</label>
393
+ <input type="text"
394
+ style="width: 60%"
395
+ class="form-control"
396
+ :value.sync="areamodel.is_close_one"
397
+ v-model="areamodel.is_close_one" placeholder='第一次关阀天数'
398
+ v-validate:is_close_one='{required: true }'
399
+ />
400
+ </div>
401
+ <div class="col-sm-6 form-group form-input-group "
402
+ :class="[$v.is_close_two.required ? 'has-error' : '']">
403
+ <label for="is_close_one" class="col-sm-1 font_normal_body _zoom4">第二次<br/>关阀天数</label>
404
+ <input type="text"
405
+ style="width: 60%"
406
+ class="form-control"
407
+ :value.sync="areamodel.is_close_two"
408
+ v-validate:is_close_two='{required: true }'
409
+ v-model="areamodel.is_close_two" placeholder='第二次关阀天数'
410
+ />
411
+ </div>
412
+ <div class="col-sm-6 form-group form-input-group "
413
+ :class="[$v.is_tablelimit.required ? 'has-error' : '']">
414
+ <label for="is_tablelimit" class="font_normal_body _zoom4">是否限购</label>
415
+ <input type="text"
416
+ style="width: 60%"
417
+ v-show="false"
418
+ v-model="areamodel.is_tablelimit"
419
+ v-validate:is_tablelimit='{required: true }'>
420
+ <v-select
421
+ style="width: 60%"
422
+ :value.sync="areamodel.is_tablelimit" v-model="areamodel.is_tablelimit"
423
+ :options='sbgf' placeholder='是否限购'
424
+ :value-single="true"
425
+ close-on-select></v-select>
426
+ </div>
427
+ <div class="col-sm-6 form-group form-input-group "
428
+ :class="[$v.is_tablelimit_gas.required ? 'has-error' : '']">
429
+ <label for="is_tablelimit_gas" class="col-sm-1 font_normal_body _zoom4">上限金额</label>
430
+ <input type="text"
431
+ style="width: 60%"
432
+ class="form-control"
433
+ :value.sync="areamodel.is_tablelimit_gas"
434
+ v-validate:is_tablelimit_gas='{required: true }'
435
+ v-model="areamodel.is_tablelimit_gas" placeholder='上限金额'
436
+ />
437
+ </div>
438
+ <div class="col-sm-6 form-group form-input-group "
439
+ :class="[$v.price_type.required ? 'has-error' : '']">
440
+ <label for="is_tablelimit" class="font_normal_body _zoom4">单价类型</label>
441
+ <input type="text"
442
+ style="width: 60%"
443
+ v-show="false"
444
+ v-model="areamodel.price_type"
445
+ v-validate:price_type='{required: true }'>
446
+ <v-select
447
+ style="width: 60%"
448
+ :value.sync="areamodel.price_type" v-model="areamodel.price_type"
449
+ :options='djlx' placeholder='单价类型'
450
+ :value-single="true"
451
+ close-on-select></v-select>
452
+ </div>
453
+ <div class="col-sm-6 form-group form-input-group "
454
+ :class="[$v.anjianyear.required ? 'has-error' : '']">
455
+ <label for="anjianyear" class="font_normal_body _zoom4">安检年数</label>
456
+ <input type="number" class="form-control"
457
+ v-validate:anjianyear='{required: true }'
458
+ style="width: 60%"
459
+ v-model="areamodel.anjianyear" placeholder='安检年数'
460
+ />
461
+ </div>
462
+ <div class="col-sm-6 form-group form-input-group "
463
+ :class="[$v.baofeiyear.required ? 'has-error' : '']">
464
+ <label for="anjianyear" class="font_normal_body _zoom4">报废年数</label>
465
+ <input type="number" class="form-control"
466
+ v-validate:baofeiyear='{required: true }'
467
+ style="width: 60%"
468
+ v-model="areamodel.baofeiyear" placeholder='报废年数'
469
+ />
470
+ </div>
471
+ <div class="col-sm-6 form-group form-input-group "
472
+ :class="[$v.onealarm.required ? 'has-error' : '']">
473
+ <label for="onealarm" class="col-sm-1 font_normal_body _zoom4">第一档<br/>报警气量</label>
474
+ <input type="text"
475
+ style="width: 60%"
476
+ class="form-control"
477
+ :value.sync="areamodel.onealarm"
478
+ v-validate:onealarm='{required: true }'
479
+ v-model="areamodel.onealarm" placeholder='第一档报警气量'
480
+ />
481
+ </div>
482
+ <div class="col-sm-6 form-group form-input-group "
483
+ :class="[$v.twoalarm.required ? 'has-error' : '']">
484
+ <label for="onealarm" class="col-sm-1 font_normal_body _zoom4">第二档<br/>报警气量</label>
485
+ <input type="text"
486
+ style="width: 60%"
487
+ class="form-control"
488
+ :value.sync="areamodel.twoalarm"
489
+ v-validate:twoalarm='{required: true }'
490
+ v-model="areamodel.twoalarm" placeholder='第二档报警气量'
491
+ />
492
+ </div>
493
+ </div>
494
+ <div v-if="f_special" class="col-sm-6">
495
+ <br/>
496
+ </div>
497
+ </div>
498
+ <div class="row" style="display: inline-block;margin-top: 10px;text-align: center">
499
+ <button class="btn btn-default fr" @click="cancel()">取消</button>
500
+ <button class="btn btn-success fr" v-if="operation!=='modify'" @click="confirm()" :disabled='!$v.valid'>保存
501
+ </button>
502
+ <button class="btn btn-success fr" v-if="operation==='modify'" @click="confirm()">保存</button>
503
+ </div>
504
+ </div>
505
+ </validator>
506
+ </div>
507
+ </template>
508
+ <style>
509
+ </style>
510
+
511
+ <script>
512
+ import {HttpResetClass} from 'vue-client'
513
+
514
+ export default {
515
+ title: '小区添加',
516
+ data() {
517
+ return {
518
+ devicetypes: this.$appdata.getParam('设备类型'),
519
+ distinct: this.$appdata.getParam('行政区域'),
520
+ opera_area: this.$appdata.getParam('运营区域'),
521
+ repair_point: this.$appdata.getParam('维修站点'),
522
+ residential_properties: this.$appdata.getParam('小区性质'),
523
+ heating_style: this.$appdata.getParam('供暖方式'),
524
+ blockslist: this.$appdata.getParam('所属街办'),
525
+ // repair_point: [{label: '航天站', value: '航天站'},
526
+ // {label: '韦曲站', value: '韦曲站'}, {label: '郭杜站', value: '郭杜站'},
527
+ // {label: '沣东站', value: '沣东站'},
528
+ // {label: '中心站', value: '中心站'}],
529
+ is_order: [{label: '开户', value: '开户'},
530
+ {label: '未开户', value: '未开户'}],
531
+ //初始化省市区数据
532
+ pcdslist: [],
533
+ //初始化街道数据
534
+ streetslist: [],
535
+ sbgf: [{label: '是', value: '是'},
536
+ {label: '否', value: '否'}],
537
+ //单价类型
538
+ djlx: [{label: '普通单价', value: '普通单价'},
539
+ {label: '阶梯单价', value: '阶梯单价'}],
540
+ //小区
541
+ areamodel: {
542
+ default_devices: [],
543
+ f_repair_point: '',
544
+ f_pcd_id: '',
545
+ f_block: '',
546
+ f_is_order: '',
547
+ oldid: '',
548
+ f_linkname: '',
549
+ f_linkphone: '',
550
+ f_street_id: '',
551
+ f_opera_area: '',
552
+ f_distinct: '',
553
+ f_slice_area: '',
554
+ f_adjustable_id: '',
555
+ f_residential_area: '',
556
+ f_user_type: '',
557
+ f_gasproperties: '',
558
+ f_meter_brand: '',
559
+ f_price_name: '',
560
+ f_area_address: '',
561
+ f_price_type: '',
562
+ f_meter_style: '',
563
+ f_position: '',
564
+ is_close: '',
565
+ is_close_one: 45,
566
+ is_close_two: 30,
567
+ is_tablelimit: '是',
568
+ is_tablelimit_gas: 20000,
569
+ price_type: '',
570
+ anjianyear: 3,
571
+ baofeiyear: 12,
572
+ onealarm: 20,
573
+ twoalarm: 10,
574
+ f_price_id: 0,
575
+ alarm: 0,
576
+ constant: 0,
577
+ f_gasbrand_id: 0,
578
+ f_gasmodel_id: 0,
579
+ default_cardfee: null,
580
+ card_start: null,
581
+ card_end: null,
582
+ card_now: null,
583
+ card_size: null,
584
+ f_isic: '',
585
+ },
586
+ }
587
+ },
588
+ props: ['f_special', 'areatype', 'row', 'operation', 'oldsize'],
589
+ ready() {
590
+ this.initdata()
591
+ },
592
+ init() {
593
+ this.$LoadParams.loadParam()
594
+ },
595
+ methods: {
596
+ //初始化省市区,添加街道
597
+ initpcds(pconditon) {
598
+ console.log("省市区准备")
599
+ let HttpReset = new HttpResetClass()
600
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=99999', {
601
+ data: {
602
+ items: '*',
603
+ tablename: 't_pcd',
604
+ orderitem: 'id desc',
605
+ condition: pconditon
606
+ }
607
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
608
+ let redata = []
609
+ req.data.forEach((row, n) => {
610
+ redata[n] = {
611
+ label: row.f_pcd,
612
+ value: row.id,
613
+ data: row,
614
+ id: row.id
615
+ }
616
+ })
617
+ this.pcdslist = redata
618
+ //this.$emit('ready')
619
+ })
620
+ },
621
+ //初始化街道 添加小区
622
+ initstreets(pconditon) {
623
+ console.log("街道数据准备")
624
+ let HttpReset = new HttpResetClass()
625
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=99999', {
626
+ data: {
627
+ items: '*',
628
+ tablename: 't_street',
629
+ orderitem: 'id desc',
630
+ condition: pconditon
631
+ }
632
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
633
+ let redata = []
634
+ req.data.forEach((row, n) => {
635
+ redata[n] = {
636
+ label: row.f_street,
637
+ value: row.id,
638
+ data: row,
639
+ id: row.id
640
+ }
641
+ })
642
+ this.streetslist = redata
643
+ //this.$emit('ready')
644
+ })
645
+ },
646
+ //根据名字找数据
647
+ findbyid(list, name) {
648
+ var result
649
+ list.forEach((row, n) => {
650
+ if (name == row.id) {
651
+ result = row.data
652
+ }
653
+ })
654
+ return result
655
+ },
656
+ //初始化数据
657
+ initdata() {
658
+ console.log('areatype是....', this.areatype, this.row)
659
+ this.initpcds(` 1=1 `)
660
+ this.initstreets(` 1=1 `)
661
+ },
662
+ //省/市/区变化
663
+ pcdChange(val) {
664
+ console.log("省/市/区变化", val)
665
+ if (val && this.operation == 'add') {
666
+ //那就把街道数据重新组织一下
667
+ this.initstreets(` f_pcd_id ='${val}' `)
668
+ if (this.areamodel.f_street_id) {
669
+ let pcd_id = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_pcd_id
670
+ if (pcd_id != val) {
671
+ this.areamodel.f_street_id = ''
672
+ }
673
+ }
674
+ }
675
+ this.$resetValidation()
676
+ },
677
+ //街道变化
678
+ streetChange(val) {
679
+ console.log("街道变化", val)
680
+ if (val && this.operation == 'add') {
681
+ if (this.areamodel.f_pcd_id.length == 0) {
682
+ this.areamodel.f_pcd_id = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_pcd_id
683
+ }
684
+ }
685
+
686
+ this.$resetValidation()
687
+ },
688
+ //保存
689
+ confirm() {
690
+ this.savearea()
691
+ this.cleardara()
692
+ this.$dispatch('confirm')
693
+ },
694
+ //获取当前小区档案中的最大卡号区间
695
+ getCard() {
696
+ if (this.oldsize > 0 && this.operation == 'modify') {
697
+ this.$showAlert('剩余卡号大于0,不能获取,避免浪费卡号', 'warning', 2000)
698
+ return
699
+ }
700
+ try {
701
+ let HttpReset = new HttpResetClass()
702
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
703
+ data: {
704
+ items: '*',
705
+ tablename: 't_area',
706
+ orderitem: 'card_end desc',
707
+ condition: " card_size is not null and card_end is not null and card_start is not null and f_special is null"
708
+ }
709
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
710
+ if (req.data.length > 0) {
711
+ let card = Number(req.data[0].card_end) + 1
712
+ //前面不够 补0
713
+ this.areamodel.card_start = this.pad(card + "", 10)
714
+ this.areamodel.card_now = this.areamodel.card_start
715
+ this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
716
+ } else {
717
+ //默认卡号为03980000001
718
+ let card = Number(this.$appdata.getSingleValue('启始卡号')) + 1
719
+ this.areamodel.card_start = this.pad(card + "", 10)
720
+ this.areamodel.card_now = this.areamodel.card_start
721
+ this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
722
+ }
723
+ })
724
+ } catch (error) {
725
+ this.$showAlert(error, 'danger', 0)
726
+ }
727
+ },
728
+ //前面补0
729
+ pad(num, n) {
730
+ while (num.length < n) {
731
+ num = "0" + num
732
+ }
733
+ return num;
734
+ },
735
+ //保存小区
736
+ savearea() {
737
+ if (this.f_special) {
738
+ this.areamodel.f_special = '1'
739
+ }
740
+ this.areamodel.f_operator = this.$login.f.name
741
+ this.areamodel.f_filiale = this.$login.f.f_fengongsi
742
+ this.areamodel.f_outlets = this.$login.f.f_parentname
743
+ this.areamodel.op_id = this.$login.f.op_id
744
+ this.areamodel.op_spot = this.$login.f.op_spot
745
+ this.areamodel.f_orgstr = this.$login.f.orgpathstr
746
+ this.areamodel.f_is_order = this.areamodel.f_is_order === '开户' ? this.areamodel.f_is_order : null
747
+ this.areamodel.f_pcd = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd
748
+ if (this.areamodel.f_street_id) {
749
+ this.areamodel.f_street = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
750
+ } else {
751
+ this.areamodel.f_street = ''
752
+ }
753
+ let result = this.$resetpost('rs/logic/address_updatearea', this.areamodel)
754
+ },
755
+ cleardara() {
756
+ this.areamodel = {
757
+ default_devices: [],
758
+ f_pcd_id: '',
759
+ oldid: '',
760
+ f_block: '',
761
+ f_linkname: '',
762
+ f_linkphone: '',
763
+ f_street_id: '',
764
+ f_slice_area: '',
765
+ f_adjustable_id: '',
766
+ f_residential_area: '',
767
+ f_user_type: '',
768
+ f_gasproperties: '',
769
+ f_meter_brand: '',
770
+ f_price_name: '',
771
+ f_area_address: '',
772
+ f_price_type: '',
773
+ f_meter_style: '',
774
+ f_position: '',
775
+ is_close: '',
776
+ is_close_one: 30,
777
+ is_close_two: 45,
778
+ is_tablelimit: '是',
779
+ is_tablelimit_gas: 20000,
780
+ price_type: '',
781
+ anjianyear: 3,
782
+ baofeiyear: 12,
783
+ onealarm: 20,
784
+ twoalarm: 10,
785
+ f_price_id: 0,
786
+ alarm: 0,
787
+ constant: 0,
788
+ f_gasbrand_id: 0,
789
+ f_gasmodel_id: 0,
790
+ f_isic: '',
791
+ default_cardfee: null,
792
+ f_heating_style: '',
793
+ f_residential_properties: '',
794
+ card_start: null,
795
+ card_end: null,
796
+ card_now: null,
797
+ card_size: null,
798
+ }
799
+ },
800
+ areaidCheck(){
801
+ let HttpReset = new HttpResetClass()
802
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
803
+ data: {
804
+ items: 'id',
805
+ tablename: 't_area',
806
+ orderitem: 'id desc',
807
+ condition: ` oldid = '${this.areamodel.oldid}' `
808
+ }
809
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
810
+ if (req.data.length > 0) {
811
+ this.areamodel.oldid = ''
812
+ this.$showAlert('ID重复,请检查ID是否正确!','warning',1000)
813
+ }
814
+ })
815
+ },
816
+ cancel() {
817
+ this.cleardara()
818
+ this.$dispatch('cancel')
819
+ },
820
+ getpricenames() {
821
+ let rs = new Array()
822
+ if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
823
+ let params = {
824
+ f_user_type: this.areamodel.f_user_type,
825
+ f_gasproperties: this.areamodel.f_gasproperties,
826
+ f_price_type: this.areamodel.f_price_type,
827
+ filter: this.$login.f.f_fengongsi
828
+ }
829
+ console.log('气价参数。,。。', params)
830
+ let ret = this.$GetSaleParam.getPrice(params)
831
+ ret.forEach((item, index) => {
832
+ rs.push({label: item.label, value: item.value.f_price_name, f_price_id: item.value.f_price_id})
833
+ })
834
+ }
835
+ return rs
836
+ },
837
+ getmeterbrands() {
838
+ let ret = this.$GetSaleParam.getGasbrand()
839
+ let rs = new Array()
840
+ if (this.areamodel.f_user_type || this.areamodel.f_gasproperties || this.areamodel.f_price_type) {
841
+ ret.forEach((item, index) => {
842
+ rs.push({label: item.label, value: item.value.f_meter_brand, id: item.value.id})
843
+ })
844
+ console.log("气表品牌: ", rs)
845
+ }
846
+ return rs
847
+ },
848
+ getmeterstyle() {
849
+ let ret = this.$GetSaleParam.getGasbrand()
850
+ console.log("气表型号ret: ", ret)
851
+ let rs = new Array()
852
+ if (this.areamodel.f_meter_brand) {
853
+ ret.forEach((item, index) => {
854
+ if (this.areamodel.f_meter_brand == item.value.f_meter_brand) {
855
+ item.value.gasmodel.forEach((item1, index) => {
856
+ rs.push({label: item1.label, value: item1.label, id: item1.value.id})
857
+ })
858
+ }
859
+ })
860
+ }
861
+ console.log("气表型号rs: ", rs)
862
+ return rs
863
+ },
864
+ },
865
+ watch: {
866
+ 'areatype'() {
867
+ this.initdata()
868
+ },
869
+ 'areamodel.f_pcd_id'() {
870
+ if (this.areamodel.f_pcd_id) {
871
+ if (this.areamodel.f_street_id) {
872
+ 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
873
+ } else {
874
+ this.areamodel.f_area_address = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd
875
+ }
876
+ }
877
+ },
878
+ 'areamodel.f_meter_style'() {
879
+ let arry = this.getmeterstyle()
880
+ arry.forEach((row, n) => {
881
+ if (this.areamodel.f_meter_style == row.value) {
882
+ this.areamodel.f_gasmodel_id = row.id
883
+ }
884
+ })
885
+ },
886
+ 'areamodel.f_meter_brand'() {
887
+ let arry = this.getmeterbrands()
888
+ arry.forEach((row, n) => {
889
+ if (this.areamodel.f_meter_brand == row.value) {
890
+ this.areamodel.f_gasbrand_id = row.id
891
+ }
892
+ })
893
+ },
894
+ 'areamodel.f_price_name'(val) {
895
+ if (this.areamodel.f_price_name) {
896
+ if (this.areamodel.f_price_name.indexOf('民用') > -1) {
897
+ this.areamodel.onealarm = 20
898
+ this.areamodel.twoalarm = 10
899
+ if (this.areamodel.default_devices.length === 0 && !this.f_special) this.areamodel.default_devices = ['灶具', '热水器']
900
+ } else if (this.areamodel.f_price_name.indexOf('锅炉') > -1) {
901
+ this.areamodel.onealarm = 20
902
+ this.areamodel.twoalarm = 10
903
+ if (this.areamodel.default_devices.length === 0 && !this.f_special) this.areamodel.default_devices = ['灶具', '壁挂锅炉']
904
+ }
905
+ }
906
+ let arry = this.getpricenames()
907
+ arry.forEach((row, n) => {
908
+ if (this.areamodel.f_price_name == row.value) {
909
+ this.areamodel.f_price_id = row.f_price_id
910
+ }
911
+ })
912
+ },
913
+ 'areamodel.f_street_id'() {
914
+ if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
915
+ 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
916
+ }
917
+ }
918
+
919
+ },
920
+ computed: {
921
+ usertypes() {
922
+ return this.$appdata.getParam('用户类型')
923
+ },
924
+ gasproperties() {
925
+ let rs = []
926
+ if (this.areamodel.f_user_type) {
927
+ rs = this.$appdata.getParam(this.areamodel.f_user_type)
928
+ }
929
+ return rs
930
+ },
931
+ meterbrands() {
932
+ let ret = this.$GetSaleParam.getGasbrand()
933
+ let rs = new Array()
934
+ if (this.areamodel.f_user_type || this.areamodel.f_gasproperties || this.areamodel.f_price_type) {
935
+ ret.forEach((item, index) => {
936
+ rs.push({label: item.label, value: item.value.f_meter_brand})
937
+ })
938
+ console.log("气表品牌: ", rs)
939
+ }
940
+ return rs
941
+ },
942
+ meterstyle() {
943
+ let ret = this.$GetSaleParam.getGasbrand()
944
+ console.log("气表型号ret: ", ret)
945
+ let rs = new Array()
946
+ if (this.areamodel.f_meter_brand) {
947
+ ret.forEach((item, index) => {
948
+ if (this.areamodel.f_meter_brand == item.value.f_meter_brand) {
949
+ item.value.gasmodel.forEach((item1, index) => {
950
+ rs.push({label: item1.label, value: item1.label})
951
+ })
952
+ }
953
+ })
954
+ }
955
+ console.log("气表型号rs: ", rs)
956
+ return rs
957
+ },
958
+ f_price_types() {
959
+ return this.$appdata.getParam('气价类型')
960
+ },
961
+ pricenames() {
962
+ let rs = new Array()
963
+ if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
964
+ let params = {
965
+ f_user_type: this.areamodel.f_user_type,
966
+ f_gasproperties: this.areamodel.f_gasproperties,
967
+ f_price_type: this.areamodel.f_price_type,
968
+ filter: this.$login.f.f_fengongsi
969
+ }
970
+ console.log('气价参数。,。。', params)
971
+ let ret = this.$GetSaleParam.getPrice(params)
972
+ ret.forEach((item, index) => {
973
+ rs.push({label: item.label, value: item.value.f_price_name})
974
+ })
975
+ }
976
+ return rs
977
+ },
978
+ positions() {
979
+ return this.$appdata.getParam('安装位置')
980
+ },
981
+ adjustables() {
982
+ let filter = this.$login.f.f_orgids
983
+ let ret = this.$GetSaleParam.getAdjustable(filter)
984
+ let arr = new Array()
985
+ ret.forEach((item, index) => {
986
+ arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
987
+ })
988
+ return [{label: '全部', value: ''}, ...arr]
989
+ },
990
+ sliceArea() {
991
+ return this.$appdata.getParam('所属区域')
992
+ },
993
+ inputtores() {
994
+ // 获取抄表员
995
+ let rs = new Array()
996
+ if (this.$login.f.f_gasman.length > 0) {
997
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
998
+ let temp = {
999
+ label: this.$login.f.f_gasman[i].name,
1000
+ value: this.$login.f.f_gasman[i].name
1001
+ }
1002
+ rs.push(temp)
1003
+ }
1004
+ }
1005
+ return rs
1006
+ },
1007
+ },
1008
+ }
1009
+ </script>
1010
+ <style>
1011
+ .box {
1012
+ width: 727px;
1013
+ height: 175px;
1014
+ border-radius: 2px;
1015
+ background-color: #fafafa;
1016
+ border: 1px solid #999999;
1017
+ margin-top: 13px;
1018
+ }
1019
+ </style>