safecheck-client 3.0.35-10 → 3.0.35-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1053 +1,1058 @@
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="f_gas_date {}"
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>
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="f_gas_date {}"
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
+ <th>
457
+ <nobr>安检结果</nobr>
458
+ </th>
459
+ </tr>
460
+ </template>
461
+ <template partial='body'>
462
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_userinfo_code }}</td>
463
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_name }}</td>
464
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_user_phone }}</td>
465
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meternumber }}</td>
466
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{ row.f_meter_brand }}</td>
467
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_user_type }}</td>
468
+ <!-- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_safe_hasfurnace }}</td>-->
469
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_slice_area }}</td>
470
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_residential_area }}</td>
471
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_address }}</td>
472
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_checker_name }}</td>
473
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_comments }}</td>
474
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_factory_date }}</td>
475
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_date }}</td>
476
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{ row.f_last_check_state }}</td>
477
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">
478
+ {{ $parent.$parent.$parent.getDefect(row.f_last_check_result) }}
479
+ </td>
480
+ </template>
481
+ </data-grid>
482
+ </criteria-paged>
483
+ </div>
484
+ </template>
485
+
486
+ <script>
487
+ import {PagedList} from 'vue-client'
488
+ import {HttpResetClass} from 'vue-client'
489
+ import co from 'co'
490
+ import * as Util from '../../Util'
491
+ import Vue from 'vue'
492
+
493
+ // let select = function * (self,userid) {
494
+ // let http = new HttpResetClass()
495
+ // let getGasman = yield http.load('POST','/rs/search', {
496
+ // source: 'this.getChildByName($安检员$).getUsers()',
497
+ // userid: userid
498
+ // }, {resolveMsg: null, rejectMsg: null})
499
+ // //tag
500
+ // getGasman.data.forEach((checker)=>{
501
+ // self.checkersid.push({label:checker.name,value:checker.id})
502
+ // })
503
+ // self.checkersid.push({label:'全部',value:''})
504
+ // }
505
+
506
+
507
+ export default {
508
+ title: '用户安检情况',
509
+ data() {
510
+ let options = []
511
+ let year = (new Date()).getFullYear()
512
+ for (let i = year; i <= year + 3; i++)
513
+ options.push({label: i + '', value: i + ''})
514
+ let moptions = []
515
+ for (let i = 1; i <= 12; i++)
516
+ moptions.push({label: i + '', value: i + ''})
517
+
518
+ return {
519
+ searchData: {
520
+ condition: '1=1',
521
+ orderitem: "f_userinfo_code",
522
+ timetype: "dd",
523
+ 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"
524
+
525
+ },
526
+ excelHeaders: {
527
+ //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
528
+
529
+ 'f_userinfo_code': '用户编号',
530
+ 'f_user_name': '用户名称',
531
+ 'f_user_phone': '用户电话',
532
+ 'f_meternumber': '燃气表号',
533
+ 'f_meter_brand': '气表品牌',
534
+ // 'count_item': '安检次数',
535
+ 'f_user_type': '用户类型',
536
+ 'f_checker_name': '安检员',
537
+ 'f_comments': '安检备注',
538
+ 'f_slice_area': '区域',
539
+ 'f_residential_area': '小区名称',
540
+ 'f_address': '地址',
541
+ 'f_factory_date': '表具出厂日期',
542
+ 'f_last_check_date': '最后一次安检日期',
543
+ 'f_last_check_state': '最后一次安检状态',
544
+ 'f_defect_content': '安检结果'
545
+ },
546
+ model: new PagedList('rs/sql/根据安检员查询用户档案', 20, {
547
+ orderitem: "'f_last_check_date desc'",
548
+ timetype: "'dd'",
549
+ f_defect_content: 'this.f_defect_content'
550
+ }),
551
+ 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",
552
+ orgstrs: [{label: '全部', value: ''}],
553
+ checkersid: [],
554
+ SafeCheckXZ: '',
555
+ civil: '', //民用安检周期
556
+ civilian: '', //非民用安检周期
557
+ SafeCheckXZs: [{label: '全部', value: ''}, {label: '未安检', value: '未安检'}, {label: '已安检', value: '已安检'}], // 安检筛选选项
558
+ SafeCheckSXs: [{label: '是', value: '是'}, {label: '否', value: '否'}, {label: '全部', value: ''}],
559
+ // user_states:[{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')],
560
+ IsShares: [{label: '是', value: '是'}, {label: '否', value: '否'}],
561
+ IsShare: '否',
562
+ checker: {},
563
+ NoBuys: [{label: '是', value: '是'}, {label: '否', value: '否'}],
564
+ criteriaShow: false,
565
+ checkers: [],
566
+ chosenOrg: {id: 0},
567
+ showModal: false,
568
+ checkedAll: false,
569
+ checkrows: [],
570
+ adjustables: [],
571
+ f_plan_year: year + '',
572
+ f_plan_month: moptions[new Date().getMonth()].value,
573
+ f_effective_start_time: '', //计划有效起始时间
574
+ f_effective_end_time: '', //计划有效结束时间
575
+ checkboxModel: {},
576
+ c_year_list: options,
577
+ c_month_list: moptions,
578
+ areas: this.areas(),
579
+ checkstatus: this.checkstatus(),
580
+ usertypes: this.usertypes(),
581
+ userstates: this.userstates(),
582
+ sqlname: '',
583
+ f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'}, {label: '有隐患', value: '有隐患'}],
584
+ creatPlanWay: '',
585
+ userTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')],
586
+ tableTypes: [{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')],
587
+ tableBrands: [{label: '全部', value: ''}],
588
+ sliceArea: [],
589
+ cbcs: [],
590
+ cbc: [],
591
+ pcds: [],
592
+ isgas: [{label: '全部', value: ''},{label: '是', value: 'is not null '},{label: '否', value: ' is null '}]
593
+
594
+ }
595
+ },
596
+ props: {
597
+ style: {
598
+ type: String,
599
+ default: 'col-sm-2 form-group'
600
+ },
601
+ style2: {
602
+ type: String,
603
+ default: 'col-sm-4 form-group'
604
+ },
605
+ checkplan: { // 传入一条安检计划信息
606
+ type: Object
607
+ },
608
+ additemshow: {
609
+ type: Boolean,
610
+ default: false
611
+ }
612
+ },
613
+ ready() {
614
+ // 获取分公司信息
615
+ this.model.f_defect_content = this.f_defect_content
616
+
617
+ //this.getfengongsi()
618
+ this.model.chosenOrg = {id: 0}
619
+ this.model.f_filialeids = this.$login.f.f_orgids
620
+ this.model.f_filiale = this.$login.f.f_fengongsi
621
+ this.model.f_OrgStr = this.$login.f.orgpathstr
622
+ this.Mreadibook(`('${this.$login.f.orgid}')`)
623
+ this.getAllMeterBook(`('${this.$login.f.orgid}')`)
624
+ this.getTableBrands()
625
+ },
626
+ methods: {
627
+ getTableBrands() {
628
+ new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
629
+ {data: {items: "*", tablename: "t_gasbrand", orderitem: "id", condition: ` 1=1 `}},
630
+ {resolveMsg: null, rejectMsg: null}).then((resp) => {
631
+ resp.data.forEach((result) => {
632
+ this.tableBrands.push({label: result.f_meter_brand, value: result.f_meter_brand})
633
+ })
634
+ })
635
+ },
636
+ //获取省市区列表
637
+ getPcd(val) {
638
+ this.pcds = [{label: '全部', value: ''}]
639
+ new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
640
+ {data: {items: "*", tablename: "t_pcd", orderitem: "id", condition: `f_orgid in ${val}`}},
641
+ {resolveMsg: null, rejectMsg: null}).then((pcdlist) => {
642
+ pcdlist.data.forEach((result) => {
643
+ this.pcds.push({label: result.f_pcd, value: result.id})
644
+ })
645
+ })
646
+ },
647
+ getmeterbook(val) {
648
+
649
+ //tag
650
+ this.cbc = []
651
+ this.cbc.push({
652
+ label: '全部',
653
+ value: ''
654
+ })
655
+ if (val == '') {
656
+
657
+ this.cbcs.forEach(res => {
658
+ this.cbc.push({
659
+ label: res.f_book_name,
660
+ value: res.id
661
+ })
662
+ })
663
+ } else {
664
+ this.cbcs.forEach(res => {
665
+ if (res.f_book_slice_area == val) {
666
+ this.cbc.push({
667
+ label: res.f_book_name,
668
+ value: res.id
669
+ })
670
+ }
671
+ })
672
+ }
673
+ },
674
+ Mreadibook(val) {
675
+ ////tag
676
+ ////tag
677
+ this.sliceArea = []
678
+ if (val) {
679
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
680
+ data: {
681
+ items: 'name',
682
+ tablename: 't_zone',
683
+ condition: `parentid in ${val}`,
684
+ orderitem: 'id'
685
+ }
686
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
687
+ this.sliceArea.push({
688
+ label: '全部',
689
+ value: ''
690
+ })
691
+ res.data.forEach(ress => {
692
+ this.sliceArea.push({
693
+ label: ress.name,
694
+ value: ress.name
695
+ })
696
+ })
697
+
698
+ })
699
+ }
700
+ },
701
+ // 获取县域分公司内容
702
+ getfengongsi() {
703
+ let val = {
704
+ source: 'this.getParentByType($organization$).getSpecialResByType($organization$)',
705
+ userid: `${this.$login.f.id}`
706
+ }
707
+ let http = new HttpResetClass()
708
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
709
+ res.data.forEach((item) => {
710
+ this.orgstrs.push({label: item.name, value: item.id})
711
+ })
712
+ //tag
713
+ })
714
+ },
715
+ // 县域分公司发生改变
716
+ // orgstrchange(val){
717
+ // if(val == undefined || val == ''){
718
+ // return
719
+ // }else {
720
+ // this.checkersid = []
721
+ // let gen = select(this,val)
722
+ // return co(gen)
723
+ // }
724
+ // },
725
+ getDefect(val) {
726
+ if (val) {
727
+ try {
728
+ var defect = JSON.parse(val)
729
+ return defect.result
730
+ } catch (e) {
731
+ //tag
732
+ return '正常'
733
+ }
734
+ }
735
+ return '正常'
736
+ },
737
+ checkerchange(val) {
738
+ this.checkboxModel.f_checker = val.name
739
+ this.checkboxModel.f_checker_id = val.id
740
+ },
741
+ search(args) {
742
+ if (this.model.f_filialeids){
743
+ args.condition += ` and f_orgid in ${this.model.f_filialeids}`
744
+ }
745
+ if (this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')) {
746
+ this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始时间!')
747
+ return
748
+ }
749
+ if ((args.model.f_check_start || args.model.f_check_end) && !this.SafeCheckXZ) {
750
+ this.$showMessage('如果录入 安检起始时间,需要选择 安检筛选条件!')
751
+ return
752
+ }
753
+ //args.condition += " and f_filialeid in " + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
754
+ // let con = ' f_filialeid in ' + (this.model.f_filialeids ? this.model.f_filialeids : `(${this.$login.f.orgid})`)
755
+ let con = '1=1'
756
+ this.$emit('filiale-change', con)
757
+ con += args.model.f_userinfo_code ? ` and f_userinfo_code like '%${args.model.f_userinfo_code}%'` : ''
758
+ con += args.model.f_user_name ? ` and f_user_name like '%${args.model.f_user_name}%'` : ''
759
+ con += args.model.f_residential_area ? ` and f_residential_area like '%${args.model.f_residential_area}%'` : ''
760
+ con += args.model.f_address ? ` and f_address like '%${args.model.f_address}%'` : ''
761
+ con += args.model.f_usertype ? ` and f_check_type = '${args.model.f_usertype}'` : ''
762
+ if (this.SafeCheckXZ) {
763
+ con += ` and f_offsite_time >= '${args.model.f_check_start}' and f_offsite_time <= '${args.model.f_check_end}' `
764
+ if (this.SafeCheckXZ == '未安检') {
765
+ args.condition += ' and ruhuid is null'
766
+ } else {
767
+ args.condition += ' and ruhuid is not null'
768
+ }
769
+ }
770
+ con += args.model.f_last_check_state ? ` and f_entry_status = '${args.model.f_last_check_state}'` : ''
771
+ con += args.model.f_checker_id ? ` and f_checker_name in ${args.model.f_checker_id}` : ''
772
+ let condition = {
773
+ condition1: args.condition,
774
+ condition2: con
775
+ }
776
+ this.searchData.condition = condition
777
+ return this.model.search(condition, args.model)
778
+ },
779
+ checkstatus() {
780
+ return this.$appdata.getParam('安检状态') ? [{
781
+ label: '全部',
782
+ value: ''
783
+ }, ...this.$appdata.getParam('安检状态')] : [{label: '全部', value: ''}]
784
+ },
785
+ usertypes() {
786
+ return this.$appdata.getParam('用户类型') ? [{
787
+ label: '全部',
788
+ value: ''
789
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
790
+ },
791
+ userstates() {
792
+ return this.$appdata.getParam('用户状态') ? [{
793
+ label: '全部',
794
+ value: ''
795
+ }, ...this.$appdata.getParam('用户状态')] : [{label: '全部', value: ''}]
796
+ },
797
+ hiddenr() {
798
+ this.$parent.showItem = !this.$parent.showItem
799
+ },
800
+ hidden() {
801
+ this.criteriaShow = !this.criteriaShow
802
+ },
803
+ confirm() {
804
+ if (!this.checkboxModel.f_plan_name) {
805
+ this.$showMessage('请填写安检计划名称!')
806
+ return
807
+ }
808
+ // if(this.f_effective_start_time == ''){
809
+ // this.$showMessage('请选择有效起始日期!')
810
+ // return
811
+ // }
812
+ // if(this.f_effective_end_time == ''){
813
+ // this.$showMessage('请选择有效结束日期!')
814
+ // return
815
+ // }
816
+ if (this.IsShare == '否') {
817
+ if (!this.checkboxModel.f_checker_id) {
818
+ this.$showMessage('请选择安检员!')
819
+ return
820
+ }
821
+ }
822
+ let gen = saveGen(this)
823
+ return co(gen)
824
+ },
825
+ changeStates() {
826
+ if (this.checkedAll) {//实现反选/
827
+ this.checkrows = [];
828
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
829
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
830
+ }
831
+ } else {//实现全选
832
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
833
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
834
+ }
835
+ let _this = this
836
+ let condition = this.$refs.paged.$refs.criteria.condition
837
+ let url = this.model.url
838
+ this.$resetpost(`${url}?pageSize=9999999`, {
839
+ data: {
840
+ condition: condition,
841
+ groupitem: '',
842
+ orderitem: 'f_residential_area',
843
+ f_usertype: this.model.f_usertype,
844
+ f_filialeids: this.model.f_filialeids,
845
+ month: this.model.month,
846
+ safeCycle: this.model.safeCycle,
847
+ f_checktime_start: this.model.f_checktime_start,
848
+ f_checktime_end: this.model.f_checktime_end,
849
+ SafeCheckSX: this.model.SafeCheckSX,
850
+ f_last_check_state: this.model.f_last_check_state
851
+ },
852
+ }, {resolveMsg: null, rejectMsg: null}, -1).then(
853
+ (respanse) => {
854
+ if (respanse.data.length >= 5000) {
855
+ this.$showMessage("数据量太大,请重新选择")
856
+ } else {
857
+ _this.checkrows = []
858
+ for (let j = 0; j < respanse.data.length; j++) {
859
+ _this.checkrows.push(respanse.data[j])
860
+ }
861
+ //tag;
862
+ }
863
+ })
864
+ }
865
+ },
866
+ addChecked(item) {
867
+ //tag;
868
+ if (!item.checked) {
869
+ this.checkrows.push(item);
870
+ //tag;
871
+ } else {
872
+ for (let i = 0; i < this.checkrows.length; i++) {
873
+ if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
874
+ this.checkrows.splice(i, 1)
875
+ }
876
+ }
877
+ }
878
+ },
879
+ ToshowModal() {
880
+ this.creatPlanWay = 'single'
881
+ if (this.checkrows.length > 0) {
882
+ this.showModal = true
883
+ } else {
884
+ this.$showMessage("请选择需要安检的用户!")
885
+ }
886
+ },
887
+ FiltrationPlan() {
888
+ if (this.model.rows.length == 0) {
889
+ this.$showMessage("暂无可生成的计划!")
890
+ return
891
+ }
892
+ this.creatPlanWay = 'filtration'
893
+ this.showModal = true
894
+ },
895
+ AllPlan() {
896
+ if (this.model.rows.length == 0) {
897
+ this.$showMessage("暂无可生成的计划!")
898
+ return
899
+ }
900
+ this.creatPlanWay = 'all'
901
+ this.showModal = true
902
+ },
903
+ cancel() {
904
+ this.showModal = false
905
+ },
906
+ areas() {
907
+ let rs = []
908
+ for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
909
+ let temp = {
910
+ label: this.$login.f.f_allArea[i].label,
911
+ value: this.$login.f.f_allArea[i].label
912
+ }
913
+ rs.push(temp)
914
+ }
915
+ return [{label: '全部', value: ''}, ...rs]
916
+ },
917
+ initAdjustables() {
918
+ //tag
919
+ let arr = []
920
+ let filter = this.$login.f.f_orgids
921
+ this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
922
+ let temp = {}
923
+ temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
924
+ temp.value = `${item.value.id}`
925
+ arr.push(temp)
926
+ })
927
+ this.adjustables = [{label: '全部', value: ''}, ...arr]
928
+ },
929
+ getAllMeterBook(val) {
930
+ ////tag
931
+ ////tag
932
+ this.cbcs = []
933
+ if (val) {
934
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
935
+ data: {
936
+ items: 'f_book_name,f_book_slice_area,id',
937
+ tablename: 't_meter_book',
938
+ condition: `f_filiale_id in ${val}`,
939
+ orderitem: 'id'
940
+ }
941
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
942
+ res.data.forEach(ress => {
943
+ this.cbcs.push({
944
+ id: ress.id,
945
+ f_book_name: ress.f_book_name,
946
+ f_book_slice_area: ress.f_book_slice_area
947
+ })
948
+ })
949
+ this.cbc = []
950
+ this.cbc.push({
951
+ label: '全部',
952
+ value: ''
953
+ })
954
+ this.cbcs.forEach(res => {
955
+ this.cbc.push({
956
+ label: res.f_book_name,
957
+ value: res.id
958
+ })
959
+ })
960
+ })
961
+ }
962
+ },
963
+ getRes(obj) {
964
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids);
965
+ this.Mreadibook(this.model.f_filialeids)
966
+ this.getAllMeterBook(this.model.f_filialeids)
967
+ this.getPcd(this.model.f_filialeids)
968
+ }
969
+ },
970
+
971
+ watch: {
972
+ 'model.f_usertype'(val) {
973
+ if (val == '民用') {
974
+ this.model.safeCycle = this.civil
975
+ } else if (val == '非民用') {
976
+ this.model.safeCycle = this.civilian
977
+ }
978
+ },
979
+ 'model.SafeCheckXZ'(val) {
980
+ this.model.SafeCheckSC = ''
981
+ if (val == '已安检') {
982
+ this.model.SafeCheckCQ = ''
983
+ this.model.SafeCheckSX = {
984
+ f_check_end: '', // 安检时间 查询起始条件
985
+ f_check_start: ''// 安检时间 查询终止条件
986
+ }
987
+ } else {
988
+ // 当使用筛选条件时,清空不需要的条件选项
989
+ this.model.f_issue_start = ''
990
+ this.model.f_issue_end = ''
991
+ this.$refs.paged.$refs.criteria.model.f_check_start = ''
992
+ this.$refs.paged.$refs.criteria.model.f_check_end = ''
993
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
994
+ this.model.month = ''
995
+ if (val == '应安检') {
996
+ this.model.SafeCheckSC = ''
997
+
998
+ this.model.f_issue_start = Util.toStartDateString()
999
+ this.model.f_issue_end = Util.toStandardDateString()
1000
+ }
1001
+ // this.model.f_checktime_start = ''
1002
+ // this.model.f_checktime_end = ''
1003
+ }
1004
+ },
1005
+ 'model.SafeCheckSC'(val) {
1006
+ if (val == '') {
1007
+ this.model.f_issue_start = ''
1008
+ this.model.f_issue_end = ''
1009
+ }
1010
+ },
1011
+ // 'checker'(val){
1012
+ // //tag
1013
+ // if(val){
1014
+ // this.checkboxModel.f_checker = this.checker[0].name
1015
+ // this.checkboxModel.f_checker_id = this.checker[0].id
1016
+ // }
1017
+ // },
1018
+ 'model.rows'() {
1019
+ // if (!this.checkedAll) {//实现反选/
1020
+ // this.checkrows = [];
1021
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1022
+ var k = false
1023
+ for (let j = 0; j < this.checkrows.length; j++) {
1024
+ if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
1025
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1026
+ k = true
1027
+ continue
1028
+ }
1029
+ }
1030
+ if (!k) {
1031
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
1032
+ }
1033
+ }
1034
+ // } else {//实现全选
1035
+ // // this.checkboxModel = {};
1036
+ // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
1037
+ // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
1038
+ // }
1039
+ // }
1040
+ }
1041
+ },
1042
+ computed: {
1043
+ selected() {
1044
+ return this.$refs.paged.$refs.grid.selected
1045
+ }
1046
+ }
1047
+ }
1048
+ </script>
1049
+ <style scoped>
1050
+ .newcolor {
1051
+ color: red;
1052
+ }
1053
+
1054
+ .table th {
1055
+ background-color: #f2f6fa;
1056
+ color: black;
1057
+ }
1058
+ </style>