safecheck-client 3.0.33-79 → 3.0.33-80

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