safecheck-client 3.0.34-45 → 3.0.34-48

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,906 +1,932 @@
1
- <template>
2
- <div style="flex:1;" class="flex">
3
- <button class="btn btn-xs" v-show="!criteriaShow" @click="show()">
4
- <span class="glyphicon glyphicon-chevron-down" style="color: #000;"></span>
5
- </button>
6
- <criteria-paged :model="model" v-ref:paged>
7
- <criteria partial='criteria' v-show="$parent.criteriaShow" @condition-changed='$parent.search' v-ref:criteria>
8
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
9
- <div class="row">
10
- <div class="col-sm-4" style="width: 20%">
11
- <label class="font_normal_body">用户编号</label>
12
- <input type="text" class="input_search" v-model="model.f_userinfo_code" id="f_userinfo_code" style="width:60%;"
13
- placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
14
- </div>
15
- <div class="col-sm-4" style="width: 20%">
16
- <label class="font_normal_body">用户姓名</label>
17
- <input type="text" class="input_search" v-model="model.f_user_name" id="f_user_name" style="width:60%;"
18
- placeholder="用户姓名" condition="f_user_name like '%{}%'">
19
- </div>
20
- <div class="col-sm-4" style="width: 20%">
21
- <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;小区&nbsp;&nbsp;&nbsp;</label>
22
- <!-- <input type="text" class="input_search" v-model="model.f_residential_area" id="f_residential_area" style="width:60%;"
23
- placeholder="小区" condition="f_residential_area like '%{}%'">-->
24
- <v-select
25
- placeholder='小区选择'
26
- :value-single="true"
27
- v-model='model.f_residential_area'
28
- :value.sync="model.f_residential_area"
29
- class="select select_list"
30
- :options='$parent.$parent.villagesChick'
31
- condition="f_residential_area like '%{}%'"
32
- close-on-select clear-button search valueSingle="true"> </v-select>
33
- </div>
34
-
35
- <div class="col-sm-4" style="width: 20%">
36
- <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;楼栋&nbsp;&nbsp;&nbsp;</label>
37
- <v-select
38
- placeholder='楼栋选择'
39
- v-model='model.f_building'
40
- :value.sync="model.f_building"
41
- class="select select_list"
42
- :options='$parent.$parent.buildingChick'
43
- condition="f_building in {}"
44
- clear-button search :multiple="true"> </v-select>
45
- </div>
46
-
47
- <div class="col-sm-4" style="width: 20%">
48
- <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;地址&nbsp;&nbsp;&nbsp;</label>
49
- <input type="text" class="input_search" v-model="model.f_address" id="f_address" style="width:60%;"
50
- placeholder="地址" condition="f_address like '%{}%'">
51
- </div>
52
- <!--<div class="col-sm-3 form-group form-input-group" style="width: 20%">-->
53
- <!--<label class="control-label">用户类型</label>-->
54
- <!--<v-select id="f_usertype"-->
55
- <!--placeholder='用户类型'-->
56
- <!--:value.sync="model.f_usertype"-->
57
- <!--:value-single="true"-->
58
- <!--:options='$parent.$parent.usertypes'-->
59
- <!--v-model="model.f_usertype"-->
60
- <!--condition="f_user_type = '{}'"-->
61
- <!--close-on-select clear-button> </v-select>-->
62
- <!--</div>-->
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 && $parent.$parent.SafeCheckXZ=='未入户'">
75
- <label class="font_normal_body">安检状态</label>
76
- <v-select id="f_entry"
77
- placeholder='安检状态'
78
- class="select select_list"
79
- :value.sync="model.f_check_state"
80
- :value-single="true"
81
- :options='$parent.$parent.checkstatus'
82
- v-model="model.f_check_state"
83
- close-on-select clear-button></v-select>
84
- </div>-->
85
- <div class="col-sm-4" style="width: 20%">
86
- <label class="font_normal_body" style="color: red;">安检筛选</label>
87
- <v-select
88
- placeholder='安检筛选'
89
- :value-single="true"
90
- class="select select_list"
91
- :value.sync="$parent.$parent.SafeCheckXZ"
92
- :options='$parent.$parent.SafeCheckXZs'
93
- v-model="$parent.$parent.SafeCheckXZ"
94
- close-on-select clear-button> </v-select>
95
- </div>
96
- <div class="col-sm-4" style="width: 20% " v-show="$parent.$parent.SafeCheckXZ=='未入户'">
97
- <label class="font_normal_body">安检状态</label>
98
- <v-select id="f_entry"
99
- placeholder='安检状态'
100
- :value.sync="model.f_check_state"
101
- :value-single="true"
102
- class="select select_list"
103
- :options='$parent.$parent.checkstatus'
104
- v-model="model.f_check_state"
105
- close-on-select clear-button> </v-select>
106
- </div>
107
- <div class="col-sm-4" style="width: 20%">
108
- <label class="font_normal_body">安检起始</label>
109
- <datepicker
110
- :value.sync="model.f_check_start"
111
- placeholder='最后安检时间起始'
112
- :disabled-days-of-week="[]"
113
- class="select select_list"
114
- style="width: 60%"
115
- :format="'yyyy-MM-dd'"
116
- :show-rest-button="reset"
117
- v-model = "model.f_check_start">
118
- </datepicker>
119
- </div>
120
- <div class="col-sm-4" style="width: 20%">
121
- <label class="font_normal_body">安检结束</label>
122
- <datepicker
123
- :value.sync="model.f_check_end"
124
- placeholder='最后安检时间结束'
125
- :disabled-days-of-week="[]"
126
- class="select select_list"
127
- style="width: 60%"
128
- :format="'yyyy-MM-dd'"
129
- :show-rest-button="reset"
130
- v-model = "model.f_check_end">
131
- </datepicker>
132
- </div>
133
-
134
-
135
- <div class="col-sm-4" style="width: 20%">
136
- <label class="font_normal_body">隐患情况</label>
137
- <v-select
138
- placeholder='隐患情况'
139
- :value-single="true"
140
- v-model='model.f_check_result'
141
- class="select select_list"
142
- :value.sync="model.f_check_result"
143
- :options='$parent.$parent.f_check_results'
144
- condition="f_last_check_result like '%{}%'"
145
- close-on-select clear-button> </v-select>
146
- </div>
147
- <!--<div class="col-sm-4" style="width: 20%" v-if="$parent.$parent.orgstrs.length > 1">
148
- <label class="font_normal_body">县域公司</label>
149
- <v-select
150
- placeholder='县域分公司'
151
- :value-single="true"
152
- v-model='model.f_orgstr'
153
- :value.sync="model.f_orgstr"
154
- class="select select_list"
155
- :options='$parent.$parent.orgstrs'
156
- condition="f_orgstr like '%{}%'"
157
- close-on-select clear-button> </v-select>
158
- </div>-->
159
- <div class="col-sm-4" style="width: 20%">
160
- <label class="font_normal_body">所属区域</label>
161
- <v-select
162
- placeholder='所属区域'
163
- :value-single="true"
164
- v-model='model.street'
165
- :value.sync="model.street"
166
- class="select select_list"
167
- :options='$parent.$parent.streets'
168
- condition="f_street ='{}'"
169
- close-on-select clear-button> </v-select>
170
- </div>
171
- <div class="row">
172
- <div class="col-sm-4" style="width: 20%">
173
- <label class="font_normal_body">开户起始</label>
174
- <datepicker
175
- :value.sync="model.f_createfile_start"
176
- placeholder='开户起始时间'
177
- :disabled-days-of-week="[]"
178
- class="select select_list"
179
- style="width: 60%"
180
- :format="'yyyy-MM-dd'"
181
- :show-rest-button="reset"
182
- condition="f_createfile_date > '{} 00:00:00'"
183
- v-model = "model.f_createfile_start">
184
- </datepicker>
185
- </div>
186
- <div class="col-sm-4" style="width: 20%">
187
- <label class="font_normal_body">开户结束</label>
188
- <datepicker
189
- :value.sync="model.f_createfile_end"
190
- placeholder='开户结束时间'
191
- :disabled-days-of-week="[]"
192
- class="select select_list"
193
- style="width: 60%"
194
- :format="'yyyy-MM-dd'"
195
- condition="f_createfile_date < '{} 23:59:00'"
196
- :show-rest-button="reset"
197
- v-model = "model.f_createfile_end">
198
- </datepicker>
199
- </div>
200
- <!--<div class="col-sm-4" style="width: 20%">
201
- <label class="font_normal_body">是否入户</label>
202
- <v-select
203
- placeholder='今年是否入户'
204
- :value-single="true"
205
- class="select select_list"
206
- :value.sync="$parent.$parent.hasHousehold"
207
- :options='$parent.$parent.safe_rhs'
208
- v-model="$parent.$parent.hasHousehold"
209
- close-on-select clear-button> </v-select>
210
- </div>-->
211
- <div class="col-sm-4" style="width: 20%">
212
- <label class="font_normal_body">安检项名</label>
213
- <v-select
214
- placeholder='安检项名'
215
- :value-single="true"
216
- class="select select_list"
217
- :value.sync="$parent.$parent.check_item"
218
- :options='$parent.$parent.check_items'
219
- v-model="$parent.$parent.check_item"
220
- close-on-select clear-button> </v-select>
221
- </div>
222
- <div class="col-sm-4" style="width: 20%">
223
- <label class="font_normal_body">安检内容</label>
224
- <v-select
225
- placeholder='安检内容'
226
- :value-single="true"
227
- class="select select_list"
228
- :value.sync="$parent.$parent.check_itemValue"
229
- :options='$parent.$parent.check_itemValues'
230
- v-model="$parent.$parent.check_itemValue"
231
- close-on-select clear-button> </v-select>
232
- </div>
233
- <div class="col-sm-8"></div>
234
- <div style="float: right;margin-right: 10px">
235
- <export-excel-safe :data="$parent.$parent.searchData"
236
- :field="$parent.$parent.excelHeaders"
237
- sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案" template-name='用户安检情况'></export-excel-safe>
238
- <div style="float: right" class="button_spacing"
239
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
240
- @click="$parent.$parent.hiddenr()"></div>
241
- </div>
242
- <div class="span" style = "float:right;margin-right:10px">
243
- <button class="btn btn-primary width-80" @click="search()">查询</button>
244
- </div>
245
- <div class="span" style = "float:right;margin-right:10px">
246
- <button class="btn btn-primary width-80" @click="$parent.$parent.show1()">年度安检率查看</button>
247
- </div>
248
- </div>
249
- </div>
250
- </div>
251
- </criteria>
252
- <data-grid :model="model" partial="list" class="table table-bordered table table-hover" v-ref:grid>
253
- <template partial='head'>
254
- <tr>
255
- <th><nobr>用户编号</nobr></th>
256
- <th><nobr>用户名称</nobr></th>
257
- <th><nobr>用户电话</nobr></th>
258
- <!--<th><nobr>今年入户次数</nobr></th>-->
259
- <th><nobr>用户类型</nobr></th>
260
- <th><nobr>小区名称</nobr></th>
261
- <th><nobr>地址</nobr></th>
262
- <th><nobr>建档日期</nobr></th>
263
- <th><nobr>安检日期</nobr></th>
264
- <th><nobr>安检状态</nobr></th>
265
- <th><nobr>安检结果</nobr></th>
266
- </tr>
267
- </template>
268
- <template partial='body'>
269
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_userinfo_code}}</td>
270
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_user_name}}</td>
271
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_user_phone}}</td>
272
- <!--<td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.r}}</td>-->
273
- <td v-bind:class="{newcolor:row.code=='1'}" style="text-align: center">{{row.f_user_type}}</td>
274
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_residential_area}}</td>
275
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_address}}</td>
276
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_createfile_date}}</td>
277
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_last_check_date}}</td>
278
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_last_check_state}}</td>
279
- <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{$parent.$parent.$parent.getDefect(row.f_last_check_result)}}</td>
280
- </template>
281
- </data-grid>
282
- </criteria-paged>
283
- </div>
284
- <modal :show.sync="showModal" v-ref:modal backdrop="false">
285
- <div slot="modal-header" class="modal-header">
286
- <h4 class="modal-title">
287
- 年度安检率查看
288
- </h4>
289
- </div>
290
- <div slot="modal-body" class="modal-body">
291
- <div>
292
- <form class="form-inline">
293
- <div class="row form-group">
294
- <div class="col-sm-4">
295
- <label class="font_normal_body" >起始时间</label>
296
- <datepicker
297
- :value.sync="y_check_start"
298
- placeholder='安检时间起始'
299
- :disabled-days-of-week="[]"
300
- class="select select_list"
301
- style="width: 60%"
302
- :format="'yyyy-MM-dd'"
303
- :show-rest-button="reset"
304
- v-model = "y_check_start">
305
- </datepicker>
306
- </div>
307
- <div class="col-sm-4">
308
- <label class="font_normal_body" >结束时间</label>
309
- <datepicker
310
- :value.sync="y_check_end"
311
- placeholder='安检时间截止'
312
- :disabled-days-of-week="[]"
313
- class="select select_list"
314
- style="width: 60%"
315
- :format="'yyyy-MM-dd'"
316
- :show-rest-button="reset"
317
- v-model = "y_check_end">
318
- </datepicker>
319
- </div>
320
- <button type="button" style="margin-left: 10px" class="button_search" @click="y_search()">查询</button>
321
- </div>
322
- <div class="row form-group">
323
- <div class="col-sm-4">
324
- <label class="font_normal_body">所属区域</label>
325
- <v-select
326
- placeholder='所属区域'
327
- :value-single="true"
328
- v-model='yearStreet'
329
- :value.sync="yearStreet"
330
- class="select select_list"
331
- :options='streets'
332
- close-on-select clear-button> </v-select>
333
- </div>
334
- </div>
335
-
336
-
337
- <div style="width: 65%;height:100%; display: inline-block">
338
- </div>
339
-
340
- </form>
341
- <hr>
342
- <table class="table table_sy">
343
- <thead>
344
- <tr>
345
- <th></th>
346
- <th>总户数</th>
347
- <th>安检入户数</th>
348
- <th>一次安检率</th>
349
- </tr>
350
- </thead>
351
- <tbody>
352
- <tr v-for="row in yearmodel">
353
- <td></td>
354
- <td style="text-align: center;">{{row.con}}</td>
355
- <td style="text-align: center;">{{row.rhcon}}</td>
356
- <td style="text-align: center;">{{row.f_check_bv}}</td>
357
- </tr>
358
- </tbody>
359
- </table>
360
- </div>
361
- </div>
362
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
363
- <!--<button class="button_search button_spacing" @click="ok()">确认</button>-->
364
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
365
- </div>
366
- </modal>
367
- </template>
368
-
369
- <script>
370
- import { PagedList } from 'vue-client'
371
- import { HttpResetClass } from 'vue-client'
372
- import co from 'co'
373
- import * as Util from './../Util'
374
- import Vue from 'vue'
375
- import {toStandardDateString} from "./../Util";
376
-
377
- // let select = function * (self,userid) {
378
- // let http = new HttpResetClass()
379
- // let getGasman = yield http.load('POST','/rs/search', {
380
- // source: 'this.getChildByName($安检员$).getUsers()',
381
- // userid: userid
382
- // }, {resolveMsg: null, rejectMsg: null})
383
- // console.log('获取安检员', getGasman)
384
- // getGasman.data.forEach((checker)=>{
385
- // self.checkersid.push({label:checker.name,value:checker.id})
386
- // })
387
- // self.checkersid.push({label:'全部',value:''})
388
- // }
389
-
390
-
391
- export default {
392
- title: '民用用户安检情况',
393
- data() {
394
- let options = []
395
- let year = (new Date()).getFullYear()
396
- for (let i = year; i <= year + 3; i++)
397
- options.push({label: i + '', value: i + ''})
398
- let moptions = []
399
- for (let i = 1; i <= 12; i++)
400
- moptions.push({label: i + '', value: i + ''})
401
-
402
- return {
403
- y_check_start:`${new Date().getFullYear()}-01-01`,
404
- y_check_end:`${new Date().getFullYear()}-12-31`,
405
- searchData: {
406
- condition: '1=1',
407
- con1: '1=1',
408
- con2: '1=1',
409
- f_itemvalue:'',
410
- f_itemname:'',
411
- orderitem: "f_userinfo_code",
412
- timetype:"dd" ,
413
- f_filialeids:`(${this.$login.f.orgid})`
414
- },
415
- excelHeaders: {
416
- //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
417
-
418
- 'f_userinfo_code': '用户编号',
419
- 'f_user_name': '用户名称',
420
- 'f_user_phone': '用户电话',
421
- //'count_item':'安检次数',
422
- 'f_user_type': '用户类型',
423
- 'f_residential_area': '小区名称',
424
- 'f_address':'地址',
425
- 'f_last_check_date':'安检日期',
426
- 'f_last_check_state': '安检状态',
427
- 'f_last_check_result':'安检结果'
428
- },
429
- model: new PagedList('rs/sql/根据安检员查询用户档案', 20, {orderitem: "'f_userinfo_code'",timetype:"'dd'" ,con1:"this.con1",con2:"this.con2",f_itemname:'this.check_item',f_itemvalue:'this.check_itemValue',f_filialeids:`'(${this.$login.f.orgid})'`}),
430
- orgstrs:[{label: '全部', value: ''}],
431
- checkersid:[],
432
- SafeCheckXZ:'',
433
- civil:'', //民用安检周期
434
- civilian:'', //非民用安检周期
435
- SafeCheckXZs: [{label: '全部', value: ''},{label: '已入户', value: '已入户'}, {label: '未入户', value: '未入户'}], // 安检筛选选项
436
- safe_rhs: [{label: '全部', value: ''},{label: '今年已入户', value: '今年已入户'}, {label: '今年未入户', value: '今年未入户'}], // 安检筛选选项
437
- SafeCheckSXs: [{label: '是', value: '是'}, {label: '否', value: '否'}, {label: '全部', value: ''},],
438
- checkstatus:[{label: '全部', value: ''},{label: '到访不遇', value: '到访不遇'}, {label: '拒检', value: '拒检'}],
439
- IsShares: [{label: '是', value: '是'}, {label: '否', value: '否'}],
440
- IsShare:'否',
441
- checker: {},
442
- NoBuys:[{label: '', value: ''},{label: '否', value: '否'}],
443
- criteriaShow: true,
444
- checkers: [],
445
- chosenOrg: {id: 0},
446
- checkedAll: false,
447
- checkrows: [],
448
- yearmodel:[],
449
- streets:[],
450
- adjustables: [],
451
- f_plan_year: year + '',
452
- f_plan_month: moptions[new Date().getMonth()].value,
453
- f_effective_start_time:'', //计划有效起始时间
454
- f_effective_end_time:'', //计划有效结束时间
455
- checkboxModel: {},
456
- c_year_list: options,
457
- c_month_list: moptions,
458
- areas: this.areas(),
459
- //checkstatus: this.checkstatus(),
460
- usertypes: this.usertypes(),
461
- userstates: this.userstates(),
462
- sqlname:'',
463
- f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'},{label: '有隐患', value: '有隐患'}],
464
- creatPlanWay:'',
465
- showModal:false,
466
- yearStreet:'',
467
- villagesModel:'', //小区绑定值
468
- villagesChick:[], //小区选择值
469
- buildingModel:'', //地址绑定值
470
- buildingChick:[], //地址选择值
471
- hasHousehold:'',
472
- check_items:[{label: '全部', value: ''}, ...this.$appdata.getParam('安检项名')],
473
- check_item:'',
474
- check_itemValue:''
475
- }
476
- },
477
- props: {
478
- checkplan: { // 传入一条安检计划信息
479
- type: Object
480
- },
481
- additemshow:{
482
- type:Boolean,
483
- default:false
484
- }
485
- },
486
- ready() {
487
- // 获取分公司信息
488
- this.getfengongsi()
489
- this.model.chosenOrg = {id: 0}
490
- this.model.f_filialeids = this.$login.f.f_orgids
491
- this.model.f_filiale = this.$login.f.f_fengongsi
492
- this.model.f_OrgStr = this.$login.f.orgpathstr
493
- this.initstreets()
494
-
495
- //小区初始化
496
- this.initVillage()
497
- this.$refs.paged.$refs.criteria.model.f_check_start = Util.toStandardDateString()
498
- this.$refs.paged.$refs.criteria.model.f_check_end = Util.toStandardDateString()
499
- // this.$refs.paged.$refs.criteria.search();
500
- },
501
- methods: {
502
- show1(){
503
- this.showModal=true
504
- },
505
- y_search(){
506
- let condition=''
507
- if(!this.y_check_start || !this.y_check_end){
508
- this.$showMessage("请选择开始和结束时间")
509
- }
510
- condition += `and f_onsite_time > '${this.y_check_start} 00:00:00' and f_onsite_time < '${this.y_check_end} 23:59:59'`
511
- new HttpResetClass().load('POST', 'rs/sql/FetchYearCheckRatio', {
512
- data: {
513
- condition: condition,
514
- f_createfile_date:this.y_check_end+' 23:59:59',
515
- usertype:'民用',
516
- f_street:this.yearStreet
517
- }
518
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((res)=>{
519
- console.log('---'+JSON.stringify(res))
520
- this.yearmodel=res.data
521
- })
522
- },
523
- //初始化小区
524
- async initVillage(){
525
- this.villagesChick = []
526
- let HttpReset = new HttpResetClass()
527
- let req = await HttpReset.load('POST', 'rs/sql/safe_singleTable_GroupBy', {
528
- data: {
529
- items: 'f_residential_area',
530
- tablename: 't_area',
531
- condition: '1 = 1',
532
- groupitem: 'f_residential_area'
533
- }
534
- }, {resolveMsg: null, rejectMsg: '获取小区列表失败!'})
535
- let redata = []
536
- req.data.forEach((row, n) => {
537
- redata.push({label: row.f_residential_area,value: row.f_residential_area,data:row})
538
- })
539
- redata.unshift({label: '全部', value: '', data: ''})
540
- this.villagesChick=redata
541
- },
542
- //初始化街道 添加小区
543
- async initstreets(){
544
- this.streetslist = []
545
- let HttpReset = new HttpResetClass()
546
- let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
547
- data: {
548
- items: '*',
549
- tablename: 't_street',
550
- orderitem: 'id',
551
- condition: `f_orgid = '${this.$login.f.orgid}'`
552
- }
553
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
554
- let redata = []
555
- req.data.forEach((row, n) => {
556
- redata.push({label: row.f_street,value: row.f_street,data:row,id:row.id})
557
- })
558
- this.streets=redata
559
- },
560
- hiddenr() {
561
- this.$parent.showItem = !this.$parent.showItem
562
- },
563
- hidden() {
564
- this.criteriaShow = !this.criteriaShow
565
- },
566
- // 获取县域分公司内容
567
- getfengongsi(){
568
- let val = {source: 'this.getParentByType($organization$).getSpecialResByType($organization$)', userid: `${this.$login.f.id}`}
569
- let http = new HttpResetClass()
570
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
571
- res.data.forEach((item) => {
572
- this.orgstrs.push({label: item.name, value: item.id})
573
- })
574
- console.log(this.orgstrs.length)
575
- })
576
- },
577
- // 县域分公司发生改变
578
- // orgstrchange(val){
579
- // if(val == undefined || val == ''){
580
- // return
581
- // }else {
582
- // this.checkersid = []
583
- // let gen = select(this,val)
584
- // return co(gen)
585
- // }
586
- // },
587
- getDefect(val){
588
- if(val){
589
- try {
590
- var defect = JSON.parse(val)
591
- return defect.result
592
- }catch (e) {
593
- console.log(val)
594
- return '正常'
595
- }
596
- }
597
- return '正常'
598
- },
599
- checkerchange(val) {
600
- this.checkboxModel.f_checker = val.name
601
- this.checkboxModel.f_checker_id = val.id
602
- },
603
- search(args) {
604
- if(this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')){
605
- this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始和结束时间!')
606
- return
607
- }
608
- if((args.model.f_check_start || args.model.f_check_end ) && !this.SafeCheckXZ ){
609
- this.$showMessage('如果录入安检起始结束时间,需要选择 安检筛选 选项!')
610
- return
611
- }
612
- let con1='1=1 '
613
- let con2='1=1 '
614
- if(this.SafeCheckXZ == '已入户'){
615
- args.condition += " and r > 0"
616
- con1 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
617
- con2 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
618
- //args.condition += " and ( f_last_check_date > '"+ args.model.f_check_end + " 23:59:00' or f_last_check_date < '"+ args.model.f_check_start + " 00:00:00' or f_last_check_date is null)"
619
- } else if(this.SafeCheckXZ == '未入户') {
620
- args.condition += " and r < 1"
621
- con1 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
622
- con2 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
623
- if(args.model.f_check_state=='到访不遇'){
624
- args.condition += " and d > 0"
625
- }else if(args.model.f_check_state=='拒检'){
626
- args.condition += " and j > 0"
627
- }
628
- }
629
- this.model.check_item=this.check_item
630
- this.model.check_itemValue=this.check_itemValue
631
- /*if(this.hasHousehold=='今年已入户'){
632
- args.condition += " and rhcon is not null"
633
- }else if(this.hasHousehold=='今年未入户'){
634
- args.condition += " and rhcon is null"
635
- }*/
636
- args.condition += " and f_filialeid = '" + this.$login.f.orgid + "' and f_user_type='民用'"
637
- this.searchData.condition=args.condition
638
- this.searchData.con1=con1
639
- this.searchData.con2=con2
640
- this.searchData.f_itemvalue=this.check_item
641
- this.searchData.f_itemname=this.check_itemValue
642
- this.model.con1=con1
643
- this.model.con2=con2
644
- return this.model.search( args.condition, args.model)
645
- },
646
- /*checkstatus() {
647
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]
648
- },*/
649
- usertypes() {
650
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]
651
- },
652
- userstates() {
653
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')]
654
- },
655
- show() {
656
- this.criteriaShow = true
657
- },
658
- hidden() {
659
- this.criteriaShow = false
660
- },
661
- confirm() {
662
- if (!this.checkboxModel.f_plan_name) {
663
- this.$showMessage('请填写安检计划名称!')
664
- return
665
- }
666
- // if(this.f_effective_start_time == ''){
667
- // this.$showMessage('请选择有效起始日期!')
668
- // return
669
- // }
670
- // if(this.f_effective_end_time == ''){
671
- // this.$showMessage('请选择有效结束日期!')
672
- // return
673
- // }
674
- if(this.IsShare == '否'){
675
- if (!this.checkboxModel.f_checker_id) {
676
- this.$showMessage('请选择安检员!')
677
- return
678
- }
679
- }
680
- let gen = saveGen(this)
681
- return co(gen)
682
- },
683
- changeStates() {
684
- if (this.checkedAll) {//实现反选/
685
- this.checkrows = [];
686
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
687
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
688
- }
689
- } else {//实现全选
690
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
691
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
692
- }
693
- let _this = this
694
- let condition = this.$refs.paged.$refs.criteria.condition
695
- let url = this.model.url
696
- this.$resetpost(`${url}?pageSize=9999999`, {
697
- data: {
698
- condition: condition,
699
- groupitem: '',
700
- orderitem: 'f_residential_area',
701
- f_usertype:this.model.f_usertype,
702
- f_filialeids: this.model.f_filialeids,
703
- month: this.model.month,
704
- safeCycle:this.model.safeCycle,
705
- f_checktime_start:this.model.f_checktime_start,
706
- f_checktime_end:this.model.f_checktime_end,
707
- SafeCheckSX: this.model.SafeCheckSX,
708
- f_last_check_state: this.model.f_last_check_state
709
- },
710
- },{resolveMsg: null, rejectMsg: null}, -1).then(
711
- (respanse) => {
712
- if (respanse.data.length >= 5000) {
713
- this.$showMessage("数据量太大,请重新选择")
714
- } else {
715
- _this.checkrows = []
716
- for (let j = 0; j < respanse.data.length; j++) {
717
- _this.checkrows.push(respanse.data[j])
718
- }
719
- console.log(_this.checkrows);
720
- }
721
- })
722
- }
723
- },
724
- addChecked(item) {
725
- console.log(item);
726
- if (!item.checked) {
727
- this.checkrows.push(item);
728
- console.log(this.checkrows);
729
- } else {
730
- for (let i = 0; i < this.checkrows.length; i++) {
731
- if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
732
- this.checkrows.splice(i, 1)
733
- }
734
- }
735
- }
736
- },
737
- ToshowModal() {
738
- this.creatPlanWay = 'single'
739
- if (this.checkrows.length > 0) {
740
- this.showModal = true
741
- } else {
742
- this.$showMessage("请选择需要安检的用户!")
743
- }
744
- },
745
- FiltrationPlan(){
746
- if(this.model.rows.length == 0){
747
- this.$showMessage("暂无可生成的计划!")
748
- return
749
- }
750
- this.creatPlanWay = 'filtration'
751
- this.showModal = true
752
- },
753
- AllPlan() {
754
- if(this.model.rows.length == 0){
755
- this.$showMessage("暂无可生成的计划!")
756
- return
757
- }
758
- this.creatPlanWay = 'all'
759
- this.showModal = true
760
- },
761
- cancel() {
762
- this.showModal = false
763
- },
764
- areas() {
765
- let rs = []
766
- for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
767
- let temp = {
768
- label: this.$login.f.f_allArea[i].label,
769
- value: this.$login.f.f_allArea[i].label
770
- }
771
- rs.push(temp)
772
- }
773
- return [{label: '全部', value: ''}, ...rs]
774
- },
775
- initAdjustables() {
776
- console.log('初始化调压箱', this.$GetSaleParam)
777
- let arr = []
778
- let filter = this.$login.f.f_orgids
779
- this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
780
- let temp = {}
781
- temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
782
- temp.value = `${item.value.id}`
783
- arr.push(temp)
784
- })
785
- this.adjustables = [{label: '全部', value: ''}, ...arr]
786
- },
787
- },
788
-
789
- watch: {
790
- 'check_item'(){
791
- this.check_itemValue=''
792
- },
793
- 'model.model.f_residential_area'(){
794
- this.model.model.f_building = []
795
- this.buildingChick = []
796
- if (!this.model.model){
797
- return
798
- }
799
- if (!this.model.model.f_residential_area){
800
- return
801
- }
802
- let HttpReset = new HttpResetClass()
803
- let redata = []
804
- HttpReset.load('POST', '/rs/sql/safe_singleTable_GroupBy', {
805
- data: {
806
- items: "f_building",
807
- tablename: "t_user_address",
808
- condition: `f_filialeid = ${this.$login.f.orgid} and f_residential_area= '${this.model.model.f_residential_area}'`,
809
- groupitem: "f_building order by cast((case PATINDEX('%[^0-9]%', f_building) when 0 then f_building else 999 end) as int)"
810
- }
811
- }, {resolveMsg: null, rejectMsg: '获取楼栋列表失败!'}).then(res=>{
812
- res.data.forEach((row, n) => {
813
- redata.push({ label: row.f_building,value: row.f_building,data:row})
814
- })
815
- this.buildingChick = redata;
816
- })
817
- },
818
- 'model.f_usertype'(val){
819
- if(val == '民用'){
820
- this.model.safeCycle = this.civil
821
- }else if(val == '非民用'){
822
- this.model.safeCycle = this.civilian
823
- }
824
- },
825
- 'model.SafeCheckXZ'(val) {
826
- this.model.SafeCheckSC = ''
827
- if (val == '已安检') {
828
- this.model.SafeCheckCQ = ''
829
- this.model.SafeCheckSX = {
830
- f_check_end: '', // 安检时间 查询起始条件
831
- f_check_start: ''// 安检时间 查询终止条件
832
- }
833
- } else {
834
- // 当使用筛选条件时,清空不需要的条件选项
835
- this.model.f_issue_start = ''
836
- this.model.f_issue_end = ''
837
- this.$refs.paged.$refs.criteria.model.f_check_start = ''
838
- this.$refs.paged.$refs.criteria.model.f_check_end = ''
839
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
840
- this.model.month = ''
841
- if(val == '应安检'){
842
- this.model.SafeCheckSC = '否'
843
-
844
- this.model.f_issue_start = Util.toStartDateString()
845
- this.model.f_issue_end = Util.toStandardDateString()
846
- }
847
- // this.model.f_checktime_start = ''
848
- // this.model.f_checktime_end = ''
849
- }
850
- },
851
- 'model.SafeCheckSC'(val) {
852
- if (val == '') {
853
- this.model.f_issue_start = ''
854
- this.model.f_issue_end = ''
855
- }
856
- },
857
- // 'checker'(val){
858
- // console.log("checker",this.checker)
859
- // if(val){
860
- // this.checkboxModel.f_checker = this.checker[0].name
861
- // this.checkboxModel.f_checker_id = this.checker[0].id
862
- // }
863
- // },
864
- 'model.rows'() {
865
- // if (!this.checkedAll) {//实现反选/
866
- // this.checkrows = [];
867
- for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
868
- var k = false
869
- for (let j = 0; j < this.checkrows.length; j++) {
870
- if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
871
- this.$set('$refs.paged.model.rows[' + i + '].checked', true)
872
- k = true
873
- continue
874
- }
875
- }
876
- if (!k) {
877
- this.$set('$refs.paged.model.rows[' + i + '].checked', false)
878
- }
879
- }
880
- // } else {//实现全选
881
- // // this.checkboxModel = {};
882
- // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
883
- // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
884
- // }
885
- // }
886
- }
887
- },
888
- computed: {
889
- selected() {
890
- return this.$refs.paged.$refs.grid.selected
891
- },
892
- check_itemValues(){
893
- return [ ...this.$appdata.getParam(this.check_item)]
894
- }
895
- }
896
- }
897
- </script>
898
- <style scoped>
899
- .newcolor{
900
- color:red;
901
- }
902
- .table th{
903
- background-color: #f2f6fa;
904
- color: black;
905
- }
906
- </style>
1
+ <template>
2
+ <div style="flex:1;" class="flex">
3
+ <button class="btn btn-xs" v-show="!criteriaShow" @click="show()">
4
+ <span class="glyphicon glyphicon-chevron-down" style="color: #000;"></span>
5
+ </button>
6
+ <criteria-paged :model="model" v-ref:paged>
7
+ <criteria partial='criteria' v-show="$parent.criteriaShow" @condition-changed='$parent.search' v-ref:criteria>
8
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
9
+ <div class="row">
10
+ <div class="col-sm-4" style="width: 20%">
11
+ <label class="font_normal_body">用户编号</label>
12
+ <input type="text" class="input_search" v-model="model.f_userinfo_code" id="f_userinfo_code" style="width:60%;"
13
+ placeholder="用户编号" condition="f_userinfo_code like '%{}%'">
14
+ </div>
15
+ <div class="col-sm-4" style="width: 20%">
16
+ <label class="font_normal_body">用户姓名</label>
17
+ <input type="text" class="input_search" v-model="model.f_user_name" id="f_user_name" style="width:60%;"
18
+ placeholder="用户姓名" condition="f_user_name like '%{}%'">
19
+ </div>
20
+ <div class="col-sm-4" style="width: 20%">
21
+ <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;小区&nbsp;&nbsp;&nbsp;</label>
22
+ <!-- <input type="text" class="input_search" v-model="model.f_residential_area" id="f_residential_area" style="width:60%;"
23
+ placeholder="小区" condition="f_residential_area like '%{}%'">-->
24
+ <v-select
25
+ placeholder='小区选择'
26
+ :value-single="true"
27
+ v-model='model.f_residential_area'
28
+ :value.sync="model.f_residential_area"
29
+ class="select select_list"
30
+ :options='$parent.$parent.villagesChick'
31
+ condition="f_residential_area like '%{}%'"
32
+ close-on-select clear-button search valueSingle="true"> </v-select>
33
+ </div>
34
+
35
+ <div class="col-sm-4" style="width: 20%">
36
+ <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;楼栋&nbsp;&nbsp;&nbsp;</label>
37
+ <v-select
38
+ placeholder='楼栋选择'
39
+ v-model='model.f_building'
40
+ :value.sync="model.f_building"
41
+ class="select select_list"
42
+ :options='$parent.$parent.buildingChick'
43
+ condition="f_building in {}"
44
+ clear-button search :multiple="true"> </v-select>
45
+ </div>
46
+
47
+ <div class="col-sm-4" style="width: 20%">
48
+ <label class="font_normal_body"> &nbsp;&nbsp;&nbsp;地址&nbsp;&nbsp;&nbsp;</label>
49
+ <input type="text" class="input_search" v-model="model.f_address" id="f_address" style="width:60%;"
50
+ placeholder="地址" condition="f_address like '%{}%'">
51
+ </div>
52
+ <!--<div class="col-sm-3 form-group form-input-group" style="width: 20%">-->
53
+ <!--<label class="control-label">用户类型</label>-->
54
+ <!--<v-select id="f_usertype"-->
55
+ <!--placeholder='用户类型'-->
56
+ <!--:value.sync="model.f_usertype"-->
57
+ <!--:value-single="true"-->
58
+ <!--:options='$parent.$parent.usertypes'-->
59
+ <!--v-model="model.f_usertype"-->
60
+ <!--condition="f_user_type = '{}'"-->
61
+ <!--close-on-select clear-button> </v-select>-->
62
+ <!--</div>-->
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 && $parent.$parent.SafeCheckXZ=='未入户'">
75
+ <label class="font_normal_body">安检状态</label>
76
+ <v-select id="f_entry"
77
+ placeholder='安检状态'
78
+ class="select select_list"
79
+ :value.sync="model.f_check_state"
80
+ :value-single="true"
81
+ :options='$parent.$parent.checkstatus'
82
+ v-model="model.f_check_state"
83
+ close-on-select clear-button></v-select>
84
+ </div>-->
85
+ <div class="col-sm-4" style="width: 20%">
86
+ <label class="font_normal_body" style="color: red;">安检筛选</label>
87
+ <v-select
88
+ placeholder='安检筛选'
89
+ :value-single="true"
90
+ class="select select_list"
91
+ :value.sync="$parent.$parent.SafeCheckXZ"
92
+ :options='$parent.$parent.SafeCheckXZs'
93
+ v-model="$parent.$parent.SafeCheckXZ"
94
+ close-on-select clear-button> </v-select>
95
+ </div>
96
+ <div class="col-sm-4" style="width: 20% " v-show="$parent.$parent.SafeCheckXZ=='未入户'">
97
+ <label class="font_normal_body">安检状态</label>
98
+ <v-select id="f_entry"
99
+ placeholder='安检状态'
100
+ :value.sync="model.f_check_state"
101
+ :value-single="true"
102
+ class="select select_list"
103
+ :options='$parent.$parent.checkstatus'
104
+ v-model="model.f_check_state"
105
+ close-on-select clear-button> </v-select>
106
+ </div>
107
+ <div class="col-sm-4" style="width: 20%">
108
+ <label class="font_normal_body">安检起始</label>
109
+ <datepicker
110
+ :value.sync="model.f_check_start"
111
+ placeholder='最后安检时间起始'
112
+ :disabled-days-of-week="[]"
113
+ class="select select_list"
114
+ style="width: 60%"
115
+ :format="'yyyy-MM-dd'"
116
+ :show-rest-button="reset"
117
+ v-model = "model.f_check_start">
118
+ </datepicker>
119
+ </div>
120
+ <div class="col-sm-4" style="width: 20%">
121
+ <label class="font_normal_body">安检结束</label>
122
+ <datepicker
123
+ :value.sync="model.f_check_end"
124
+ placeholder='最后安检时间结束'
125
+ :disabled-days-of-week="[]"
126
+ class="select select_list"
127
+ style="width: 60%"
128
+ :format="'yyyy-MM-dd'"
129
+ :show-rest-button="reset"
130
+ v-model = "model.f_check_end">
131
+ </datepicker>
132
+ </div>
133
+
134
+
135
+ <div class="col-sm-4" style="width: 20%">
136
+ <label class="font_normal_body">隐患情况</label>
137
+ <v-select
138
+ placeholder='隐患情况'
139
+ :value-single="true"
140
+ v-model='model.f_check_result'
141
+ class="select select_list"
142
+ :value.sync="model.f_check_result"
143
+ :options='$parent.$parent.f_check_results'
144
+ condition="f_last_check_result like '%{}%'"
145
+ close-on-select clear-button> </v-select>
146
+ </div>
147
+ <!--<div class="col-sm-4" style="width: 20%" v-if="$parent.$parent.orgstrs.length > 1">
148
+ <label class="font_normal_body">县域公司</label>
149
+ <v-select
150
+ placeholder='县域分公司'
151
+ :value-single="true"
152
+ v-model='model.f_orgstr'
153
+ :value.sync="model.f_orgstr"
154
+ class="select select_list"
155
+ :options='$parent.$parent.orgstrs'
156
+ condition="f_orgstr like '%{}%'"
157
+ close-on-select clear-button> </v-select>
158
+ </div>-->
159
+ <div class="col-sm-4" style="width: 20%">
160
+ <label class="font_normal_body">所属区域</label>
161
+ <v-select
162
+ placeholder='所属区域'
163
+ :value-single="true"
164
+ v-model='model.street'
165
+ :value.sync="model.street"
166
+ class="select select_list"
167
+ :options='$parent.$parent.streets'
168
+ condition="f_street ='{}'"
169
+ close-on-select clear-button> </v-select>
170
+ </div>
171
+ <div class="row">
172
+ <div class="col-sm-4" style="width: 20%">
173
+ <label class="font_normal_body">开户起始</label>
174
+ <datepicker
175
+ :value.sync="model.f_createfile_start"
176
+ placeholder='开户起始时间'
177
+ :disabled-days-of-week="[]"
178
+ class="select select_list"
179
+ style="width: 60%"
180
+ :format="'yyyy-MM-dd'"
181
+ :show-rest-button="reset"
182
+ condition="f_createfile_date > '{} 00:00:00'"
183
+ v-model = "model.f_createfile_start">
184
+ </datepicker>
185
+ </div>
186
+ <div class="col-sm-4" style="width: 20%">
187
+ <label class="font_normal_body">开户结束</label>
188
+ <datepicker
189
+ :value.sync="model.f_createfile_end"
190
+ placeholder='开户结束时间'
191
+ :disabled-days-of-week="[]"
192
+ class="select select_list"
193
+ style="width: 60%"
194
+ :format="'yyyy-MM-dd'"
195
+ condition="f_createfile_date < '{} 23:59:00'"
196
+ :show-rest-button="reset"
197
+ v-model = "model.f_createfile_end">
198
+ </datepicker>
199
+ </div>
200
+ <!--<div class="col-sm-4" style="width: 20%">
201
+ <label class="font_normal_body">是否入户</label>
202
+ <v-select
203
+ placeholder='今年是否入户'
204
+ :value-single="true"
205
+ class="select select_list"
206
+ :value.sync="$parent.$parent.hasHousehold"
207
+ :options='$parent.$parent.safe_rhs'
208
+ v-model="$parent.$parent.hasHousehold"
209
+ close-on-select clear-button> </v-select>
210
+ </div>-->
211
+ <div class="col-sm-4" style="width: 20%">
212
+ <label class="font_normal_body">安检项名</label>
213
+ <v-select
214
+ placeholder='安检项名'
215
+ :value-single="true"
216
+ class="select select_list"
217
+ :value.sync="$parent.$parent.check_item"
218
+ :options='$parent.$parent.check_items'
219
+ v-model="$parent.$parent.check_item"
220
+ close-on-select clear-button> </v-select>
221
+ </div>
222
+ <div class="col-sm-4" style="width: 20%">
223
+ <label class="font_normal_body">安检内容</label>
224
+ <v-select
225
+ placeholder='安检内容'
226
+ :value-single="true"
227
+ class="select select_list"
228
+ :value.sync="$parent.$parent.check_itemValue"
229
+ :options='$parent.$parent.check_itemValues'
230
+ v-model="$parent.$parent.check_itemValue"
231
+ close-on-select clear-button> </v-select>
232
+ </div>
233
+ <div class="col-sm-4" style="width: 20%">
234
+ <label class="font_normal_body">安检员</label>
235
+ <v-select
236
+ placeholder='安检员'
237
+ :value-single="true"
238
+ class="select select_list"
239
+ :value.sync="model.f_checker_id"
240
+ :options='$parent.$parent.checkersid'
241
+ v-model="model.f_checker_id"
242
+ condition="f_checker_id = '{}'"
243
+ close-on-select clear-button> </v-select>
244
+ </div>
245
+ <div class="col-sm-4" style="width: 20%">
246
+ <label class="font_normal_body">安检状态</label>
247
+ <v-select
248
+ placeholder='安检状态'
249
+ :value-single="true"
250
+ class="select select_list"
251
+ :value.sync="model.f_entry"
252
+ :options='$parent.$parent.f_entry_status'
253
+ v-model="model.f_entry"
254
+ condition="f_last_check_state= '{}'"
255
+ close-on-select clear-button> </v-select>
256
+ </div>
257
+ <div class="col-sm-8"></div>
258
+ <div style="float: right;margin-right: 10px">
259
+ <export-excel-safe :data="$parent.$parent.searchData"
260
+ :field="$parent.$parent.excelHeaders"
261
+ sqlurl="rs/logic/SafeExportExcel" sql-name="根据安检员查询用户档案" template-name='用户安检情况'></export-excel-safe>
262
+ <div style="float: right" class="button_spacing"
263
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
264
+ @click="$parent.$parent.hiddenr()"></div>
265
+ </div>
266
+ <div class="span" style = "float:right;margin-right:10px">
267
+ <button class="btn btn-primary width-80" @click="search()">查询</button>
268
+ </div>
269
+ <div class="span" style = "float:right;margin-right:10px">
270
+ <button class="btn btn-primary width-80" @click="$parent.$parent.show1()">年度安检率查看</button>
271
+ </div>
272
+ </div>
273
+ </div>
274
+ </div>
275
+ </criteria>
276
+ <data-grid :model="model" partial="list" class="table table-bordered table table-hover" v-ref:grid>
277
+ <template partial='head'>
278
+ <tr>
279
+ <th><nobr>用户编号</nobr></th>
280
+ <th><nobr>用户名称</nobr></th>
281
+ <th><nobr>用户电话</nobr></th>
282
+ <!--<th><nobr>今年入户次数</nobr></th>-->
283
+ <th><nobr>用户类型</nobr></th>
284
+ <th><nobr>小区名称</nobr></th>
285
+ <th><nobr>地址</nobr></th>
286
+ <th><nobr>建档日期</nobr></th>
287
+ <th><nobr>安检日期</nobr></th>
288
+ <th><nobr>安检状态</nobr></th>
289
+ <th><nobr>安检结果</nobr></th>
290
+ </tr>
291
+ </template>
292
+ <template partial='body'>
293
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_userinfo_code}}</td>
294
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_user_name}}</td>
295
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.f_user_phone}}</td>
296
+ <!--<td v-bind:class="{newcolor:row.code==1}" style="text-align: center;">{{row.r}}</td>-->
297
+ <td v-bind:class="{newcolor:row.code=='1'}" style="text-align: center">{{row.f_user_type}}</td>
298
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_residential_area}}</td>
299
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_address}}</td>
300
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_createfile_date}}</td>
301
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_last_check_date}}</td>
302
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{row.f_last_check_state}}</td>
303
+ <td v-bind:class="{newcolor:row.code==1}" style="text-align: center">{{$parent.$parent.$parent.getDefect(row.f_last_check_result)}}</td>
304
+ </template>
305
+ </data-grid>
306
+ </criteria-paged>
307
+ </div>
308
+ <modal :show.sync="showModal" v-ref:modal backdrop="false">
309
+ <div slot="modal-header" class="modal-header">
310
+ <h4 class="modal-title">
311
+ 年度安检率查看
312
+ </h4>
313
+ </div>
314
+ <div slot="modal-body" class="modal-body">
315
+ <div>
316
+ <form class="form-inline">
317
+ <div class="row form-group">
318
+ <div class="col-sm-4">
319
+ <label class="font_normal_body" >起始时间</label>
320
+ <datepicker
321
+ :value.sync="y_check_start"
322
+ placeholder='安检时间起始'
323
+ :disabled-days-of-week="[]"
324
+ class="select select_list"
325
+ style="width: 60%"
326
+ :format="'yyyy-MM-dd'"
327
+ :show-rest-button="reset"
328
+ v-model = "y_check_start">
329
+ </datepicker>
330
+ </div>
331
+ <div class="col-sm-4">
332
+ <label class="font_normal_body" >结束时间</label>
333
+ <datepicker
334
+ :value.sync="y_check_end"
335
+ placeholder='安检时间截止'
336
+ :disabled-days-of-week="[]"
337
+ class="select select_list"
338
+ style="width: 60%"
339
+ :format="'yyyy-MM-dd'"
340
+ :show-rest-button="reset"
341
+ v-model = "y_check_end">
342
+ </datepicker>
343
+ </div>
344
+ <button type="button" style="margin-left: 10px" class="button_search" @click="y_search()">查询</button>
345
+ </div>
346
+ <div class="row form-group">
347
+ <div class="col-sm-4">
348
+ <label class="font_normal_body">所属区域</label>
349
+ <v-select
350
+ placeholder='所属区域'
351
+ :value-single="true"
352
+ v-model='yearStreet'
353
+ :value.sync="yearStreet"
354
+ class="select select_list"
355
+ :options='streets'
356
+ close-on-select clear-button> </v-select>
357
+ </div>
358
+ </div>
359
+
360
+
361
+ <div style="width: 65%;height:100%; display: inline-block">
362
+ </div>
363
+
364
+ </form>
365
+ <hr>
366
+ <table class="table table_sy">
367
+ <thead>
368
+ <tr>
369
+ <th></th>
370
+ <th>总户数</th>
371
+ <th>安检入户数</th>
372
+ <th>一次安检率</th>
373
+ </tr>
374
+ </thead>
375
+ <tbody>
376
+ <tr v-for="row in yearmodel">
377
+ <td></td>
378
+ <td style="text-align: center;">{{row.con}}</td>
379
+ <td style="text-align: center;">{{row.rhcon}}</td>
380
+ <td style="text-align: center;">{{row.f_check_bv}}</td>
381
+ </tr>
382
+ </tbody>
383
+ </table>
384
+ </div>
385
+ </div>
386
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
387
+ <!--<button class="button_search button_spacing" @click="ok()">确认</button>-->
388
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
389
+ </div>
390
+ </modal>
391
+ </template>
392
+
393
+ <script>
394
+ import { PagedList } from 'vue-client'
395
+ import { HttpResetClass } from 'vue-client'
396
+ import co from 'co'
397
+ import * as Util from './../Util'
398
+ import Vue from 'vue'
399
+ import {toStandardDateString} from "./../Util";
400
+
401
+ let select = function* (self) {
402
+ let http = new HttpResetClass()
403
+ let getGasman = yield http.load('POST','/rs/search', {
404
+ source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
405
+ userid: self.$login.f.id
406
+ }, {resolveMsg: null, rejectMsg: null})
407
+ //tag
408
+ self.checkersid.push({label: '全部', value: ''})
409
+ getGasman.data.forEach((checker) => {
410
+ self.checkersid.push({label: checker.name, value: checker.id})
411
+ })
412
+ }
413
+
414
+ export default {
415
+ title: '民用用户安检情况',
416
+ data() {
417
+ let options = []
418
+ let year = (new Date()).getFullYear()
419
+ for (let i = year; i <= year + 3; i++)
420
+ options.push({label: i + '', value: i + ''})
421
+ let moptions = []
422
+ for (let i = 1; i <= 12; i++)
423
+ moptions.push({label: i + '', value: i + ''})
424
+
425
+ return {
426
+ y_check_start:`${new Date().getFullYear()}-01-01`,
427
+ y_check_end:`${new Date().getFullYear()}-12-31`,
428
+ searchData: {
429
+ condition: '1=1',
430
+ con1: '1=1',
431
+ con2: '1=1',
432
+ f_itemvalue:'',
433
+ f_itemname:'',
434
+ orderitem: "f_userinfo_code",
435
+ timetype:"dd" ,
436
+ f_filialeids:`(${this.$login.f.orgid})`
437
+ },
438
+ excelHeaders: {
439
+ //用户编号 用户名称 用户电话 安检次数 用户类型 小区名称 地址 安检日期 安检状态 安检结果
440
+
441
+ 'f_userinfo_code': '用户编号',
442
+ 'f_user_name': '用户名称',
443
+ 'f_user_phone': '用户电话',
444
+ //'count_item':'安检次数',
445
+ 'f_user_type': '用户类型',
446
+ 'f_residential_area': '小区名称',
447
+ 'f_address':'地址',
448
+ 'f_last_check_date':'安检日期',
449
+ 'f_last_check_state': '安检状态',
450
+ 'f_last_check_result':'安检结果'
451
+ },
452
+ model: new PagedList('rs/sql/根据安检员查询用户档案', 20, {orderitem: "'f_userinfo_code'",timetype:"'dd'" ,con1:"this.con1",con2:"this.con2",f_itemname:'this.check_item',f_itemvalue:'this.check_itemValue',f_filialeids:`'(${this.$login.f.orgid})'`}),
453
+ orgstrs:[{label: '全部', value: ''}],
454
+ checkersid:[],
455
+ SafeCheckXZ:'',
456
+ civil:'', //民用安检周期
457
+ civilian:'', //非民用安检周期
458
+ SafeCheckXZs: [{label: '全部', value: ''},{label: '已入户', value: '已入户'}, {label: '未入户', value: '未入户'}], // 安检筛选选项
459
+ safe_rhs: [{label: '全部', value: ''},{label: '今年已入户', value: '今年已入户'}, {label: '今年未入户', value: '今年未入户'}], // 安检筛选选项
460
+ SafeCheckSXs: [{label: '是', value: '是'}, {label: '否', value: '否'}, {label: '全部', value: ''},],
461
+ checkstatus:[{label: '全部', value: ''},{label: '到访不遇', value: '到访不遇'}, {label: '拒检', value: '拒检'}],
462
+ IsShares: [{label: '', value: '是'}, {label: '否', value: '否'}],
463
+ IsShare:'',
464
+ checker: {},
465
+ NoBuys:[{label: '是', value: '是'},{label: '否', value: '否'}],
466
+ criteriaShow: true,
467
+ checkers: [],
468
+ chosenOrg: {id: 0},
469
+ checkedAll: false,
470
+ checkrows: [],
471
+ yearmodel:[],
472
+ streets:[],
473
+ adjustables: [],
474
+ f_plan_year: year + '',
475
+ f_plan_month: moptions[new Date().getMonth()].value,
476
+ f_effective_start_time:'', //计划有效起始时间
477
+ f_effective_end_time:'', //计划有效结束时间
478
+ checkboxModel: {},
479
+ c_year_list: options,
480
+ c_month_list: moptions,
481
+ areas: this.areas(),
482
+ //checkstatus: this.checkstatus(),
483
+ usertypes: this.usertypes(),
484
+ userstates: this.userstates(),
485
+ sqlname:'',
486
+ f_check_results: [{label: '全部', value: ''}, {label: '正常', value: '正常'},{label: '有隐患', value: '有隐患'}],
487
+ creatPlanWay:'',
488
+ showModal:false,
489
+ yearStreet:'',
490
+ villagesModel:'', //小区绑定值
491
+ villagesChick:[], //小区选择值
492
+ buildingModel:'', //地址绑定值
493
+ buildingChick:[], //地址选择值
494
+ hasHousehold:'',
495
+ check_items:[{label: '全部', value: ''}, ...this.$appdata.getParam('安检项名')],
496
+ check_item:'',
497
+ check_itemValue:'',
498
+ f_entry_status: this.$appdata.getParam('安检状态'),
499
+ }
500
+ },
501
+ props: {
502
+ checkplan: { // 传入一条安检计划信息
503
+ type: Object
504
+ },
505
+ additemshow:{
506
+ type:Boolean,
507
+ default:false
508
+ }
509
+ },
510
+ ready() {
511
+ // 获取分公司信息
512
+ this.getfengongsi()
513
+ this.model.chosenOrg = {id: 0}
514
+ this.model.f_filialeids = this.$login.f.f_orgids
515
+ this.model.f_filiale = this.$login.f.f_fengongsi
516
+ this.model.f_OrgStr = this.$login.f.orgpathstr
517
+ this.initstreets()
518
+
519
+ //小区初始化
520
+ this.initVillage()
521
+ this.$refs.paged.$refs.criteria.model.f_check_start = Util.toStandardDateString()
522
+ this.$refs.paged.$refs.criteria.model.f_check_end = Util.toStandardDateString()
523
+ let gen = select(this)
524
+ co(gen)
525
+ // this.$refs.paged.$refs.criteria.search();
526
+ },
527
+ methods: {
528
+ show1(){
529
+ this.showModal=true
530
+ },
531
+ y_search(){
532
+ let condition=''
533
+ if(!this.y_check_start || !this.y_check_end){
534
+ this.$showMessage("请选择开始和结束时间")
535
+ }
536
+ condition += `and f_onsite_time > '${this.y_check_start} 00:00:00' and f_onsite_time < '${this.y_check_end} 23:59:59'`
537
+ new HttpResetClass().load('POST', 'rs/sql/FetchYearCheckRatio', {
538
+ data: {
539
+ condition: condition,
540
+ f_createfile_date:this.y_check_end+' 23:59:59',
541
+ usertype:'民用',
542
+ f_street:this.yearStreet
543
+ }
544
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((res)=>{
545
+ console.log('---'+JSON.stringify(res))
546
+ this.yearmodel=res.data
547
+ })
548
+ },
549
+ //初始化小区
550
+ async initVillage(){
551
+ this.villagesChick = []
552
+ let HttpReset = new HttpResetClass()
553
+ let req = await HttpReset.load('POST', 'rs/sql/safe_singleTable_GroupBy', {
554
+ data: {
555
+ items: 'f_residential_area',
556
+ tablename: 't_area',
557
+ condition: '1 = 1',
558
+ groupitem: 'f_residential_area'
559
+ }
560
+ }, {resolveMsg: null, rejectMsg: '获取小区列表失败!'})
561
+ let redata = []
562
+ req.data.forEach((row, n) => {
563
+ redata.push({label: row.f_residential_area,value: row.f_residential_area,data:row})
564
+ })
565
+ redata.unshift({label: '全部', value: '', data: ''})
566
+ this.villagesChick=redata
567
+ },
568
+ //初始化街道 添加小区
569
+ async initstreets(){
570
+ this.streetslist = []
571
+ let HttpReset = new HttpResetClass()
572
+ let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
573
+ data: {
574
+ items: '*',
575
+ tablename: 't_street',
576
+ orderitem: 'id',
577
+ condition: `f_orgid = '${this.$login.f.orgid}'`
578
+ }
579
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
580
+ let redata = []
581
+ req.data.forEach((row, n) => {
582
+ redata.push({label: row.f_street,value: row.f_street,data:row,id:row.id})
583
+ })
584
+ this.streets=redata
585
+ },
586
+ hiddenr() {
587
+ this.$parent.showItem = !this.$parent.showItem
588
+ },
589
+ hidden() {
590
+ this.criteriaShow = !this.criteriaShow
591
+ },
592
+ // 获取县域分公司内容
593
+ getfengongsi(){
594
+ let val = {source: 'this.getParentByType($organization$).getSpecialResByType($organization$)', userid: `${this.$login.f.id}`}
595
+ let http = new HttpResetClass()
596
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
597
+ res.data.forEach((item) => {
598
+ this.orgstrs.push({label: item.name, value: item.id})
599
+ })
600
+ console.log(this.orgstrs.length)
601
+ })
602
+ },
603
+ // 县域分公司发生改变
604
+ // orgstrchange(val){
605
+ // if(val == undefined || val == ''){
606
+ // return
607
+ // }else {
608
+ // this.checkersid = []
609
+ // let gen = select(this,val)
610
+ // return co(gen)
611
+ // }
612
+ // },
613
+ getDefect(val){
614
+ if(val){
615
+ try {
616
+ var defect = JSON.parse(val)
617
+ return defect.result
618
+ }catch (e) {
619
+ console.log(val)
620
+ return '正常'
621
+ }
622
+ }
623
+ return '正常'
624
+ },
625
+ checkerchange(val) {
626
+ this.checkboxModel.f_checker = val.name
627
+ this.checkboxModel.f_checker_id = val.id
628
+ },
629
+ search(args) {
630
+ if(this.SafeCheckXZ && (args.model.f_check_start == '' || args.model.f_check_end == '')){
631
+ this.$showMessage('如果选择 已安检/未安检 选项,需要选择 安检起始和结束时间!')
632
+ return
633
+ }
634
+ if((args.model.f_check_start || args.model.f_check_end ) && !this.SafeCheckXZ ){
635
+ this.$showMessage('如果录入安检起始结束时间,需要选择 安检筛选 选项!')
636
+ return
637
+ }
638
+ let con1='1=1 '
639
+ let con2='1=1 '
640
+ if(this.SafeCheckXZ == '已入户'){
641
+ args.condition += " and r > 0"
642
+ con1 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
643
+ con2 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
644
+ //args.condition += " and ( f_last_check_date > '"+ args.model.f_check_end + " 23:59:00' or f_last_check_date < '"+ args.model.f_check_start + " 00:00:00' or f_last_check_date is null)"
645
+ } else if(this.SafeCheckXZ == '未入户') {
646
+ args.condition += " and r < 1"
647
+ con1 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
648
+ con2 += ` and f_offsite_time > '${args.model.f_check_start}' and f_offsite_time < '${args.model.f_check_end}'`
649
+ if(args.model.f_check_state=='到访不遇'){
650
+ args.condition += " and d > 0"
651
+ }else if(args.model.f_check_state=='拒检'){
652
+ args.condition += " and j > 0"
653
+ }
654
+ }
655
+ this.model.check_item=this.check_item
656
+ this.model.check_itemValue=this.check_itemValue
657
+ /*if(this.hasHousehold=='今年已入户'){
658
+ args.condition += " and rhcon is not null"
659
+ }else if(this.hasHousehold=='今年未入户'){
660
+ args.condition += " and rhcon is null"
661
+ }*/
662
+ args.condition += " and f_filialeid = '" + this.$login.f.orgid + "' and f_user_type='民用'"
663
+ this.searchData.condition=args.condition
664
+ this.searchData.con1=con1
665
+ this.searchData.con2=con2
666
+ this.searchData.f_itemvalue=this.check_item
667
+ this.searchData.f_itemname=this.check_itemValue
668
+ this.model.con1=con1
669
+ this.model.con2=con2
670
+ return this.model.search( args.condition, args.model)
671
+ },
672
+ /*checkstatus() {
673
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]
674
+ },*/
675
+ usertypes() {
676
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]
677
+ },
678
+ userstates() {
679
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('用户状态')]
680
+ },
681
+ show() {
682
+ this.criteriaShow = true
683
+ },
684
+ hidden() {
685
+ this.criteriaShow = false
686
+ },
687
+ confirm() {
688
+ if (!this.checkboxModel.f_plan_name) {
689
+ this.$showMessage('请填写安检计划名称!')
690
+ return
691
+ }
692
+ // if(this.f_effective_start_time == ''){
693
+ // this.$showMessage('请选择有效起始日期!')
694
+ // return
695
+ // }
696
+ // if(this.f_effective_end_time == ''){
697
+ // this.$showMessage('请选择有效结束日期!')
698
+ // return
699
+ // }
700
+ if(this.IsShare == ''){
701
+ if (!this.checkboxModel.f_checker_id) {
702
+ this.$showMessage('请选择安检员!')
703
+ return
704
+ }
705
+ }
706
+ let gen = saveGen(this)
707
+ return co(gen)
708
+ },
709
+ changeStates() {
710
+ if (this.checkedAll) {//实现反选/
711
+ this.checkrows = [];
712
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
713
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
714
+ }
715
+ } else {//实现全选
716
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
717
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
718
+ }
719
+ let _this = this
720
+ let condition = this.$refs.paged.$refs.criteria.condition
721
+ let url = this.model.url
722
+ this.$resetpost(`${url}?pageSize=9999999`, {
723
+ data: {
724
+ condition: condition,
725
+ groupitem: '',
726
+ orderitem: 'f_residential_area',
727
+ f_usertype:this.model.f_usertype,
728
+ f_filialeids: this.model.f_filialeids,
729
+ month: this.model.month,
730
+ safeCycle:this.model.safeCycle,
731
+ f_checktime_start:this.model.f_checktime_start,
732
+ f_checktime_end:this.model.f_checktime_end,
733
+ SafeCheckSX: this.model.SafeCheckSX,
734
+ f_last_check_state: this.model.f_last_check_state
735
+ },
736
+ },{resolveMsg: null, rejectMsg: null}, -1).then(
737
+ (respanse) => {
738
+ if (respanse.data.length >= 5000) {
739
+ this.$showMessage("数据量太大,请重新选择")
740
+ } else {
741
+ _this.checkrows = []
742
+ for (let j = 0; j < respanse.data.length; j++) {
743
+ _this.checkrows.push(respanse.data[j])
744
+ }
745
+ console.log(_this.checkrows);
746
+ }
747
+ })
748
+ }
749
+ },
750
+ addChecked(item) {
751
+ console.log(item);
752
+ if (!item.checked) {
753
+ this.checkrows.push(item);
754
+ console.log(this.checkrows);
755
+ } else {
756
+ for (let i = 0; i < this.checkrows.length; i++) {
757
+ if (item.f_userinfo_id == this.checkrows[i].f_userinfo_id) {
758
+ this.checkrows.splice(i, 1)
759
+ }
760
+ }
761
+ }
762
+ },
763
+ ToshowModal() {
764
+ this.creatPlanWay = 'single'
765
+ if (this.checkrows.length > 0) {
766
+ this.showModal = true
767
+ } else {
768
+ this.$showMessage("请选择需要安检的用户!")
769
+ }
770
+ },
771
+ FiltrationPlan(){
772
+ if(this.model.rows.length == 0){
773
+ this.$showMessage("暂无可生成的计划!")
774
+ return
775
+ }
776
+ this.creatPlanWay = 'filtration'
777
+ this.showModal = true
778
+ },
779
+ AllPlan() {
780
+ if(this.model.rows.length == 0){
781
+ this.$showMessage("暂无可生成的计划!")
782
+ return
783
+ }
784
+ this.creatPlanWay = 'all'
785
+ this.showModal = true
786
+ },
787
+ cancel() {
788
+ this.showModal = false
789
+ },
790
+ areas() {
791
+ let rs = []
792
+ for (let i = 0; i < this.$login.f.f_allArea.length; i++) {
793
+ let temp = {
794
+ label: this.$login.f.f_allArea[i].label,
795
+ value: this.$login.f.f_allArea[i].label
796
+ }
797
+ rs.push(temp)
798
+ }
799
+ return [{label: '全部', value: ''}, ...rs]
800
+ },
801
+ initAdjustables() {
802
+ console.log('初始化调压箱', this.$GetSaleParam)
803
+ let arr = []
804
+ let filter = this.$login.f.f_orgids
805
+ this.$GetSaleParam.getAdjustable(filter).forEach((item) => {
806
+ let temp = {}
807
+ temp.label = `[${item.value.f_adjustable_id}]-${item.label}`
808
+ temp.value = `${item.value.id}`
809
+ arr.push(temp)
810
+ })
811
+ this.adjustables = [{label: '全部', value: ''}, ...arr]
812
+ },
813
+ },
814
+
815
+ watch: {
816
+ 'check_item'(){
817
+ this.check_itemValue=''
818
+ },
819
+ 'model.model.f_residential_area'(){
820
+ this.model.model.f_building = []
821
+ this.buildingChick = []
822
+ if (!this.model.model){
823
+ return
824
+ }
825
+ if (!this.model.model.f_residential_area){
826
+ return
827
+ }
828
+ let HttpReset = new HttpResetClass()
829
+ let redata = []
830
+ HttpReset.load('POST', '/rs/sql/safe_singleTable_GroupBy', {
831
+ data: {
832
+ items: "f_building",
833
+ tablename: "t_user_address",
834
+ condition: `f_filialeid = ${this.$login.f.orgid} and f_residential_area= '${this.model.model.f_residential_area}'`,
835
+ groupitem: "f_building order by cast((case PATINDEX('%[^0-9]%', f_building) when 0 then f_building else 999 end) as int)"
836
+ }
837
+ }, {resolveMsg: null, rejectMsg: '获取楼栋列表失败!'}).then(res=>{
838
+ res.data.forEach((row, n) => {
839
+ redata.push({ label: row.f_building,value: row.f_building,data:row})
840
+ })
841
+ this.buildingChick = redata;
842
+ })
843
+ },
844
+ 'model.f_usertype'(val){
845
+ if(val == '民用'){
846
+ this.model.safeCycle = this.civil
847
+ }else if(val == '非民用'){
848
+ this.model.safeCycle = this.civilian
849
+ }
850
+ },
851
+ 'model.SafeCheckXZ'(val) {
852
+ this.model.SafeCheckSC = ''
853
+ if (val == '已安检') {
854
+ this.model.SafeCheckCQ = ''
855
+ this.model.SafeCheckSX = {
856
+ f_check_end: '', // 安检时间 查询起始条件
857
+ f_check_start: ''// 安检时间 查询终止条件
858
+ }
859
+ } else {
860
+ // 当使用筛选条件时,清空不需要的条件选项
861
+ this.model.f_issue_start = ''
862
+ this.model.f_issue_end = ''
863
+ this.$refs.paged.$refs.criteria.model.f_check_start = ''
864
+ this.$refs.paged.$refs.criteria.model.f_check_end = ''
865
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
866
+ this.model.month = ''
867
+ if(val == '应安检'){
868
+ this.model.SafeCheckSC = '否'
869
+
870
+ this.model.f_issue_start = Util.toStartDateString()
871
+ this.model.f_issue_end = Util.toStandardDateString()
872
+ }
873
+ // this.model.f_checktime_start = ''
874
+ // this.model.f_checktime_end = ''
875
+ }
876
+ },
877
+ 'model.SafeCheckSC'(val) {
878
+ if (val == '') {
879
+ this.model.f_issue_start = ''
880
+ this.model.f_issue_end = ''
881
+ }
882
+ },
883
+ // 'checker'(val){
884
+ // console.log("checker",this.checker)
885
+ // if(val){
886
+ // this.checkboxModel.f_checker = this.checker[0].name
887
+ // this.checkboxModel.f_checker_id = this.checker[0].id
888
+ // }
889
+ // },
890
+ 'model.rows'() {
891
+ // if (!this.checkedAll) {//实现反选/
892
+ // this.checkrows = [];
893
+ for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
894
+ var k = false
895
+ for (let j = 0; j < this.checkrows.length; j++) {
896
+ if (this.$refs.paged.model.rows[i].f_userinfo_id == this.checkrows[j].f_userinfo_id) {
897
+ this.$set('$refs.paged.model.rows[' + i + '].checked', true)
898
+ k = true
899
+ continue
900
+ }
901
+ }
902
+ if (!k) {
903
+ this.$set('$refs.paged.model.rows[' + i + '].checked', false)
904
+ }
905
+ }
906
+ // } else {//实现全选
907
+ // // this.checkboxModel = {};
908
+ // for (let i = 0; i < this.$refs.paged.model.rows.length; i++) {
909
+ // this.$set('$refs.paged.model.rows[' + i + '].checked', true)
910
+ // }
911
+ // }
912
+ }
913
+ },
914
+ computed: {
915
+ selected() {
916
+ return this.$refs.paged.$refs.grid.selected
917
+ },
918
+ check_itemValues(){
919
+ return [ ...this.$appdata.getParam(this.check_item)]
920
+ }
921
+ }
922
+ }
923
+ </script>
924
+ <style scoped>
925
+ .newcolor{
926
+ color:red;
927
+ }
928
+ .table th{
929
+ background-color: #f2f6fa;
930
+ color: black;
931
+ }
932
+ </style>