safecheck-client 3.0.33-15 → 3.0.33-16

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,685 +1,793 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row">
8
- <div class="form-group col-sm-3">
9
- <label class="font_normal_body">客户编号</label>
10
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
- style="width: 60%" placeholder="客户编号" condition="f_userinfo_code='{}'">
12
- </div>
13
- <div class="form-group col-sm-3">
14
- <label class="font_normal_body">客户名称</label>
15
- <input type="text" class="input_search" v-model="model.f_user_name"
16
- style="width: 60%" placeholder="客户名称" condition="f_user_name like '%{}%'">
17
- </div>
18
- <div class="form-group col-sm-3">
19
- <label class="font_normal_body">用气性质</label>
20
- <v-select
21
- class="select select_list"
22
- :value.sync="model.f_gasproperties"
23
- v-model="model.f_gasproperties"
24
- :options='$parent.$parent.gasproperties'
25
- placeholder='请选择'
26
- condition="f_gasproperties='{}'"
27
- :search="false"
28
- close-on-select
29
- value-single
30
- >
31
- </v-select>
32
- </div>
33
- <div class="form-group col-sm-3">
34
- <button class="button_spacing button_search" @click="search()">查询</button>
35
- <div style="float: right" class="button_spacing"
36
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
37
- @click="$parent.$parent.hidden()"></div>
38
- </div>
39
-
40
- <!-- <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">-->
41
- <!-- <label class="font_normal_body">客户地址</label>-->
42
- <!-- <input type="text" class="input_search" v-model="model.f_address"-->
43
- <!-- style="width: 60%" placeholder="客户地址" condition="tua.f_address like '%{}%'">-->
44
- <!-- </div>-->
45
- <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
46
- <label class="font_normal_body">客户类型</label>
47
- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
48
- :value-single="true" style="width: 60%"
49
- class="select_list select"
50
- :options='$parent.$parent.userTypes' placeholder='客户类型'
51
- close-on-select
52
- condition="f_user_type ='{}'"></v-select>
53
- </div>
54
- <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
55
- <label class="font_normal_body">用气类型</label>
56
- <v-select class="select_list select"
57
- placeholder='请选择' style="width: 60%"
58
- :value.sync="model.f_user_gas_type"
59
- v-model="model.f_user_gas_type"
60
- :options='$parent.$parent.userGasType'
61
- filer-key="name"
62
- close-on-select clear-button
63
- condition="f_user_gas_type='{}'"
64
- :value-single="true">
65
- </v-select>
66
- </div>
67
- <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
68
- <label class="font_normal_body">用户标签</label>
69
- <v-select class="select_list select"
70
- placeholder='请选择' style="width: 60%"
71
- :value.sync="model.f_user_tags"
72
- v-model="model.f_user_tags"
73
- :options='$parent.$parent.userTags'
74
- filer-key="name"
75
- close-on-select clear-button
76
- condition="f_user_tags='{}'"
77
- :value-single="true">
78
- </v-select>
79
- </div>
80
- </div>
81
- <div class="row">
82
- <div class="col-sm-3 form-group" style="margin-bottom: 0px" v-show="$parent.$parent.criteriaShow">
83
- <label class="font_normal_body">公&emsp;&emsp;司</label>
84
- <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="f_orgid in {}"></right-tree-safe>
85
- </div>
86
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
87
-
88
- <label class="font_normal_body">片区名称</label>
89
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
90
- :value-single="true" style="width: 60%"
91
- class="select_list select"
92
- :options='$parent.$parent.checkBooks' placeholder='片区名称'
93
- close-on-select
94
- condition="f_check_book_id ='{}'"></v-select>
95
-
96
- </div>
97
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
98
- <label class="font_normal_body">是否在册</label>
99
- <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
100
- :value-single="true" style="width: 60%"
101
- class="select_list select"
102
- @change="$parent.$parent.changeState"
103
- :options='$parent.$parent.isCheckBook' placeholder='有无所属片区'
104
- close-on-select
105
- condition="{}"></v-select>
106
- </div>
107
- </div>
108
- <div class="row">
109
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
110
- <label class="font_normal_body">区/县</label>
111
- <input type="text" class="input_search" v-model="model.f_pcd"
112
- style="width: 60%" placeholder="区/县" condition="f_pcd like '%{}%'">
113
- </div>
114
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
115
- <label class="font_normal_body">街道/乡镇</label>
116
- <input type="text" class="input_search" v-model="model.f_street"
117
- style="width: 60%" placeholder="街道/乡镇" condition="f_street like '%{}%'">
118
- </div>
119
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
120
- <label class="font_normal_body">街道/乡镇</label>
121
- <input type="text" class="input_search" v-model="model.f_community_name"
122
- style="width: 60%" placeholder="街道/乡镇" condition="f_community_name like '%{}%'">
123
- </div>
124
- <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
125
- <label class="font_normal_body">小区/自然村</label>
126
- <input type="text" class="input_search" v-model="model.f_residential_area"
127
- style="width: 60%" placeholder="小区/自然村" condition="f_residential_area like '%{}%'">
128
- </div>
129
- </div>
130
- </div>
131
- </criteria>
132
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
133
- <template partial='head'>
134
- <tr @dblclick.stop="">
135
- <th>
136
- <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
137
- </th>
138
- <th>
139
- <nobr>客户姓名</nobr>
140
- </th>
141
- <th>
142
- <nobr>客户编号</nobr>
143
- </th>
144
- <th>
145
- <nobr>客户类型</nobr>
146
- </th>
147
- <th>
148
- <nobr>客户电话</nobr>
149
- </th>
150
- <th>
151
- <nobr>区/县</nobr>
152
- </th>
153
- <th>
154
- <nobr>街道/乡镇</nobr>
155
- </th>
156
- <th>
157
- <nobr>片区/行政村</nobr>
158
- </th>
159
- <th>
160
- <nobr>小区/自然村</nobr>
161
- </th>
162
- <th>
163
- <nobr>客户地址</nobr>
164
- </th>
165
- <th>
166
- <nobr>所属片区</nobr>
167
- </th>
168
- </tr>
169
- </template>
170
- <template partial='body'>
171
- <!-- <td style="text-align: center">-->
172
- <!-- <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"-->
173
- <!-- @change="$parent.$parent.$parent.checkChange(row, $event)"></input>-->
174
- <!-- </nobr>-->
175
- <!-- </td>-->
176
- <td style="text-align: center">{{ row.f_user_name }}</td>
177
- <td style="text-align: center">{{ row.f_userinfo_code }}</td>
178
- <td style="text-align: center">{{ row.f_user_type }}</td>
179
- <td style="text-align: center">{{ row.f_user_phone }}</td>
180
- <td style="text-align: center">{{ row.f_pcd }}</td>
181
- <td style="text-align: center">{{ row.f_street }}</td>
182
- <td style="text-align: center">{{ row.f_community_name }}</td>
183
- <td style="text-align: center">{{ row.f_residential_area }}</td>
184
- <td style="text-align: center">{{ row.f_address }}</td>
185
- <td style="text-align: center">{{ row.f_check_book_name }}</td>
186
- </template>
187
- </data-grid>
188
- </criteria-paged>
189
- </div>
190
- <modal :show.sync="showModal" :backdrop="false">
191
- <div slot="modal-header" class="modal-header">
192
- <h4 class="modal-title">
193
- 创建片区
194
- </h4>
195
- </div>
196
- <div slot="modal-body" class="modal-body">
197
- <div v-if="true">
198
- <div class="row" style="margin-top: 10px">
199
- <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">片区名称</label>-->
200
- <!-- <div class="col-xs-8 col-md-8">-->
201
- <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
202
- <!-- </div>-->
203
- <div class="col-sm-12 form-group" style="margin: 0">
204
- <role-selector-safe
205
- @re-res="getRes"
206
- role-name="安检员"
207
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
208
- :value.sync="checkBook.f_checker_name"
209
- v-model="checkBook.f_checker_name">
210
- </role-selector-safe>
211
- </div>
212
- <div class="form-group col-sm-6" style="margin-top: 20px">
213
- <label class="font_normal_body">片区名</label>
214
- <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
215
- style="width: 60%" >
216
- </div>
217
- <div class="form-group col-sm-6" style="margin-top: 20px">
218
- <label class="font_normal_body">执行日期</label>
219
- <datepicker
220
- :value.sync="checkBook.f_run_date"
221
- style="width: 60%"
222
- :format="'yyyy-MM-dd'"
223
- v-model="checkBook.f_run_date"
224
- >
225
- </datepicker>
226
- </div>
227
- <div class="form-group col-sm-6" style="margin-top: 20px">
228
- <label class="font_normal_body">执行周期</label>
229
- <input type="number" class="input_search" v-model="checkBook.f_around_time"
230
- style="width: 60%" >
231
- </div>
232
- <div class="form-group col-sm-6" style="margin-top: 20px">
233
- <label class="font_normal_body">周期单位</label>
234
- <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
235
- :value-single="true" style="width: 60%"
236
- class="select_list select"
237
- :options='aroundUnit' placeholder=''
238
- close-on-select></v-select>
239
- </div>
240
- </div>
241
- </div>
242
- </div>
243
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
244
- <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
245
- <button class="button_search" @click="cancel">取消</button>
246
- </div>
247
- </modal>
248
- <modal :show.sync="showModal2" :backdrop="false">
249
- <div slot="modal-header" class="modal-header">
250
- <h4 class="modal-title">
251
- 添加用户
252
- </h4>
253
- </div>
254
- <div slot="modal-body" class="modal-body">
255
- <div v-if="true">
256
- <div class="row" style="margin-top: 10px">
257
- <div class="form-group col-sm-12" style="margin-top: 20px">
258
- <label class="font_normal_body">片&ensp;区&ensp;名</label>
259
- <v-select :value.sync="selectBook" v-model='selectBook'
260
- :value-single="true" style="width: 80%"
261
- class="select_list select"
262
- :options='checkBooks' placeholder=''
263
- close-on-select></v-select>
264
- </div>
265
- </div>
266
- </div>
267
- </div>
268
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
269
- <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
270
- <button class="button_search" @click="cancel2">取消</button>
271
- </div>
272
- </modal>
273
- <modal :show.sync="showModal3" :backdrop="false">
274
- <div slot="modal-header" class="modal-header">
275
- <h4 class="modal-title">
276
- 调整用户
277
- </h4>
278
- </div>
279
- <div slot="modal-body" class="modal-body">
280
- <div v-if="true">
281
- <div class="row" style="margin-top: 10px;text-align: center">
282
- <div class="form-group col-sm-12" style="margin-top: 20px">
283
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
284
- <v-select :value.sync="selectBook" v-model='selectBook'
285
- :value-single="true" style="width: 80%"
286
- class="select_list select"
287
- :options='checkBooks' placeholder=''
288
- close-on-select></v-select>
289
- </div>
290
- </div>
291
- </div>
292
- </div>
293
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
294
- <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
295
- <button class="button_search" @click="cancel3">取消</button>
296
- </div>
297
- </modal>
298
-
299
- </div>
300
- </template>
301
-
302
- <script>
303
- import {PagedList, HttpResetClass} from 'vue-client'
304
- import * as Util from "../../../components/Util";
305
- import bus from "../../../bus";
306
-
307
- export default {
308
- title: '片区管理',
309
- data () {
310
- let model = new PagedList('rs/sql/getUserByCheckBookuser', 20)
311
- return {
312
- model: model,
313
- criteriaShow: false,
314
- excelHeaders: {},
315
- checkBooks: [],
316
- f_orgid: '',
317
- bookAll: false,
318
- bookList: [],
319
- selectBook:'',
320
- userTypes: [{label: '全部', value: ''},{label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
321
- // init:false,
322
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
323
- isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
324
- isSearch: false,
325
- checkBook: {
326
- f_check_book_name: '',
327
- f_run_date: '',
328
- f_around_time: '',
329
- f_around_unit: '',
330
- f_create_date: Util.toStandardDateString(),
331
- f_create_person: this.$login.f.name,
332
- f_orgid: '',
333
- f_checker_name: ''
334
- },
335
- showModal: false,
336
- showModal2: false,
337
- showModal3: false,
338
- userGasType:[{label: '全部', value: ''},...this.$appdata.getParam('用气类型')],
339
- userTags:[{label: '全部', value: ''},...this.$appdata.getParam('用户标签')],
340
- gasproperties:[{label: '全部', value: ''},...this.$appdata.getParam('用气性质')],
341
- }
342
- },
343
- props: {
344
- showtype:{
345
- type: String
346
- }
347
- },
348
- computed: {
349
- searchData () {
350
- return {condition: this.model.condition}
351
- },
352
- bookCondition () {
353
- return this.model.condition
354
- },
355
- isCreateBook () {
356
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
357
- },
358
- isChangeBook () {
359
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
360
- }
361
- },
362
- watch:{
363
- 'bookList'(){
364
- this.$emit('book-list',this.bookList)
365
- },
366
- 'bookAll'(val){
367
- if(!val){
368
- this.bookList=[]
369
- }
370
-
371
- this.$emit('book-all',this.bookAll)
372
- }
373
- },
374
- methods: {
375
- async ok2() {
376
- if (!this.selectBook) {
377
- this.$showMessage('请选择片区')
378
- return
379
- }
380
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
381
- let userCondition = ''
382
- if (this.bookList.length < 1) {
383
- //tag
384
- userCondition = this.bookCondition
385
- } else {
386
- //tag)
387
-
388
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
389
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
390
- //tag
391
- }
392
- let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
393
- FROM
394
- t_userinfo tui
395
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
396
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
397
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
398
- WHERE
399
- tui.f_user_state = '正常'
400
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
401
- AND ${userCondition}`
402
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
403
- {resolveMsg: null, rejectMsg: '添加用户失败'})
404
- this.$showMessage('添加用户成功')
405
- this.selectBook = ''
406
- this.bookAll = false
407
- this.bookList = []
408
- this.showModal2 = false
409
- this.$refs.paged.$refs.criteria.search()
410
- }
411
- },
412
- async ok3() {
413
- if (!this.selectBook) {
414
- this.$showMessage('请选择片区')
415
- return
416
- }
417
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
418
- let userCondition = ''
419
- if (this.bookList.length < 1) {
420
- //tag
421
- userCondition = this.bookCondition
422
- } else {
423
- //tag)
424
-
425
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
426
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
427
- //tag
428
- }
429
- let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
430
- FROM
431
- t_userinfo tui
432
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
433
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
434
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
435
- WHERE
436
- tui.f_user_state = '正常'
437
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
438
- AND ${userCondition}`
439
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
440
- {resolveMsg: null, rejectMsg: '调整用户失败'})
441
- this.$showMessage('调整用户成功')
442
- this.selectBook = ''
443
- this.bookAll = false
444
- this.bookList = []
445
- this.showModal3 = false
446
- this.$refs.paged.$refs.criteria.search()
447
- }
448
- },
449
- cancel2(){
450
- this.selectBook = ''
451
- this.bookAll = false
452
- this.bookList = []
453
- this.showModal2 = false
454
- this.$refs.paged.$refs.criteria.search()
455
- },
456
- cancel3(){
457
- this.selectBook = ''
458
- this.bookAll = false
459
- this.bookList = []
460
- this.showModal3 = false
461
- this.$refs.paged.$refs.criteria.search()
462
- },
463
- addUser () {
464
- if (!this.isCreateBook) {
465
- this.$showMessage('请选择查询未划分片区的用户')
466
- return
467
- }
468
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
469
- this.showModal2 = true
470
- this.freshCheckBook()
471
- return
472
- }
473
- this.$showMessage('请选择用户')
474
- },
475
- upUser () {
476
- if (!this.isChangeBook) {
477
- this.$showMessage('请选择查询已划分片区的用户')
478
- return
479
- }
480
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
481
- this.showModal3 = true
482
- this.freshCheckBook()
483
- return
484
- }
485
- this.$showMessage('请选择用户')
486
- },
487
- async delUser () {
488
- if (!this.isChangeBook) {
489
- this.$showMessage('请选择查询已划分片区的用户')
490
- return
491
- }
492
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
493
- let userCondition= ''
494
- if (this.bookList.length < 1) {
495
- //tag
496
- userCondition = this.bookCondition
497
- } else {
498
- //tag)
499
-
500
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
501
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
502
- //tag
503
- }
504
- let delUser= `update t_user_address set f_check_book_id =null
505
- FROM
506
- t_userinfo tui
507
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
508
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
509
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
510
- WHERE
511
- tui.f_user_state = '正常'
512
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
513
- AND ${userCondition}`
514
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
515
- {resolveMsg: null, rejectMsg: '删除片区失败'})
516
- this.$showMessage('从片区删除所选用户成功')
517
- this.selectBook = ''
518
- this.bookAll = false
519
- this.bookList = []
520
- this.showModal3 = false
521
- this.$refs.paged.$refs.criteria.search()
522
- return
523
- }
524
- this.$showMessage('请选择用户')
525
- },
526
- beforeCreateBook () {
527
- if (!this.isCreateBook) {
528
- this.$showMessage('请选择查询未划分片区的用户')
529
- return
530
- }
531
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
532
- this.showModal = true
533
- return
534
- }
535
- this.$showMessage('请选择用户')
536
- },
537
- ok () {
538
- //tag)
539
- let condition = ''
540
- if (!this.checkBook.f_check_book_name) {
541
- return this.$showMessage('请填写册名')
542
- }
543
- if (!this.checkBook.f_checker_name) {
544
- return this.$showMessage('请选择安检员')
545
- }
546
- if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
547
- return this.$showMessage('请选填写周期信息')
548
- }
549
- if (!this.checkBook.f_run_date) {
550
- return this.$showMessage('执行日期')
551
- }
552
- if (this.bookList.length < 1) {
553
- //tag
554
- condition = this.bookCondition
555
- } else {
556
- //tag)
557
-
558
- condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
559
- condition = 'tui.f_userinfo_id in (' + condition + ')'
560
- //tag
561
- }
562
- let data = {
563
- checkBook: this.checkBook,
564
- sqlStr: condition
565
- }
566
- new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
567
- //tag)
568
- if (res.data.id) {
569
- this.$showMessage('创建成功')
570
- this.showModal = false
571
- this.isSearch = false
572
- this.bookList = []
573
- this.bookAll = false
574
- this.freshCheckBook()
575
- this.$refs.paged.$refs.criteria.search()
576
- }
577
- })
578
- },
579
- changeState (val) {
580
- //tag
581
- //tag
582
- this.bookAll = false
583
- this.bookList = []
584
- if (this.$refs.paged.$refs.criteria.model.f_orgid){
585
- this.$refs.paged.$refs.criteria.search()
586
- }
587
- },
588
- cancel () {
589
- this.bookAll = false
590
- this.bookList = []
591
- this.showModal = false
592
- this.$refs.paged.$refs.criteria.search()
593
- },
594
- checkModel (row) {
595
- if (this.bookAll) {
596
- //tag)
597
- return true
598
- } else {
599
- // this.bookList = []
600
- if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
601
- return true
602
- } else {
603
- return false
604
- }
605
- }
606
- },
607
- checkChange (row, e) {
608
- //tag
609
- if (e.target.checked) {
610
- this.bookList.push(row.f_userinfo_id)
611
- } else {
612
- this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
613
- }
614
- // //tag)
615
- },
616
- getRes (obj) {
617
- this.checkBook.f_orgid = obj.resids[0]
618
- },
619
- getResm (obj) {
620
- this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
621
- },
622
- hidden () {
623
- this.criteriaShow = !this.criteriaShow
624
- },
625
- selfSearch (args) {
626
- this.isSearch = true
627
- this.bookAll = false
628
- this.bookList = []
629
-
630
- console.log("查询66666666666666666")
631
- this.$emit('book-condition',args.condition)
632
- // if (this.$refs.paged.$refs.criteria.model.f_orgid){
633
- // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
634
- // }
635
- args.condition += ` and f_user_type = '${this.showtype}' `
636
- this.model.search(args.condition, args.model)
637
- },
638
- freshCheckBook () {
639
- this.checkBooks = []
640
- new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
641
- data: {
642
- items: 'id,f_check_book_name,f_check_book_type',
643
- tablename: 't_check_book',
644
- condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
645
- orderitem: 'id desc'
646
- }
647
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
648
- this.checkBooks.push({label: '全部', value: ''})
649
- res.data.forEach(ress => {
650
- console.log("片区类型",ress)
651
- if(ress.f_check_book_type ==='用户'){
652
- this.checkBooks.push({
653
- label: ress.f_check_book_name,
654
- value: ress.id
655
- })
656
- }
657
-
658
- })
659
- })
660
- }
661
- },
662
- beforeDestroy() {
663
- //tag
664
- bus.$off('fresh-user')
665
- },
666
- ready () {
667
- bus.$on('fresh-user',()=>{
668
- console.log("进入方法")
669
- this.bookAll = false
670
- this.bookList = []
671
- this.$refs.paged.$refs.criteria.search()
672
- })
673
- this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
674
- //tag
675
- // this.init=true
676
- this.freshCheckBook()
677
- }
678
- }
679
- </script>
680
- <style scoped>
681
- /*.btn-group > .btn:first-child {*/
682
- /* margin-left: 0;*/
683
- /* width: 100%;*/
684
- /*}*/
685
- </style>
1
+ <template>
2
+ <div id='MbpeopleList' class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+ <div class="col-sm-3 form-group">
8
+ <label class="font_normal_body">用户编号</label>
9
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code"
10
+ condition="f_userinfo_code = '{}'" placeholder='用户编号'>
11
+ </div>
12
+ <div class="col-sm-3 form-group">
13
+ <label class="font_normal_body">用户姓名</label>
14
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_user_name"
15
+ condition="f_user_name = '{}'" placeholder='用户姓名'>
16
+ </div>
17
+
18
+ <div class="form-group button-range" style="float: right">
19
+ <button class="button_search button_spacing" @click="$parent.$parent.search()">查询</button>
20
+ <button class="button_clear button_spacing" @click="clear">清空</button>
21
+ <!-- <button class="button_export button_spacing" @click="$parent.$parent.importFile">导入</button>-->
22
+ <!-- <export-excel-->
23
+ <!-- :data="{condition:$parent.$parent.condition}"-->
24
+ <!-- :field="$parent.$parent.getfield"-->
25
+ <!-- sqlurl="api/af-revenue/logic/exportfile" sql-name="salembPeopleList" template-name='表册用户导出'-->
26
+ <!-- :choose-col="true"></export-excel>-->
27
+ <div style="float: right" class="button_spacing"
28
+ :class="{'button_shrink_top': $parent.$parent.criteriaShow,'button_shrink_bottom': !$parent.$parent.criteriaShow}"
29
+ @click="$parent.$parent.criteriaShow = !$parent.$parent.criteriaShow"></div>
30
+ </div>
31
+ </div>
32
+ <div class="row" v-show="$parent.$parent.criteriaShow">
33
+ <div class="col-sm-3 form-group">
34
+ <label class="font_normal_body">&nbsp;小&nbsp;区&nbsp;域</label>
35
+ <v-select :value.sync="model.f_small_area" v-model="model.f_small_area"
36
+ :options='$parent.$parent.smallareas' placeholder='小区域'
37
+ close-on-select :search='true'
38
+ condition="f_small_area = '{}'"></v-select>
39
+ </div>
40
+ <div class="form-group col-sm-3">
41
+ <label class="font_normal_body">用户电话</label>
42
+ <input type="text" class="form-control" v-model="model.f_user_phone" placeholder='用户电话'
43
+ condition="f_user_phone like '%{}%'" v-next-el='yhxm' style="width: 60%"
44
+ >
45
+ </div>
46
+ <div class="col-sm-2 form-group" title="参数名称:【用气类型】">
47
+ <label class="font_normal_body" >用气类型</label>
48
+ <v-select :value.sync="model.f_user_gas_type"
49
+ v-model="model.f_user_gas_type"
50
+ :options='$parent.$parent.usergastype' placeholder='请选择'
51
+ condition="f_user_gas_type in {}"
52
+ close-on-select></v-select>
53
+ </div>
54
+ <div class="col-sm-2 form-group" title="参数名称:【用户标签】">
55
+ <label class="font_normal_body" >用户标签</label>
56
+ <v-select :value.sync="model.f_user_tags"
57
+ v-model="model.f_user_tags"
58
+ :options='$parent.$parent.usertags' placeholder='请选择'
59
+ condition="f_user_tags in {}"
60
+ close-on-select></v-select>
61
+ </div>
62
+ <div class="form-group col-sm-3">
63
+ <label class="font_normal_body">客户类型</label>
64
+ <v-select :options='$parent.$parent.user_type' :value.sync="model.f_user_type"
65
+ close-on-select condition="f_user_type='{}'"
66
+ placeholder='用户类型' v-model="model.f_user_type"></v-select>
67
+ </div>
68
+ <div class="form-group col-sm-3">
69
+ <label class="font_normal_body">客户状态</label>
70
+ <v-select :options='$parent.$parent.user_state' :value.sync="model.f_user_state"
71
+ close-on-select condition="f_user_state = '{}'"
72
+ placeholder='客户状态' v-model="model.f_user_state"></v-select>
73
+ </div>
74
+ <div class="col-sm-3 form-group">
75
+ <label class="font_normal_body">所属表册</label>
76
+ <v-select :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
77
+ :options='$parent.$parent.meterbooks' placeholder='安检册'
78
+ :value-single="true"
79
+ condition="f_meter_book_num='{}'"
80
+ style="width:60%"
81
+ close-on-select></v-select>
82
+ </div>
83
+ <div class="col-sm-3 form-group">
84
+ <label class="font_normal_body">抄&nbsp;表&nbsp;员&nbsp;</label>
85
+ <v-select :value.sync="model.f_inputtor" v-model='model.f_inputtor'
86
+ style="width:60%"
87
+ condition="f_inputtor in {}"
88
+ :options='$parent.$parent.inputtores' placeholder='抄表员'
89
+ close-on-select
90
+ v-el:cc></v-select>
91
+ </div>
92
+ <div class="col-sm-3 form-group">
93
+ <label class="font_normal_body">表箱号&emsp;</label>
94
+ <input style="width:60%" type="text" class="form-control" v-model="model.f_metertitles"
95
+ condition="f_metertitles like '%{}%'" placeholder='表箱号'
96
+ >
97
+ </div>
98
+ <div class="form-group col-sm-3">
99
+ <label class="font_normal_body">用气性质</label>
100
+ <v-select :options='$parent.$parent.gasproperties' :value.sync="model.f_gasproperties"
101
+ close-on-select condition="f_gasproperties='{}'"
102
+ placeholder='用气性质' v-model="model.f_gasproperties"></v-select>
103
+ </div>
104
+ <div class="form-group col-sm-3">
105
+ <label class="font_normal_body">气表类型</label>
106
+ <v-select :options='$parent.$parent.meter_classify' :value.sync="model.f_meter_classify"
107
+ close-on-select condition="f_meter_classify='{}'"
108
+ placeholder='气表类型' v-model="model.f_meter_classify"></v-select>
109
+ </div>
110
+ <div class="col-sm-3 form-group">
111
+ <label class="font_normal_body">气表品牌</label>
112
+ <v-select :value.sync="model.f_meter_brand"
113
+ v-model="model.f_meter_brand"
114
+ :options='$parent.$parent.meterbrands' placeholder='请选择'
115
+ condition="f_meter_brand in {}"
116
+ close-on-select></v-select>
117
+ </div>
118
+ <div class="form-group col-sm-3">
119
+ <label class="font_normal_body">气表状态</label>
120
+ <v-select :options='$parent.$parent.table_state' :value.sync="model.f_table_state"
121
+ close-on-select condition="f_table_state = '{}'"
122
+ placeholder='气表状态' v-model="model.f_table_state"></v-select>
123
+ </div>
124
+ <div class="col-sm-3 form-group">
125
+ <label class="font_normal_body">小&emsp;区&emsp;</label>
126
+ <input type="text" class="input_search" v-model="model.f_residential_area" style="width: 60%"
127
+ condition=" f_residential_area like '{}%'" placeholder="输入小区">
128
+ </div>
129
+ <div class="form-group col-sm-3">
130
+ <label class="font_normal_body">客户地址</label>
131
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_address"
132
+ condition="f_address like '%{}%'" placeholder='客户地址'>
133
+ </div>
134
+ <div class="col-sm-3 form-group">
135
+ <label class="font_normal_body">楼&emsp;号&emsp;</label>
136
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_building"
137
+ condition="f_building = '{}'" placeholder='楼号'>
138
+ </div>
139
+ <div class="form-group col-sm-3">
140
+ <label class="font_normal_body">组织机构</label>
141
+ <res-select :initresid='$parent.$parent.curorgid'
142
+ @res-select="$parent.$parent.getorg"
143
+ class="select select_list"
144
+ restype='organization' :is-mul="false"
145
+ style="width: 60%">
146
+ </res-select>
147
+ </div>
148
+ <div class="form-group col-sm-3">
149
+ <label class="font_normal_body">是否在册</label>
150
+ <v-select :options='$parent.$parent.whether_list'
151
+ :value.sync="model.f_book_name"
152
+ v-model="model.f_book_name"
153
+ close-on-select condition="f_book_name {}"
154
+ placeholder='是否在册' ></v-select>
155
+ </div>
156
+ <div class="col-sm-3 form-group">
157
+ <label class="font_normal_body">入户证号</label>
158
+ <input style="width:60%" type="text" class="form-control" v-model="model.f_book_no"
159
+ condition="f_book_no like '%{}%'" placeholder='入户证号'
160
+ >
161
+ </div>
162
+ <div class="col-sm-3 form-group">
163
+ <label class="font_normal_body">表&emsp;号&emsp;</label>
164
+ <input style="width:60%" type="text" class="form-control" v-model="model.f_meternumber"
165
+ condition="f_meternumber like '%{}%'" placeholder='表号'
166
+ >
167
+ </div>
168
+
169
+ <div class="col-sm-3 form-group">
170
+ <label class="font_normal_body">街道/乡镇</label>
171
+ <v-select :value.sync="model.f_street_id" :value-single="true"
172
+ :options='$parent.$parent.streetslist' placeholder='请选择'
173
+ condition="f_street_id = '{}'"
174
+ v-model='model.f_street_id'
175
+ @change="$parent.$parent.streetChange"
176
+ close-on-select :search="true" >
177
+ </v-select>
178
+ </div>
179
+ <div class="col-sm-3 form-group">
180
+ <label class="font_normal_body">片区/行政村</label>
181
+ <v-select :value.sync="model.f_community_id" v-model='model.f_community_id'
182
+ :options='$parent.$parent.communitylist' placeholder='片区/管理站' filer-key="name"
183
+ condition="f_community_id = '{}'"
184
+ @change="$parent.$parent.communityChange"
185
+ close-on-select v-ref:slice>
186
+ </v-select>
187
+ </div>
188
+ <div class="col-sm-3 form-group">
189
+ <label class="font_normal_body">小区/自然村</label>
190
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
191
+ :options='$parent.$parent.areaslist' placeholder='请选择'
192
+ condition="f_residential_area_id = '{}'"
193
+ v-model='model.f_residential_area_id'
194
+ close-on-select>
195
+ </v-select>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </criteria>
200
+ <data-grid class="list_area table_sy" :model="model" partial='list' v-ref:grid :optional="true">
201
+ <template partial='head'>
202
+ <!--<th>-->
203
+ <!--<input type="checkbox" id="f_operator" v-model="$parent.$parent.$parent.all[model.pageIndex-1]"-->
204
+ <!--@change="$parent.$parent.$parent.select()"/>-->
205
+ <!--</th>-->
206
+ <th><nobr>序号</nobr></th>
207
+ <th><nobr>客户编号</nobr></th>
208
+ <th><nobr>客户名称</nobr></th>
209
+ <th><nobr>客户状态</nobr></th>
210
+
211
+ <th><nobr>区/县</nobr></th>
212
+ <th><nobr>街道/乡镇</nobr></th>
213
+ <th><nobr>片区/行政村</nobr></th>
214
+ <th><nobr>小区/自然村</nobr></th>
215
+ <th><nobr>客户地址</nobr></th>
216
+ <th><nobr>表号</nobr></th>
217
+ <th><nobr>气表状态</nobr></th>
218
+ <th><nobr>所属表册</nobr></th>
219
+ <th><nobr>册内排序</nobr></th>
220
+ <th><nobr>表箱号</nobr></th>
221
+ <th><nobr>入户证号</nobr></th>
222
+ <th><nobr>表底数</nobr></th>
223
+ </template>
224
+ <template partial='body'>
225
+ <!--<td>-->
226
+ <!--<input :id="'body'+model.pageIndex" type='checkbox' @change="$parent.$parent.$parent.selectOne($event,row,$index)"-->
227
+ <!--:checked="$parent.$parent.$parent.ischecked(model.pageIndex-1,$index)"/>-->
228
+ <!--</td>-->
229
+ <td>{{$index+1}}</td>
230
+ <td>{{row.f_userinfo_code}}</td>
231
+ <td>{{row.f_user_name}}</td>
232
+ <td>{{row.f_user_state}}</td>
233
+
234
+ <td>{{row.f_pcd}}</td>
235
+ <td>{{row.f_street}}</td>
236
+ <td>{{row.f_community}}</td>
237
+ <td>{{row.f_residential_area}}</td>
238
+ <td>{{row.f_address}}</td>
239
+ <td>{{row.f_meternumber}}</td>
240
+ <td>{{row.f_table_state}}</td>
241
+ <td>{{row.f_book_name}}</td>
242
+ <td>{{row.f_meter_book_sort}}</td>
243
+ <!-- <td>{{row.f_adjustable_id}}</td>-->
244
+ <td style="text-align:center">{{row.f_metertitles}}</td>
245
+ <td style="text-align:center"><nobr>{{row.f_book_no}}</nobr></td>
246
+ <td style="text-align:center">{{row.f_meter_base}}</td>
247
+ </template>
248
+ </data-grid>
249
+ </criteria-paged>
250
+ </div>
251
+ <modal :show.sync="show" width="500px" title="文件导入" v-ref:modal large backdrop="false">
252
+ <article slot="modal-body" class="modal-body">
253
+ <file-upload class="my-file-uploader " name="UploadFile" style="border-radius: 2px;"
254
+ action="api/af-revenue/file/uploadFile" tagname="导入表册用户" v-ref:file multiple></file-upload>
255
+ </article>
256
+ <footer slot="modal-footer" class="modal-footer">
257
+ </footer>
258
+ </modal>
259
+ </template>
260
+
261
+ <script>
262
+ import {HttpResetClass, PagedList} from 'vue-client'
263
+ import Vue from 'vue'
264
+
265
+ let getAreaConfig = async function (self) {
266
+ // 获取气价里面的配置
267
+ await self.$getConfig(self, 'UserAddress')
268
+ Object.assign(self.model, self.config)
269
+ self.initdata()
270
+ }
271
+ let loadParamGem = async function (self) {
272
+ await self.$LoadParams.loadParam()
273
+ self.getfield = self.config.excelHeaders
274
+ // self.$refs.paged.$refs.cri.model.f_meter_classify = ['机表']
275
+ self.$refs.paged.$refs.cri.model.f_book_name = ['is null']
276
+ await self.initAdjustables()
277
+ // await self.search()
278
+ }
279
+ export default {
280
+ name: 'MbpeopleList',
281
+ data () {
282
+ return {
283
+ f_filialeids: this.$login.f.orgid,
284
+ // 初始化省市区数据
285
+ pcdslist: [],
286
+ //初始化街道数据
287
+ streetslist:[],
288
+ communitylist:[],
289
+ areaslist: [],
290
+ // 选中所有地址
291
+ addresslist: [],
292
+ sliceArea: [],
293
+ orgCondtionStr: '',
294
+ f_filialeid: this.$login.f.orgid,
295
+ f_orgid: '',
296
+ invoiceuse: [{label: '是', value: 'is not null'}, {label: '否', value: 'is null'}],
297
+ model: new PagedList('api/af-revenue/sql/mb_peopleList', 20),
298
+ f_orgstr: this.$login.f.orgid,
299
+ // 要操作的用户
300
+ rowsdata: [],
301
+ aaa: '',
302
+ // 控制全选
303
+ all: [],
304
+ // 控制单选
305
+ radio: [],
306
+ show: false,
307
+ meterbooks: [{label: '全部', value: ''}],
308
+ criteriaShow: false,
309
+ gasproperties: this.$appdata.getParam('用气性质') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')] : [],
310
+ user_type: this.$appdata.getParam('用户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')] : [],
311
+ meter_classify: this.$appdata.getParam('气表类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')] : [],
312
+ table_state: this.$appdata.getParam('气表状态') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('气表状态')] : [],
313
+ f_small_areas: this.$appdata.getParam('小区域') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('小区域')] : [],
314
+ user_state: [{label: '正常', value: '正常'}, {label: '预备', value: '预备'}, {label: '销户', value: '销户'}],
315
+ whether_list: [{label: '已在册内', value: 'is not null'}, {label: '不在册内', value: 'is null'}],
316
+ meterbrands: [],
317
+ condition: '',
318
+ adjustables: [],
319
+ unnullrowdata: [],
320
+ getfield: {},
321
+ config: {
322
+ // 导出列要和查询列相同
323
+ excelHeaders: {
324
+ 'f_userfiles_id': '系统识别号',
325
+ 'f_userinfo_code': '用户编号',
326
+ 'f_user_name': '用户姓名',
327
+ 'f_address': '用户地址'
328
+ }
329
+ },
330
+ curorgid: [this.$login.f.orgid]
331
+ }
332
+ },
333
+ created () {
334
+ },
335
+ ready () {
336
+ getAreaConfig(this)
337
+ loadParamGem(this)
338
+ },
339
+ methods: {
340
+ async meterbook(){
341
+ this.meterbooks=[]
342
+ if(this.f_orgid==''){
343
+ this.f_orgid=this.$login.f.orgid
344
+ }
345
+ let res=await this.$resetpost('api/af-revenue/sql/saleSingleTable',{data:{tablename:'t_meter_book',condition:` 1=1 and f_orgid=${this.f_orgid} and f_book_state='有效'`}},{resolveMsg:null,rejectMsg:null})
346
+ for(let i=0;i<res.data.length;i++){
347
+ console.log("res",res.data[i])
348
+ let temp=[]
349
+ temp.label=res.data[i].f_book_name
350
+ temp.value=res.data[i].id
351
+ this.meterbooks.push(temp)
352
+ }
353
+
354
+ },
355
+ invoiceuseChange (val) {
356
+ // 查询已开票记录清空选项
357
+ if (val == 'is not null') {
358
+ this.rowsdata = []
359
+ this.radio = []
360
+ }
361
+ },
362
+
363
+ select () {
364
+ let index = this.model.pageIndex - 1
365
+ console.log('全选', this.all[index])
366
+ if (!this.radio[index]) {
367
+ this.radio.$set(index, [])
368
+ }
369
+ if (this.all[index]) {
370
+ // 数据
371
+ this.rowsdata[index] = Object.assign([], this.model.rows)
372
+ // 勾选
373
+ for (var i = 0; i < this.model.rows.length; i++) {
374
+ this.radio[index].$set(i, true)
375
+ }
376
+ } else {
377
+ // 数据
378
+ this.rowsdata[index] = []
379
+ // 不勾选
380
+ for (var i = 0; i < this.model.rows.length; i++) {
381
+ this.radio[index].$set(i, false)
382
+ }
383
+ }
384
+ this.mergeRowData()
385
+ },
386
+ importFile () {
387
+ this.show = true
388
+ },
389
+ async initAdjustables () {
390
+ let arr = []
391
+ let filter = this.$login.f.orgid
392
+ this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
393
+ let temp = {}
394
+ temp.label = '[' + item.value.f_adjustable_id + ']-' + item.label
395
+ temp.value = item.value.id
396
+ arr.push(temp)
397
+ })
398
+ this.adjustables = [{label: '全部', value: ''}, ...arr]
399
+ // 初始化气表品牌
400
+ let brandArr = []
401
+ this.$GetSaleParam.getGasbrand().forEach((item) => {
402
+ let temp1 = {}
403
+ temp1.label = item.label
404
+ temp1.value = item.value.f_meter_brand
405
+ brandArr.push(temp1)
406
+ })
407
+ this.meterbrands = [{label: '全部', value: ''}, ...brandArr]
408
+ //
409
+ // // 加载抄表册
410
+ // console.log("------------------this.$GetSaleParam.getMeterBooks()",this.$GetSaleParam.getMeterBooks())
411
+ // this.meterbooks = [{label: '全部', value: ''}, ...this.$GetSaleParam.getMeterBooks()]
412
+ },
413
+ search () {
414
+ this.$refs.paged.$refs.cri.search()
415
+ console.log('mbpeople this = ', this)
416
+ },
417
+ selfSearch (args) {
418
+ let f_orgstr = this.orgCondtionStr ? this.orgCondtionStr : "and f_orgid in ('" + this.f_orgid + "')"
419
+ args.condition = `${args.condition} ` + f_orgstr
420
+ // args.condition += ` and f_orgid = ${this.f_orgstr}`
421
+ this.condition = args.condition
422
+ this.$parent.condition = this.condition
423
+ this.model.search(args.condition, args.model)
424
+ },
425
+ // 合并二维数组并去空
426
+ mergeRowData () {
427
+ console.log('!!!!!!!!!!!!!数组去空', this.rowsdata)
428
+ let data = []
429
+ // 合并
430
+ for (let array of this.rowsdata) {
431
+ data.push.apply(data, array)
432
+ }
433
+ // 去空
434
+ // 拓展数组去空值的方法
435
+ Array.prototype.removeEmpty = function () {
436
+ for (var i = 0; i < this.length; i++) {
437
+ if (this[i] == '' || typeof (this[i]) == 'undefined') {
438
+ this.splice(i, 1)
439
+ i--
440
+ }
441
+ }
442
+ return this
443
+ }
444
+ data = data.removeEmpty()
445
+ this.unnullrowdata = []
446
+ data.forEach((row) => {
447
+ this.unnullrowdata.push(row.f_userfiles_id + '')
448
+ })
449
+ this.$parent.rowsdata = this.unnullrowdata
450
+ // this.$parent.rowsdata = this.rowsdata
451
+ },
452
+ selectOne (event, row, i) {
453
+ console.log('单选', event.target.checked)
454
+ let index = this.model.pageIndex - 1
455
+ if (!this.rowsdata[index]) {
456
+ this.rowsdata[index] = []
457
+ }
458
+ if (!this.radio[index]) {
459
+ this.radio.$set(index, [])
460
+ }
461
+ if (event.target.checked) {
462
+ // 数据
463
+ this.rowsdata[index][i] = row
464
+ // 勾选
465
+ this.radio[index].$set(i, true)
466
+ // 判断是否全部选中
467
+ var allState = true
468
+ if (this.model.rows.length != this.radio[index].length) {
469
+ allState = false
470
+ }
471
+ for (var state of this.radio[index]) {
472
+ if (!state) {
473
+ allState = false
474
+ }
475
+ }
476
+ if (allState) {
477
+ this.all.$set(index, true)
478
+ } else {
479
+ this.all.$set(index, false)
480
+ }
481
+ } else {
482
+ // 数据
483
+ this.rowsdata[index][i] = []
484
+ // 不勾选
485
+ this.radio[index].$set(i, false)
486
+ // 任意取消一个则全选状态设为false
487
+ this.all.$set(index, false)
488
+ }
489
+ this.mergeRowData()
490
+ },
491
+ getorg (val) {
492
+ console.log('getorg:val=', val)
493
+ console.log('getorg:this.f_orgid=', this.f_orgid)
494
+ this.f_orgid = val
495
+ this.f_filialeid = val[0]
496
+ },
497
+ async getmeterbook(){
498
+ await this.meterbook()
499
+ this.$emit('childre',this.meterbooks)
500
+ },
501
+ async initdata () {
502
+ this.initAreas(this.f_filialeids)
503
+ // 添加特殊地址选省市区
504
+
505
+ this.initpcds(` f_orgid = '${this.f_filialeids}'`)
506
+ this.initstreets(` f_orgid = '${this.f_filialeids}' `)
507
+ this.initareas(` f_orgid = '${this.f_filialeids}'`)
508
+ },
509
+ // 初始化片区
510
+ async initAreas (val) {
511
+ if (val) {
512
+ let getAllArea = await this.$resetpost('/rs/search', {
513
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
514
+ userid: this.$login.f.id
515
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
516
+
517
+ let arr = getAllArea.data.filter((res) => {
518
+ return res.parentid == val
519
+ })
520
+ console.log('过滤之后的片区', arr)
521
+ this.sliceArea = []
522
+ arr.forEach((res) => {
523
+ this.sliceArea.push({label: res.name, value: res.name})
524
+ })
525
+ }
526
+ },
527
+ initModel () {
528
+ if (this.row) {
529
+ this.cleardata()
530
+ this.model = Object.assign({}, this.model, this.row)
531
+ // 处理片区代码
532
+ this.model.slice_area = [{
533
+ name: this.model.f_slice_area,
534
+ code: this.model.f_area_code
535
+ }]
536
+ }
537
+ },
538
+ // 初始化省市区,添加街道
539
+ async initpcds (pconditon) {
540
+ this.pcdslist = []
541
+ let HttpReset = new HttpResetClass()
542
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
543
+ data: {
544
+ items: '*',
545
+ tablename: 't_pcd',
546
+ orderitem: 'id',
547
+ condition: pconditon
548
+ }
549
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
550
+ let redata = []
551
+ req.data.forEach((row, n) => {
552
+ redata[n] = {
553
+ label: row.f_pcd,
554
+ value: row.id,
555
+ data: row,
556
+ id: row.id
557
+ }
558
+ })
559
+ this.pcdslist = redata
560
+ console.log("xxxxxxxxxxxxxx")
561
+ console.log(this.pcdslist)
562
+ console.log("redataxxxxxxxx")
563
+ },
564
+ // 初始化街道 添加小区
565
+ async initstreets (pconditon) {
566
+ this.streetslist = []
567
+ let HttpReset = new HttpResetClass()
568
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
569
+ data: {
570
+ items: '*',
571
+ tablename: 't_street',
572
+ orderitem: 'id',
573
+ condition: pconditon
574
+ }
575
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
576
+ let redata = []
577
+ req.data.forEach((row, n) => {
578
+ redata[n] = {
579
+ label: row.f_street,
580
+ value: row.id,
581
+ data: row,
582
+ id: row.id
583
+ }
584
+ })
585
+ this.streetslist = redata
586
+ console.log("xxxxxxxxxxxxxx")
587
+ console.log(this.streetslist)
588
+ console.log("redataxxxxxxxx")
589
+ },
590
+ // 初始化小区添加小区
591
+ async initareas (pconditon) {
592
+ // if(this.usertype){
593
+ // pconditon=pconditon+` and f_special='1' `
594
+ // }
595
+ this.areaslist = []
596
+ let HttpReset = new HttpResetClass()
597
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
598
+ data: {
599
+ items: '*',
600
+ tablename: 't_area',
601
+ orderitem: 'id',
602
+ condition: pconditon
603
+ }
604
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
605
+ let redata = []
606
+ req.data.forEach((row) => {
607
+ redata.push({
608
+ label: row.f_residential_area,
609
+ value: row.id,
610
+ data: row,
611
+ id: row.id
612
+ })
613
+ })
614
+ this.areaslist = redata
615
+ },
616
+ //小区变化
617
+ areaChange(val){
618
+ console.log("小区变化",val)
619
+ // 选择小区后级联出省市区和街道
620
+ let selectArea // 选中的小区数据
621
+ for (let row of this.areaslist) {
622
+ if (val == row.value) {
623
+ selectArea = row.data
624
+ break
625
+ }
626
+ }
627
+ if (selectArea) {
628
+ this.model.f_street_id = selectArea.f_street_id
629
+ this.model.f_pcd_id = selectArea.f_pcd_id
630
+ this.model.f_community_id = selectArea.f_community_id
631
+ console.log( this.model.f_community_id)
632
+
633
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
634
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
635
+ if(selectArea.f_community_id){
636
+ this.initcommunity(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_community_id}' `)
637
+ }
638
+ // this.model.f_slice_area = selectArea.f_slice_area
639
+ // 拼接地址
640
+ this.model.f_address = `${selectArea.f_street}${selectArea.f_community}${selectArea.f_residential_area}`
641
+ console.log( this.model.f_community_id)
642
+ }
643
+ this.$nextTick(() => {
644
+ this.$resetValidation()
645
+ })
646
+ },
647
+ // 片区变化 f_area_code
648
+ async areasChange (val) {
649
+ console.log('街道变化', val)
650
+ if (this.streetslist[0]) {
651
+ var street = ''
652
+ this.streetslist.forEach((item) => {
653
+ if (item.id === val) {
654
+ street = item.label
655
+ }
656
+ })
657
+ // this.model.f_address = street
658
+ }
659
+ if (val) {
660
+ // 那就把[小区]重新组织一下
661
+ await this.initareas(` f_area_code ='${val}' `)
662
+ if (this.$refs.paged.$refs.criteria.model.f_residential_area_id) {
663
+ if (this.findbyid(this.areaslist, this.$refs.paged.$refs.criteria.model.f_residential_area_id)) {
664
+ let street_id = this.findbyid(this.areaslist,this.$refs.paged.$refs.criteria.model.f_residential_area_id).f_street_id
665
+ if (street_id != val) {
666
+ this.$refs.paged.$refs.criteria.model.f_residential_area_id = ''
667
+ }
668
+ } else {
669
+ this.$refs.paged.$refs.criteria.model.f_residential_area_id = ''
670
+ }
671
+ }
672
+ }
673
+ },
674
+ //街道变化
675
+ //初始化街道 添加小区
676
+ async initcommunity(pconditon){
677
+ this.communitylist = []
678
+ let HttpReset = new HttpResetClass()
679
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
680
+ data: {
681
+ items: '*',
682
+ tablename: 't_community',
683
+ orderitem: 'id',
684
+ condition: pconditon
685
+ }
686
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
687
+ let redata = []
688
+ req.data.forEach((row, n) => {
689
+ redata[n] = {
690
+ label: row.f_community_name,
691
+ value: row.id,
692
+ data:row,
693
+ id:row.id
694
+ }
695
+ })
696
+ this.communitylist=redata
697
+ },
698
+ async streetChange(val){
699
+ if(val){
700
+ await this.initcommunity(` f_filialeid = '${this.f_filialeids}' and f_street_id ='${val}' `)
701
+ }
702
+ },
703
+ async communityChange(val){
704
+ console.log(val)
705
+ if(val){
706
+ await this.initareas(` f_filialeid = '${this.f_filialeids}' and f_community_id ='${val}' `)
707
+ }
708
+ }
709
+ },
710
+ computed: {
711
+ usergastype () {
712
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用气类型')]
713
+ },
714
+ usertags () {
715
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户标签')]
716
+ },
717
+ ischecked () {
718
+ return function (index, i) {
719
+ if (!this.radio[index]) {
720
+ return false
721
+ }
722
+ return this.radio[index][i]
723
+ }
724
+ },
725
+ smallareas () {
726
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('小区域')]
727
+ },
728
+ inputtores () {
729
+ // 获取抄表员
730
+ console.log('获取抄表员', this.$login.f)
731
+ let rs = []
732
+ if (this.$login.f.f_gasman.length > 0) {
733
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
734
+ let temp = {
735
+ label: this.$login.f.f_gasman[i].name,
736
+ value: this.$login.f.f_gasman[i].name
737
+ }
738
+ rs.push(temp)
739
+ }
740
+ }
741
+ this.inputtores2 = rs
742
+ return [ ...rs]
743
+ }
744
+ },
745
+ watch: {
746
+ async 'f_orgid'(){
747
+ this.meterbooks=[]
748
+ await this.meterbook()
749
+ this.$emit('childre',this.meterbooks)
750
+ },
751
+ batchMeterShow () {
752
+ if (this.batchMeterShow == false) {
753
+ // 将选的文件清空
754
+ this.$refs.file.$el.querySelector('input').value = ''
755
+ }
756
+ },
757
+ 'f_filialeid' (val) {
758
+ loadParamGem(this)
759
+ }
760
+ },
761
+ events: {
762
+ onFileUpload: function (file, res) {
763
+ // let URL = res.f_downloadpath.substring(res.f_downloadpath.lastIndexOf(":\\") + 2)
764
+ // res.f_downloadpath = "http://" + location.host + "/" + URL
765
+ // res.f_downloadpath.replace('\\','/')
766
+ this.$resetpost('api/af-revenue/logic/upLoadBookFile',
767
+ {data: {
768
+ condition: this.condition,
769
+ filepath: res.f_downloadpath
770
+ }
771
+ },
772
+ {resolveMsg: null, rejectMsg: '上传失败'}).then((res) => {
773
+ this.show = false
774
+ this.$showAlert(`导入成功`, 'success', 2000)
775
+ this.search()
776
+ })
777
+ }
778
+ }
779
+ }
780
+ </script>
781
+
782
+ <style lang="less">
783
+ #MbpeopleList {
784
+ tr {
785
+ th {
786
+ text-align: center;
787
+ }
788
+ td {
789
+ text-align: center;
790
+ }
791
+ }
792
+ }
793
+ </style>