safecheck-client 3.0.33-gongyi → 3.0.34-gongyi

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,508 +1,580 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row" v-if="!$parent.$parent.$parent.showItem">
7
- <div :class="$parent.$parent.style">
8
- <label class="font_normal_body">安检计划</label>
9
- <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
10
- @click="$parent.$parent.showChooser"
11
- style="width: 60%" placeholder="安检计划" readonly="readonly">
12
- </div>
13
- <div :class="$parent.$parent.style">
14
- <label class="font_normal_body">存在隐患</label>
15
- <v-select style="width:60% "
16
- class="select select_list"
17
- :value.sync="model.f_has_defect"
18
- v-model="model.f_has_defect"
19
- :options='$parent.$parent.hasDefectOptions'
20
- :placeholder='model.f_has_defect'
21
- condition="f_has_defect = '{}'"
22
- close-on-select>
23
- </v-select>
24
- </div>
25
- <div :class="$parent.$parent.style">
26
- <label class="font_normal_body">用户编号</label>
27
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
28
- condition="f_userinfo_code = '{}'"
29
- style="width: 60%" placeholder="用户编号">
30
- </div>
31
- <div :class="$parent.$parent.style">
32
- <label class="font_normal_body">结果查询</label>
33
- <v-select
34
- placeholder='处理结果查询'
35
- :value-single="true"
36
- class="select select_list" style="width: 60%"
37
- v-model='model.f_repaired'
38
- :value.sync="model.f_repaired"
39
- :options='$parent.$parent.repaired'
40
- condition="f_repaired = '{}'"
41
- close-on-select clear-button> </v-select>
42
- </div>
43
- <div class=" col-sm-4 form-group button-range" >
44
- <div class="span" style="float: right;margin-top: 8px">
45
- <div style="float: right" class="button_spacing"
46
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
47
- @click="$parent.$parent.hiddenr()"></div>
48
- <div style="float: right" class="button_spacing"
49
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
50
- @click="$parent.$parent.hidden()"></div>
51
- <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
52
- <div style="float: right">
53
- <export-excel-safe :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids,f_defect_content:$parent.$parent.model.f_defect_content}"
54
- :field="$parent.$parent.getfield"
55
- progress="safeGetExportProgress"
56
- sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefect" template-name='安检隐患明细' :choose-col="true"></export-excel-safe>
57
- </div>
58
- </div>
59
- </div>
60
- </div>
61
- <div class="row" v-if="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
62
- <div :class="$parent.$parent.style">
63
- <label class="font_normal_body">片&emsp;&emsp;区</label>
64
- <v-select class="select_list select"
65
- placeholder='片区/管理站' style="width: 60%"
66
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
67
- :options='$parent.$parent.sliceArea'
68
- filer-key="name"
69
- close-on-select clear-button
70
- condition="f_slice_area='{}'"
71
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
72
- :value-single="true">
73
- </v-select>
74
- </div>
75
- <div :class="$parent.$parent.style2" style="margin: 0">
76
- <role-selector-safe
77
- role-name="安检员"
78
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
79
- @re-res="$parent.$parent.getRes"
80
- :value.sync="model.f_checker_id"
81
- v-model="model.f_checker_id"
82
- condition="f_checker_name = '{}'">
83
- </role-selector-safe>
84
- </div>
85
-
86
- <div :class="$parent.$parent.style">
87
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
88
- <v-select class="select_list select"
89
- placeholder='抄表册' style="width: 60%"
90
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
91
- :options='$parent.$parent.cbc'
92
- filer-key="name"
93
- close-on-select clear-button
94
- condition="f_meter_book_num={}"
95
- :value-single="true">
96
- </v-select>
97
- </div>
98
- <div :class="$parent.$parent.style">
99
- <label class="font_normal_body">起始时间</label>
100
- <datepicker
101
- placeholder='起始时间' style="width:60%"
102
- :disabled-days-of-week="[]"
103
- :format="'yyyy-MM-dd'"
104
- :show-rest-button="reset"
105
- :value.sync="model.f_start_time"
106
- v-model="model.f_start_time"
107
- condition="f_offsite_time >= '{} 00:00:00'">
108
- </datepicker>
109
- </div>
110
- <div :class="$parent.$parent.style">
111
- <label class="font_normal_body">结束时间</label>
112
- <datepicker
113
- placeholder='结束时间' style="width:60%"
114
- :disabled-days-of-week="[]"
115
- :format="'yyyy-MM-dd'"
116
- :show-rest-button="reset"
117
- :value.sync="model.f_end_time"
118
- v-model="model.f_end_time"
119
- condition="f_offsite_time <= '{} 23:59:59'">
120
- </datepicker>
121
- </div>
122
-
123
-
124
- </div>
125
- <div class="row" v-if="$parent.$parent.$parent.showItem">
126
- <div :class="$parent.$parent.style">
127
- <label class="font_normal_body">安检计划</label>
128
- <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
129
- @click="$parent.$parent.showChooser"
130
- style="width: 60%" placeholder="安检计划" readonly="readonly">
131
- </div>
132
- <div :class="$parent.$parent.style">
133
- <label class="font_normal_body">存在隐患</label>
134
- <v-select style="width:60% "
135
- class="select select_list"
136
- :value.sync="model.f_has_defect"
137
- v-model="model.f_has_defect"
138
- :options='$parent.$parent.hasDefectOptions'
139
- :placeholder='model.f_has_defect'
140
- condition="f_has_defect = '{}'"
141
- close-on-select>
142
- </v-select>
143
- </div>
144
-
145
- <div class=" col-sm-4 form-group button-range">
146
- <div class="span" style="float: right;margin-top: 8px;margin-right: 50px">
147
- <div style="float: right" class="button_spacing"
148
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
149
- @click="$parent.$parent.hiddenr()"></div>
150
- <div style="float: right" class="button_spacing"
151
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
152
- @click="$parent.$parent.hidden()"></div>
153
- <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
154
- <div style="float: right">
155
- <export-excel-safe :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids}"
156
- :field="$parent.$parent.getfield"
157
- progress="safeGetExportProgress"
158
- sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefect" template-name='安检计划明细' :choose-col="true"></export-excel-safe>
159
- </div>
160
- </div>
161
- </div>
162
-
163
-
164
-
165
- </div>
166
- <div class="row" v-if="$parent.$parent.criteriaShow&&$parent.$parent.$parent.showItem">
167
- <div :class="$parent.$parent.style">
168
- <label class="font_normal_body">用户编号</label>
169
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
170
- condition="f_userinfo_code = '{}'"
171
- style="width: 60%" placeholder="用户编号">
172
- </div>
173
- <div :class="$parent.$parent.style">
174
- <label class="font_normal_body">结果查询</label>
175
- <v-select
176
- placeholder='处理结果查询'
177
- :value-single="true"
178
- class="select select_list" style="width: 60%"
179
- v-model='model.f_repaired'
180
- :value.sync="model.f_repaired"
181
- :options='$parent.$parent.repaired'
182
- condition="f_repaired = '{}'"
183
- close-on-select clear-button> </v-select>
184
- </div>
185
-
186
- <div :class="$parent.$parent.style2" style="margin: 0">
187
- <role-selector-safe
188
- role-name="安检员"
189
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
190
- @re-res="$parent.$parent.getRes"
191
- :value.sync="model.f_checker_id"
192
- v-model="model.f_checker_id"
193
- condition="f_checker_name = '{}'">
194
- </role-selector-safe>
195
- </div>
196
- </div>
197
- <div class="row" v-if="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
198
- <div :class="$parent.$parent.style">
199
- <label class="font_normal_body">片&emsp;&emsp;区</label>
200
- <v-select class="select_list select"
201
- placeholder='片区/管理站' style="width: 60%"
202
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
203
- :options='$parent.$parent.sliceArea'
204
- filer-key="name"
205
- close-on-select clear-button
206
- condition="f_slice_area='{}'"
207
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
208
- :value-single="true">
209
- </v-select>
210
- </div>
211
- <div :class="$parent.$parent.style">
212
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
213
- <v-select class="select_list select"
214
- placeholder='抄表册' style="width: 60%"
215
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
216
- :options='$parent.$parent.cbc'
217
- filer-key="name"
218
- close-on-select clear-button
219
- condition="f_meter_book_num={}"
220
- :value-single="true">
221
- </v-select>
222
- </div>
223
- <div :class="$parent.$parent.style">
224
- <label class="font_normal_body">起始时间</label>
225
- <datepicker
226
- placeholder='起始时间' style="width:60%"
227
- :disabled-days-of-week="[]"
228
- :format="'yyyy-MM-dd'"
229
- :show-rest-button="reset"
230
- :value.sync="model.f_start_time"
231
- v-model="model.f_start_time"
232
- condition="f_offsite_time >= '{} 00:00:00'">
233
- </datepicker>
234
- </div>
235
- <div :class="$parent.$parent.style">
236
- <label class="font_normal_body">结束时间</label>
237
- <datepicker
238
- placeholder='结束时间' style="width:60%"
239
- :disabled-days-of-week="[]"
240
- :format="'yyyy-MM-dd'"
241
- :show-rest-button="reset"
242
- :value.sync="model.f_end_time"
243
- v-model="model.f_end_time"
244
- condition="f_offsite_time <= '{} 23:59:59'">
245
- </datepicker>
246
- </div>
247
-
248
-
249
- </div>
250
- </div>
251
- </criteria>
252
- <data-grid :model="model" partial='list' v-ref:grid class="list_area table_sy">
253
- <template partial='head'>
254
- <tr>
255
- <th><nobr>入户状态</nobr></th>
256
- <th><nobr>用户编号</nobr></th>
257
- <th><nobr>用户名</nobr></th>
258
- <th><nobr>用户电话</nobr></th>
259
- <th><nobr>用户小区</nobr></th>
260
- <th><nobr>用户地址</nobr></th>
261
- <th><nobr>安检时间</nobr></th>
262
- <th><nobr>安检员</nobr></th>
263
- <th><nobr>计划名</nobr></th>
264
- <th><nobr>是否有隐患</nobr></th>
265
- <th><nobr>隐患数</nobr></th>
266
- <!-- <th><nobr>整改数</nobr></th>-->
267
-
268
- </tr>
269
- </template>
270
- <template partial='body'>
271
- <td style="text-align: center;white-space:nowrap;">{{row.f_entry_status}}</td>
272
- <td style="text-align: center;white-space:nowrap;">{{row.f_userinfo_code}}</td>
273
- <td style="text-align: center;white-space:nowrap;">{{row.f_user_name}}</td>
274
- <td style="text-align: center;white-space:nowrap;">{{row.f_user_phone}}</td>
275
- <td style="text-align: center;white-space:nowrap;">{{row.f_residential_area}}</td>
276
- <td style="text-align: center;white-space:nowrap;">{{row.f_address}}</td>
277
- <td style="text-align: center;white-space:nowrap;">{{row.f_offsite_time}}</td>
278
- <td style="text-align: center;white-space:nowrap;">{{row.f_checker_name}}</td>
279
- <td style="text-align: center;white-space:nowrap;">{{row.f_plan_name}}</td>
280
- <td style="text-align: center;white-space:nowrap;">{{row.f_has_defect}}</td>
281
- <td style="text-align: center;white-space:nowrap;">{{row.f_defect_count}}</td>
282
- <!-- <td style="text-align: center;white-space:nowrap;">{{row.f_repair_count}}</td>-->
283
-
284
- </template>
285
- </data-grid>
286
- </criteria-paged>
287
-
288
- <modal :show.sync="showModal" v-ref:modal>
289
- <div slot="modal-header" class="modal-header">
290
- <h4 class="modal-title">
291
- 选择计划
292
- </h4>
293
- </div>
294
- <div slot="modal-body" class="modal-body">
295
- <plan-chooser :f.sync="this.$login.f" v-ref:chooser></plan-chooser>
296
- </div>
297
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
298
- <button class="button_search" @click="ok">确认</button>
299
- <button class="button_search" @click="cancel">取消</button>
300
- </div>
301
- </modal>
302
- </div>
303
- </template>
304
- <script>
305
- import {PagedList} from 'vue-client'
306
- import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
307
- import co from 'co'
308
-
309
- let select = function* (self) {
310
- let http = new HttpResetClass()
311
- let getGasman = yield http.load('POST', '/rs/search', {
312
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
313
- userid: self.$login.f.id
314
- }, {resolveMsg: null, rejectMsg: null})
315
- console.log('获取安检员', getGasman)
316
- self.checkersid.push({label: '全部', value: ''})
317
- getGasman.data.forEach((checker) => {
318
- self.checkersid.push({label: checker.name, value: checker.name})
319
- })
320
- }
321
- export default {
322
- title: '隐患查询',
323
- data() {
324
- let model = new PagedList('rs/sql/GetCheckPaperByDefect', 20, {
325
- f_filialeids: 'this.f_filialeids',f_defect_content: 'this.f_defect_content'
326
- })
327
- model.f_filialeids = '(' + this.$login.f.orgid + ')'
328
- model.f_defect_content="CASE WHEN CHARINDEX( '\"result\":\"正常\"', f_defect_content ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( f_defect_content, len( f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
329
- return {
330
- repaired:[{label: '未修', value: '未修'}, {label: '已修', value: '已修'}],
331
- hasDefectOptions: [{label: '全部', value: ''}, {label: '有隐患', value: '有隐患'}, {label: '无隐患', value: '无隐患'}],
332
- f: this.$login.f,
333
- model: model,
334
- criteriaShow: false,
335
- showModal: false,
336
- f_check_plan: {f_plan_name: '', id: ''},
337
- sumsmodel: {},
338
- all: false,
339
- fields: {},
340
- modelval: [],
341
- checkersid: [],
342
- sliceArea: [],
343
- cbc:[],
344
- cbcs:[],
345
- thead: '',
346
- headData: ['入户状态','用户编号','用户名','用户电话','用户小区','用户地址','安检时间','安检员','计划名','是否有隐患','隐患数','隐患情况'],
347
- bodyData: ['f_entry_status','f_userinfo_code','f_user_name','f_user_phone','f_residential_area','f_address','f_offsite_time','f_checker_name','f_plan_name','f_has_defect','f_defect_count','f_defect_content']
348
- }
349
- },
350
- props:{
351
-
352
- style: {
353
- type: String,
354
- default: 'col-sm-2 form-group'
355
- },
356
- style2: {
357
- type: String,
358
- default: 'col-sm-4 form-group'
359
- }
360
-
361
- },
362
-
363
- methods: {
364
- getmeterbook(val){
365
- this.cbc=[]
366
- this.cbc.push({
367
- label:'全部',
368
- value:''
369
- })
370
- if (val==''){
371
-
372
- this.cbcs.forEach(res=>{
373
- this.cbc.push({
374
- label:res.f_book_name,
375
- value:res.id
376
- })
377
- })
378
- }else{
379
- this.cbcs.forEach(res=>{
380
- if (res.f_book_slice_area==val){
381
- this.cbc.push({
382
- label:res.f_book_name,
383
- value:res.id
384
- })
385
- }
386
- })
387
- }
388
- },
389
-
390
- Mreadibook(val){
391
- console.log("999999999")
392
- console.log(val)
393
- this.sliceArea=[]
394
- if (val){
395
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
396
- items: 'name',
397
- tablename: 't_zone',
398
- condition: `parentid in ${val}`,
399
- orderitem: 'id'
400
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
401
- this.sliceArea.push({
402
- label:'全部',
403
- value:''
404
- })
405
- res.data.forEach(ress=>{
406
- this.sliceArea.push({
407
- label:ress.name,
408
- value:ress.name
409
- })
410
- })
411
-
412
- })
413
- }
414
- },
415
- getAllMeterBook(val){
416
- console.log("999999999")
417
- console.log(val)
418
- this.cbcs=[]
419
- if (val){
420
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
421
- items: 'f_book_name,f_book_slice_area,id',
422
- tablename: 't_meter_book',
423
- condition: `f_filiale_id in ${val}`,
424
- orderitem: 'id'
425
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
426
- res.data.forEach(ress=>{
427
- this.cbcs.push({
428
- id:ress.id,
429
- f_book_name:ress.f_book_name,
430
- f_book_slice_area:ress.f_book_slice_area
431
- })
432
- })
433
- this.cbc=[]
434
- this.cbc.push({
435
- label:'全部',
436
- value:''
437
- })
438
- this.cbcs.forEach(res=>{
439
- this.cbc.push({
440
- label:res.f_book_name,
441
- value:res.id
442
- })
443
- })
444
- })
445
- }
446
- },
447
- hiddenr() {
448
- this.$parent.showItem = !this.$parent.showItem
449
- },
450
- hidden() {
451
- this.criteriaShow = !this.criteriaShow
452
- },
453
- search(args) {
454
- if (this.f_check_plan.f_plan_name) {
455
- args.condition += ` and f_check_plan_id = '${this.f_check_plan.id}'`
456
- }
457
- this.model.search(args.condition, args.model)
458
- },
459
- getRes(obj) {
460
- this.model.f_filialeids = this.$login.convertToIn(obj.resids);
461
- this.Mreadibook(this.model.f_filialeids)
462
- this.getAllMeterBook(this.model.f_filialeids)
463
- },
464
- showChooser() {
465
- this.showModal = true
466
- },
467
- ok() {
468
- this.showModal = false
469
- if (this.$refs.modal.$children[0].selectedRow.id) {
470
- this.f_check_plan = this.$refs.modal.$children[0].selectedRow
471
- }
472
- },
473
- cancel() {
474
- this.showModal = false
475
- this.f_check_plan = {f_plan_name: '', id: ''}
476
- }
477
- },
478
- ready() {
479
- this.$refs.paged.$refs.criteria.model.f_has_defect = '有隐患'
480
- let gen = select(this)
481
- // this.Mreadibook(`('${this.$login.f.orgid}')`)
482
- co(gen)
483
- },
484
- computed: {
485
- selected() {
486
- return this.$refs.paged.$refs.grid.selected
487
- },
488
- getfield(){
489
- console.log("---------------------------------------------导出方法")
490
- let data = {}
491
- this.bodyData.forEach((value, index)=>{
492
- data[this.bodyData[index]] = this.headData[index]
493
- })
494
- //合计字段打印
495
- this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
496
- if(this.sumsmodel){
497
- Object.keys(this.sumsmodel).forEach((key) => {
498
- this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
499
- })
500
- }else{
501
- this.tfoot += '暂无'
502
- }
503
- this.tfoot += '</th></tr>'
504
- return data
505
- }
506
- }
507
- }
508
- </script>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row" v-if="!$parent.$parent.$parent.showItem">
7
+ <div :class="$parent.$parent.style">
8
+ <label class="font_normal_body">安检计划</label>
9
+ <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
10
+ @click="$parent.$parent.showChooser"
11
+ style="width: 60%" placeholder="安检计划" readonly="readonly">
12
+ </div>
13
+ <div :class="$parent.$parent.style" v-show="false">
14
+ <label class="font_normal_body">存在隐患</label>
15
+ <v-select style="width:60% "
16
+ class="select select_list"
17
+ :value.sync="model.f_has_defect"
18
+ v-model="model.f_has_defect"
19
+ :options='$parent.$parent.hasDefectOptions'
20
+ :placeholder='model.f_has_defect'
21
+ condition="f_has_defect = '{}'"
22
+ close-on-select>
23
+ </v-select>
24
+ </div>
25
+ <div :class="$parent.$parent.style">
26
+ <label class="font_normal_body">用户编号</label>
27
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
28
+ condition="f_userinfo_code = '{}'"
29
+ style="width: 60%" placeholder="用户编号">
30
+ </div>
31
+ <div :class="$parent.$parent.style">
32
+ <label class="font_normal_body">结果查询</label>
33
+ <v-select
34
+ placeholder='处理结果查询'
35
+ :value-single="true"
36
+ class="select select_list" style="width: 60%"
37
+ v-model='model.f_repaired'
38
+ :value.sync="model.f_repaired"
39
+ :options='$parent.$parent.repaired'
40
+ condition="f_repaired = '{}'"
41
+ close-on-select clear-button> </v-select>
42
+ </div>
43
+ <div class=" col-sm-4 form-group button-range" >
44
+ <div class="span" style="float: right;margin-top: 8px">
45
+ <div style="float: right" class="button_spacing"
46
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
47
+ @click="$parent.$parent.hiddenr()"></div>
48
+ <div style="float: right" class="button_spacing"
49
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
50
+ @click="$parent.$parent.hidden()"></div>
51
+ <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
52
+ <div style="float: right">
53
+ <export-excel-safe :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids,f_defect_content:$parent.$parent.model.f_defect_content}"
54
+ :field="$parent.$parent.getfield"
55
+ progress="safeGetExportProgress"
56
+ sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefect" template-name='安检隐患明细' :choose-col="true"></export-excel-safe>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <div class="row" v-if="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
62
+ <div :class="$parent.$parent.style">
63
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
64
+ <v-select class="select_list select"
65
+ placeholder='片区/管理站' style="width: 60%"
66
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
67
+ :options='$parent.$parent.sliceArea'
68
+ filer-key="name"
69
+ close-on-select clear-button
70
+ condition="f_slice_area='{}'"
71
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
72
+ :value-single="true">
73
+ </v-select>
74
+ </div>
75
+ <div :class="$parent.$parent.style2" style="margin: 0">
76
+ <role-selector-safe
77
+ role-name="安检员"
78
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
79
+ @re-res="$parent.$parent.getRes"
80
+ :value.sync="model.f_checker_id"
81
+ v-model="model.f_checker_id"
82
+ condition="f_checker_name = '{}'">
83
+ </role-selector-safe>
84
+ </div>
85
+
86
+ <div :class="$parent.$parent.style">
87
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
88
+ <v-select class="select_list select"
89
+ placeholder='抄表册' style="width: 60%"
90
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
91
+ :options='$parent.$parent.cbc'
92
+ filer-key="name"
93
+ close-on-select clear-button
94
+ condition="f_meter_book_num={}"
95
+ :value-single="true">
96
+ </v-select>
97
+ </div>
98
+ <div :class="$parent.$parent.style">
99
+ <label class="font_normal_body">起始时间</label>
100
+ <datepicker
101
+ placeholder='起始时间' style="width:60%"
102
+ :disabled-days-of-week="[]"
103
+ :format="'yyyy-MM-dd'"
104
+ :show-rest-button="reset"
105
+ :value.sync="model.f_start_time"
106
+ v-model="model.f_start_time"
107
+ condition="f_offsite_time >= '{} 00:00:00'">
108
+ </datepicker>
109
+ </div>
110
+ <div :class="$parent.$parent.style">
111
+ <label class="font_normal_body">结束时间</label>
112
+ <datepicker
113
+ placeholder='结束时间' style="width:60%"
114
+ :disabled-days-of-week="[]"
115
+ :format="'yyyy-MM-dd'"
116
+ :show-rest-button="reset"
117
+ :value.sync="model.f_end_time"
118
+ v-model="model.f_end_time"
119
+ condition="f_offsite_time <= '{} 23:59:59'">
120
+ </datepicker>
121
+ </div>
122
+ <div :class="$parent.$parent.style">
123
+ <label class="font_normal_body">隐&ensp;患&ensp;项</label>
124
+ <v-select style="width:60% "
125
+ class="select select_list"
126
+ :value.sync="$parent.$parent.defectLeave"
127
+ v-model="$parent.$parent.defectLeave"
128
+ :options='$parent.$parent.defectLeaveList'
129
+ placeholder='隐患项'
130
+ value-single
131
+ close-on-select>
132
+ </v-select>
133
+ </div>
134
+ <div :class="$parent.$parent.style">
135
+ <label class="font_normal_body">隐患内容</label>
136
+ <v-select style="width:60% "
137
+ class="select select_list"
138
+ :value.sync="$parent.$parent.defectType"
139
+ v-model="$parent.$parent.defectType"
140
+ :options='$parent.$parent.getdefectType'
141
+ placeholder='隐患内容'
142
+ :multiple="true">
143
+ </v-select>
144
+ </div>
145
+
146
+ </div>
147
+ <div class="row" v-if="$parent.$parent.$parent.showItem">
148
+ <div :class="$parent.$parent.style">
149
+ <label class="font_normal_body">安检计划</label>
150
+ <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
151
+ @click="$parent.$parent.showChooser"
152
+ style="width: 60%" placeholder="安检计划" readonly="readonly">
153
+ </div>
154
+ <div :class="$parent.$parent.style" v-show="false">
155
+ <label class="font_normal_body">存在隐患</label>
156
+ <v-select style="width:60% "
157
+ class="select select_list"
158
+ :value.sync="model.f_has_defect"
159
+ v-model="model.f_has_defect"
160
+ :options='$parent.$parent.hasDefectOptions'
161
+ :placeholder='model.f_has_defect'
162
+ condition="f_has_defect = '{}'"
163
+ close-on-select>
164
+ </v-select>
165
+ </div>
166
+
167
+ <div class=" col-sm-4 form-group button-range">
168
+ <div class="span" style="float: right;margin-top: 8px;margin-right: 50px">
169
+ <div style="float: right" class="button_spacing"
170
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
171
+ @click="$parent.$parent.hiddenr()"></div>
172
+ <div style="float: right" class="button_spacing"
173
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
174
+ @click="$parent.$parent.hidden()"></div>
175
+ <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
176
+ <div style="float: right">
177
+ <export-excel-safe :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids}"
178
+ :field="$parent.$parent.getfield"
179
+ progress="safeGetExportProgress"
180
+ sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefect" template-name='安检计划明细' :choose-col="true"></export-excel-safe>
181
+ </div>
182
+ </div>
183
+ </div>
184
+
185
+
186
+
187
+ </div>
188
+ <div class="row" v-if="$parent.$parent.criteriaShow&&$parent.$parent.$parent.showItem">
189
+ <div :class="$parent.$parent.style">
190
+ <label class="font_normal_body">用户编号</label>
191
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
192
+ condition="f_userinfo_code = '{}'"
193
+ style="width: 60%" placeholder="用户编号">
194
+ </div>
195
+ <div :class="$parent.$parent.style">
196
+ <label class="font_normal_body">结果查询</label>
197
+ <v-select
198
+ placeholder='处理结果查询'
199
+ :value-single="true"
200
+ class="select select_list" style="width: 60%"
201
+ v-model='model.f_repaired'
202
+ :value.sync="model.f_repaired"
203
+ :options='$parent.$parent.repaired'
204
+ condition="f_repaired = '{}'"
205
+ close-on-select clear-button> </v-select>
206
+ </div>
207
+
208
+ <div :class="$parent.$parent.style2" style="margin: 0">
209
+ <role-selector-safe
210
+ role-name="安检员"
211
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
212
+ @re-res="$parent.$parent.getRes"
213
+ :value.sync="model.f_checker_id"
214
+ v-model="model.f_checker_id"
215
+ condition="f_checker_name = '{}'">
216
+ </role-selector-safe>
217
+ </div>
218
+ </div>
219
+ <div class="row" v-if="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
220
+ <div :class="$parent.$parent.style">
221
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
222
+ <v-select class="select_list select"
223
+ placeholder='片区/管理站' style="width: 60%"
224
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
225
+ :options='$parent.$parent.sliceArea'
226
+ filer-key="name"
227
+ close-on-select clear-button
228
+ condition="f_slice_area='{}'"
229
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
230
+ :value-single="true">
231
+ </v-select>
232
+ </div>
233
+ <div :class="$parent.$parent.style">
234
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
235
+ <v-select class="select_list select"
236
+ placeholder='抄表册' style="width: 60%"
237
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
238
+ :options='$parent.$parent.cbc'
239
+ filer-key="name"
240
+ close-on-select clear-button
241
+ condition="f_meter_book_num={}"
242
+ :value-single="true">
243
+ </v-select>
244
+ </div>
245
+ <div :class="$parent.$parent.style">
246
+ <label class="font_normal_body">起始时间</label>
247
+ <datepicker
248
+ placeholder='起始时间' style="width:60%"
249
+ :disabled-days-of-week="[]"
250
+ :format="'yyyy-MM-dd'"
251
+ :show-rest-button="reset"
252
+ :value.sync="model.f_start_time"
253
+ v-model="model.f_start_time"
254
+ condition="f_offsite_time >= '{} 00:00:00'">
255
+ </datepicker>
256
+ </div>
257
+ <div :class="$parent.$parent.style">
258
+ <label class="font_normal_body">结束时间</label>
259
+ <datepicker
260
+ placeholder='结束时间' style="width:60%"
261
+ :disabled-days-of-week="[]"
262
+ :format="'yyyy-MM-dd'"
263
+ :show-rest-button="reset"
264
+ :value.sync="model.f_end_time"
265
+ v-model="model.f_end_time"
266
+ condition="f_offsite_time <= '{} 23:59:59'">
267
+ </datepicker>
268
+ </div>
269
+ <div :class="$parent.$parent.style">
270
+ <label class="font_normal_body">隐&ensp;患&ensp;项</label>
271
+ <v-select style="width:60% "
272
+ class="select select_list"
273
+ :value.sync="$parent.$parent.defectLeave"
274
+ v-model="$parent.$parent.defectLeave"
275
+ :options='$parent.$parent.defectLeaveList'
276
+ placeholder='隐患项'
277
+ value-single
278
+ close-on-select>
279
+ </v-select>
280
+ </div>
281
+ <div :class="$parent.$parent.style">
282
+ <label class="font_normal_body">隐患内容</label>
283
+ <v-select style="width:60% "
284
+ class="select select_list"
285
+ :value.sync="$parent.$parent.defectType"
286
+ v-model="$parent.$parent.defectType"
287
+ :options='$parent.$parent.getdefectType'
288
+ placeholder='隐患内容'
289
+ :multiple="true">
290
+ </v-select>
291
+ </div>
292
+
293
+ </div>
294
+ </div>
295
+ </criteria>
296
+ <data-grid :model="model" partial='list' v-ref:grid class="list_area table_sy">
297
+ <template partial='head'>
298
+ <tr>
299
+ <th><nobr>入户状态</nobr></th>
300
+ <th><nobr>用户编号</nobr></th>
301
+ <th><nobr>用户名</nobr></th>
302
+ <th><nobr>用户电话</nobr></th>
303
+ <th><nobr>用户小区</nobr></th>
304
+ <th><nobr>用户地址</nobr></th>
305
+ <th><nobr>安检时间</nobr></th>
306
+ <th><nobr>安检员</nobr></th>
307
+ <th><nobr>计划名</nobr></th>
308
+ <!--<th><nobr>是否有隐患</nobr></th>-->
309
+ <th><nobr>隐患总数</nobr></th>
310
+ <th><nobr>已处理数</nobr></th>
311
+ <th><nobr>未处理数</nobr></th>
312
+ <!-- <th><nobr>整改数</nobr></th>-->
313
+
314
+ </tr>
315
+ </template>
316
+ <template partial='body'>
317
+ <td style="text-align: center;white-space:nowrap;">{{row.f_entry_status}}</td>
318
+ <td style="text-align: center;white-space:nowrap;">{{row.f_userinfo_code}}</td>
319
+ <td style="text-align: center;white-space:nowrap;">{{row.f_user_name}}</td>
320
+ <td style="text-align: center;white-space:nowrap;">{{row.f_user_phone}}</td>
321
+ <td style="text-align: center;white-space:nowrap;">{{row.f_residential_area}}</td>
322
+ <td style="text-align: center;white-space:nowrap;">{{row.f_address}}</td>
323
+ <td style="text-align: center;white-space:nowrap;">{{row.f_offsite_time}}</td>
324
+ <td style="text-align: center;white-space:nowrap;">{{row.f_checker_name}}</td>
325
+ <td style="text-align: center;white-space:nowrap;">{{row.f_plan_name}}</td>
326
+ <!--<td style="text-align: center;white-space:nowrap;">{{row.f_has_defect}}</td>-->
327
+ <td style="text-align: center;white-space:nowrap;">{{row.f_defect_count}}</td>
328
+ <td style="text-align: center;white-space:nowrap;">{{row.f_repair_count}}</td>
329
+ <td style="text-align: center;white-space:nowrap;">{{row.remainder}}</td>
330
+ <!-- <td style="text-align: center;white-space:nowrap;">{{row.f_repair_count}}</td>-->
331
+
332
+ </template>
333
+ </data-grid>
334
+ </criteria-paged>
335
+
336
+ <modal :show.sync="showModal" v-ref:modal>
337
+ <div slot="modal-header" class="modal-header">
338
+ <h4 class="modal-title">
339
+ 选择计划
340
+ </h4>
341
+ </div>
342
+ <div slot="modal-body" class="modal-body">
343
+ <plan-chooser :f.sync="this.$login.f" v-ref:chooser></plan-chooser>
344
+ </div>
345
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
346
+ <button class="button_search" @click="ok">确认</button>
347
+ <button class="button_search" @click="cancel">取消</button>
348
+ </div>
349
+ </modal>
350
+ </div>
351
+ </template>
352
+ <script>
353
+ import {PagedList} from 'vue-client'
354
+ import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
355
+ import co from 'co'
356
+
357
+ let select = function* (self) {
358
+ let http = new HttpResetClass()
359
+ let getGasman = yield http.load('POST', '/rs/search', {
360
+ source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
361
+ userid: self.$login.f.id
362
+ }, {resolveMsg: null, rejectMsg: null})
363
+ console.log('获取安检员', getGasman)
364
+ self.checkersid.push({label: '全部', value: ''})
365
+ getGasman.data.forEach((checker) => {
366
+ self.checkersid.push({label: checker.name, value: checker.name})
367
+ })
368
+ }
369
+ export default {
370
+ title: '隐患查询',
371
+ data() {
372
+ let model = new PagedList('rs/sql/GetCheckPaperByDefect', 20, {
373
+ f_filialeids: 'this.f_filialeids',f_defect_content: 'this.f_defect_content'
374
+ })
375
+ model.f_filialeids = '(' + this.$login.f.orgid + ')'
376
+ model.f_defect_content="CASE WHEN CHARINDEX( '\"result\":\"正常\"', f_defect_content ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( f_defect_content, len( f_defect_content ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
377
+ return {
378
+ repaired:[{label: '未修', value: '未修'}, {label: '已修', value: '已修'}],
379
+ hasDefectOptions: [{label: '全部', value: ''}, {label: '有隐患', value: '有隐患'}, {label: '无隐患', value: '无隐患'}],
380
+ f: this.$login.f,
381
+ model: model,
382
+ criteriaShow: false,
383
+ showModal: false,
384
+ f_check_plan: {f_plan_name: '', id: ''},
385
+ sumsmodel: {},
386
+ all: false,
387
+ fields: {},
388
+ modelval: [],
389
+ checkersid: [],
390
+ sliceArea: [],
391
+ cbc:[],
392
+ cbcs:[],
393
+ thead: '',
394
+ defectLeave:'',
395
+ defectType:'',
396
+ defectLeaveList:[],
397
+ headData: ['入户状态','用户编号','用户名','用户电话','用户小区','用户地址','安检时间','安检员','计划名','隐患总数','已处理数','未处理数','隐患数','隐患情况'],
398
+ bodyData: ['f_entry_status','f_userinfo_code','f_user_name','f_user_phone','f_residential_area','f_address','f_offsite_time','f_checker_name','f_plan_name','f_defect_count','f_repair_count','remainder','f_defect_count','f_defect_content']
399
+ }
400
+ },
401
+ props:{
402
+
403
+ style: {
404
+ type: String,
405
+ default: 'col-sm-2 form-group'
406
+ },
407
+ style2: {
408
+ type: String,
409
+ default: 'col-sm-4 form-group'
410
+ }
411
+
412
+ },
413
+
414
+ methods: {
415
+ getmeterbook(val){
416
+ this.cbc=[]
417
+ this.cbc.push({
418
+ label:'全部',
419
+ value:''
420
+ })
421
+ if (val==''){
422
+
423
+ this.cbcs.forEach(res=>{
424
+ this.cbc.push({
425
+ label:res.f_book_name,
426
+ value:res.id
427
+ })
428
+ })
429
+ }else{
430
+ this.cbcs.forEach(res=>{
431
+ if (res.f_book_slice_area==val){
432
+ this.cbc.push({
433
+ label:res.f_book_name,
434
+ value:res.id
435
+ })
436
+ }
437
+ })
438
+ }
439
+ },
440
+
441
+ Mreadibook(val){
442
+ console.log("999999999")
443
+ console.log(val)
444
+ this.sliceArea=[]
445
+ if (val){
446
+ new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
447
+ items: 'name',
448
+ tablename: 't_zone',
449
+ condition: `parentid in ${val}`,
450
+ orderitem: 'id'
451
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
452
+ this.sliceArea.push({
453
+ label:'全部',
454
+ value:''
455
+ })
456
+ res.data.forEach(ress=>{
457
+ this.sliceArea.push({
458
+ label:ress.name,
459
+ value:ress.name
460
+ })
461
+ })
462
+
463
+ })
464
+ }
465
+ },
466
+ getAllMeterBook(val){
467
+ console.log("999999999")
468
+ console.log(val)
469
+ this.cbcs=[]
470
+ if (val){
471
+ new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
472
+ items: 'f_book_name,f_book_slice_area,id',
473
+ tablename: 't_meter_book',
474
+ condition: `f_filiale_id in ${val}`,
475
+ orderitem: 'id'
476
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
477
+ res.data.forEach(ress=>{
478
+ this.cbcs.push({
479
+ id:ress.id,
480
+ f_book_name:ress.f_book_name,
481
+ f_book_slice_area:ress.f_book_slice_area
482
+ })
483
+ })
484
+ this.cbc=[]
485
+ this.cbc.push({
486
+ label:'全部',
487
+ value:''
488
+ })
489
+ this.cbcs.forEach(res=>{
490
+ this.cbc.push({
491
+ label:res.f_book_name,
492
+ value:res.id
493
+ })
494
+ })
495
+ })
496
+ }
497
+ },
498
+ hiddenr() {
499
+ this.$parent.showItem = !this.$parent.showItem
500
+ },
501
+ hidden() {
502
+ this.criteriaShow = !this.criteriaShow
503
+ },
504
+ search(args) {
505
+ if(this.defectLeave && (this.defectType.length==0 || !this.defectType.length)){
506
+ this.$showMessage("选择隐患项后,必须选择隐患内容!")
507
+ return
508
+ }
509
+ if(this.defectType.length>0){
510
+ args.condition += ` and (`
511
+ for(let sqlstr=0;sqlstr<this.defectType.length;sqlstr++){
512
+ console.log(sqlstr)
513
+ console.log(this.defectType[sqlstr])
514
+ args.condition += ` f_defect_content like '%${this.defectType[sqlstr]}%'`
515
+ if(sqlstr<this.defectType.length-1){
516
+ args.condition +=' or'
517
+ }
518
+ }
519
+ args.condition += ` )`
520
+ }
521
+ if (this.f_check_plan.f_plan_name) {
522
+ args.condition += ` and f_check_plan_id = '${this.f_check_plan.id}'`
523
+ }
524
+ this.model.search(args.condition, args.model)
525
+ },
526
+ getRes(obj) {
527
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids);
528
+ this.Mreadibook(this.model.f_filialeids)
529
+ this.getAllMeterBook(this.model.f_filialeids)
530
+ },
531
+ showChooser() {
532
+ this.showModal = true
533
+ },
534
+ ok() {
535
+ this.showModal = false
536
+ if (this.$refs.modal.$children[0].selectedRow.id) {
537
+ this.f_check_plan = this.$refs.modal.$children[0].selectedRow
538
+ }
539
+ },
540
+ cancel() {
541
+ this.showModal = false
542
+ this.f_check_plan = {f_plan_name: '', id: ''}
543
+ }
544
+ },
545
+ ready() {
546
+ this.$refs.paged.$refs.criteria.model.f_has_defect = '有隐患'
547
+ this.defectLeaveList=[{label:'全部',value:''}, ...this.$appdata.getParam('安检隐患项')]
548
+ let gen = select(this)
549
+ // this.Mreadibook(`('${this.$login.f.orgid}')`)
550
+ co(gen)
551
+ },
552
+ computed: {
553
+ getdefectType(){
554
+ this.defectType=[]
555
+ return [... this.$appdata.getParam(`安检项-${this.defectLeave}`)]
556
+ },
557
+ selected() {
558
+ return this.$refs.paged.$refs.grid.selected
559
+ },
560
+ getfield(){
561
+ console.log("---------------------------------------------导出方法")
562
+ let data = {}
563
+ this.bodyData.forEach((value, index)=>{
564
+ data[this.bodyData[index]] = this.headData[index]
565
+ })
566
+ //合计字段打印
567
+ this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
568
+ if(this.sumsmodel){
569
+ Object.keys(this.sumsmodel).forEach((key) => {
570
+ this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
571
+ })
572
+ }else{
573
+ this.tfoot += '暂无'
574
+ }
575
+ this.tfoot += '</th></tr>'
576
+ return data
577
+ }
578
+ }
579
+ }
580
+ </script>