safecheck-client 3.0.32-23 → 3.0.32-25

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.
@@ -0,0 +1,634 @@
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
+ <input type="text" class="input_search" v-model="model.f_residential_area"
21
+ style="width: 60%" placeholder="用气性质" condition="f_gasproperties like '%{}%'">
22
+ </div>
23
+ <div class="form-group col-sm-3">
24
+ <button class="button_spacing button_search" @click="search()">查询</button>
25
+ <div style="float: right" class="button_spacing"
26
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
27
+ @click="$parent.$parent.hidden()"></div>
28
+ </div>
29
+
30
+ <!-- <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">-->
31
+ <!-- <label class="font_normal_body">客户地址</label>-->
32
+ <!-- <input type="text" class="input_search" v-model="model.f_address"-->
33
+ <!-- style="width: 60%" placeholder="客户地址" condition="tua.f_address like '%{}%'">-->
34
+ <!-- </div>-->
35
+ <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
36
+ <label class="font_normal_body">客户类型</label>
37
+ <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
38
+ :value-single="true" style="width: 60%"
39
+ class="select_list select"
40
+ :options='$parent.$parent.userTypes' placeholder='客户类型'
41
+ close-on-select
42
+ condition="f_user_type ='{}'"></v-select>
43
+ </div>
44
+ <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
45
+ <label class="font_normal_body">用气类型</label>
46
+ <v-select class="select_list select"
47
+ placeholder='请选择' style="width: 60%"
48
+ :value.sync="model.f_user_gas_type"
49
+ v-model="model.f_user_gas_type"
50
+ :options='$parent.$parent.userGasType'
51
+ filer-key="name"
52
+ close-on-select clear-button
53
+ condition="f_user_gas_type='{}'"
54
+ :value-single="true">
55
+ </v-select>
56
+ </div>
57
+ <div class="form-group col-sm-3" v-show="$parent.$parent.criteriaShow">
58
+ <label class="font_normal_body">用户标签</label>
59
+ <v-select class="select_list select"
60
+ placeholder='请选择' style="width: 60%"
61
+ :value.sync="model.f_user_tags"
62
+ v-model="model.f_user_tags"
63
+ :options='$parent.$parent.userTags'
64
+ filer-key="name"
65
+ close-on-select clear-button
66
+ condition="f_user_tags='{}'"
67
+ :value-single="true">
68
+ </v-select>
69
+ </div>
70
+ </div>
71
+ <div class="row">
72
+ <div class="col-sm-3 form-group" style="margin-bottom: 0px" v-show="$parent.$parent.criteriaShow">
73
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
74
+ <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="f_orgid in {}"></right-tree-safe>
75
+ </div>
76
+ <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
77
+
78
+ <label class="font_normal_body">片区名称</label>
79
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
80
+ :value-single="true" style="width: 60%"
81
+ class="select_list select"
82
+ :options='$parent.$parent.checkBooks' placeholder='片区名称'
83
+ close-on-select
84
+ condition="f_check_book_id ='{}'"></v-select>
85
+
86
+ </div>
87
+ <div class="col-sm-3 form-group" v-show="$parent.$parent.criteriaShow">
88
+ <label class="font_normal_body">是否在册</label>
89
+ <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
90
+ :value-single="true" style="width: 60%"
91
+ class="select_list select"
92
+ @change="$parent.$parent.changeState"
93
+ :options='$parent.$parent.isCheckBook' placeholder='有无所属片区'
94
+ close-on-select
95
+ condition="{}"></v-select>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </criteria>
100
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
101
+ <template partial='head'>
102
+ <tr @dblclick.stop="">
103
+ <!-- <th>-->
104
+ <!-- <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>-->
105
+ <!-- </th>-->
106
+ <th>
107
+ <nobr>客户姓名</nobr>
108
+ </th>
109
+ <th>
110
+ <nobr>客户编号</nobr>
111
+ </th>
112
+ <th>
113
+ <nobr>客户类型</nobr>
114
+ </th>
115
+ <th>
116
+ <nobr>客户电话</nobr>
117
+ </th>
118
+ <th>
119
+ <nobr>用户单位</nobr>
120
+ </th>
121
+ <th>
122
+ <nobr>客户地址</nobr>
123
+ </th>
124
+ <th>
125
+ <nobr>所属片区</nobr>
126
+ </th>
127
+ </tr>
128
+ </template>
129
+ <template partial='body'>
130
+ <!-- <td style="text-align: center">-->
131
+ <!-- <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"-->
132
+ <!-- @change="$parent.$parent.$parent.checkChange(row, $event)"></input>-->
133
+ <!-- </nobr>-->
134
+ <!-- </td>-->
135
+ <td style="text-align: center">{{ row.f_user_name }}</td>
136
+ <td style="text-align: center">{{ row.f_userinfo_code }}</td>
137
+ <td style="text-align: center">{{ row.f_user_type }}</td>
138
+ <td style="text-align: center">{{ row.f_user_phone }}</td>
139
+ <td style="text-align: center">{{ row.f_residential_area }}</td>
140
+ <td style="text-align: center">{{ row.f_address }}</td>
141
+ <td style="text-align: center">{{ row.f_check_book_name }}</td>
142
+ </template>
143
+ </data-grid>
144
+ </criteria-paged>
145
+ </div>
146
+ <modal :show.sync="showModal" :backdrop="false">
147
+ <div slot="modal-header" class="modal-header">
148
+ <h4 class="modal-title">
149
+ 创建片区
150
+ </h4>
151
+ </div>
152
+ <div slot="modal-body" class="modal-body">
153
+ <div v-if="true">
154
+ <div class="row" style="margin-top: 10px">
155
+ <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">片区名称</label>-->
156
+ <!-- <div class="col-xs-8 col-md-8">-->
157
+ <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
158
+ <!-- </div>-->
159
+ <div class="col-sm-12 form-group" style="margin: 0">
160
+ <role-selector-safe
161
+ @re-res="getRes"
162
+ role-name="安检员"
163
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
164
+ :value.sync="checkBook.f_checker_name"
165
+ v-model="checkBook.f_checker_name">
166
+ </role-selector-safe>
167
+ </div>
168
+ <div class="form-group col-sm-6" style="margin-top: 20px">
169
+ <label class="font_normal_body">片区名</label>
170
+ <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
171
+ style="width: 60%" >
172
+ </div>
173
+ <div class="form-group col-sm-6" style="margin-top: 20px">
174
+ <label class="font_normal_body">执行日期</label>
175
+ <datepicker
176
+ :value.sync="checkBook.f_run_date"
177
+ style="width: 60%"
178
+ :format="'yyyy-MM-dd'"
179
+ v-model="checkBook.f_run_date"
180
+ >
181
+ </datepicker>
182
+ </div>
183
+ <div class="form-group col-sm-6" style="margin-top: 20px">
184
+ <label class="font_normal_body">执行周期</label>
185
+ <input type="number" class="input_search" v-model="checkBook.f_around_time"
186
+ style="width: 60%" >
187
+ </div>
188
+ <div class="form-group col-sm-6" style="margin-top: 20px">
189
+ <label class="font_normal_body">周期单位</label>
190
+ <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
191
+ :value-single="true" style="width: 60%"
192
+ class="select_list select"
193
+ :options='aroundUnit' placeholder=''
194
+ close-on-select></v-select>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
200
+ <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
201
+ <button class="button_search" @click="cancel">取消</button>
202
+ </div>
203
+ </modal>
204
+ <modal :show.sync="showModal2" :backdrop="false">
205
+ <div slot="modal-header" class="modal-header">
206
+ <h4 class="modal-title">
207
+ 添加用户
208
+ </h4>
209
+ </div>
210
+ <div slot="modal-body" class="modal-body">
211
+ <div v-if="true">
212
+ <div class="row" style="margin-top: 10px">
213
+ <div class="form-group col-sm-12" style="margin-top: 20px">
214
+ <label class="font_normal_body">片&ensp;区&ensp;名</label>
215
+ <v-select :value.sync="selectBook" v-model='selectBook'
216
+ :value-single="true" style="width: 80%"
217
+ class="select_list select"
218
+ :options='checkBooks' placeholder=''
219
+ close-on-select></v-select>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ </div>
224
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
225
+ <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
226
+ <button class="button_search" @click="cancel2">取消</button>
227
+ </div>
228
+ </modal>
229
+ <modal :show.sync="showModal3" :backdrop="false">
230
+ <div slot="modal-header" class="modal-header">
231
+ <h4 class="modal-title">
232
+ 调整用户
233
+ </h4>
234
+ </div>
235
+ <div slot="modal-body" class="modal-body">
236
+ <div v-if="true">
237
+ <div class="row" style="margin-top: 10px;text-align: center">
238
+ <div class="form-group col-sm-12" style="margin-top: 20px">
239
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
240
+ <v-select :value.sync="selectBook" v-model='selectBook'
241
+ :value-single="true" style="width: 80%"
242
+ class="select_list select"
243
+ :options='checkBooks' placeholder=''
244
+ close-on-select></v-select>
245
+ </div>
246
+ </div>
247
+ </div>
248
+ </div>
249
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
250
+ <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
251
+ <button class="button_search" @click="cancel3">取消</button>
252
+ </div>
253
+ </modal>
254
+
255
+ </div>
256
+ </template>
257
+
258
+ <script>
259
+ import {PagedList, HttpResetClass} from 'vue-client'
260
+ import * as Util from "../../../components/Util";
261
+ import bus from "../../../bus";
262
+
263
+ export default {
264
+ title: '片区管理',
265
+ data () {
266
+ let model = new PagedList('rs/sql/getUserByCheckBookuser', 20)
267
+ return {
268
+ model: model,
269
+ criteriaShow: false,
270
+ excelHeaders: {},
271
+ checkBooks: [],
272
+ f_orgid: '',
273
+ bookAll: false,
274
+ bookList: [],
275
+ selectBook:'',
276
+ userTypes: [{label: '全部', value: ''},{label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
277
+ // init:false,
278
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
279
+ isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
280
+ isSearch: false,
281
+ checkBook: {
282
+ f_check_book_name: '',
283
+ f_run_date: '',
284
+ f_around_time: '',
285
+ f_around_unit: '',
286
+ f_create_date: Util.toStandardDateString(),
287
+ f_create_person: this.$login.f.name,
288
+ f_orgid: '',
289
+ f_checker_name: ''
290
+ },
291
+ showModal: false,
292
+ showModal2: false,
293
+ showModal3: false,
294
+ userGasType:[{label: '全部', value: ''},...this.$appdata.getParam('用气类型')],
295
+ userTags:[{label: '全部', value: ''},...this.$appdata.getParam('用户标签')]
296
+ }
297
+ },
298
+ computed: {
299
+ searchData () {
300
+ return {condition: this.model.condition}
301
+ },
302
+ bookCondition () {
303
+ return this.model.condition
304
+ },
305
+ isCreateBook () {
306
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
307
+ },
308
+ isChangeBook () {
309
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
310
+ }
311
+ },
312
+ watch:{
313
+ 'bookList'(){
314
+ this.$emit('book-list',this.bookList)
315
+ },
316
+ 'bookAll'(val){
317
+ if(!val){
318
+ this.bookList=[]
319
+ }
320
+
321
+ this.$emit('book-all',this.bookAll)
322
+ }
323
+ },
324
+ methods: {
325
+ async ok2() {
326
+ if (!this.selectBook) {
327
+ this.$showMessage('请选择片区')
328
+ return
329
+ }
330
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
331
+ let userCondition = ''
332
+ if (this.bookList.length < 1) {
333
+ //tag
334
+ userCondition = this.bookCondition
335
+ } else {
336
+ //tag)
337
+
338
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
339
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
340
+ //tag
341
+ }
342
+ let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
343
+ FROM
344
+ t_userinfo tui
345
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
346
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
347
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
348
+ WHERE
349
+ tui.f_user_state = '正常'
350
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
351
+ AND ${userCondition}`
352
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
353
+ {resolveMsg: null, rejectMsg: '添加用户失败'})
354
+ this.$showMessage('添加用户成功')
355
+ this.selectBook = ''
356
+ this.bookAll = false
357
+ this.bookList = []
358
+ this.showModal2 = false
359
+ this.$refs.paged.$refs.criteria.search()
360
+ }
361
+ },
362
+ async ok3() {
363
+ if (!this.selectBook) {
364
+ this.$showMessage('请选择片区')
365
+ return
366
+ }
367
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
368
+ let userCondition = ''
369
+ if (this.bookList.length < 1) {
370
+ //tag
371
+ userCondition = this.bookCondition
372
+ } else {
373
+ //tag)
374
+
375
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
376
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
377
+ //tag
378
+ }
379
+ let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
380
+ FROM
381
+ t_userinfo tui
382
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
383
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
384
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
385
+ WHERE
386
+ tui.f_user_state = '正常'
387
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
388
+ AND ${userCondition}`
389
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
390
+ {resolveMsg: null, rejectMsg: '调整用户失败'})
391
+ this.$showMessage('调整用户成功')
392
+ this.selectBook = ''
393
+ this.bookAll = false
394
+ this.bookList = []
395
+ this.showModal3 = false
396
+ this.$refs.paged.$refs.criteria.search()
397
+ }
398
+ },
399
+ cancel2(){
400
+ this.selectBook = ''
401
+ this.bookAll = false
402
+ this.bookList = []
403
+ this.showModal2 = false
404
+ this.$refs.paged.$refs.criteria.search()
405
+ },
406
+ cancel3(){
407
+ this.selectBook = ''
408
+ this.bookAll = false
409
+ this.bookList = []
410
+ this.showModal3 = false
411
+ this.$refs.paged.$refs.criteria.search()
412
+ },
413
+ addUser () {
414
+ if (!this.isCreateBook) {
415
+ this.$showMessage('请选择查询未划分片区的用户')
416
+ return
417
+ }
418
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
419
+ this.showModal2 = true
420
+ this.freshCheckBook()
421
+ return
422
+ }
423
+ this.$showMessage('请选择用户')
424
+ },
425
+ upUser () {
426
+ if (!this.isChangeBook) {
427
+ this.$showMessage('请选择查询已划分片区的用户')
428
+ return
429
+ }
430
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
431
+ this.showModal3 = true
432
+ this.freshCheckBook()
433
+ return
434
+ }
435
+ this.$showMessage('请选择用户')
436
+ },
437
+ async delUser () {
438
+ if (!this.isChangeBook) {
439
+ this.$showMessage('请选择查询已划分片区的用户')
440
+ return
441
+ }
442
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
443
+ let userCondition= ''
444
+ if (this.bookList.length < 1) {
445
+ //tag
446
+ userCondition = this.bookCondition
447
+ } else {
448
+ //tag)
449
+
450
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
451
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
452
+ //tag
453
+ }
454
+ let delUser= `update t_user_address set f_check_book_id =null
455
+ FROM
456
+ t_userinfo tui
457
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
458
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
459
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
460
+ WHERE
461
+ tui.f_user_state = '正常'
462
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
463
+ AND ${userCondition}`
464
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
465
+ {resolveMsg: null, rejectMsg: '删除片区失败'})
466
+ this.$showMessage('从片区删除所选用户成功')
467
+ this.selectBook = ''
468
+ this.bookAll = false
469
+ this.bookList = []
470
+ this.showModal3 = false
471
+ this.$refs.paged.$refs.criteria.search()
472
+ return
473
+ }
474
+ this.$showMessage('请选择用户')
475
+ },
476
+ beforeCreateBook () {
477
+ if (!this.isCreateBook) {
478
+ this.$showMessage('请选择查询未划分片区的用户')
479
+ return
480
+ }
481
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
482
+ this.showModal = true
483
+ return
484
+ }
485
+ this.$showMessage('请选择用户')
486
+ },
487
+ ok () {
488
+ //tag)
489
+ let condition = ''
490
+ if (!this.checkBook.f_check_book_name) {
491
+ return this.$showMessage('请填写册名')
492
+ }
493
+ if (!this.checkBook.f_checker_name) {
494
+ return this.$showMessage('请选择安检员')
495
+ }
496
+ if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
497
+ return this.$showMessage('请选填写周期信息')
498
+ }
499
+ if (!this.checkBook.f_run_date) {
500
+ return this.$showMessage('执行日期')
501
+ }
502
+ if (this.bookList.length < 1) {
503
+ //tag
504
+ condition = this.bookCondition
505
+ } else {
506
+ //tag)
507
+
508
+ condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
509
+ condition = 'tui.f_userinfo_id in (' + condition + ')'
510
+ //tag
511
+ }
512
+ let data = {
513
+ checkBook: this.checkBook,
514
+ sqlStr: condition
515
+ }
516
+ new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
517
+ //tag)
518
+ if (res.data.id) {
519
+ this.$showMessage('创建成功')
520
+ this.showModal = false
521
+ this.isSearch = false
522
+ this.bookList = []
523
+ this.bookAll = false
524
+ this.freshCheckBook()
525
+ this.$refs.paged.$refs.criteria.search()
526
+ }
527
+ })
528
+ },
529
+ changeState (val) {
530
+ //tag
531
+ //tag
532
+ this.bookAll = false
533
+ this.bookList = []
534
+ if (this.$refs.paged.$refs.criteria.model.f_orgid){
535
+ this.$refs.paged.$refs.criteria.search()
536
+ }
537
+ },
538
+ cancel () {
539
+ this.bookAll = false
540
+ this.bookList = []
541
+ this.showModal = false
542
+ this.$refs.paged.$refs.criteria.search()
543
+ },
544
+ checkModel (row) {
545
+ if (this.bookAll) {
546
+ //tag)
547
+ return true
548
+ } else {
549
+ // this.bookList = []
550
+ if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
551
+ return true
552
+ } else {
553
+ return false
554
+ }
555
+ }
556
+ },
557
+ checkChange (row, e) {
558
+ //tag
559
+ if (e.target.checked) {
560
+ this.bookList.push(row.f_userinfo_id)
561
+ } else {
562
+ this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
563
+ }
564
+ // //tag)
565
+ },
566
+ getRes (obj) {
567
+ this.checkBook.f_orgid = obj.resids[0]
568
+ },
569
+ getResm (obj) {
570
+ this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
571
+ },
572
+ hidden () {
573
+ this.criteriaShow = !this.criteriaShow
574
+ },
575
+ selfSearch (args) {
576
+ this.isSearch = true
577
+ this.bookAll = false
578
+ this.bookList = []
579
+
580
+ console.log("查询66666666666666666")
581
+ this.$emit('book-condition',args.condition)
582
+ // if (this.$refs.paged.$refs.criteria.model.f_orgid){
583
+ // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
584
+ // }
585
+ this.model.search(args.condition, args.model)
586
+ },
587
+ freshCheckBook () {
588
+ this.checkBooks = []
589
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
590
+ data: {
591
+ items: 'id,f_check_book_name,f_check_book_type',
592
+ tablename: 't_check_book',
593
+ condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1',
594
+ orderitem: 'id desc'
595
+ }
596
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
597
+ this.checkBooks.push({label: '全部', value: ''})
598
+ res.data.forEach(ress => {
599
+ console.log("片区类型",ress)
600
+ if(ress.f_check_book_type ==='用户'){
601
+ this.checkBooks.push({
602
+ label: ress.f_check_book_name,
603
+ value: ress.id
604
+ })
605
+ }
606
+
607
+ })
608
+ })
609
+ }
610
+ },
611
+ beforeDestroy() {
612
+ //tag
613
+ bus.$off('fresh-user')
614
+ },
615
+ ready () {
616
+ bus.$on('fresh-user',()=>{
617
+ console.log("进入方法")
618
+ this.bookAll = false
619
+ this.bookList = []
620
+ this.$refs.paged.$refs.criteria.search()
621
+ })
622
+ this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
623
+ //tag
624
+ // this.init=true
625
+ this.freshCheckBook()
626
+ }
627
+ }
628
+ </script>
629
+ <style scoped>
630
+ /*.btn-group > .btn:first-child {*/
631
+ /* margin-left: 0;*/
632
+ /* width: 100%;*/
633
+ /*}*/
634
+ </style>