safecheck-client 3.0.34-99 → 3.0.35-1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1040 +1,1053 @@
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-show="!$parent.$parent.$parent.showItem">
7
- <div :class="$parent.$parent.style">
8
- <label class="font_normal_body">用户编号</label>
9
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
10
- id="f_userinfo_code"
11
-
12
- placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
13
- </div>
14
- <div :class="$parent.$parent.style">
15
- <label class="font_normal_body">用户姓名</label>
16
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name" id="f_user_name"
17
- placeholder="用户姓名" condition="f_user_name like '%{}%'">
18
- </div>
19
- <div :class="$parent.$parent.style">
20
- <label class="font_normal_body">小&emsp;&emsp;区</label>
21
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
22
- id="f_residential_area"
23
- placeholder="小区" condition="f_residential_area like '%{}%'">
24
- </div>
25
- <div :class="$parent.$parent.style">
26
- <label class="font_normal_body">地&emsp;&emsp;址</label>
27
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_address" id="f_address"
28
- placeholder="地址" condition="f_address like '%{}%'">
29
- </div>
30
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
31
- <export-excel-safe :data="$parent.$parent.searchData"
32
- :field="$parent.$parent.excelHeaders"
33
- sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案"
34
- template-name='用户安检情况' :choose-col="true"></export-excel-safe>
35
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
36
- <div style="float: right" class="button_spacing"
37
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
38
- @click="$parent.$parent.hiddenr()"></div>
39
- <div style="float: right" class="button_spacing"
40
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
41
- @click="$parent.$parent.hidden()">
42
-
43
- </div>
44
- </div>
45
-
46
-
47
- </div>
48
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
49
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
50
- <label class="font_normal_body">用户类型</label>
51
- <v-select id="f_usertype"
52
- placeholder='用户类型'
53
- class="select select_list"
54
- :value.sync="model.f_usertype"
55
- :value-single="true"
56
- :options='$parent.$parent.usertypes'
57
- v-model="model.f_usertype"
58
- condition="f_user_type = '{}'"
59
- close-on-select clear-button></v-select>
60
- </div>
61
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
62
-
63
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
64
- <label class="font_normal_body" style="color: red;">安检筛选</label>
65
- <v-select
66
- placeholder='安检筛选'
67
- :value-single="true"
68
- class="select select_list"
69
- :value.sync="$parent.$parent.SafeCheckXZ"
70
- :options='$parent.$parent.SafeCheckXZs'
71
- v-model="$parent.$parent.SafeCheckXZ"
72
- close-on-select clear-button></v-select>
73
- </div>
74
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
75
- <label class="font_normal_body">安检起始</label>
76
- <datepicker
77
- :value.sync="model.f_check_start"
78
- placeholder='最后安检时间起始'
79
- style="width: 60%"
80
- :format="'yyyy-MM-dd 00:00:00'"
81
- :show-rest-button="reset"
82
- v-model="model.f_check_start">
83
- </datepicker>
84
- </div>
85
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
86
- <label class="font_normal_body">安检结束</label>
87
- <datepicker
88
- :value.sync="model.f_check_end"
89
- placeholder='最后安检时间结束'
90
- style="width: 60%"
91
- :format="'yyyy-MM-dd 23:59:59'"
92
- :show-rest-button="reset"
93
- v-model="model.f_check_end">
94
- </datepicker>
95
- </div>
96
-
97
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
98
- <label class="font_normal_body">安检状态</label>
99
- <v-select id="f_entry"
100
- placeholder='安检状态'
101
- class="select select_list"
102
- :value.sync="model.f_last_check_state"
103
- :value-single="true"
104
- :options='$parent.$parent.checkstatus'
105
- v-model="model.f_last_check_state"
106
- condition="f_last_check_state = '{}'"
107
- close-on-select clear-button></v-select>
108
- </div>
109
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
110
- <label class="font_normal_body">隐患情况</label>
111
- <v-select
112
- placeholder='隐患情况'
113
- class="select select_list"
114
- :value-single="true"
115
- v-model='model.f_check_result'
116
- :value.sync="model.f_check_result"
117
- :options='$parent.$parent.f_check_results'
118
- condition="f_last_check_result like '%{}%'"
119
- close-on-select clear-button></v-select>
120
- </div>
121
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
122
- </div>
123
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
124
-
125
- <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
126
- <role-selector-safe
127
- role-name="安检员"
128
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
129
- @re-res="$parent.$parent.getRes"
130
- :value.sync="model.f_checker_id"
131
- v-model="model.f_checker_id"
132
- :value-multiple="true"
133
- condition=" f_checker_name in {}">
134
- </role-selector-safe>
135
- </div>
136
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
137
- <label class="font_normal_body">片&emsp;&emsp;区</label>
138
- <v-select class="select_list select"
139
- placeholder='片区/管理站' style="width: 60%"
140
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
141
- :options='$parent.$parent.sliceArea'
142
- filer-key="name"
143
- close-on-select clear-button
144
- condition="f_slice_area='{}'"
145
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
146
- :value-single="true">
147
- </v-select>
148
- </div>
149
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
150
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
151
- <v-select class="select_list select"
152
- placeholder='抄表册' style="width: 60%"
153
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
154
- :options='$parent.$parent.cbc'
155
- filer-key="name"
156
- close-on-select clear-button
157
- condition="f_meter_book_num={}"
158
- :value-single="true">
159
- </v-select>
160
- </div>
161
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
162
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
163
- <v-select class="select_list select"
164
- placeholder='请选择' style="width: 60%"
165
- :value.sync="model.f_pcd" v-model="model.f_pcd"
166
- :options='$parent.$parent.pcds'
167
- filer-key="name"
168
- close-on-select clear-button
169
- condition="f_pcd_id ='{}'"
170
- :value-single="true">
171
- </v-select>
172
- </div>
173
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
174
- <label class="font_normal_body">用户状态</label>
175
- <v-select class="select_list select"
176
- placeholder='用户状态' style="width: 60%"
177
- :value.sync="model.f_user_state" v-model="model.f_user_state"
178
- :options='$parent.$parent.userstates'
179
- close-on-select clear-button
180
- condition="f_user_state = '{}'"
181
- :value-single="true">
182
- </v-select>
183
- </div>
184
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
185
- <label class="font_normal_body">用气性质</label>
186
- <v-select
187
- class="select_list select"
188
- placeholder='用气性质' style="width: 60%"
189
- v-model='model.userType'
190
- :value.sync="model.userType"
191
- :options='$parent.$parent.userTypes'
192
- condition="f_gasproperties = '{}'"
193
- :value-single="true"
194
- close-on-select clear-button></v-select>
195
- </div>
196
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
197
- <label class="font_normal_body">气表类型</label>
198
- <v-select
199
- class="select_list select"
200
- placeholder='气表类型' style="width: 60%"
201
- v-model='model.tableType'
202
- :value.sync="model.tableType"
203
- :options='$parent.$parent.tableTypes'
204
- condition="f_meter_classify = '{}'"
205
- :value-single="true"
206
- close-on-select clear-button></v-select>
207
- </div>
208
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
209
- <label class="font_normal_body">气表品牌</label>
210
- <v-select
211
- class="select_list select"
212
- placeholder='气表类型' style="width: 60%"
213
- v-model='model.tableBrand'
214
- :value.sync="model.tableBrand"
215
- :options='$parent.$parent.tableBrands'
216
- condition="f_meter_brand = '{}'"
217
- :value-single="true"
218
- close-on-select clear-button></v-select>
219
- </div>
220
- </div>
221
-
222
- <div class="row" v-show="$parent.$parent.$parent.showItem">
223
- <div :class="$parent.$parent.style">
224
- <label class="font_normal_body">用户编号</label>
225
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
226
-
227
- placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
228
- </div>
229
- <div :class="$parent.$parent.style">
230
- <label class="font_normal_body">用户姓名</label>
231
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name"
232
- placeholder="用户姓名" condition="f_user_name like '%{}%'">
233
- </div>
234
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
235
- <export-excel-safe :data="$parent.$parent.searchData"
236
- :field="$parent.$parent.excelHeaders"
237
- sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案"
238
- template-name='用户安检情况' :choose-col="true"></export-excel-safe>
239
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
240
- <div style="float: right" class="button_spacing"
241
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
242
- @click="$parent.$parent.hiddenr()"></div>
243
- <div style="float: right" class="button_spacing"
244
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
245
- @click="$parent.$parent.hidden()">
246
-
247
- </div>
248
- </div>
249
-
250
- </div>
251
- <div class="row" v-show="$parent.$parent.$parent.showItem">
252
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
253
- <label class="font_normal_body">小&emsp;&emsp;区</label>
254
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
255
-
256
- placeholder="小区" condition="f_residential_area like '%{}%'">
257
- </div>
258
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
259
- <label class="font_normal_body">地&emsp;&emsp;址</label>
260
- <input style="width: 60%" type="text" class="input_search" v-model="model.f_address"
261
-
262
- placeholder="地址" condition="f_address like '%{}%'">
263
- </div>
264
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
265
- <label class="font_normal_body">用户类型</label>
266
- <v-select
267
- placeholder='用户类型'
268
- class="select select_list"
269
-
270
- :value.sync="model.f_usertype"
271
- :value-single="true"
272
- :options='$parent.$parent.usertypes'
273
- v-model="model.f_usertype"
274
- condition="f_user_type = '{}'"
275
- close-on-select clear-button></v-select>
276
- </div>
277
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
278
-
279
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
280
- <label class="font_normal_body" style="color: red;">安检筛选</label>
281
- <v-select
282
- placeholder='安检筛选'
283
- :value-single="true"
284
-
285
- class="select select_list"
286
- :value.sync="$parent.$parent.SafeCheckXZ"
287
- :options='$parent.$parent.SafeCheckXZs'
288
- v-model="$parent.$parent.SafeCheckXZ"
289
- close-on-select clear-button></v-select>
290
- </div>
291
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
292
- <label class="font_normal_body">用气性质</label>
293
- <v-select
294
- class="select_list select"
295
- placeholder='用气性质' style="width: 60%"
296
- v-model='model.userType'
297
- :value.sync="model.userType"
298
- :options='$parent.$parent.userTypes'
299
- condition="f_gasproperties = '{}'"
300
- :value-single="true"
301
- close-on-select clear-button></v-select>
302
- </div>
303
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
304
- <label class="font_normal_body">气表类型</label>
305
- <v-select
306
- class="select_list select"
307
- placeholder='气表类型' style="width: 60%"
308
- v-model='model.tableType'
309
- :value.sync="model.tableType"
310
- :options='$parent.$parent.tableTypes'
311
- condition="f_meter_classify = '{}'"
312
- :value-single="true"
313
- close-on-select clear-button></v-select>
314
- </div>
315
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
316
- <label class="font_normal_body">气表品牌</label>
317
- <v-select
318
- class="select_list select"
319
- placeholder='气表类型' style="width: 60%"
320
- v-model='model.tableBrand'
321
- :value.sync="model.tableBrand"
322
- :options='$parent.$parent.tableBrands'
323
- condition="f_meter_brand = '{}'"
324
- :value-single="true"
325
- close-on-select clear-button></v-select>
326
- </div>
327
-
328
- </div>
329
- <div class="row" v-show="$parent.$parent.$parent.showItem">
330
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
331
- <label class="font_normal_body">安检起始</label>
332
- <datepicker
333
- :value.sync="model.f_check_start"
334
- placeholder='最后安检时间起始'
335
- :disabled-days-of-week="[]"
336
- style="width: 60%"
337
- :format="'yyyy-MM-dd'"
338
- :show-rest-button="reset"
339
- v-model="model.f_check_start">
340
- </datepicker>
341
- </div>
342
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
343
- <label class="font_normal_body">安检结束</label>
344
- <datepicker
345
- :value.sync="model.f_check_end"
346
- placeholder='最后安检时间结束'
347
- style="width: 60%"
348
- :disabled-days-of-week="[]"
349
- :format="'yyyy-MM-dd'"
350
- :show-rest-button="reset"
351
- v-model="model.f_check_end">
352
- </datepicker>
353
- </div>
354
-
355
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
356
- <label class="font_normal_body">安检状态</label>
357
- <v-select
358
- placeholder='安检状态'
359
- class="select select_list"
360
-
361
- :value.sync="model.f_last_check_state"
362
- :value-single="true"
363
- :options='$parent.$parent.checkstatus'
364
- v-model="model.f_last_check_state"
365
- condition="f_last_check_state = '{}'"
366
- close-on-select clear-button></v-select>
367
- </div>
368
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
369
- <label class="font_normal_body">隐患情况</label>
370
- <v-select
371
- placeholder='隐患情况'
372
- class="select select_list"
373
-
374
- :value-single="true"
375
- v-model='model.f_check_result'
376
- :value.sync="model.f_check_result"
377
- :options='$parent.$parent.f_check_results'
378
- condition="f_last_check_result like '%{}%'"
379
- close-on-select clear-button></v-select>
380
- </div>
381
-
382
- </div>
383
- <!--<div class="row" v-show="$parent.$parent.$parent.showItem">
384
- <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
385
- <label class="font_normal_body">公&emsp;&emsp;司</label>
386
- <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">
387
- </right-tree>
388
- </div>
389
-
390
- </div>-->
391
- </div>
392
- </criteria>
393
- <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
394
- <template partial='head'>
395
- <tr>
396
- <th>
397
- <nobr>用户编号</nobr>
398
- </th>
399
- <th>
400
- <nobr>用户名称</nobr>
401
- </th>
402
- <th>
403
- <nobr>用户电话</nobr>
404
- </th>
405
- <th>
406
- <nobr>燃气表号</nobr>
407
- </th>
408
- <th>
409
- <nobr>气表品牌</nobr>
410
- </th>
411
- <th>
412
- <nobr>用户类型</nobr>
413
- </th>
414
- <!-- <th>-->
415
- <!-- <nobr>壁挂炉</nobr>-->
416
- <!-- </th>-->
417
- <!-- <th>-->
418
- <!-- <nobr>灶具</nobr>-->
419
- <!-- </th>-->
420
- <th>
421
- <nobr>区域</nobr>
422
- </th>
423
- <th>
424
- <nobr>小区名称</nobr>
425
- </th>
426
- <th style="padding: 0 40px">
427
- <nobr>地址</nobr>
428
- </th>
429
- <th>
430
- <nobr>安检员</nobr>
431
- </th>
432
- <th>
433
- <nobr>安检员备注</nobr>
434
- </th>
435
- <th>
436
- <nobr>最后一次安检日期</nobr>
437
- </th>
438
- <th>
439
- <nobr>最后一次安检状态</nobr>
440
- </th>
441
- <th>
442
- <nobr>安检结果</nobr>
443
- </th>
444
- </tr>
445
- </template>
446
- <template partial='body'>
447
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_userinfo_code }}</td>
448
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_name }}</td>
449
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_phone }}</td>
450
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meternumber }}</td>
451
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meter_brand }}</td>
452
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_user_type }}</td>
453
- <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_hasfurnace }}</td>-->
454
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_slice_area }}</td>
455
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_residential_area }}</td>
456
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_address }}</td>
457
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_checker_name }}</td>
458
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_comments }}</td>
459
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_date }}</td>
460
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_state }}</td>
461
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">
462
- {{ $parent.$parent.$parent.getDefect(row.f_last_check_result) }}
463
- </td>
464
- </template>
465
- </data-grid>
466
- </criteria-paged>
467
- </div>
468
- </template>
469
-
470
- <script>
471
- import {PagedList} from 'vue-client'
472
- import {HttpResetClass} from 'vue-client'
473
- import co from 'co'
474
- import * as Util from '../../Util'
475
- import Vue from 'vue'
476
-
477
- // let select = function * (self,userid) {
478
- // let http = new HttpResetClass()
479
- // let getGasman = yield http.load('POST','/rs/search', {
480
- // source: 'this.getChildByName($安检员$).getUsers()',
481
- // userid: userid
482
- // }, {resolveMsg: null, rejectMsg: null})
483
- // //tag
484
- // getGasman.data.forEach((checker)=>{
485
- // self.checkersid.push({label:checker.name,value:checker.id})
486
- // })
487
- // self.checkersid.push({label:'全部',value:''})
488
- // }
489
-
490
-
491
- export default {
492
- title: '用户安检情况',
493
- data() {
494
- let options = []
495
- let year = (new Date()).getFullYear()
496
- for (let i = year; i <= year + 3; i++)
497
- options.push({label: i + '', value: i + ''})
498
- let moptions = []
499
- for (let i = 1; i <= 12; i++)
500
- moptions.push({label: i + '', value: i + ''})
501
-
502
- return {
503
- searchData: {
504
- condition: '1=1',
505
- orderitem: "f_userinfo_code",
506
- timetype: "dd",
507
- f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', ua.f_last_check_result ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( ua.f_last_check_result, len( ua.f_last_check_result ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
508
-
509
- },
510
- excelHeaders: {
511
- //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
512
-
513
- 'f_userinfo_code': '用户编号',
514
- 'f_user_name': '用户名称',
515
- 'f_user_phone': '用户电话',
516
- 'f_meternumber': '燃气表号',
517
- 'f_meter_brand': '气表品牌',
518
- // 'count_item': '安检次数',
519
- 'f_user_type': '用户类型',
520
- 'f_checker_name': '安检员',
521
- 'f_comments': '安检备注',
522
- 'f_slice_area': '区域',
523
- 'f_residential_area': '小区名称',
524
- 'f_address': '地址',
525
- 'f_last_check_date': '最后一次安检日期',
526
- 'f_last_check_state': '最后一次安检状态',
527
- 'f_defect_content': '安检结果'
528
- },
529
- model: new PagedList('rs/sql/根据安检员查询用户档案', 20, {
530
- orderitem: "'f_last_check_date desc'",
531
- timetype: "'dd'",
532
- f_defect_content: 'this.f_defect_content'
533
- }),
534
- f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', ua.f_last_check_result ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( ua.f_last_check_result, len( ua.f_last_check_result ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END",
535
- orgstrs: [{label: '全部', value: ''}],
536
- checkersid: [],
537
- SafeCheckXZ: '',
538
- civil: '', //民用安检周期
539
- civilian: '', //非民用安检周期
540
- SafeCheckXZs: [{label: '全部', value: ''}, {label: '未安检', value: '未安检'}, {label: '已安检', value: '已安检'}], // 安检筛选选项
541
- SafeCheckSXs: [{label: '', value: '是'}, {label: '否', value: '否'}, {label: '全部', value: ''}],
542
- // user_states:[{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')],
543
- IsShares: [{label: '', value: '是'}, {label: '否', value: '否'}],
544
- IsShare: '',
545
- checker: {},
546
- NoBuys: [{label: '', value: ''}, {label: '', value: ''}],
547
- criteriaShow: false,
548
- checkers: [],
549
- chosenOrg: {id: 0},
550
- showModal: false,
551
- checkedAll: false,
552
- checkrows: [],
553
- adjustables: [],
554
- f_plan_year: year + '',
555
- f_plan_month: moptions[new Date().getMonth()].value,
556
- f_effective_start_time: '', //计划有效起始时间
557
- f_effective_end_time: '', //计划有效结束时间
558
- checkboxModel: {},
559
- c_year_list: options,
560
- c_month_list: moptions,
561
- areas: this.areas(),
562
- checkstatus: this.checkstatus(),
563
- usertypes: this.usertypes(),
564
- userstates: this.userstates(),
565
- sqlname: '',
566
- f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'}, {label: '有隐患', value: '有隐患'}],
567
- creatPlanWay: '',
568
- userTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')],
569
- tableTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')],
570
- tableBrands: [{label: '全部', value: ''}],
571
- sliceArea: [],
572
- cbcs: [],
573
- cbc: [],
574
- pcds: []
575
-
576
- }
577
- },
578
- props: {
579
- style: {
580
- type: String,
581
- default: 'col-sm-2 form-group'
582
- },
583
- style2: {
584
- type: String,
585
- default: 'col-sm-4 form-group'
586
- },
587
- checkplan: { // 传入一条安检计划信息
588
- type: Object
589
- },
590
- additemshow: {
591
- type: Boolean,
592
- default: false
593
- }
594
- },
595
- ready() {
596
- // 获取分公司信息
597
- this.model.f_defect_content = this.f_defect_content
598
-
599
- //this.getfengongsi()
600
- this.model.chosenOrg = {id: 0}
601
- this.model.f_filialeids = this.$login.f.f_orgids
602
- this.model.f_filiale = this.$login.f.f_fengongsi
603
- this.model.f_OrgStr = this.$login.f.orgpathstr
604
- this.Mreadibook(`('${this.$login.f.orgid}')`)
605
- this.getAllMeterBook(`('${this.$login.f.orgid}')`)
606
- this.getTableBrands()
607
- },
608
- methods: {
609
- getTableBrands() {
610
- new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
611
- {data: {items: "*", tablename: "t_gasbrand", orderitem: "id", condition: ` 1=1 `}},
612
- {resolveMsg: null, rejectMsg: null}).then((resp) => {
613
- resp.data.forEach((result) => {
614
- this.tableBrands.push({label: result.f_meter_brand, value: result.f_meter_brand})
615
- })
616
- })
617
- },
618
- //获取省市区列表
619
- getPcd(val) {
620
- this.pcds = [{label: '全部', value: ''}]
621
- new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
622
- {data: {items: "*", tablename: "t_pcd", orderitem: "id", condition: `f_orgid in ${val}`}},
623
- {resolveMsg: null, rejectMsg: null}).then((pcdlist) => {
624
- pcdlist.data.forEach((result) => {
625
- this.pcds.push({label: result.f_pcd, value: result.id})
626
- })
627
- })
628
- },
629
- getmeterbook(val) {
630
-
631
- //tag
632
- this.cbc = []
633
- this.cbc.push({
634
- label: '全部',
635
- value: ''
636
- })
637
- if (val == '') {
638
-
639
- this.cbcs.forEach(res => {
640
- this.cbc.push({
641
- label: res.f_book_name,
642
- value: res.id
643
- })
644
- })
645
- } else {
646
- this.cbcs.forEach(res => {
647
- if (res.f_book_slice_area == val) {
648
- this.cbc.push({
649
- label: res.f_book_name,
650
- value: res.id
651
- })
652
- }
653
- })
654
- }
655
- },
656
- Mreadibook(val) {
657
- ////tag
658
- ////tag
659
- this.sliceArea = []
660
- if (val) {
661
- new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
662
- data: {
663
- items: 'name',
664
- tablename: 't_zone',
665
- condition: `parentid in ${val}`,
666
- orderitem: 'id'
667
- }
668
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
669
- this.sliceArea.push({
670
- label: '全部',
671
- value: ''
672
- })
673
- res.data.forEach(ress => {
674
- this.sliceArea.push({
675
- label: ress.name,
676
- value: ress.name
677
- })
678
- })
679
-
680
- })
681
- }
682
- },
683
- // 获取县域分公司内容
684
- getfengongsi() {
685
- let val = {
686
- source: 'this.getParentByType($organization$).getSpecialResByType($organization$)',
687
- userid: `${this.$login.f.id}`
688
- }
689
- let http = new HttpResetClass()
690
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
691
- res.data.forEach((item) => {
692
- this.orgstrs.push({label: item.name, value: item.id})
693
- })
694
- //tag
695
- })
696
- },
697
- // 县域分公司发生改变
698
- // orgstrchange(val){
699
- // if(val == undefined || val == ''){
700
- // return
701
- // }else {
702
- // this.checkersid = []
703
- // let gen = select(this,val)
704
- // return co(gen)
705
- // }
706
- // },
707
- getDefect(val) {
708
- if (val) {
709
- try {
710
- var defect = JSON.parse(val)
711
- return defect.result
712
- } catch (e) {
713
- //tag
714
- return '正常'
715
- }
716
- }
717
- return '正常'
718
- },
719
- checkerchange(val) {
720
- this.checkboxModel.f_checker = val.name
721
- this.checkboxModel.f_checker_id = val.id
722
- },
723
- search(args) {
724
- if (this.model.f_filialeids){
725
- args.condition += ` and f_orgid in ${this.model.f_filialeids}`
726
- }
727
- if (this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')) {
728
- this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始时间!')
729
- return
730
- }
731
- if ((args.model.f_check_start || args.model.f_check_end) && !this.SafeCheckXZ) {
732
- this.$showMessage('如果录入 安检起始时间,需要选择 安检筛选条件!')
733
- return
734
- }
735
- //args.condition += " and f_filialeid in " + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
736
- // let con = ' f_filialeid in ' + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
737
- let con = '1=1'
738
- this.$emit('filiale-change', con)
739
- con += args.model.f_userinfo_code ? ` and f_userinfo_code like '%${args.model.f_userinfo_code}%'` : ''
740
- con += args.model.f_user_name ? ` and f_user_name like '%${args.model.f_user_name}%'` : ''
741
- con += args.model.f_residential_area ? ` and f_residential_area like '%${args.model.f_residential_area}%'` : ''
742
- con += args.model.f_address ? ` and f_address like '%${args.model.f_address}%'` : ''
743
- con += args.model.f_usertype ? ` and f_check_type = '${args.model.f_usertype}'` : ''
744
- if (this.SafeCheckXZ) {
745
- con += ` and f_offsite_time >= '${args.model.f_check_start}' and f_offsite_time <= '${args.model.f_check_end}' `
746
- if (this.SafeCheckXZ == '未安检') {
747
- args.condition += ' and ruhuid is null'
748
- } else {
749
- args.condition += ' and ruhuid is not null'
750
- }
751
- }
752
- con += args.model.f_last_check_state ? ` and f_entry_status = '${args.model.f_last_check_state}'` : ''
753
- con += args.model.f_checker_id ? ` and f_checker_name in ${args.model.f_checker_id}` : ''
754
- let condition = {
755
- condition1: args.condition,
756
- condition2: con
757
- }
758
- this.searchData.condition = condition
759
- return this.model.search(condition, args.model)
760
- },
761
- checkstatus() {
762
- return this.$appdata.getParam('安检状态') ? [{
763
- label: '全部',
764
- value: ''
765
- }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
766
- },
767
- usertypes() {
768
- return this.$appdata.getParam('用户类型') ? [{
769
- label: '全部',
770
- value: ''
771
- }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
772
- },
773
- userstates() {
774
- return this.$appdata.getParam('用户状态') ? [{
775
- label: '全部',
776
- value: ''
777
- }, ...this.$appdata.getParam('用户状态')] : [{label: '全部', value: ''}]
778
- },
779
- hiddenr() {
780
- this.$parent.showItem = !this.$parent.showItem
781
- },
782
- hidden() {
783
- this.criteriaShow = !this.criteriaShow
784
- },
785
- confirm() {
786
- if (!this.checkboxModel.f_plan_name) {
787
- this.$showMessage('请填写安检计划名称!')
788
- return
789
- }
790
- // if(this.f_effective_start_time == ''){
791
- // this.$showMessage('请选择有效起始日期!')
792
- // return
793
- // }
794
- // if(this.f_effective_end_time == ''){
795
- // this.$showMessage('请选择有效结束日期!')
796
- // return
797
- // }
798
- if (this.IsShare == '否') {
799
- if (!this.checkboxModel.f_checker_id) {
800
- this.$showMessage('请选择安检员!')
801
- return
802
- }
803
- }
804
- let gen = saveGen(this)
805
- return co(gen)
806
- },
807
- changeStates() {
808
- if (this.checkedAll) {//实现反选/
809
- this.checkrows = [];
810
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
811
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
812
- }
813
- } else {//实现全选
814
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
815
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
816
- }
817
- let _this = this
818
- let condition = this.$refs.paged.$refs.criteria.condition
819
- let url = this.model.url
820
- this.$resetpost(`${url}?pageSize=9999999`, {
821
- data: {
822
- condition: condition,
823
- groupitem: '',
824
- orderitem: 'f_residential_area',
825
- f_usertype: this.model.f_usertype,
826
- f_filialeids: this.model.f_filialeids,
827
- month: this.model.month,
828
- safeCycle: this.model.safeCycle,
829
- f_checktime_start: this.model.f_checktime_start,
830
- f_checktime_end: this.model.f_checktime_end,
831
- SafeCheckSX: this.model.SafeCheckSX,
832
- f_last_check_state: this.model.f_last_check_state
833
- },
834
- }, {resolveMsg: null, rejectMsg: null}, -1).then(
835
- (respanse) => {
836
- if (respanse.data.length >= 5000) {
837
- this.$showMessage("数据量太大,请重新选择")
838
- } else {
839
- _this.checkrows = []
840
- for (let j = 0; j < respanse.data.length; j++) {
841
- _this.checkrows.push(respanse.data[j])
842
- }
843
- //tag;
844
- }
845
- })
846
- }
847
- },
848
- addChecked(item) {
849
- //tag;
850
- if (!item.checked) {
851
- this.checkrows.push(item);
852
- //tag;
853
- } else {
854
- for (let i = 0; i < this.checkrows.length; i++) {
855
- if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
856
- this.checkrows.splice(i, 1)
857
- }
858
- }
859
- }
860
- },
861
- ToshowModal() {
862
- this.creatPlanWay = 'single'
863
- if (this.checkrows.length > 0) {
864
- this.showModal = true
865
- } else {
866
- this.$showMessage("请选择需要安检的用户!")
867
- }
868
- },
869
- FiltrationPlan() {
870
- if (this.model.rows.length == 0) {
871
- this.$showMessage("暂无可生成的计划!")
872
- return
873
- }
874
- this.creatPlanWay = 'filtration'
875
- this.showModal = true
876
- },
877
- AllPlan() {
878
- if (this.model.rows.length == 0) {
879
- this.$showMessage("暂无可生成的计划!")
880
- return
881
- }
882
- this.creatPlanWay = 'all'
883
- this.showModal = true
884
- },
885
- cancel() {
886
- this.showModal = false
887
- },
888
- areas() {
889
- let rs = []
890
- for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
891
- let temp = {
892
- label: this.$login.f.f_allArea[i].label,
893
- value: this.$login.f.f_allArea[i].label
894
- }
895
- rs.push(temp)
896
- }
897
- return [{label: '全部', value: ''}, ...rs]
898
- },
899
- initAdjustables() {
900
- //tag
901
- let arr = []
902
- let filter = this.$login.f.f_orgids
903
- this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
904
- let temp = {}
905
- temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
906
- temp.value = `${item.value.id}`
907
- arr.push(temp)
908
- })
909
- this.adjustables = [{label: '全部', value: ''}, ...arr]
910
- },
911
- getAllMeterBook(val) {
912
- ////tag
913
- ////tag
914
- this.cbcs = []
915
- if (val) {
916
- new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
917
- data: {
918
- items: 'f_book_name,f_book_slice_area,id',
919
- tablename: 't_meter_book',
920
- condition: `f_filiale_id in ${val}`,
921
- orderitem: 'id'
922
- }
923
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
924
- res.data.forEach(ress => {
925
- this.cbcs.push({
926
- id: ress.id,
927
- f_book_name: ress.f_book_name,
928
- f_book_slice_area: ress.f_book_slice_area
929
- })
930
- })
931
- this.cbc = []
932
- this.cbc.push({
933
- label: '全部',
934
- value: ''
935
- })
936
- this.cbcs.forEach(res => {
937
- this.cbc.push({
938
- label: res.f_book_name,
939
- value: res.id
940
- })
941
- })
942
- })
943
- }
944
- },
945
- getRes(obj) {
946
- this.model.f_filialeids = this.$login.convertToIn(obj.resids);
947
- this.Mreadibook(this.model.f_filialeids)
948
- this.getAllMeterBook(this.model.f_filialeids)
949
- this.getPcd(this.model.f_filialeids)
950
- }
951
- },
952
-
953
- watch: {
954
- 'model.f_usertype'(val) {
955
- if (val == '民用') {
956
- this.model.safeCycle = this.civil
957
- } else if (val == '非民用') {
958
- this.model.safeCycle = this.civilian
959
- }
960
- },
961
- 'model.SafeCheckXZ'(val) {
962
- this.model.SafeCheckSC = ''
963
- if (val == '已安检') {
964
- this.model.SafeCheckCQ = ''
965
- this.model.SafeCheckSX = {
966
- f_check_end: '', // 安检时间 查询起始条件
967
- f_check_start: ''// 安检时间 查询终止条件
968
- }
969
- } else {
970
- // 当使用筛选条件时,清空不需要的条件选项
971
- this.model.f_issue_start = ''
972
- this.model.f_issue_end = ''
973
- this.$refs.paged.$refs.criteria.model.f_check_start = ''
974
- this.$refs.paged.$refs.criteria.model.f_check_end = ''
975
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
976
- this.model.month = ''
977
- if (val == '应安检') {
978
- this.model.SafeCheckSC = '否'
979
-
980
- this.model.f_issue_start = Util.toStartDateString()
981
- this.model.f_issue_end = Util.toStandardDateString()
982
- }
983
- // this.model.f_checktime_start = ''
984
- // this.model.f_checktime_end = ''
985
- }
986
- },
987
- 'model.SafeCheckSC'(val) {
988
- if (val == '') {
989
- this.model.f_issue_start = ''
990
- this.model.f_issue_end = ''
991
- }
992
- },
993
- // 'checker'(val){
994
- // //tag
995
- // if(val){
996
- // this.checkboxModel.f_checker = this.checker[0].name
997
- // this.checkboxModel.f_checker_id = this.checker[0].id
998
- // }
999
- // },
1000
- 'model.rows'() {
1001
- // if (!this.checkedAll) {//实现反选/
1002
- // this.checkrows = [];
1003
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1004
- var k = false
1005
- for (let j = 0; j < this.checkrows.length; j++) {
1006
- if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
1007
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1008
- k = true
1009
- continue
1010
- }
1011
- }
1012
- if (!k) {
1013
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
1014
- }
1015
- }
1016
- // } else {//实现全选
1017
- // // this.checkboxModel = {};
1018
- // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1019
- // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1020
- // }
1021
- // }
1022
- }
1023
- },
1024
- computed: {
1025
- selected() {
1026
- return this.$refs.paged.$refs.grid.selected
1027
- }
1028
- }
1029
- }
1030
- </script>
1031
- <style scoped>
1032
- .newcolor {
1033
- color: red;
1034
- }
1035
-
1036
- .table th {
1037
- background-color: #f2f6fa;
1038
- color: black;
1039
- }
1040
- </style>
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-show="!$parent.$parent.$parent.showItem">
7
+ <div :class="$parent.$parent.style">
8
+ <label class="font_normal_body">用户编号</label>
9
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
10
+ id="f_userinfo_code"
11
+
12
+ placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
13
+ </div>
14
+ <div :class="$parent.$parent.style">
15
+ <label class="font_normal_body">用户姓名</label>
16
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name" id="f_user_name"
17
+ placeholder="用户姓名" condition="f_user_name like '%{}%'">
18
+ </div>
19
+ <div :class="$parent.$parent.style">
20
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
21
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
22
+ id="f_residential_area"
23
+ placeholder="小区" condition="f_residential_area like '%{}%'">
24
+ </div>
25
+ <div :class="$parent.$parent.style">
26
+ <label class="font_normal_body">地&emsp;&emsp;址</label>
27
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_address" id="f_address"
28
+ placeholder="地址" condition="f_address like '%{}%'">
29
+ </div>
30
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
31
+ <export-excel-safe :data="$parent.$parent.searchData"
32
+ :field="$parent.$parent.excelHeaders"
33
+ sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案"
34
+ template-name='用户安检情况' :choose-col="true"></export-excel-safe>
35
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
36
+ <div style="float: right" class="button_spacing"
37
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
38
+ @click="$parent.$parent.hiddenr()"></div>
39
+ <div style="float: right" class="button_spacing"
40
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
41
+ @click="$parent.$parent.hidden()">
42
+
43
+ </div>
44
+ </div>
45
+
46
+
47
+ </div>
48
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
49
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
50
+ <label class="font_normal_body">用户类型</label>
51
+ <v-select id="f_usertype"
52
+ placeholder='用户类型'
53
+ class="select select_list"
54
+ :value.sync="model.f_usertype"
55
+ :value-single="true"
56
+ :options='$parent.$parent.usertypes'
57
+ v-model="model.f_usertype"
58
+ condition="f_user_type = '{}'"
59
+ close-on-select clear-button></v-select>
60
+ </div>
61
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
62
+
63
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
64
+ <label class="font_normal_body" style="color: red;">安检筛选</label>
65
+ <v-select
66
+ placeholder='安检筛选'
67
+ :value-single="true"
68
+ class="select select_list"
69
+ :value.sync="$parent.$parent.SafeCheckXZ"
70
+ :options='$parent.$parent.SafeCheckXZs'
71
+ v-model="$parent.$parent.SafeCheckXZ"
72
+ close-on-select clear-button></v-select>
73
+ </div>
74
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
75
+ <label class="font_normal_body">安检起始</label>
76
+ <datepicker
77
+ :value.sync="model.f_check_start"
78
+ placeholder='最后安检时间起始'
79
+ style="width: 60%"
80
+ :format="'yyyy-MM-dd 00:00:00'"
81
+ :show-rest-button="reset"
82
+ v-model="model.f_check_start">
83
+ </datepicker>
84
+ </div>
85
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
86
+ <label class="font_normal_body">安检结束</label>
87
+ <datepicker
88
+ :value.sync="model.f_check_end"
89
+ placeholder='最后安检时间结束'
90
+ style="width: 60%"
91
+ :format="'yyyy-MM-dd 23:59:59'"
92
+ :show-rest-button="reset"
93
+ v-model="model.f_check_end">
94
+ </datepicker>
95
+ </div>
96
+
97
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
98
+ <label class="font_normal_body">安检状态</label>
99
+ <v-select id="f_entry"
100
+ placeholder='安检状态'
101
+ class="select select_list"
102
+ :value.sync="model.f_last_check_state"
103
+ :value-single="true"
104
+ :options='$parent.$parent.checkstatus'
105
+ v-model="model.f_last_check_state"
106
+ condition="f_last_check_state = '{}'"
107
+ close-on-select clear-button></v-select>
108
+ </div>
109
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
110
+ <label class="font_normal_body">隐患情况</label>
111
+ <v-select
112
+ placeholder='隐患情况'
113
+ class="select select_list"
114
+ :value-single="true"
115
+ v-model='model.f_check_result'
116
+ :value.sync="model.f_check_result"
117
+ :options='$parent.$parent.f_check_results'
118
+ condition="f_last_check_result like '%{}%'"
119
+ close-on-select clear-button></v-select>
120
+ </div>
121
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
122
+ </div>
123
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
124
+
125
+ <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
126
+ <role-selector-safe
127
+ role-name="安检员"
128
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
129
+ @re-res="$parent.$parent.getRes"
130
+ :value.sync="model.f_checker_id"
131
+ v-model="model.f_checker_id"
132
+ :value-multiple="true"
133
+ condition=" f_checker_name in {}">
134
+ </role-selector-safe>
135
+ </div>
136
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
137
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
138
+ <v-select class="select_list select"
139
+ placeholder='片区/管理站' style="width: 60%"
140
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
141
+ :options='$parent.$parent.sliceArea'
142
+ filer-key="name"
143
+ close-on-select clear-button
144
+ condition="f_slice_area='{}'"
145
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
146
+ :value-single="true">
147
+ </v-select>
148
+ </div>
149
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
150
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
151
+ <v-select class="select_list select"
152
+ placeholder='抄表册' style="width: 60%"
153
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
154
+ :options='$parent.$parent.cbc'
155
+ filer-key="name"
156
+ close-on-select clear-button
157
+ condition="f_meter_book_num={}"
158
+ :value-single="true">
159
+ </v-select>
160
+ </div>
161
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
162
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
163
+ <v-select class="select_list select"
164
+ placeholder='请选择' style="width: 60%"
165
+ :value.sync="model.f_pcd" v-model="model.f_pcd"
166
+ :options='$parent.$parent.pcds'
167
+ filer-key="name"
168
+ close-on-select clear-button
169
+ condition="f_pcd_id ='{}'"
170
+ :value-single="true">
171
+ </v-select>
172
+ </div>
173
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
174
+ <label class="font_normal_body">用户状态</label>
175
+ <v-select class="select_list select"
176
+ placeholder='用户状态' style="width: 60%"
177
+ :value.sync="model.f_user_state" v-model="model.f_user_state"
178
+ :options='$parent.$parent.userstates'
179
+ close-on-select clear-button
180
+ condition="f_user_state = '{}'"
181
+ :value-single="true">
182
+ </v-select>
183
+ </div>
184
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
185
+ <label class="font_normal_body">用气性质</label>
186
+ <v-select
187
+ class="select_list select"
188
+ placeholder='用气性质' style="width: 60%"
189
+ v-model='model.userType'
190
+ :value.sync="model.userType"
191
+ :options='$parent.$parent.userTypes'
192
+ condition="f_gasproperties = '{}'"
193
+ :value-single="true"
194
+ close-on-select clear-button></v-select>
195
+ </div>
196
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
197
+ <label class="font_normal_body">气表类型</label>
198
+ <v-select
199
+ class="select_list select"
200
+ placeholder='气表类型' style="width: 60%"
201
+ v-model='model.tableType'
202
+ :value.sync="model.tableType"
203
+ :options='$parent.$parent.tableTypes'
204
+ condition="f_meter_classify = '{}'"
205
+ :value-single="true"
206
+ close-on-select clear-button></v-select>
207
+ </div>
208
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
209
+ <label class="font_normal_body">气表品牌</label>
210
+ <v-select
211
+ class="select_list select"
212
+ placeholder='气表类型' style="width: 60%"
213
+ v-model='model.tableBrand'
214
+ :value.sync="model.tableBrand"
215
+ :options='$parent.$parent.tableBrands'
216
+ condition="f_meter_brand = '{}'"
217
+ :value-single="true"
218
+ close-on-select clear-button></v-select>
219
+ </div>
220
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
221
+ <label class="font_normal_body">是否通气</label>
222
+ <v-select
223
+ class="select_list select"
224
+ placeholder='是否通气' style="width: 60%"
225
+ v-model='model.f_is_gas'
226
+ :value.sync="model.f_is_gas"
227
+ :options='$parent.$parent.isgas'
228
+ condition="uf.f_gas_data {}"
229
+ :value-single="true"
230
+ close-on-select clear-button></v-select>
231
+ </div>
232
+ </div>
233
+
234
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
235
+ <div :class="$parent.$parent.style">
236
+ <label class="font_normal_body">用户编号</label>
237
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_userinfo_code"
238
+
239
+ placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
240
+ </div>
241
+ <div :class="$parent.$parent.style">
242
+ <label class="font_normal_body">用户姓名</label>
243
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_user_name"
244
+ placeholder="用户姓名" condition="f_user_name like '%{}%'">
245
+ </div>
246
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
247
+ <export-excel-safe :data="$parent.$parent.searchData"
248
+ :field="$parent.$parent.excelHeaders"
249
+ sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案"
250
+ template-name='用户安检情况' :choose-col="true"></export-excel-safe>
251
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
252
+ <div style="float: right" class="button_spacing"
253
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
254
+ @click="$parent.$parent.hiddenr()"></div>
255
+ <div style="float: right" class="button_spacing"
256
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
257
+ @click="$parent.$parent.hidden()">
258
+
259
+ </div>
260
+ </div>
261
+
262
+ </div>
263
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
264
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
265
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
266
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_residential_area"
267
+
268
+ placeholder="小区" condition="f_residential_area like '%{}%'">
269
+ </div>
270
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
271
+ <label class="font_normal_body">地&emsp;&emsp;址</label>
272
+ <input style="width: 60%" type="text" class="input_search" v-model="model.f_address"
273
+
274
+ placeholder="地址" condition="f_address like '%{}%'">
275
+ </div>
276
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
277
+ <label class="font_normal_body">用户类型</label>
278
+ <v-select
279
+ placeholder='用户类型'
280
+ class="select select_list"
281
+
282
+ :value.sync="model.f_usertype"
283
+ :value-single="true"
284
+ :options='$parent.$parent.usertypes'
285
+ v-model="model.f_usertype"
286
+ condition="f_user_type = '{}'"
287
+ close-on-select clear-button></v-select>
288
+ </div>
289
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow && !$parent.$parent.$parent.showItem"></div>-->
290
+
291
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
292
+ <label class="font_normal_body" style="color: red;">安检筛选</label>
293
+ <v-select
294
+ placeholder='安检筛选'
295
+ :value-single="true"
296
+
297
+ class="select select_list"
298
+ :value.sync="$parent.$parent.SafeCheckXZ"
299
+ :options='$parent.$parent.SafeCheckXZs'
300
+ v-model="$parent.$parent.SafeCheckXZ"
301
+ close-on-select clear-button></v-select>
302
+ </div>
303
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
304
+ <label class="font_normal_body">用气性质</label>
305
+ <v-select
306
+ class="select_list select"
307
+ placeholder='用气性质' style="width: 60%"
308
+ v-model='model.userType'
309
+ :value.sync="model.userType"
310
+ :options='$parent.$parent.userTypes'
311
+ condition="f_gasproperties = '{}'"
312
+ :value-single="true"
313
+ close-on-select clear-button></v-select>
314
+ </div>
315
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
316
+ <label class="font_normal_body">气表类型</label>
317
+ <v-select
318
+ class="select_list select"
319
+ placeholder='气表类型' style="width: 60%"
320
+ v-model='model.tableType'
321
+ :value.sync="model.tableType"
322
+ :options='$parent.$parent.tableTypes'
323
+ condition="f_meter_classify = '{}'"
324
+ :value-single="true"
325
+ close-on-select clear-button></v-select>
326
+ </div>
327
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
328
+ <label class="font_normal_body">气表品牌</label>
329
+ <v-select
330
+ class="select_list select"
331
+ placeholder='气表类型' style="width: 60%"
332
+ v-model='model.tableBrand'
333
+ :value.sync="model.tableBrand"
334
+ :options='$parent.$parent.tableBrands'
335
+ condition="f_meter_brand = '{}'"
336
+ :value-single="true"
337
+ close-on-select clear-button></v-select>
338
+ </div>
339
+
340
+ </div>
341
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
342
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
343
+ <label class="font_normal_body">安检起始</label>
344
+ <datepicker
345
+ :value.sync="model.f_check_start"
346
+ placeholder='最后安检时间起始'
347
+ :disabled-days-of-week="[]"
348
+ style="width: 60%"
349
+ :format="'yyyy-MM-dd'"
350
+ :show-rest-button="reset"
351
+ v-model="model.f_check_start">
352
+ </datepicker>
353
+ </div>
354
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
355
+ <label class="font_normal_body">安检结束</label>
356
+ <datepicker
357
+ :value.sync="model.f_check_end"
358
+ placeholder='最后安检时间结束'
359
+ style="width: 60%"
360
+ :disabled-days-of-week="[]"
361
+ :format="'yyyy-MM-dd'"
362
+ :show-rest-button="reset"
363
+ v-model="model.f_check_end">
364
+ </datepicker>
365
+ </div>
366
+
367
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
368
+ <label class="font_normal_body">安检状态</label>
369
+ <v-select
370
+ placeholder='安检状态'
371
+ class="select select_list"
372
+
373
+ :value.sync="model.f_last_check_state"
374
+ :value-single="true"
375
+ :options='$parent.$parent.checkstatus'
376
+ v-model="model.f_last_check_state"
377
+ condition="f_last_check_state = '{}'"
378
+ close-on-select clear-button></v-select>
379
+ </div>
380
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
381
+ <label class="font_normal_body">隐患情况</label>
382
+ <v-select
383
+ placeholder='隐患情况'
384
+ class="select select_list"
385
+
386
+ :value-single="true"
387
+ v-model='model.f_check_result'
388
+ :value.sync="model.f_check_result"
389
+ :options='$parent.$parent.f_check_results'
390
+ condition="f_last_check_result like '%{}%'"
391
+ close-on-select clear-button></v-select>
392
+ </div>
393
+
394
+ </div>
395
+ <!--<div class="row" v-show="$parent.$parent.$parent.showItem">
396
+ <div :class="$parent.$parent.style" v-show="$parent.$parent.criteriaShow">
397
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
398
+ <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">
399
+ </right-tree>
400
+ </div>
401
+
402
+ </div>-->
403
+ </div>
404
+ </criteria>
405
+ <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
406
+ <template partial='head'>
407
+ <tr>
408
+ <th>
409
+ <nobr>用户编号</nobr>
410
+ </th>
411
+ <th>
412
+ <nobr>用户名称</nobr>
413
+ </th>
414
+ <th>
415
+ <nobr>用户电话</nobr>
416
+ </th>
417
+ <th>
418
+ <nobr>燃气表号</nobr>
419
+ </th>
420
+ <th>
421
+ <nobr>气表品牌</nobr>
422
+ </th>
423
+ <th>
424
+ <nobr>用户类型</nobr>
425
+ </th>
426
+ <!-- <th>-->
427
+ <!-- <nobr>壁挂炉</nobr>-->
428
+ <!-- </th>-->
429
+ <!-- <th>-->
430
+ <!-- <nobr>灶具</nobr>-->
431
+ <!-- </th>-->
432
+ <th>
433
+ <nobr>区域</nobr>
434
+ </th>
435
+ <th>
436
+ <nobr>小区名称</nobr>
437
+ </th>
438
+ <th style="padding: 0 40px">
439
+ <nobr>地址</nobr>
440
+ </th>
441
+ <th>
442
+ <nobr>安检员</nobr>
443
+ </th>
444
+ <th>
445
+ <nobr>安检员备注</nobr>
446
+ </th>
447
+ <th>
448
+ <nobr>最后一次安检日期</nobr>
449
+ </th>
450
+ <th>
451
+ <nobr>最后一次安检状态</nobr>
452
+ </th>
453
+ <th>
454
+ <nobr>安检结果</nobr>
455
+ </th>
456
+ </tr>
457
+ </template>
458
+ <template partial='body'>
459
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_userinfo_code }}</td>
460
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_name }}</td>
461
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_phone }}</td>
462
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meternumber }}</td>
463
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meter_brand }}</td>
464
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_user_type }}</td>
465
+ <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_hasfurnace }}</td>-->
466
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_slice_area }}</td>
467
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_residential_area }}</td>
468
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_address }}</td>
469
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_checker_name }}</td>
470
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_comments }}</td>
471
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_date }}</td>
472
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_state }}</td>
473
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">
474
+ {{ $parent.$parent.$parent.getDefect(row.f_last_check_result) }}
475
+ </td>
476
+ </template>
477
+ </data-grid>
478
+ </criteria-paged>
479
+ </div>
480
+ </template>
481
+
482
+ <script>
483
+ import {PagedList} from 'vue-client'
484
+ import {HttpResetClass} from 'vue-client'
485
+ import co from 'co'
486
+ import * as Util from '../../Util'
487
+ import Vue from 'vue'
488
+
489
+ // let select = function * (self,userid) {
490
+ // let http = new HttpResetClass()
491
+ // let getGasman = yield http.load('POST','/rs/search', {
492
+ // source: 'this.getChildByName($安检员$).getUsers()',
493
+ // userid: userid
494
+ // }, {resolveMsg: null, rejectMsg: null})
495
+ // //tag
496
+ // getGasman.data.forEach((checker)=>{
497
+ // self.checkersid.push({label:checker.name,value:checker.id})
498
+ // })
499
+ // self.checkersid.push({label:'全部',value:''})
500
+ // }
501
+
502
+
503
+ export default {
504
+ title: '用户安检情况',
505
+ data() {
506
+ let options = []
507
+ let year = (new Date()).getFullYear()
508
+ for (let i = year; i <= year + 3; i++)
509
+ options.push({label: i + '', value: i + ''})
510
+ let moptions = []
511
+ for (let i = 1; i <= 12; i++)
512
+ moptions.push({label: i + '', value: i + ''})
513
+
514
+ return {
515
+ searchData: {
516
+ condition: '1=1',
517
+ orderitem: "f_userinfo_code",
518
+ timetype: "dd",
519
+ f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', ua.f_last_check_result ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( ua.f_last_check_result, len( ua.f_last_check_result ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END"
520
+
521
+ },
522
+ excelHeaders: {
523
+ //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
524
+
525
+ 'f_userinfo_code': '用户编号',
526
+ 'f_user_name': '用户名称',
527
+ 'f_user_phone': '用户电话',
528
+ 'f_meternumber': '燃气表号',
529
+ 'f_meter_brand': '气表品牌',
530
+ // 'count_item': '安检次数',
531
+ 'f_user_type': '用户类型',
532
+ 'f_checker_name': '安检员',
533
+ 'f_comments': '安检备注',
534
+ 'f_slice_area': '区域',
535
+ 'f_residential_area': '小区名称',
536
+ 'f_address': '地址',
537
+ 'f_last_check_date': '最后一次安检日期',
538
+ 'f_last_check_state': '最后一次安检状态',
539
+ 'f_defect_content': '安检结果'
540
+ },
541
+ model: new PagedList('rs/sql/根据安检员查询用户档案', 20, {
542
+ orderitem: "'f_last_check_date desc'",
543
+ timetype: "'dd'",
544
+ f_defect_content: 'this.f_defect_content'
545
+ }),
546
+ f_defect_content: "CASE WHEN CHARINDEX( '\"result\":\"正常\"', ua.f_last_check_result ) > 0 THEN '无隐患' ELSE replace(replace(replace( replace( RIGHT ( ua.f_last_check_result, len( ua.f_last_check_result ) - 26 ), substring('{}',2,1), '' ), substring('{}',1,1), '' ),']',''),'\"','') END",
547
+ orgstrs: [{label: '全部', value: ''}],
548
+ checkersid: [],
549
+ SafeCheckXZ: '',
550
+ civil: '', //民用安检周期
551
+ civilian: '', //非民用安检周期
552
+ SafeCheckXZs: [{label: '全部', value: ''}, {label: '未安检', value: '未安检'}, {label: '已安检', value: '已安检'}], // 安检筛选选项
553
+ SafeCheckSXs: [{label: '是', value: '是'}, {label: '否', value: '否'}, {label: '全部', value: ''}],
554
+ // user_states:[{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')],
555
+ IsShares: [{label: '是', value: '是'}, {label: '否', value: '否'}],
556
+ IsShare: '',
557
+ checker: {},
558
+ NoBuys: [{label: '是', value: '是'}, {label: '否', value: '否'}],
559
+ criteriaShow: false,
560
+ checkers: [],
561
+ chosenOrg: {id: 0},
562
+ showModal: false,
563
+ checkedAll: false,
564
+ checkrows: [],
565
+ adjustables: [],
566
+ f_plan_year: year + '',
567
+ f_plan_month: moptions[new Date().getMonth()].value,
568
+ f_effective_start_time: '', //计划有效起始时间
569
+ f_effective_end_time: '', //计划有效结束时间
570
+ checkboxModel: {},
571
+ c_year_list: options,
572
+ c_month_list: moptions,
573
+ areas: this.areas(),
574
+ checkstatus: this.checkstatus(),
575
+ usertypes: this.usertypes(),
576
+ userstates: this.userstates(),
577
+ sqlname: '',
578
+ f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'}, {label: '有隐患', value: '有隐患'}],
579
+ creatPlanWay: '',
580
+ userTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')],
581
+ tableTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')],
582
+ tableBrands: [{label: '全部', value: ''}],
583
+ sliceArea: [],
584
+ cbcs: [],
585
+ cbc: [],
586
+ pcds: [],
587
+ isgas: [{label: '全部', value: ''},{label: '是', value: 'is not null '},{label: '否', value: ' is null '}]
588
+
589
+ }
590
+ },
591
+ props: {
592
+ style: {
593
+ type: String,
594
+ default: 'col-sm-2 form-group'
595
+ },
596
+ style2: {
597
+ type: String,
598
+ default: 'col-sm-4 form-group'
599
+ },
600
+ checkplan: { // 传入一条安检计划信息
601
+ type: Object
602
+ },
603
+ additemshow: {
604
+ type: Boolean,
605
+ default: false
606
+ }
607
+ },
608
+ ready() {
609
+ // 获取分公司信息
610
+ this.model.f_defect_content = this.f_defect_content
611
+
612
+ //this.getfengongsi()
613
+ this.model.chosenOrg = {id: 0}
614
+ this.model.f_filialeids = this.$login.f.f_orgids
615
+ this.model.f_filiale = this.$login.f.f_fengongsi
616
+ this.model.f_OrgStr = this.$login.f.orgpathstr
617
+ this.Mreadibook(`('${this.$login.f.orgid}')`)
618
+ this.getAllMeterBook(`('${this.$login.f.orgid}')`)
619
+ this.getTableBrands()
620
+ },
621
+ methods: {
622
+ getTableBrands() {
623
+ new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
624
+ {data: {items: "*", tablename: "t_gasbrand", orderitem: "id", condition: ` 1=1 `}},
625
+ {resolveMsg: null, rejectMsg: null}).then((resp) => {
626
+ resp.data.forEach((result) => {
627
+ this.tableBrands.push({label: result.f_meter_brand, value: result.f_meter_brand})
628
+ })
629
+ })
630
+ },
631
+ //获取省市区列表
632
+ getPcd(val) {
633
+ this.pcds = [{label: '全部', value: ''}]
634
+ new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
635
+ {data: {items: "*", tablename: "t_pcd", orderitem: "id", condition: `f_orgid in ${val}`}},
636
+ {resolveMsg: null, rejectMsg: null}).then((pcdlist) => {
637
+ pcdlist.data.forEach((result) => {
638
+ this.pcds.push({label: result.f_pcd, value: result.id})
639
+ })
640
+ })
641
+ },
642
+ getmeterbook(val) {
643
+
644
+ //tag
645
+ this.cbc = []
646
+ this.cbc.push({
647
+ label: '全部',
648
+ value: ''
649
+ })
650
+ if (val == '') {
651
+
652
+ this.cbcs.forEach(res => {
653
+ this.cbc.push({
654
+ label: res.f_book_name,
655
+ value: res.id
656
+ })
657
+ })
658
+ } else {
659
+ this.cbcs.forEach(res => {
660
+ if (res.f_book_slice_area == val) {
661
+ this.cbc.push({
662
+ label: res.f_book_name,
663
+ value: res.id
664
+ })
665
+ }
666
+ })
667
+ }
668
+ },
669
+ Mreadibook(val) {
670
+ ////tag
671
+ ////tag
672
+ this.sliceArea = []
673
+ if (val) {
674
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
675
+ data: {
676
+ items: 'name',
677
+ tablename: 't_zone',
678
+ condition: `parentid in ${val}`,
679
+ orderitem: 'id'
680
+ }
681
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
682
+ this.sliceArea.push({
683
+ label: '全部',
684
+ value: ''
685
+ })
686
+ res.data.forEach(ress => {
687
+ this.sliceArea.push({
688
+ label: ress.name,
689
+ value: ress.name
690
+ })
691
+ })
692
+
693
+ })
694
+ }
695
+ },
696
+ // 获取县域分公司内容
697
+ getfengongsi() {
698
+ let val = {
699
+ source: 'this.getParentByType($organization$).getSpecialResByType($organization$)',
700
+ userid: `${this.$login.f.id}`
701
+ }
702
+ let http = new HttpResetClass()
703
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
704
+ res.data.forEach((item) => {
705
+ this.orgstrs.push({label: item.name, value: item.id})
706
+ })
707
+ //tag
708
+ })
709
+ },
710
+ // 县域分公司发生改变
711
+ // orgstrchange(val){
712
+ // if(val == undefined || val == ''){
713
+ // return
714
+ // }else {
715
+ // this.checkersid = []
716
+ // let gen = select(this,val)
717
+ // return co(gen)
718
+ // }
719
+ // },
720
+ getDefect(val) {
721
+ if (val) {
722
+ try {
723
+ var defect = JSON.parse(val)
724
+ return defect.result
725
+ } catch (e) {
726
+ //tag
727
+ return '正常'
728
+ }
729
+ }
730
+ return '正常'
731
+ },
732
+ checkerchange(val) {
733
+ this.checkboxModel.f_checker = val.name
734
+ this.checkboxModel.f_checker_id = val.id
735
+ },
736
+ search(args) {
737
+ if (this.model.f_filialeids){
738
+ args.condition += ` and f_orgid in ${this.model.f_filialeids}`
739
+ }
740
+ if (this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')) {
741
+ this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始时间!')
742
+ return
743
+ }
744
+ if ((args.model.f_check_start || args.model.f_check_end) && !this.SafeCheckXZ) {
745
+ this.$showMessage('如果录入 安检起始时间,需要选择 安检筛选条件!')
746
+ return
747
+ }
748
+ //args.condition += " and f_filialeid in " + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
749
+ // let con = ' f_filialeid in ' + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
750
+ let con = '1=1'
751
+ this.$emit('filiale-change', con)
752
+ con += args.model.f_userinfo_code ? ` and f_userinfo_code like '%${args.model.f_userinfo_code}%'` : ''
753
+ con += args.model.f_user_name ? ` and f_user_name like '%${args.model.f_user_name}%'` : ''
754
+ con += args.model.f_residential_area ? ` and f_residential_area like '%${args.model.f_residential_area}%'` : ''
755
+ con += args.model.f_address ? ` and f_address like '%${args.model.f_address}%'` : ''
756
+ con += args.model.f_usertype ? ` and f_check_type = '${args.model.f_usertype}'` : ''
757
+ if (this.SafeCheckXZ) {
758
+ con += ` and f_offsite_time >= '${args.model.f_check_start}' and f_offsite_time <= '${args.model.f_check_end}' `
759
+ if (this.SafeCheckXZ == '未安检') {
760
+ args.condition += ' and ruhuid is null'
761
+ } else {
762
+ args.condition += ' and ruhuid is not null'
763
+ }
764
+ }
765
+ con += args.model.f_last_check_state ? ` and f_entry_status = '${args.model.f_last_check_state}'` : ''
766
+ con += args.model.f_checker_id ? ` and f_checker_name in ${args.model.f_checker_id}` : ''
767
+ let condition = {
768
+ condition1: args.condition,
769
+ condition2: con
770
+ }
771
+ this.searchData.condition = condition
772
+ return this.model.search(condition, args.model)
773
+ },
774
+ checkstatus() {
775
+ return this.$appdata.getParam('安检状态') ? [{
776
+ label: '全部',
777
+ value: ''
778
+ }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
779
+ },
780
+ usertypes() {
781
+ return this.$appdata.getParam('用户类型') ? [{
782
+ label: '全部',
783
+ value: ''
784
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
785
+ },
786
+ userstates() {
787
+ return this.$appdata.getParam('用户状态') ? [{
788
+ label: '全部',
789
+ value: ''
790
+ }, ...this.$appdata.getParam('用户状态')] : [{label: '全部', value: ''}]
791
+ },
792
+ hiddenr() {
793
+ this.$parent.showItem = !this.$parent.showItem
794
+ },
795
+ hidden() {
796
+ this.criteriaShow = !this.criteriaShow
797
+ },
798
+ confirm() {
799
+ if (!this.checkboxModel.f_plan_name) {
800
+ this.$showMessage('请填写安检计划名称!')
801
+ return
802
+ }
803
+ // if(this.f_effective_start_time == ''){
804
+ // this.$showMessage('请选择有效起始日期!')
805
+ // return
806
+ // }
807
+ // if(this.f_effective_end_time == ''){
808
+ // this.$showMessage('请选择有效结束日期!')
809
+ // return
810
+ // }
811
+ if (this.IsShare == '') {
812
+ if (!this.checkboxModel.f_checker_id) {
813
+ this.$showMessage('请选择安检员!')
814
+ return
815
+ }
816
+ }
817
+ let gen = saveGen(this)
818
+ return co(gen)
819
+ },
820
+ changeStates() {
821
+ if (this.checkedAll) {//实现反选/
822
+ this.checkrows = [];
823
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
824
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
825
+ }
826
+ } else {//实现全选
827
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
828
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
829
+ }
830
+ let _this = this
831
+ let condition = this.$refs.paged.$refs.criteria.condition
832
+ let url = this.model.url
833
+ this.$resetpost(`${url}?pageSize=9999999`, {
834
+ data: {
835
+ condition: condition,
836
+ groupitem: '',
837
+ orderitem: 'f_residential_area',
838
+ f_usertype: this.model.f_usertype,
839
+ f_filialeids: this.model.f_filialeids,
840
+ month: this.model.month,
841
+ safeCycle: this.model.safeCycle,
842
+ f_checktime_start: this.model.f_checktime_start,
843
+ f_checktime_end: this.model.f_checktime_end,
844
+ SafeCheckSX: this.model.SafeCheckSX,
845
+ f_last_check_state: this.model.f_last_check_state
846
+ },
847
+ }, {resolveMsg: null, rejectMsg: null}, -1).then(
848
+ (respanse) => {
849
+ if (respanse.data.length >= 5000) {
850
+ this.$showMessage("数据量太大,请重新选择")
851
+ } else {
852
+ _this.checkrows = []
853
+ for (let j = 0; j < respanse.data.length; j++) {
854
+ _this.checkrows.push(respanse.data[j])
855
+ }
856
+ //tag;
857
+ }
858
+ })
859
+ }
860
+ },
861
+ addChecked(item) {
862
+ //tag;
863
+ if (!item.checked) {
864
+ this.checkrows.push(item);
865
+ //tag;
866
+ } else {
867
+ for (let i = 0; i < this.checkrows.length; i++) {
868
+ if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
869
+ this.checkrows.splice(i, 1)
870
+ }
871
+ }
872
+ }
873
+ },
874
+ ToshowModal() {
875
+ this.creatPlanWay = 'single'
876
+ if (this.checkrows.length > 0) {
877
+ this.showModal = true
878
+ } else {
879
+ this.$showMessage("请选择需要安检的用户!")
880
+ }
881
+ },
882
+ FiltrationPlan() {
883
+ if (this.model.rows.length == 0) {
884
+ this.$showMessage("暂无可生成的计划!")
885
+ return
886
+ }
887
+ this.creatPlanWay = 'filtration'
888
+ this.showModal = true
889
+ },
890
+ AllPlan() {
891
+ if (this.model.rows.length == 0) {
892
+ this.$showMessage("暂无可生成的计划!")
893
+ return
894
+ }
895
+ this.creatPlanWay = 'all'
896
+ this.showModal = true
897
+ },
898
+ cancel() {
899
+ this.showModal = false
900
+ },
901
+ areas() {
902
+ let rs = []
903
+ for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
904
+ let temp = {
905
+ label: this.$login.f.f_allArea[i].label,
906
+ value: this.$login.f.f_allArea[i].label
907
+ }
908
+ rs.push(temp)
909
+ }
910
+ return [{label: '全部', value: ''}, ...rs]
911
+ },
912
+ initAdjustables() {
913
+ //tag
914
+ let arr = []
915
+ let filter = this.$login.f.f_orgids
916
+ this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
917
+ let temp = {}
918
+ temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
919
+ temp.value = `${item.value.id}`
920
+ arr.push(temp)
921
+ })
922
+ this.adjustables = [{label: '全部', value: ''}, ...arr]
923
+ },
924
+ getAllMeterBook(val) {
925
+ ////tag
926
+ ////tag
927
+ this.cbcs = []
928
+ if (val) {
929
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
930
+ data: {
931
+ items: 'f_book_name,f_book_slice_area,id',
932
+ tablename: 't_meter_book',
933
+ condition: `f_filiale_id in ${val}`,
934
+ orderitem: 'id'
935
+ }
936
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
937
+ res.data.forEach(ress => {
938
+ this.cbcs.push({
939
+ id: ress.id,
940
+ f_book_name: ress.f_book_name,
941
+ f_book_slice_area: ress.f_book_slice_area
942
+ })
943
+ })
944
+ this.cbc = []
945
+ this.cbc.push({
946
+ label: '全部',
947
+ value: ''
948
+ })
949
+ this.cbcs.forEach(res => {
950
+ this.cbc.push({
951
+ label: res.f_book_name,
952
+ value: res.id
953
+ })
954
+ })
955
+ })
956
+ }
957
+ },
958
+ getRes(obj) {
959
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids);
960
+ this.Mreadibook(this.model.f_filialeids)
961
+ this.getAllMeterBook(this.model.f_filialeids)
962
+ this.getPcd(this.model.f_filialeids)
963
+ }
964
+ },
965
+
966
+ watch: {
967
+ 'model.f_usertype'(val) {
968
+ if (val == '民用') {
969
+ this.model.safeCycle = this.civil
970
+ } else if (val == '非民用') {
971
+ this.model.safeCycle = this.civilian
972
+ }
973
+ },
974
+ 'model.SafeCheckXZ'(val) {
975
+ this.model.SafeCheckSC = ''
976
+ if (val == '已安检') {
977
+ this.model.SafeCheckCQ = ''
978
+ this.model.SafeCheckSX = {
979
+ f_check_end: '', // 安检时间 查询起始条件
980
+ f_check_start: ''// 安检时间 查询终止条件
981
+ }
982
+ } else {
983
+ // 当使用筛选条件时,清空不需要的条件选项
984
+ this.model.f_issue_start = ''
985
+ this.model.f_issue_end = ''
986
+ this.$refs.paged.$refs.criteria.model.f_check_start = ''
987
+ this.$refs.paged.$refs.criteria.model.f_check_end = ''
988
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
989
+ this.model.month = ''
990
+ if (val == '应安检') {
991
+ this.model.SafeCheckSC = '否'
992
+
993
+ this.model.f_issue_start = Util.toStartDateString()
994
+ this.model.f_issue_end = Util.toStandardDateString()
995
+ }
996
+ // this.model.f_checktime_start = ''
997
+ // this.model.f_checktime_end = ''
998
+ }
999
+ },
1000
+ 'model.SafeCheckSC'(val) {
1001
+ if (val == '') {
1002
+ this.model.f_issue_start = ''
1003
+ this.model.f_issue_end = ''
1004
+ }
1005
+ },
1006
+ // 'checker'(val){
1007
+ // //tag
1008
+ // if(val){
1009
+ // this.checkboxModel.f_checker = this.checker[0].name
1010
+ // this.checkboxModel.f_checker_id = this.checker[0].id
1011
+ // }
1012
+ // },
1013
+ 'model.rows'() {
1014
+ // if (!this.checkedAll) {//实现反选/
1015
+ // this.checkrows = [];
1016
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1017
+ var k = false
1018
+ for (let j = 0; j < this.checkrows.length; j++) {
1019
+ if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
1020
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1021
+ k = true
1022
+ continue
1023
+ }
1024
+ }
1025
+ if (!k) {
1026
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
1027
+ }
1028
+ }
1029
+ // } else {//实现全选
1030
+ // // this.checkboxModel = {};
1031
+ // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1032
+ // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1033
+ // }
1034
+ // }
1035
+ }
1036
+ },
1037
+ computed: {
1038
+ selected() {
1039
+ return this.$refs.paged.$refs.grid.selected
1040
+ }
1041
+ }
1042
+ }
1043
+ </script>
1044
+ <style scoped>
1045
+ .newcolor {
1046
+ color: red;
1047
+ }
1048
+
1049
+ .table th {
1050
+ background-color: #f2f6fa;
1051
+ color: black;
1052
+ }
1053
+ </style>