safecheck-client 3.0.34-77 → 3.0.34-79

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