safecheck-client 3.0.30-48 → 3.0.30-49

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,1136 +1,1136 @@
1
- <template>
2
- <div class="flex">
3
- <work-busy :is-busy="isbusy"></work-busy>
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row" v-show="!$parent.$parent.$parent.showItem">
8
- <div :class="$parent.$parent.style">
9
- <label class="font_normal_body">安检计划</label>
10
- <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
11
- @click="$parent.$parent.showChooser"
12
- style="width: 60%" placeholder="安检计划" readonly="readonly">
13
- </div>
14
- <div :class="$parent.$parent.style">
15
- <label class="font_normal_body">存在隐患</label>
16
- <v-select style="width:60% "
17
- class="select select_list"
18
- :value.sync="model.f_has_defect"
19
- v-model="model.f_has_defect"
20
- :options='$parent.$parent.hasDefectOptions'
21
- :placeholder='model.f_has_defect'
22
- condition="f_has_defect = '{}'"
23
- close-on-select>
24
- </v-select>
25
- </div>
26
- <div :class="$parent.$parent.style">
27
- <label class="font_normal_body">用户编号</label>
28
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
29
- condition="f_userinfo_code = '{}'"
30
- style="width: 60%" placeholder="用户编号">
31
- </div>
32
- <div :class="$parent.$parent.style">
33
- <label class="font_normal_body">处理情况</label>
34
- <v-select
35
- placeholder='处理情况'
36
- :value-single="true"
37
- class="select select_list" style="width: 60%"
38
- v-model='model.f_is_deal'
39
- :value.sync="model.f_is_deal"
40
- :options='$parent.$parent.deals'
41
- condition="f_is_deal = '{}'"
42
- close-on-select clear-button></v-select>
43
- </div>
44
- <div class=" col-sm-4 form-group button-range">
45
- <div class="span" style="float: right;margin-top: 8px">
46
- <div style="float: right" class="button_spacing"
47
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
48
- @click="$parent.$parent.hiddenr()"></div>
49
- <div style="float: right" class="button_spacing"
50
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
51
- @click="$parent.$parent.hidden()"></div>
52
- <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
53
- <!-- <button style="float: right" class="button_search button_spacing" @click="$parent.$parent.toRepair">转维修</button>-->
54
- <div style="float: right">
55
- <export-excel-safe
56
- :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids,f_defect_content:$parent.$parent.model.f_defect_content}"
57
- :field="$parent.$parent.getfield"
58
- progress="safeGetExportProgress"
59
- sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefectNew2" template-name='安检隐患明细'
60
- :choose-col="true"></export-excel-safe>
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- <div class="row" v-show="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
66
- <div :class="$parent.$parent.style">
67
- <label class="font_normal_body">片&emsp;&emsp;区</label>
68
- <v-select class="select_list select"
69
- placeholder='片区/管理站' style="width: 60%"
70
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
71
- :options='$parent.$parent.sliceArea'
72
- filer-key="name"
73
- close-on-select clear-button
74
- condition="f_slice_area='{}'"
75
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
76
- :value-single="true">
77
- </v-select>
78
- </div>
79
- <div :class="$parent.$parent.style2" style="margin: 0">
80
- <role-selector-safe
81
- role-name="安检员"
82
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
83
- :resobjprop.sync="$parent.$parent.resids"
84
- @re-res="$parent.$parent.getRes"
85
- :value.sync="model.f_checker_id"
86
- v-model="model.f_checker_id"
87
- condition="f_checker_name = '{}'">
88
- </role-selector-safe>
89
- </div>
90
-
91
- <div :class="$parent.$parent.style">
92
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
93
- <v-select class="select_list select"
94
- placeholder='抄表册' style="width: 60%"
95
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
96
- :options='$parent.$parent.cbc'
97
- filer-key="name"
98
- close-on-select clear-button
99
- condition="f_meter_book_num={}"
100
- :value-single="true">
101
- </v-select>
102
- </div>
103
- <div :class="$parent.$parent.style">
104
- <label class="font_normal_body">起始时间</label>
105
- <datepicker
106
- placeholder='起始时间' style="width:60%"
107
- :disabled-days-of-week="[]"
108
- :format="'yyyy-MM-dd'"
109
- :show-rest-button="reset"
110
- :value.sync="model.f_start_time"
111
- v-model="model.f_start_time"
112
- condition="f_offsite_time >= '{} 00:00:00'">
113
- </datepicker>
114
- </div>
115
- <div :class="$parent.$parent.style">
116
- <label class="font_normal_body">结束时间</label>
117
- <datepicker
118
- placeholder='结束时间' style="width:60%"
119
- :disabled-days-of-week="[]"
120
- :format="'yyyy-MM-dd'"
121
- :show-rest-button="reset"
122
- :value.sync="model.f_end_time"
123
- v-model="model.f_end_time"
124
- condition="f_offsite_time <= '{} 23:59:59'">
125
- </datepicker>
126
- </div>
127
-
128
-
129
- </div>
130
- <div class="row" v-show="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
131
-
132
- <div :class="$parent.$parent.style">
133
- <label class="font_normal_body">维&ensp;修&ensp;员</label>
134
- <input type="text" class="input_search" v-model="model.f_repairman"
135
- condition="f_repairman = '{}'"
136
- style="width: 60%" placeholder="维修员">
137
- </div>
138
- <div :class="$parent.$parent.style">
139
- <label class="font_normal_body">用户姓名</label>
140
- <input type="text" class="input_search" v-model="model.f_user_name"
141
- condition="f_user_name like '%{}%'"
142
- style="width: 60%" placeholder="用户姓名">
143
- </div>
144
- <div :class="$parent.$parent.style">
145
- <label class="font_normal_body">用户地址</label>
146
- <input type="text" class="input_search" v-model="model.f_address"
147
- condition="f_address like '%{}%'"
148
- style="width: 60%" placeholder="用户地址">
149
- </div>
150
- <div :class="$parent.$parent.style">
151
- <label class="font_normal_body">用户电话</label>
152
- <input type="text" class="input_search" v-model="model.f_user_phone"
153
- condition="f_user_phone = '{}'"
154
- style="width: 60%" placeholder="用户电话">
155
- </div>
156
- <div :class="$parent.$parent.style">
157
- <label class="font_normal_body">用户表号</label>
158
- <input type="text" class="input_search" v-model="model.f_meternumber"
159
- condition="f_meternumber = '{}'"
160
- style="width: 60%" placeholder="用户表号">
161
- </div>
162
- <div :class="$parent.$parent.style">
163
- <label class="font_normal_body">隐&ensp;患&ensp;项</label>
164
- <v-select
165
- placeholder='隐患项'
166
- :value-single="true"
167
- class="select select_list" style="width: 60%"
168
- v-model='model.f_defect_content'
169
- :value.sync="model.f_defect_content"
170
- :options='$parent.$parent.f_defect_contents'
171
- condition="f_defect_content like '%{}%'"
172
- close-on-select clear-button></v-select>
173
- </div>
174
- <div :class="$parent.$parent.style">
175
- <label class="font_normal_body">最后一次隐患处理时间</label>
176
- <datepicker
177
- placeholder='起始时间' style="width:60%"
178
- :disabled-days-of-week="[]"
179
- :format="'yyyy-MM-dd'"
180
- :show-rest-button="reset"
181
- :value.sync="model.f_repair_start"
182
- v-model="model.f_repair_start"
183
- condition="f_repair_date >= '{} 00:00:00'">
184
- </datepicker>
185
- </div>
186
- <div :class="$parent.$parent.style">
187
- <label class="font_normal_body">最后一次隐患处理时间</label>
188
- <datepicker
189
- placeholder='结束时间' style="width:60%"
190
- :disabled-days-of-week="[]"
191
- :format="'yyyy-MM-dd'"
192
- :show-rest-button="reset"
193
- :value.sync="model.f_repair_end"
194
- v-model="model.f_repair_end"
195
- condition="f_repair_date<= '{} 23:59:59'">
196
- </datepicker>
197
- </div>
198
- </div>
199
-
200
-
201
- <div class="row" v-show="$parent.$parent.$parent.showItem">
202
- <div :class="$parent.$parent.style">
203
- <label class="font_normal_body">安检计划</label>
204
- <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
205
- @click="$parent.$parent.showChooser"
206
- style="width: 60%" placeholder="安检计划" readonly="readonly">
207
- </div>
208
- <div :class="$parent.$parent.style">
209
- <label class="font_normal_body">存在隐患</label>
210
- <v-select style="width:60% "
211
- class="select select_list"
212
- :value.sync="model.f_has_defect"
213
- v-model="model.f_has_defect"
214
- :options='$parent.$parent.hasDefectOptions'
215
- :placeholder='model.f_has_defect'
216
- condition="f_has_defect = '{}'"
217
- close-on-select>
218
- </v-select>
219
- </div>
220
-
221
- <div class=" col-sm-4 form-group button-range">
222
- <div class="span" style="float: right;margin-top: 8px;margin-right: 50px">
223
- <div style="float: right" class="button_spacing"
224
- :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
225
- @click="$parent.$parent.hiddenr()"></div>
226
- <div style="float: right" class="button_spacing"
227
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
228
- @click="$parent.$parent.hidden()"></div>
229
- <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
230
- <!-- <button style="float: right" class="button_search button_spacing" @click="$parent.$parent.toRepair">转维修</button>-->
231
- <div style="float: right">
232
- <export-excel-old
233
- :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids}"
234
- :field="$parent.$parent.getfield"
235
- progress="safeGetExportProgress"
236
- sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefectNew2" template-name='安检计划明细'
237
- :choose-col="true"></export-excel-old>
238
- </div>
239
- </div>
240
- </div>
241
-
242
-
243
- </div>
244
- <div class="row" v-show="$parent.$parent.criteriaShow&&$parent.$parent.$parent.showItem">
245
- <div :class="$parent.$parent.style">
246
- <label class="font_normal_body">用户编号</label>
247
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
248
- condition="f_userinfo_code = '{}'"
249
- style="width: 60%" placeholder="用户编号">
250
- </div>
251
- <div :class="$parent.$parent.style">
252
- <label class="font_normal_body">结果查询</label>
253
- <v-select
254
- placeholder='处理结果查询'
255
- :value-single="true"
256
- class="select select_list" style="width: 60%"
257
- v-model='model.f_repaired'
258
- :value.sync="model.f_repaired"
259
- :options='$parent.$parent.repaired'
260
- condition="f_repaired = '{}'"
261
- close-on-select clear-button></v-select>
262
- </div>
263
-
264
- <div :class="$parent.$parent.style2" style="margin: 0">
265
- <role-selector-safe
266
- role-name="安检员"
267
- :resobjprop.sync="$parent.$parent.resids"
268
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
269
- @re-res="$parent.$parent.getRes"
270
- :value.sync="model.f_checker_id"
271
- v-model="model.f_checker_id"
272
- condition="f_checker_name = '{}'">
273
- </role-selector-safe>
274
- </div>
275
- </div>
276
- <div class="row" v-show="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
277
- <div :class="$parent.$parent.style">
278
- <label class="font_normal_body">片&emsp;&emsp;区</label>
279
- <v-select class="select_list select"
280
- placeholder='片区/管理站' style="width: 60%"
281
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
282
- :options='$parent.$parent.sliceArea'
283
- filer-key="name"
284
- close-on-select clear-button
285
- condition="f_slice_area='{}'"
286
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
287
- :value-single="true">
288
- </v-select>
289
- </div>
290
- <div :class="$parent.$parent.style">
291
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
292
- <v-select class="select_list select"
293
- placeholder='抄表册' style="width: 60%"
294
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
295
- :options='$parent.$parent.cbc'
296
- filer-key="name"
297
- close-on-select clear-button
298
- condition="f_meter_book_num={}"
299
- :value-single="true">
300
- </v-select>
301
- </div>
302
- <div :class="$parent.$parent.style">
303
- <label class="font_normal_body">起始时间</label>
304
- <datepicker
305
- placeholder='起始时间' style="width:60%"
306
- :disabled-days-of-week="[]"
307
- :format="'yyyy-MM-dd'"
308
- :show-rest-button="reset"
309
- :value.sync="model.f_start_time"
310
- v-model="model.f_start_time"
311
- condition="f_offsite_time >= '{} 00:00:00'">
312
- </datepicker>
313
- </div>
314
- <div :class="$parent.$parent.style">
315
- <label class="font_normal_body">结束时间</label>
316
- <datepicker
317
- placeholder='结束时间' style="width:60%"
318
- :disabled-days-of-week="[]"
319
- :format="'yyyy-MM-dd'"
320
- :show-rest-button="reset"
321
- :value.sync="model.f_end_time"
322
- v-model="model.f_end_time"
323
- condition="f_offsite_time <= '{} 23:59:59'">
324
- </datepicker>
325
- </div>
326
-
327
-
328
- </div>
329
- <div class="row" v-show="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
330
-
331
- <div :class="$parent.$parent.style">
332
- <label class="font_normal_body">维&ensp;修&ensp;员</label>
333
- <input type="text" class="input_search" v-model="model.f_repairman"
334
- condition="f_repairman = '{}'"
335
- style="width: 60%" placeholder="维修员">
336
- </div>
337
- <div :class="$parent.$parent.style">
338
- <label class="font_normal_body">处理查询</label>
339
- <v-select
340
- placeholder='处理结果查询'
341
- :value-single="true"
342
- class="select select_list" style="width: 60%"
343
- v-model='model.f_is_deal'
344
- :value.sync="model.f_is_deal"
345
- :options='$parent.$parent.deals'
346
- condition="f_is_deal = '{}'"
347
- close-on-select clear-button></v-select>
348
- </div>
349
- </div>
350
- </div>
351
- </criteria>
352
- <data-grid :model="model" partial='list' v-ref:grid class="list_area table_sy">
353
- <template partial='head'>
354
- <tr>
355
- <!-- <th><nobr><input type="checkbox" v-model="$parent.$parent.$parent.checkAll" @click.stop="()=>{return}" />全选</nobr></th>-->
356
- <th>
357
- <nobr>入户状态</nobr>
358
- </th>
359
- <th>
360
- <nobr>用户编号</nobr>
361
- </th>
362
- <th>
363
- <nobr>用户名</nobr>
364
- </th>
365
- <th>
366
- <nobr>用户电话</nobr>
367
- </th>
368
- <th>
369
- <nobr>用户小区</nobr>
370
- </th>
371
- <th>
372
- <nobr>用户地址</nobr>
373
- </th>
374
- <th>
375
- <nobr>用户表号</nobr>
376
- </th>
377
- <th>
378
- <nobr>安检时间</nobr>
379
- </th>
380
- <th>
381
- <nobr>安检员</nobr>
382
- </th>
383
- <th>
384
- <nobr>计划名</nobr>
385
- </th>
386
- <th>
387
- <nobr>是否有隐患</nobr>
388
- </th>
389
- <th>
390
- <nobr>隐患数</nobr>
391
- </th>
392
- <th>
393
- <nobr>处理数</nobr>
394
- </th>
395
- <th>
396
- <nobr>处理情况</nobr>
397
- </th>
398
- <th>
399
- <nobr>维修员</nobr>
400
- </th>
401
- <th>
402
- <nobr>隐患明细</nobr>
403
- </th>
404
- <th>
405
- <nobr>最后一次隐患处理时间</nobr>
406
- </th>
407
- </tr>
408
- </template>
409
- <template partial='body'>
410
- <!-- <td style="text-align: center;white-space:nowrap;"><input type="checkbox" @click="$event.cancelBubble=true" :checked="$parent.$parent.$parent.isChecked(row.id)" @change="$parent.$parent.$parent.setCheckes(row.id)"></input></td>-->
411
- <td style="text-align: center;white-space:nowrap;">{{ row.f_entry_status }}</td>
412
- <td style="text-align: center;white-space:nowrap;">{{ row.f_userinfo_code }}</td>
413
- <td style="text-align: center;white-space:nowrap;">{{ row.f_user_name }}</td>
414
- <td style="text-align: center;white-space:nowrap;">{{ row.f_user_phone }}</td>
415
- <td style="text-align: center;white-space:nowrap;">{{ row.f_residential_area }}</td>
416
- <td style="text-align: center;white-space:nowrap;">{{ row.f_address }}</td>
417
- <td style="text-align: center;white-space:nowrap;">{{ row.f_meternumber }}</td>
418
- <td style="text-align: center;white-space:nowrap;">{{ row.f_offsite_time }}</td>
419
- <td style="text-align: center;white-space:nowrap;">{{ row.f_checker_name }}</td>
420
- <td style="text-align: center;white-space:nowrap;">{{ row.f_plan_name }}</td>
421
- <td style="text-align: center;white-space:nowrap;">{{ row.f_has_defect }}</td>
422
- <td style="text-align: center;white-space:nowrap;">{{ row.f_defect_count }}</td>
423
- <td style="text-align: center;white-space:nowrap;">{{ row.f_deal_count }}</td>
424
- <td style="text-align: center;white-space:nowrap;">{{ row.f_is_deal }}</td>
425
- <td style="text-align: center;white-space:nowrap;">{{ row.f_repairman }}</td>
426
- <td style="text-align: center;white-space:nowrap;">
427
- {{ $parent.$parent.$parent.trouble(row.f_defect_content) }}
428
- </td>
429
- <td style="text-align: center;white-space:nowrap;">
430
- {{row.f_repair_date}}
431
- </td>
432
- </template>
433
- </data-grid>
434
- </criteria-paged>
435
-
436
- <modal :show.sync="showModal" v-ref:modal>
437
- <div slot="modal-header" class="modal-header">
438
- <h4 class="modal-title">
439
- 选择计划
440
- </h4>
441
- </div>
442
- <div slot="modal-body" class="modal-body">
443
- <plan-chooser :f.sync="this.$login.f" v-ref:chooser></plan-chooser>
444
- </div>
445
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
446
- <button class="button_search" @click="ok">确认</button>
447
- <button class="button_search" @click="cancel">取消</button>
448
- </div>
449
- </modal>
450
- <modal :show.sync="showModal2" :backdrop="false">
451
- <div slot="modal-header" class="modal-header">
452
- <h4 class="modal-title">
453
- 转维修
454
- </h4>
455
- </div>
456
- <div slot="modal-body" class="modal-body">
457
- <div v-if="true">
458
- <div class="row" style="margin-top: 10px">
459
- <label class="control-label font text-left"
460
- style="float:left;margin-left:20%;margin-top:5px">派发类型</label>
461
- <div class="col-xs-8 col-md-8">
462
- <v-select :value.sync="selectData.dispatchType" :value-single="true" v-model="selectData.dispatchType"
463
- :options='dispatchTypeOptions' placeholder='派发类型'
464
- close-on-select>
465
- </v-select>
466
- </div>
467
- </div>
468
- <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给维修员'">
469
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">维&ensp;修&ensp;员</label>
470
- <div class="col-xs-8 col-md-8">
471
- <v-select
472
- :value.sync="selectData.f_repairman"
473
- :value-single="true"
474
- :options='repairers'
475
- placeholder='请选择维修员'
476
- close-on-select></v-select>
477
- </div>
478
- </div>
479
- <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给站点'">
480
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">站&ensp;&ensp;&ensp;&ensp;点</label>
481
- <div class="col-xs-8 col-md-8">
482
- <right-tree
483
- islist
484
- :userid="userid"
485
- :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
486
- @re-res="getSiteRes"></right-tree>
487
- </div>
488
- </div>
489
- <div class="row" style="margin-top: 10px">
490
- <label class="control-label font text-left"
491
- style="float:left;margin-left:20%;margin-top:5px">报修类型</label>
492
- <div class="col-xs-8 col-md-8">
493
- <v-select :value.sync="selectData.f_repairtype" style="width:60%"
494
- class="select select_list"
495
- :value-single="true"
496
- :options='repairTypeOptions'
497
- close-on-select>
498
- </v-select>
499
- </div>
500
- </div>
501
- <div class="row" style="margin-top: 10px">
502
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
503
- <div class="col-xs-8 col-md-8">
504
- <textarea style="width: 60%; height: 100px" v-model="selectData.f_remarks"></textarea>
505
- </div>
506
- </div>
507
- </div>
508
- </div>
509
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
510
- <!-- <button class="button_search" @click="rectification">转维修</button>-->
511
- <button class="button_search" @click="cancel1">取消</button>
512
- </div>
513
- </modal>
514
- <modal :show.sync="showModal3">
515
- <div slot="modal-header" class="modal-header">
516
- <h4 class="modal-title">
517
- 转维修进度{{ progressbarWidth }}%
518
- </h4>
519
- </div>
520
- <div slot="modal-body" class="modal-body">
521
- <div class="progress">
522
- <div class="progress-bar" role="progressbar" aria-valuenow="60"
523
- aria-valuemin="0" aria-valuemax="100" :style="'width:'+ progressbarWidth+'%'">
524
- <!-- <span class="sr-only">40% 完成</span>-->
525
- </div>
526
- </div>
527
- </div>
528
- <div slot="modal-footer" class="modal-footer" style="text-align: center" v-show="false"></div>
529
- </modal>
530
- </div>
531
- </template>
532
- <script>
533
- import {PagedList} from 'vue-client'
534
- import HttpResetClass from 'vue-client/src/plugins/HttpResetClass'
535
- import co from 'co'
536
- import Vue from 'vue'
537
- import * as Util from '../../../components/Util'
538
-
539
- let select = function * (self) {
540
- let http = new HttpResetClass()
541
- let getGasman = yield http.load('POST', '/rs/search', {
542
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
543
- userid: self.$login.f.id
544
- }, {resolveMsg: null, rejectMsg: null})
545
- //tag
546
- self.checkersid.push({label: '全部', value: ''})
547
- getGasman.data.forEach((checker) => {
548
- self.checkersid.push({label: checker.name, value: checker.name})
549
- })
550
- }
551
- export default {
552
- title: '隐患查询',
553
- data () {
554
- let model = new PagedList('rs/sql/GetCheckPaperByDefectNew2', 20, {
555
- f_filialeids: 'this.f_filialeids', f_defect_content: 'this.f_defect_content'
556
- })
557
- model.f_filialeids = '(' + this.$login.f.orgid + ')'
558
- model.f_defect_content = 'CASE WHEN CHARINDEX( \'"result":"正常"\', f_defect_content ) > 0 THEN \'无隐患\' ELSE replace(replace(replace( replace( RIGHT ( f_defect_content, len( f_defect_content ) - 26 ), substring(\'{}\',2,1), \'\' ), substring(\'{}\',1,1), \'\' ),\']\',\'\'),\'"\',\'\') END'
559
- return {
560
- repaired: [{label: '全部', value: ''}, {label: '未完成', value: '未完成'}, {label: '已完成', value: '已完成'}],
561
- deals: [{label: '全部', value: ''}, {label: '未处理', value: '未处理'}, {label: '已处理', value: '已处理'},{label: '处理中', value: '处理中'}],
562
- hasDefectOptions: [{label: '全部', value: ''}, {label: '有隐患', value: '有隐患'}, {
563
- label: '无隐患',
564
- value: '无隐患'
565
- }],
566
- f: this.$login.f,
567
- model: model,
568
- criteriaShow: false,
569
- checkAll: false,
570
- timercount: 0,
571
- showModal2: false,
572
- repairTypeOptions: this.$appdata.getParam('转维修类型'),
573
- dispatchTypeOptions: [{label: '派发给维修员', value: '派发给维修员'}],
574
- checkes: [],
575
- showModal: false,
576
- f_check_plan: {f_plan_name: '', id: ''},
577
- sumsmodel: {},
578
- resids: {},
579
- all: false,
580
- fields: {},
581
-
582
- selectData: {
583
- dispatchType: '',
584
- f_repairman: '',
585
- f_remarks: '',
586
- f_repairtype: ''
587
- },
588
- progressbarWidth: '0',
589
- modelval: [],
590
- isbusy: false,
591
- checkersid: [],
592
- showModal3: false,
593
- toRepairCount: 0,
594
- sliceArea: [],
595
- callSends: [],
596
- cbc: [],
597
- repairedOptions: [{label: '全部', value: ''}, {label: '已修', value: '已修'}, {label: '未修', value: '未修'}],
598
- repairers: [],
599
- cbcs: [],
600
- thead: '',
601
- headData: ['入户状态', '用户编号', '用户名', '用户电话', '用户小区', '用户地址', '用户表号', '安检时间', '安检员', '计划名', '是否有隐患', '隐患数', '隐患明细'],
602
- bodyData: ['f_entry_status', 'f_userinfo_code', 'f_user_name', 'f_user_phone', 'f_residential_area', 'f_address', 'f_meternumber', 'f_offsite_time', 'f_checker_name', 'f_plan_name', 'f_has_defect', 'f_defect_count', 'f_defect_content'],
603
- f_defect_contents: [{label:"全部",value:""}],
604
- DevicesConfig: [],
605
- DevicesSetConfig: []
606
- }
607
- },
608
- props: {
609
- style: {
610
- type: String,
611
- default: 'col-sm-2 form-group'
612
- },
613
- style2: {
614
- type: String,
615
- default: 'col-sm-4 form-group'
616
- }
617
-
618
- },
619
-
620
- methods: {
621
- trouble (val) {
622
- // return val.replaceAll("'",'')
623
- // .replaceAll("\"",'')
624
- // .replaceAll("{",'')
625
- // .replaceAll("}",'')
626
- // .replaceAll("]",'')
627
- // .replaceAll("[",'')
628
- // .replaceAll("result:",'')
629
- // .replaceAll("data:",'')
630
- // .replaceAll("有隐患",'')
631
- // .replaceAll(",",'')
632
-
633
- const defect_content = JSON.parse(val)
634
- let result = ''
635
- if (defect_content.data) {
636
- const jsonData = defect_content.data
637
- for (const itemdata of jsonData) {
638
- const keys = Object.keys(itemdata)
639
- for (const itm of keys) {
640
- const value = itemdata[itm]
641
- result += itm + ':' + value + ','
642
- }
643
- }
644
- }
645
- return result
646
- },
647
- getEmp () {
648
- let val = {
649
- source: 'this.getParentByType($organization$).getSpecialResByType($user$).where(row.getAttributes().get($rolestr$)!=null ).where(row.getAttributes().get($rolestr$).indexOf($维修员$) != -1))',
650
- userid: `${this.$login.f.id}`
651
- }
652
- let http = new HttpResetClass()
653
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
654
- let str = ''
655
- res.data.forEach((item, idx, arr) => {
656
- //tag
657
- if (idx + 1 == arr.length) {
658
- str += item.id
659
- } else {
660
- str += item.id + ','
661
- }
662
-
663
- })
664
- let http1 = new HttpResetClass()
665
- http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
666
- data: {
667
- items: 'id,f_user_telephone',
668
- tablename: 't_user',
669
- condition: `id in (${str})`,
670
- orderitem: 'id'
671
- }
672
- }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
673
-
674
- res.data.forEach((user) => {
675
- try {
676
- ress.data.forEach((tel, tidx, arr) => {
677
- //tag
678
- if (user.id == tel.id) {
679
- this.repairers.push({label: `${user.name}:${tel.f_user_telephone}`, value: user.name})
680
- ress.data.splice(tidx, 1)
681
- //tag
682
- throw new Error('跳出循环')
683
- }
684
- })
685
- } catch (e) {
686
- //tag
687
- }
688
- })
689
- })
690
-
691
- })
692
- },
693
- toRepair () {
694
- //tag
695
- this.showModal2 = true
696
- },
697
- async rectification () {
698
- this.isbusy = true
699
- // if (this.checkAll){
700
- let data = {
701
- f_filialeids: this.model.params.f_filialeids,
702
- f_defect_content: this.model.params.f_defect_content,
703
- condition: this.model.params.condition
704
- }
705
- let res1 = await new HttpResetClass().load('post', 'rs/sql/GetCheckPaperByDefectNew2', {data: data})
706
- for (let i = 0; i < res1.data.length; i++) {
707
- let data1 = {
708
- f_paper_id: res1.data[i].id,
709
- condition: `f_repaire_type != '无隐患'`
710
- }
711
- let res2 = await new HttpResetClass().load('POST', 'rs/sql/GetDefectByPaperIdNew2', {data: data1})
712
- //tag
713
- const uploadData = {
714
- model: {
715
- serviceacitivity: [{
716
- f_service_acitivity_type: '派单'
717
- }],
718
- f_repairitems: {},
719
- failure: '',
720
- f_source: '安检',
721
- f_service_id: '',
722
- f_contact_phone: '',
723
- f_meetunit: '',
724
- f_phone: '',
725
- f_user_name: '',
726
- f_address: '',
727
- f_repair_date: '',
728
- f_reciever: '',
729
- f_remarks: '',
730
- f_user_type: '',
731
- f_area: '',
732
- f_unit_name: '',
733
- f_street: '',
734
- f_residential_area: '',
735
- f_building: '',
736
- f_unit: '',
737
- f_floor: '',
738
- f_room: '',
739
- aState: '',
740
- f_repairtype: '',
741
- f_userinfo_id: '',
742
- f_userinfo_code: '',
743
- f_orgstr: '',
744
- f_outlets: '',
745
- f_attendant: this.$login.f.name
746
- },
747
- loginUser: {
748
- name: this.$login.f.name,
749
- ename: this.$login.f.ename
750
- },
751
- user: {
752
- f_userinfo_id: ''
753
- },
754
- callObj: null
755
- }
756
-
757
- uploadData.model.serviceacitivity[0].f_reciever = this.selectData.f_repairman
758
- // uploadData.model.f_meetunit = self.$login.f.orgpathnames
759
- // uploadData.model.f_orgstr = self.$login.f.orgpathstr
760
- // uploadData.model.f_outlets = self.$login.f.f_parentname
761
- uploadData.model.f_meetunit = this.$login.f.deps
762
- uploadData.model.f_orgid = this.$login.f.orgid
763
- uploadData.model.f_filiale = this.$login.f.org
764
- uploadData.model.f_outlets = this.$login.f.deps
765
- uploadData.model.f_filiale_id = this.$login.f.orgid
766
- uploadData.toRepair = '一级派单'
767
- let res3 = await new HttpResetClass().load('post', '/rs/sql/GetUserForRepaireNew2', {data: {f_userinfo_id: res1.data[i].f_userinfo_id}})
768
- uploadData.model = Object.assign(uploadData.model, res3.data[0])
769
- uploadData.user.f_userinfo_id = res3.data[0].f_userinfo_id
770
- uploadData.model.f_repair_date = Util.getNowDate()
771
- uploadData.model.f_repairtype = res3.data[0].f_repairtype
772
- uploadData.model.f_remarks = res3.data[0].f_remarks
773
- let failure = []
774
- res2.data.forEach(row => {
775
- if (row.f_repaire_type == '隐患未处理') {
776
- console.log('row.f_item_value', row.f_item_value)
777
- failure.push({
778
- f_failure_type: row.f_item_name,
779
- failurecase: row.f_item_value ? row.f_item_value.split(',') : ''
780
- })
781
- }
782
- })
783
- uploadData.model.failure = failure
784
- // 拼接repairitems
785
- let rows = JSON.parse(JSON.stringify(res2.data))
786
- let repairitems = {
787
- data: []
788
- }
789
- let safecheckOptions = [{'data': '已处理'}, {'data': '未处理'}]
790
- // 取隐患未处理的
791
- rows = rows.filter(row => row.f_repaire_type == '隐患未处理')
792
- //tag)
793
- // 开始拼接
794
- rows.forEach(row => {
795
- let existIndex = -1
796
- // 判断该设备是否已经存在
797
- for (let i = 0; i < repairitems.data.length; i++) {
798
- if (repairitems.data[i].f_type == row.f_device_type) {
799
- existIndex = i
800
- break
801
- }
802
- }
803
- if (existIndex == -1) {
804
- // 不存在则新建
805
- let newItem = {
806
- f_type: row.f_device_type,
807
- details: [{
808
- f_defect_id: row.id,
809
- f_project: `${row.f_item_name}:${row.f_item_value}`,
810
- type: 'selector',
811
- options: safecheckOptions
812
- }]
813
- }
814
- repairitems.data.push(newItem)
815
- } else {
816
- // 存在则追加
817
- repairitems.data[existIndex].details.push({
818
- f_defect_id: row.id,
819
- f_project: `${row.f_item_name}:${row.f_item_value}`,
820
- type: 'selector',
821
- options: safecheckOptions
822
- })
823
- }
824
- })
825
- uploadData.model.f_repairitems = repairitems
826
- uploadData.rows = rows
827
- //tag)
828
- //tag
829
- if (uploadData.model.f_repairitems.data.length > 0) {
830
- this.callSends.push(uploadData)
831
- } else {
832
- //tag
833
- }
834
- }
835
- //tag)
836
- let timer = setInterval(async () => {
837
- this.showModal3 = true
838
- this.isbusy = false
839
- if (this.timercount < this.callSends.length) {
840
- //tag)
841
- let rows = this.callSends[this.timercount].rows
842
- //tag)
843
- let result = await this.$resetpost('/rs/logic/callerSend', this.callSends[this.timercount])
844
- //tag)
845
- if (result.data.f_service_id) {
846
- const data = {
847
- f_paper_id: rows[0].f_paper_id,
848
- f_service_id: result.data.f_service_id,
849
- itemsId: this.$login.convertToIn(rows.map(row => row.id))
850
- }
851
- //tag
852
- let updateRes = await this.$resetpost('/rs/logic/updateDefectStateNew', data)
853
- }
854
- this.toRepairCount++
855
- //tag
856
- this.timercount++
857
- } else {
858
- clearInterval(timer)
859
- //tag
860
- this.callSends = []
861
- this.timercount = 0
862
- this.showModal3 = false
863
- this.cancel1()
864
- this.$showMessage('本次转维修成功' + this.toRepairCount + '单')
865
- this.toRepairCount = 0
866
- }
867
- }, 3000)
868
- },
869
- cancel1 () {
870
- this.showModal2 = false
871
- this.selectData = {
872
- dispatchType: '',
873
- f_repairman: '',
874
- f_remarks: '',
875
- f_repairtype: ''
876
- }
877
- },
878
- sleep (d) {
879
- //tag)
880
- var t = Date.now()
881
- while (Date.now - t <= d) {
882
-
883
- }
884
- //tag)
885
- },
886
- isChecked (v) {
887
- // 如果全选,不在的按选中算,否则,在的按选中算
888
- if (this.checkAll) {
889
- return this.checkes.indexOf(v) == -1
890
- } else {
891
- return this.checkes.indexOf(v) != -1
892
- }
893
- },
894
- setCheckAll () {
895
- this.checkAll = this.checkAll ? false : true
896
- // 全选改变后,清空选中数据
897
- this.checkes = []
898
- },
899
- setCheckes (id) {
900
- let index = this.checkes.indexOf(id)
901
- if (index < 0) {
902
- this.checkes.push(id)
903
- } else {
904
- this.checkes.splice(index, 1)
905
- }
906
- },
907
- getmeterbook (val) {
908
- this.cbc = []
909
- this.cbc.push({
910
- label: '全部',
911
- value: ''
912
- })
913
- if (val == '') {
914
-
915
- this.cbcs.forEach(res => {
916
- this.cbc.push({
917
- label: res.f_book_name,
918
- value: res.id
919
- })
920
- })
921
- } else {
922
- this.cbcs.forEach(res => {
923
- if (res.f_book_slice_area == val) {
924
- this.cbc.push({
925
- label: res.f_book_name,
926
- value: res.id
927
- })
928
- }
929
- })
930
- }
931
- },
932
- Mreadibook (val) {
933
- //tag
934
- //tag
935
- this.sliceArea = []
936
- if (val) {
937
- new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
938
- data: {
939
- items: 'name',
940
- tablename: 't_zone',
941
- condition: `parentid in ${val}`,
942
- orderitem: 'id'
943
- }
944
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
945
- this.sliceArea.push({
946
- label: '全部',
947
- value: ''
948
- })
949
- res.data.forEach(ress => {
950
- this.sliceArea.push({
951
- label: ress.name,
952
- value: ress.name
953
- })
954
- })
955
-
956
- })
957
- }
958
- },
959
- getAllMeterBook (val) {
960
- //tag
961
- //tag
962
- this.cbcs = []
963
- if (val) {
964
- new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
965
- data: {
966
- items: 'f_book_name,f_book_slice_area,id',
967
- tablename: 't_meter_book',
968
- condition: `f_filiale_id in ${val}`,
969
- orderitem: 'id'
970
- }
971
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
972
- res.data.forEach(ress => {
973
- this.cbcs.push({
974
- id: ress.id,
975
- f_book_name: ress.f_book_name,
976
- f_book_slice_area: ress.f_book_slice_area
977
- })
978
- })
979
- this.cbc = []
980
- this.cbc.push({
981
- label: '全部',
982
- value: ''
983
- })
984
- this.cbcs.forEach(res => {
985
- this.cbc.push({
986
- label: res.f_book_name,
987
- value: res.id
988
- })
989
- })
990
- })
991
- }
992
- },
993
- hiddenr () {
994
- this.$parent.showItem = !this.$parent.showItem
995
- },
996
- hidden () {
997
- this.criteriaShow = !this.criteriaShow
998
- },
999
- search (args) {
1000
- //tag
1001
- if (this.f_check_plan.f_plan_name) {
1002
- args.condition += ` and f_check_plan_id = '${this.f_check_plan.id}'`
1003
- }
1004
- this.checkes = []
1005
- this.checkAll = false
1006
- this.model.search(args.condition, args.model)
1007
- },
1008
- getRes (obj) {
1009
- //tag
1010
- this.resids = {res: obj.res[0], resids: obj.resids[0]}
1011
- this.model.f_filialeids = this.$login.convertToIn(obj.resids)
1012
- this.Mreadibook(this.model.f_filialeids)
1013
- this.getAllMeterBook(this.model.f_filialeids)
1014
- },
1015
- showChooser () {
1016
- this.showModal = true
1017
- },
1018
- ok () {
1019
- this.showModal = false
1020
- if (this.$refs.modal.$children[0].selectedRow.id) {
1021
- this.f_check_plan = this.$refs.modal.$children[0].selectedRow
1022
- }
1023
- },
1024
- cancel () {
1025
- this.showModal = false
1026
- this.f_check_plan = {f_plan_name: '', id: ''}
1027
- },
1028
- async asyncReady (self) {
1029
- // 获取配置信息
1030
- try {
1031
- let res = await new HttpResetClass().load('post', 'rs/sql/tel_singleTable_OrderBy', {
1032
- data: {
1033
- items: 'f_dir',
1034
- tablename: 't_organization',
1035
- condition: `id = '${self.$login.f.orgid}'`,
1036
- orderitem: 'id'
1037
- }
1038
- })/*.then(res=>{*/
1039
- //tag
1040
- //tag)
1041
- if (!res.data[0].f_dir) {
1042
- self.$showMessage("该公司无组织目录,无法获取配置文件,请联系管理员确认")
1043
- } else {
1044
- //this.f_dir=res.data[0].f_dir
1045
- try {
1046
- let res1 = await new HttpResetClass().load('GET', `/safecheck/rs/vue/DevicesConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {}, {
1047
- resolveMsg: '获取居民配置项成功!',
1048
- rejectMsg: '获取居民配置项出错!'
1049
- })
1050
- this.DevicesConfig = res1.data
1051
- let res2 = await new HttpResetClass().load('GET', `/safecheck/rs/vue/DevicesSetConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {}, {
1052
- resolveMsg: '获取非居民配置项成功!',
1053
- rejectMsg: '获取非居民配置项出错!'
1054
- })
1055
- this.DevicesSetConfig = res2.data
1056
- } catch (e) {
1057
- self.$showMessage("获取配置文件失败" + e)
1058
- }
1059
- }
1060
- } catch (error) {
1061
- // 忽略704,文件找不到异常R
1062
- if (error.status !== 704) {
1063
- throw error
1064
- }
1065
- }
1066
- }
1067
- },
1068
- ready () {
1069
- //tag
1070
- this.$refs.paged.$refs.criteria.model.f_has_defect = '有隐患'
1071
- this.getEmp()
1072
- let gen = select(this)
1073
- // this.Mreadibook(`('${this.$login.f.orgid}')`)
1074
- co(gen)
1075
- this.asyncReady(this).then(()=>{
1076
- let defectTypeSet = new Set()
1077
- if (this.DevicesConfig) {
1078
- for (const key in this.DevicesConfig) {
1079
- if (Object.hasOwnProperty.call(this.DevicesConfig, key)) {
1080
- for (const ke in this.DevicesConfig[key]['items']) {
1081
- defectTypeSet.add(ke)
1082
- }
1083
- }
1084
- }
1085
- }
1086
- if (this.DevicesSetConfig) {
1087
- for (const key in this.DevicesSetConfig) {
1088
- if (Object.hasOwnProperty.call(this.DevicesConfig, key)) {
1089
- for (const ke in this.DevicesConfig[key]['items']) {
1090
- defectTypeSet.add(ke)
1091
- }
1092
- }
1093
- }
1094
- }
1095
- defectTypeSet.forEach((item) => {
1096
- this.f_defect_contents.push({label: item, value: item})
1097
- })
1098
- })
1099
- },
1100
- watch: {
1101
- 'timercount' () {
1102
- if (this.timercount === 0) {
1103
- this.progressbarWidth = '0'
1104
- } else {
1105
- //tag
1106
- //tag
1107
- this.progressbarWidth = parseInt(this.timercount * 100 / (this.callSends.length + 1))
1108
- }
1109
-
1110
- }
1111
- },
1112
- computed: {
1113
- selected () {
1114
- return this.$refs.paged.$refs.grid.selected
1115
- },
1116
- getfield () {
1117
- //tag
1118
- let data = {}
1119
- this.bodyData.forEach((value, index) => {
1120
- data[this.bodyData[index]] = this.headData[index]
1121
- })
1122
- //合计字段打印
1123
- this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
1124
- if (this.sumsmodel) {
1125
- Object.keys(this.sumsmodel).forEach((key) => {
1126
- this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
1127
- })
1128
- } else {
1129
- this.tfoot += '暂无'
1130
- }
1131
- this.tfoot += '</th></tr>'
1132
- return data
1133
- }
1134
- }
1135
- }
1136
- </script>
1
+ <template>
2
+ <div class="flex">
3
+ <work-busy :is-busy="isbusy"></work-busy>
4
+ <criteria-paged :model="model" v-ref:paged>
5
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row" v-show="!$parent.$parent.$parent.showItem">
8
+ <div :class="$parent.$parent.style">
9
+ <label class="font_normal_body">安检计划</label>
10
+ <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
11
+ @click="$parent.$parent.showChooser"
12
+ style="width: 60%" placeholder="安检计划" readonly="readonly">
13
+ </div>
14
+ <div :class="$parent.$parent.style">
15
+ <label class="font_normal_body">存在隐患</label>
16
+ <v-select style="width:60% "
17
+ class="select select_list"
18
+ :value.sync="model.f_has_defect"
19
+ v-model="model.f_has_defect"
20
+ :options='$parent.$parent.hasDefectOptions'
21
+ :placeholder='model.f_has_defect'
22
+ condition="f_has_defect = '{}'"
23
+ close-on-select>
24
+ </v-select>
25
+ </div>
26
+ <div :class="$parent.$parent.style">
27
+ <label class="font_normal_body">用户编号</label>
28
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
29
+ condition="f_userinfo_code = '{}'"
30
+ style="width: 60%" placeholder="用户编号">
31
+ </div>
32
+ <div :class="$parent.$parent.style">
33
+ <label class="font_normal_body">处理情况</label>
34
+ <v-select
35
+ placeholder='处理情况'
36
+ :value-single="true"
37
+ class="select select_list" style="width: 60%"
38
+ v-model='model.f_is_deal'
39
+ :value.sync="model.f_is_deal"
40
+ :options='$parent.$parent.deals'
41
+ condition="f_is_deal = '{}'"
42
+ close-on-select clear-button></v-select>
43
+ </div>
44
+ <div class=" col-sm-4 form-group button-range">
45
+ <div class="span" style="float: right;margin-top: 8px">
46
+ <div style="float: right" class="button_spacing"
47
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
48
+ @click="$parent.$parent.hiddenr()"></div>
49
+ <div style="float: right" class="button_spacing"
50
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
51
+ @click="$parent.$parent.hidden()"></div>
52
+ <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
53
+ <!-- <button style="float: right" class="button_search button_spacing" @click="$parent.$parent.toRepair">转维修</button>-->
54
+ <div style="float: right">
55
+ <export-excel-safe
56
+ :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids,f_defect_content:$parent.$parent.model.f_defect_content}"
57
+ :field="$parent.$parent.getfield"
58
+ progress="safeGetExportProgress"
59
+ sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefectNew2" template-name='安检隐患明细'
60
+ :choose-col="true"></export-excel-safe>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ <div class="row" v-show="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
66
+ <div :class="$parent.$parent.style">
67
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
68
+ <v-select class="select_list select"
69
+ placeholder='片区/管理站' style="width: 60%"
70
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
71
+ :options='$parent.$parent.sliceArea'
72
+ filer-key="name"
73
+ close-on-select clear-button
74
+ condition="f_slice_area='{}'"
75
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
76
+ :value-single="true">
77
+ </v-select>
78
+ </div>
79
+ <div :class="$parent.$parent.style2" style="margin: 0">
80
+ <role-selector-safe
81
+ role-name="安检员"
82
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
83
+ :resobjprop.sync="$parent.$parent.resids"
84
+ @re-res="$parent.$parent.getRes"
85
+ :value.sync="model.f_checker_id"
86
+ v-model="model.f_checker_id"
87
+ condition="f_checker_name = '{}'">
88
+ </role-selector-safe>
89
+ </div>
90
+
91
+ <div :class="$parent.$parent.style">
92
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
93
+ <v-select class="select_list select"
94
+ placeholder='抄表册' style="width: 60%"
95
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
96
+ :options='$parent.$parent.cbc'
97
+ filer-key="name"
98
+ close-on-select clear-button
99
+ condition="f_meter_book_num={}"
100
+ :value-single="true">
101
+ </v-select>
102
+ </div>
103
+ <div :class="$parent.$parent.style">
104
+ <label class="font_normal_body">起始时间</label>
105
+ <datepicker
106
+ placeholder='起始时间' style="width:60%"
107
+ :disabled-days-of-week="[]"
108
+ :format="'yyyy-MM-dd'"
109
+ :show-rest-button="reset"
110
+ :value.sync="model.f_start_time"
111
+ v-model="model.f_start_time"
112
+ condition="f_offsite_time >= '{} 00:00:00'">
113
+ </datepicker>
114
+ </div>
115
+ <div :class="$parent.$parent.style">
116
+ <label class="font_normal_body">结束时间</label>
117
+ <datepicker
118
+ placeholder='结束时间' style="width:60%"
119
+ :disabled-days-of-week="[]"
120
+ :format="'yyyy-MM-dd'"
121
+ :show-rest-button="reset"
122
+ :value.sync="model.f_end_time"
123
+ v-model="model.f_end_time"
124
+ condition="f_offsite_time <= '{} 23:59:59'">
125
+ </datepicker>
126
+ </div>
127
+
128
+
129
+ </div>
130
+ <div class="row" v-show="$parent.$parent.criteriaShow&&!$parent.$parent.$parent.showItem">
131
+
132
+ <div :class="$parent.$parent.style">
133
+ <label class="font_normal_body">维&ensp;修&ensp;员</label>
134
+ <input type="text" class="input_search" v-model="model.f_repairman"
135
+ condition="f_repairman = '{}'"
136
+ style="width: 60%" placeholder="维修员">
137
+ </div>
138
+ <div :class="$parent.$parent.style">
139
+ <label class="font_normal_body">用户姓名</label>
140
+ <input type="text" class="input_search" v-model="model.f_user_name"
141
+ condition="f_user_name like '%{}%'"
142
+ style="width: 60%" placeholder="用户姓名">
143
+ </div>
144
+ <div :class="$parent.$parent.style">
145
+ <label class="font_normal_body">用户地址</label>
146
+ <input type="text" class="input_search" v-model="model.f_address"
147
+ condition="f_address like '%{}%'"
148
+ style="width: 60%" placeholder="用户地址">
149
+ </div>
150
+ <div :class="$parent.$parent.style">
151
+ <label class="font_normal_body">用户电话</label>
152
+ <input type="text" class="input_search" v-model="model.f_user_phone"
153
+ condition="f_user_phone = '{}'"
154
+ style="width: 60%" placeholder="用户电话">
155
+ </div>
156
+ <div :class="$parent.$parent.style">
157
+ <label class="font_normal_body">用户表号</label>
158
+ <input type="text" class="input_search" v-model="model.f_meternumber"
159
+ condition="f_meternumber = '{}'"
160
+ style="width: 60%" placeholder="用户表号">
161
+ </div>
162
+ <div :class="$parent.$parent.style">
163
+ <label class="font_normal_body">隐&ensp;患&ensp;项</label>
164
+ <v-select
165
+ placeholder='隐患项'
166
+ :value-single="true"
167
+ class="select select_list" style="width: 60%"
168
+ v-model='model.f_defect_content'
169
+ :value.sync="model.f_defect_content"
170
+ :options='$parent.$parent.f_defect_contents'
171
+ condition="f_defect_content like '%{}%'"
172
+ close-on-select clear-button></v-select>
173
+ </div>
174
+ <div :class="$parent.$parent.style">
175
+ <label class="font_normal_body">最后一次隐患处理时间</label>
176
+ <datepicker
177
+ placeholder='起始时间' style="width:60%"
178
+ :disabled-days-of-week="[]"
179
+ :format="'yyyy-MM-dd'"
180
+ :show-rest-button="reset"
181
+ :value.sync="model.f_repair_start"
182
+ v-model="model.f_repair_start"
183
+ condition="f_repair_date >= '{} 00:00:00'">
184
+ </datepicker>
185
+ </div>
186
+ <div :class="$parent.$parent.style">
187
+ <label class="font_normal_body">最后一次隐患处理时间</label>
188
+ <datepicker
189
+ placeholder='结束时间' style="width:60%"
190
+ :disabled-days-of-week="[]"
191
+ :format="'yyyy-MM-dd'"
192
+ :show-rest-button="reset"
193
+ :value.sync="model.f_repair_end"
194
+ v-model="model.f_repair_end"
195
+ condition="f_repair_date<= '{} 23:59:59'">
196
+ </datepicker>
197
+ </div>
198
+ </div>
199
+
200
+
201
+ <div class="row" v-show="$parent.$parent.$parent.showItem">
202
+ <div :class="$parent.$parent.style">
203
+ <label class="font_normal_body">安检计划</label>
204
+ <input type="text" class="input_search" v-model="$parent.$parent.f_check_plan.f_plan_name"
205
+ @click="$parent.$parent.showChooser"
206
+ style="width: 60%" placeholder="安检计划" readonly="readonly">
207
+ </div>
208
+ <div :class="$parent.$parent.style">
209
+ <label class="font_normal_body">存在隐患</label>
210
+ <v-select style="width:60% "
211
+ class="select select_list"
212
+ :value.sync="model.f_has_defect"
213
+ v-model="model.f_has_defect"
214
+ :options='$parent.$parent.hasDefectOptions'
215
+ :placeholder='model.f_has_defect'
216
+ condition="f_has_defect = '{}'"
217
+ close-on-select>
218
+ </v-select>
219
+ </div>
220
+
221
+ <div class=" col-sm-4 form-group button-range">
222
+ <div class="span" style="float: right;margin-top: 8px;margin-right: 50px">
223
+ <div style="float: right" class="button_spacing"
224
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItem,'button_shrink_right':!$parent.$parent.$parent.showItem}"
225
+ @click="$parent.$parent.hiddenr()"></div>
226
+ <div style="float: right" class="button_spacing"
227
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
228
+ @click="$parent.$parent.hidden()"></div>
229
+ <button style="float: right" class="button_search button_spacing" @click="search">查询</button>
230
+ <!-- <button style="float: right" class="button_search button_spacing" @click="$parent.$parent.toRepair">转维修</button>-->
231
+ <div style="float: right">
232
+ <export-excel-old
233
+ :data="{condition: $parent.$parent.model.condition,f_filialeids:$parent.$parent.model.f_filialeids}"
234
+ :field="$parent.$parent.getfield"
235
+ progress="safeGetExportProgress"
236
+ sqlurl="rs/logic/SafeExportExcel" sql-name="GetCheckPaperByDefectNew2" template-name='安检计划明细'
237
+ :choose-col="true"></export-excel-old>
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+
243
+ </div>
244
+ <div class="row" v-show="$parent.$parent.criteriaShow&&$parent.$parent.$parent.showItem">
245
+ <div :class="$parent.$parent.style">
246
+ <label class="font_normal_body">用户编号</label>
247
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
248
+ condition="f_userinfo_code = '{}'"
249
+ style="width: 60%" placeholder="用户编号">
250
+ </div>
251
+ <div :class="$parent.$parent.style">
252
+ <label class="font_normal_body">结果查询</label>
253
+ <v-select
254
+ placeholder='处理结果查询'
255
+ :value-single="true"
256
+ class="select select_list" style="width: 60%"
257
+ v-model='model.f_repaired'
258
+ :value.sync="model.f_repaired"
259
+ :options='$parent.$parent.repaired'
260
+ condition="f_repaired = '{}'"
261
+ close-on-select clear-button></v-select>
262
+ </div>
263
+
264
+ <div :class="$parent.$parent.style2" style="margin: 0">
265
+ <role-selector-safe
266
+ role-name="安检员"
267
+ :resobjprop.sync="$parent.$parent.resids"
268
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
269
+ @re-res="$parent.$parent.getRes"
270
+ :value.sync="model.f_checker_id"
271
+ v-model="model.f_checker_id"
272
+ condition="f_checker_name = '{}'">
273
+ </role-selector-safe>
274
+ </div>
275
+ </div>
276
+ <div class="row" v-show="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
277
+ <div :class="$parent.$parent.style">
278
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
279
+ <v-select class="select_list select"
280
+ placeholder='片区/管理站' style="width: 60%"
281
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
282
+ :options='$parent.$parent.sliceArea'
283
+ filer-key="name"
284
+ close-on-select clear-button
285
+ condition="f_slice_area='{}'"
286
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
287
+ :value-single="true">
288
+ </v-select>
289
+ </div>
290
+ <div :class="$parent.$parent.style">
291
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
292
+ <v-select class="select_list select"
293
+ placeholder='抄表册' style="width: 60%"
294
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
295
+ :options='$parent.$parent.cbc'
296
+ filer-key="name"
297
+ close-on-select clear-button
298
+ condition="f_meter_book_num={}"
299
+ :value-single="true">
300
+ </v-select>
301
+ </div>
302
+ <div :class="$parent.$parent.style">
303
+ <label class="font_normal_body">起始时间</label>
304
+ <datepicker
305
+ placeholder='起始时间' style="width:60%"
306
+ :disabled-days-of-week="[]"
307
+ :format="'yyyy-MM-dd'"
308
+ :show-rest-button="reset"
309
+ :value.sync="model.f_start_time"
310
+ v-model="model.f_start_time"
311
+ condition="f_offsite_time >= '{} 00:00:00'">
312
+ </datepicker>
313
+ </div>
314
+ <div :class="$parent.$parent.style">
315
+ <label class="font_normal_body">结束时间</label>
316
+ <datepicker
317
+ placeholder='结束时间' style="width:60%"
318
+ :disabled-days-of-week="[]"
319
+ :format="'yyyy-MM-dd'"
320
+ :show-rest-button="reset"
321
+ :value.sync="model.f_end_time"
322
+ v-model="model.f_end_time"
323
+ condition="f_offsite_time <= '{} 23:59:59'">
324
+ </datepicker>
325
+ </div>
326
+
327
+
328
+ </div>
329
+ <div class="row" v-show="$parent.$parent.criteriaShow && $parent.$parent.$parent.showItem">
330
+
331
+ <div :class="$parent.$parent.style">
332
+ <label class="font_normal_body">维&ensp;修&ensp;员</label>
333
+ <input type="text" class="input_search" v-model="model.f_repairman"
334
+ condition="f_repairman = '{}'"
335
+ style="width: 60%" placeholder="维修员">
336
+ </div>
337
+ <div :class="$parent.$parent.style">
338
+ <label class="font_normal_body">处理查询</label>
339
+ <v-select
340
+ placeholder='处理结果查询'
341
+ :value-single="true"
342
+ class="select select_list" style="width: 60%"
343
+ v-model='model.f_is_deal'
344
+ :value.sync="model.f_is_deal"
345
+ :options='$parent.$parent.deals'
346
+ condition="f_is_deal = '{}'"
347
+ close-on-select clear-button></v-select>
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </criteria>
352
+ <data-grid :model="model" partial='list' v-ref:grid class="list_area table_sy">
353
+ <template partial='head'>
354
+ <tr>
355
+ <!-- <th><nobr><input type="checkbox" v-model="$parent.$parent.$parent.checkAll" @click.stop="()=>{return}" />全选</nobr></th>-->
356
+ <th>
357
+ <nobr>入户状态</nobr>
358
+ </th>
359
+ <th>
360
+ <nobr>用户编号</nobr>
361
+ </th>
362
+ <th>
363
+ <nobr>用户名</nobr>
364
+ </th>
365
+ <th>
366
+ <nobr>用户电话</nobr>
367
+ </th>
368
+ <th>
369
+ <nobr>用户小区</nobr>
370
+ </th>
371
+ <th>
372
+ <nobr>用户地址</nobr>
373
+ </th>
374
+ <th>
375
+ <nobr>用户表号</nobr>
376
+ </th>
377
+ <th>
378
+ <nobr>安检时间</nobr>
379
+ </th>
380
+ <th>
381
+ <nobr>安检员</nobr>
382
+ </th>
383
+ <th>
384
+ <nobr>计划名</nobr>
385
+ </th>
386
+ <th>
387
+ <nobr>是否有隐患</nobr>
388
+ </th>
389
+ <th>
390
+ <nobr>隐患数</nobr>
391
+ </th>
392
+ <th>
393
+ <nobr>处理数</nobr>
394
+ </th>
395
+ <th>
396
+ <nobr>处理情况</nobr>
397
+ </th>
398
+ <th>
399
+ <nobr>维修员</nobr>
400
+ </th>
401
+ <th>
402
+ <nobr>隐患明细</nobr>
403
+ </th>
404
+ <th>
405
+ <nobr>最后一次隐患处理时间</nobr>
406
+ </th>
407
+ </tr>
408
+ </template>
409
+ <template partial='body'>
410
+ <!-- <td style="text-align: center;white-space:nowrap;"><input type="checkbox" @click="$event.cancelBubble=true" :checked="$parent.$parent.$parent.isChecked(row.id)" @change="$parent.$parent.$parent.setCheckes(row.id)"></input></td>-->
411
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_entry_status }}</td>
412
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_userinfo_code }}</td>
413
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_user_name }}</td>
414
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_user_phone }}</td>
415
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_residential_area }}</td>
416
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_address }}</td>
417
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_meternumber }}</td>
418
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_offsite_time }}</td>
419
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_checker_name }}</td>
420
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_plan_name }}</td>
421
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_has_defect }}</td>
422
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_defect_count }}</td>
423
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_deal_count }}</td>
424
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_is_deal }}</td>
425
+ <td style="text-align: center;white-space:nowrap;">{{ row.f_repairman }}</td>
426
+ <td style="text-align: center;white-space:nowrap;">
427
+ {{ $parent.$parent.$parent.trouble(row.f_defect_content) }}
428
+ </td>
429
+ <td style="text-align: center;white-space:nowrap;">
430
+ {{row.f_repair_date}}
431
+ </td>
432
+ </template>
433
+ </data-grid>
434
+ </criteria-paged>
435
+
436
+ <modal :show.sync="showModal" v-ref:modal>
437
+ <div slot="modal-header" class="modal-header">
438
+ <h4 class="modal-title">
439
+ 选择计划
440
+ </h4>
441
+ </div>
442
+ <div slot="modal-body" class="modal-body">
443
+ <plan-chooser :f.sync="this.$login.f" v-ref:chooser></plan-chooser>
444
+ </div>
445
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
446
+ <button class="button_search" @click="ok">确认</button>
447
+ <button class="button_search" @click="cancel">取消</button>
448
+ </div>
449
+ </modal>
450
+ <modal :show.sync="showModal2" :backdrop="false">
451
+ <div slot="modal-header" class="modal-header">
452
+ <h4 class="modal-title">
453
+ 转维修
454
+ </h4>
455
+ </div>
456
+ <div slot="modal-body" class="modal-body">
457
+ <div v-if="true">
458
+ <div class="row" style="margin-top: 10px">
459
+ <label class="control-label font text-left"
460
+ style="float:left;margin-left:20%;margin-top:5px">派发类型</label>
461
+ <div class="col-xs-8 col-md-8">
462
+ <v-select :value.sync="selectData.dispatchType" :value-single="true" v-model="selectData.dispatchType"
463
+ :options='dispatchTypeOptions' placeholder='派发类型'
464
+ close-on-select>
465
+ </v-select>
466
+ </div>
467
+ </div>
468
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给维修员'">
469
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">维&ensp;修&ensp;员</label>
470
+ <div class="col-xs-8 col-md-8">
471
+ <v-select
472
+ :value.sync="selectData.f_repairman"
473
+ :value-single="true"
474
+ :options='repairers'
475
+ placeholder='请选择维修员'
476
+ close-on-select></v-select>
477
+ </div>
478
+ </div>
479
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给站点'">
480
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">站&ensp;&ensp;&ensp;&ensp;点</label>
481
+ <div class="col-xs-8 col-md-8">
482
+ <right-tree
483
+ islist
484
+ :userid="userid"
485
+ :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
486
+ @re-res="getSiteRes"></right-tree>
487
+ </div>
488
+ </div>
489
+ <div class="row" style="margin-top: 10px">
490
+ <label class="control-label font text-left"
491
+ style="float:left;margin-left:20%;margin-top:5px">报修类型</label>
492
+ <div class="col-xs-8 col-md-8">
493
+ <v-select :value.sync="selectData.f_repairtype" style="width:60%"
494
+ class="select select_list"
495
+ :value-single="true"
496
+ :options='repairTypeOptions'
497
+ close-on-select>
498
+ </v-select>
499
+ </div>
500
+ </div>
501
+ <div class="row" style="margin-top: 10px">
502
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
503
+ <div class="col-xs-8 col-md-8">
504
+ <textarea style="width: 60%; height: 100px" v-model="selectData.f_remarks"></textarea>
505
+ </div>
506
+ </div>
507
+ </div>
508
+ </div>
509
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
510
+ <!-- <button class="button_search" @click="rectification">转维修</button>-->
511
+ <button class="button_search" @click="cancel1">取消</button>
512
+ </div>
513
+ </modal>
514
+ <modal :show.sync="showModal3">
515
+ <div slot="modal-header" class="modal-header">
516
+ <h4 class="modal-title">
517
+ 转维修进度{{ progressbarWidth }}%
518
+ </h4>
519
+ </div>
520
+ <div slot="modal-body" class="modal-body">
521
+ <div class="progress">
522
+ <div class="progress-bar" role="progressbar" aria-valuenow="60"
523
+ aria-valuemin="0" aria-valuemax="100" :style="'width:'+ progressbarWidth+'%'">
524
+ <!-- <span class="sr-only">40% 完成</span>-->
525
+ </div>
526
+ </div>
527
+ </div>
528
+ <div slot="modal-footer" class="modal-footer" style="text-align: center" v-show="false"></div>
529
+ </modal>
530
+ </div>
531
+ </template>
532
+ <script>
533
+ import {PagedList} from 'vue-client'
534
+ import HttpResetClass from 'vue-client/src/plugins/HttpResetClass'
535
+ import co from 'co'
536
+ import Vue from 'vue'
537
+ import * as Util from '../../../components/Util'
538
+
539
+ let select = function * (self) {
540
+ let http = new HttpResetClass()
541
+ let getGasman = yield http.load('POST', '/rs/search', {
542
+ source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
543
+ userid: self.$login.f.id
544
+ }, {resolveMsg: null, rejectMsg: null})
545
+ //tag
546
+ self.checkersid.push({label: '全部', value: ''})
547
+ getGasman.data.forEach((checker) => {
548
+ self.checkersid.push({label: checker.name, value: checker.name})
549
+ })
550
+ }
551
+ export default {
552
+ title: '隐患查询',
553
+ data () {
554
+ let model = new PagedList('rs/sql/GetCheckPaperByDefectNew2', 20, {
555
+ f_filialeids: 'this.f_filialeids', f_defect_content: 'this.f_defect_content'
556
+ })
557
+ model.f_filialeids = '(' + this.$login.f.orgid + ')'
558
+ model.f_defect_content = 'CASE WHEN CHARINDEX( \'"result":"正常"\', f_defect_content ) > 0 THEN \'无隐患\' ELSE replace(replace(replace( replace( RIGHT ( f_defect_content, len( f_defect_content ) - 26 ), substring(\'{}\',2,1), \'\' ), substring(\'{}\',1,1), \'\' ),\']\',\'\'),\'"\',\'\') END'
559
+ return {
560
+ repaired: [{label: '全部', value: ''}, {label: '未完成', value: '未完成'}, {label: '已完成', value: '已完成'}],
561
+ deals: [{label: '全部', value: ''}, {label: '未处理', value: '未处理'}, {label: '已处理', value: '已处理'},{label: '处理中', value: '处理中'}],
562
+ hasDefectOptions: [{label: '全部', value: ''}, {label: '有隐患', value: '有隐患'}, {
563
+ label: '无隐患',
564
+ value: '无隐患'
565
+ }],
566
+ f: this.$login.f,
567
+ model: model,
568
+ criteriaShow: false,
569
+ checkAll: false,
570
+ timercount: 0,
571
+ showModal2: false,
572
+ repairTypeOptions: this.$appdata.getParam('转维修类型'),
573
+ dispatchTypeOptions: [{label: '派发给维修员', value: '派发给维修员'}],
574
+ checkes: [],
575
+ showModal: false,
576
+ f_check_plan: {f_plan_name: '', id: ''},
577
+ sumsmodel: {},
578
+ resids: {},
579
+ all: false,
580
+ fields: {},
581
+
582
+ selectData: {
583
+ dispatchType: '',
584
+ f_repairman: '',
585
+ f_remarks: '',
586
+ f_repairtype: ''
587
+ },
588
+ progressbarWidth: '0',
589
+ modelval: [],
590
+ isbusy: false,
591
+ checkersid: [],
592
+ showModal3: false,
593
+ toRepairCount: 0,
594
+ sliceArea: [],
595
+ callSends: [],
596
+ cbc: [],
597
+ repairedOptions: [{label: '全部', value: ''}, {label: '已修', value: '已修'}, {label: '未修', value: '未修'}],
598
+ repairers: [],
599
+ cbcs: [],
600
+ thead: '',
601
+ headData: ['入户状态', '用户编号', '用户名', '用户电话', '用户小区', '用户地址', '用户表号', '安检时间', '安检员', '计划名', '是否有隐患', '隐患数', '隐患明细'],
602
+ bodyData: ['f_entry_status', 'f_userinfo_code', 'f_user_name', 'f_user_phone', 'f_residential_area', 'f_address', 'f_meternumber', 'f_offsite_time', 'f_checker_name', 'f_plan_name', 'f_has_defect', 'f_defect_count', 'f_defect_content'],
603
+ f_defect_contents: [{label:"全部",value:""}],
604
+ DevicesConfig: [],
605
+ DevicesSetConfig: []
606
+ }
607
+ },
608
+ props: {
609
+ style: {
610
+ type: String,
611
+ default: 'col-sm-2 form-group'
612
+ },
613
+ style2: {
614
+ type: String,
615
+ default: 'col-sm-4 form-group'
616
+ }
617
+
618
+ },
619
+
620
+ methods: {
621
+ trouble (val) {
622
+ // return val.replaceAll("'",'')
623
+ // .replaceAll("\"",'')
624
+ // .replaceAll("{",'')
625
+ // .replaceAll("}",'')
626
+ // .replaceAll("]",'')
627
+ // .replaceAll("[",'')
628
+ // .replaceAll("result:",'')
629
+ // .replaceAll("data:",'')
630
+ // .replaceAll("有隐患",'')
631
+ // .replaceAll(",",'')
632
+
633
+ const defect_content = JSON.parse(val)
634
+ let result = ''
635
+ if (defect_content.data) {
636
+ const jsonData = defect_content.data
637
+ for (const itemdata of jsonData) {
638
+ const keys = Object.keys(itemdata)
639
+ for (const itm of keys) {
640
+ const value = itemdata[itm]
641
+ result += itm + ':' + value + ','
642
+ }
643
+ }
644
+ }
645
+ return result
646
+ },
647
+ getEmp () {
648
+ let val = {
649
+ source: 'this.getParentByType($organization$).getSpecialResByType($user$).where(row.getAttributes().get($rolestr$)!=null ).where(row.getAttributes().get($rolestr$).indexOf($维修员$) != -1))',
650
+ userid: `${this.$login.f.id}`
651
+ }
652
+ let http = new HttpResetClass()
653
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
654
+ let str = ''
655
+ res.data.forEach((item, idx, arr) => {
656
+ //tag
657
+ if (idx + 1 == arr.length) {
658
+ str += item.id
659
+ } else {
660
+ str += item.id + ','
661
+ }
662
+
663
+ })
664
+ let http1 = new HttpResetClass()
665
+ http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
666
+ data: {
667
+ items: 'id,f_user_telephone',
668
+ tablename: 't_user',
669
+ condition: `id in (${str})`,
670
+ orderitem: 'id'
671
+ }
672
+ }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
673
+
674
+ res.data.forEach((user) => {
675
+ try {
676
+ ress.data.forEach((tel, tidx, arr) => {
677
+ //tag
678
+ if (user.id == tel.id) {
679
+ this.repairers.push({label: `${user.name}:${tel.f_user_telephone}`, value: user.name})
680
+ ress.data.splice(tidx, 1)
681
+ //tag
682
+ throw new Error('跳出循环')
683
+ }
684
+ })
685
+ } catch (e) {
686
+ //tag
687
+ }
688
+ })
689
+ })
690
+
691
+ })
692
+ },
693
+ toRepair () {
694
+ //tag
695
+ this.showModal2 = true
696
+ },
697
+ async rectification () {
698
+ this.isbusy = true
699
+ // if (this.checkAll){
700
+ let data = {
701
+ f_filialeids: this.model.params.f_filialeids,
702
+ f_defect_content: this.model.params.f_defect_content,
703
+ condition: this.model.params.condition
704
+ }
705
+ let res1 = await new HttpResetClass().load('post', 'rs/sql/GetCheckPaperByDefectNew2', {data: data})
706
+ for (let i = 0; i < res1.data.length; i++) {
707
+ let data1 = {
708
+ f_paper_id: res1.data[i].id,
709
+ condition: `f_repaire_type != '无隐患'`
710
+ }
711
+ let res2 = await new HttpResetClass().load('POST', 'rs/sql/GetDefectByPaperIdNew2', {data: data1})
712
+ //tag
713
+ const uploadData = {
714
+ model: {
715
+ serviceacitivity: [{
716
+ f_service_acitivity_type: '派单'
717
+ }],
718
+ f_repairitems: {},
719
+ failure: '',
720
+ f_source: '安检',
721
+ f_service_id: '',
722
+ f_contact_phone: '',
723
+ f_meetunit: '',
724
+ f_phone: '',
725
+ f_user_name: '',
726
+ f_address: '',
727
+ f_repair_date: '',
728
+ f_reciever: '',
729
+ f_remarks: '',
730
+ f_user_type: '',
731
+ f_area: '',
732
+ f_unit_name: '',
733
+ f_street: '',
734
+ f_residential_area: '',
735
+ f_building: '',
736
+ f_unit: '',
737
+ f_floor: '',
738
+ f_room: '',
739
+ aState: '',
740
+ f_repairtype: '',
741
+ f_userinfo_id: '',
742
+ f_userinfo_code: '',
743
+ f_orgstr: '',
744
+ f_outlets: '',
745
+ f_attendant: this.$login.f.name
746
+ },
747
+ loginUser: {
748
+ name: this.$login.f.name,
749
+ ename: this.$login.f.ename
750
+ },
751
+ user: {
752
+ f_userinfo_id: ''
753
+ },
754
+ callObj: null
755
+ }
756
+
757
+ uploadData.model.serviceacitivity[0].f_reciever = this.selectData.f_repairman
758
+ // uploadData.model.f_meetunit = self.$login.f.orgpathnames
759
+ // uploadData.model.f_orgstr = self.$login.f.orgpathstr
760
+ // uploadData.model.f_outlets = self.$login.f.f_parentname
761
+ uploadData.model.f_meetunit = this.$login.f.deps
762
+ uploadData.model.f_orgid = this.$login.f.orgid
763
+ uploadData.model.f_filiale = this.$login.f.org
764
+ uploadData.model.f_outlets = this.$login.f.deps
765
+ uploadData.model.f_filiale_id = this.$login.f.orgid
766
+ uploadData.toRepair = '一级派单'
767
+ let res3 = await new HttpResetClass().load('post', '/rs/sql/GetUserForRepaireNew2', {data: {f_userinfo_id: res1.data[i].f_userinfo_id}})
768
+ uploadData.model = Object.assign(uploadData.model, res3.data[0])
769
+ uploadData.user.f_userinfo_id = res3.data[0].f_userinfo_id
770
+ uploadData.model.f_repair_date = Util.getNowDate()
771
+ uploadData.model.f_repairtype = res3.data[0].f_repairtype
772
+ uploadData.model.f_remarks = res3.data[0].f_remarks
773
+ let failure = []
774
+ res2.data.forEach(row => {
775
+ if (row.f_repaire_type == '隐患未处理') {
776
+ console.log('row.f_item_value', row.f_item_value)
777
+ failure.push({
778
+ f_failure_type: row.f_item_name,
779
+ failurecase: row.f_item_value ? row.f_item_value.split(',') : ''
780
+ })
781
+ }
782
+ })
783
+ uploadData.model.failure = failure
784
+ // 拼接repairitems
785
+ let rows = JSON.parse(JSON.stringify(res2.data))
786
+ let repairitems = {
787
+ data: []
788
+ }
789
+ let safecheckOptions = [{'data': '已处理'}, {'data': '未处理'}]
790
+ // 取隐患未处理的
791
+ rows = rows.filter(row => row.f_repaire_type == '隐患未处理')
792
+ //tag)
793
+ // 开始拼接
794
+ rows.forEach(row => {
795
+ let existIndex = -1
796
+ // 判断该设备是否已经存在
797
+ for (let i = 0; i < repairitems.data.length; i++) {
798
+ if (repairitems.data[i].f_type == row.f_device_type) {
799
+ existIndex = i
800
+ break
801
+ }
802
+ }
803
+ if (existIndex == -1) {
804
+ // 不存在则新建
805
+ let newItem = {
806
+ f_type: row.f_device_type,
807
+ details: [{
808
+ f_defect_id: row.id,
809
+ f_project: `${row.f_item_name}:${row.f_item_value}`,
810
+ type: 'selector',
811
+ options: safecheckOptions
812
+ }]
813
+ }
814
+ repairitems.data.push(newItem)
815
+ } else {
816
+ // 存在则追加
817
+ repairitems.data[existIndex].details.push({
818
+ f_defect_id: row.id,
819
+ f_project: `${row.f_item_name}:${row.f_item_value}`,
820
+ type: 'selector',
821
+ options: safecheckOptions
822
+ })
823
+ }
824
+ })
825
+ uploadData.model.f_repairitems = repairitems
826
+ uploadData.rows = rows
827
+ //tag)
828
+ //tag
829
+ if (uploadData.model.f_repairitems.data.length > 0) {
830
+ this.callSends.push(uploadData)
831
+ } else {
832
+ //tag
833
+ }
834
+ }
835
+ //tag)
836
+ let timer = setInterval(async () => {
837
+ this.showModal3 = true
838
+ this.isbusy = false
839
+ if (this.timercount < this.callSends.length) {
840
+ //tag)
841
+ let rows = this.callSends[this.timercount].rows
842
+ //tag)
843
+ let result = await this.$resetpost('/rs/logic/callerSend', this.callSends[this.timercount])
844
+ //tag)
845
+ if (result.data.f_service_id) {
846
+ const data = {
847
+ f_paper_id: rows[0].f_paper_id,
848
+ f_service_id: result.data.f_service_id,
849
+ itemsId: this.$login.convertToIn(rows.map(row => row.id))
850
+ }
851
+ //tag
852
+ let updateRes = await this.$resetpost('/rs/logic/updateDefectStateNew', data)
853
+ }
854
+ this.toRepairCount++
855
+ //tag
856
+ this.timercount++
857
+ } else {
858
+ clearInterval(timer)
859
+ //tag
860
+ this.callSends = []
861
+ this.timercount = 0
862
+ this.showModal3 = false
863
+ this.cancel1()
864
+ this.$showMessage('本次转维修成功' + this.toRepairCount + '单')
865
+ this.toRepairCount = 0
866
+ }
867
+ }, 3000)
868
+ },
869
+ cancel1 () {
870
+ this.showModal2 = false
871
+ this.selectData = {
872
+ dispatchType: '',
873
+ f_repairman: '',
874
+ f_remarks: '',
875
+ f_repairtype: ''
876
+ }
877
+ },
878
+ sleep (d) {
879
+ //tag)
880
+ var t = Date.now()
881
+ while (Date.now - t <= d) {
882
+
883
+ }
884
+ //tag)
885
+ },
886
+ isChecked (v) {
887
+ // 如果全选,不在的按选中算,否则,在的按选中算
888
+ if (this.checkAll) {
889
+ return this.checkes.indexOf(v) == -1
890
+ } else {
891
+ return this.checkes.indexOf(v) != -1
892
+ }
893
+ },
894
+ setCheckAll () {
895
+ this.checkAll = this.checkAll ? false : true
896
+ // 全选改变后,清空选中数据
897
+ this.checkes = []
898
+ },
899
+ setCheckes (id) {
900
+ let index = this.checkes.indexOf(id)
901
+ if (index < 0) {
902
+ this.checkes.push(id)
903
+ } else {
904
+ this.checkes.splice(index, 1)
905
+ }
906
+ },
907
+ getmeterbook (val) {
908
+ this.cbc = []
909
+ this.cbc.push({
910
+ label: '全部',
911
+ value: ''
912
+ })
913
+ if (val == '') {
914
+
915
+ this.cbcs.forEach(res => {
916
+ this.cbc.push({
917
+ label: res.f_book_name,
918
+ value: res.id
919
+ })
920
+ })
921
+ } else {
922
+ this.cbcs.forEach(res => {
923
+ if (res.f_book_slice_area == val) {
924
+ this.cbc.push({
925
+ label: res.f_book_name,
926
+ value: res.id
927
+ })
928
+ }
929
+ })
930
+ }
931
+ },
932
+ Mreadibook (val) {
933
+ //tag
934
+ //tag
935
+ this.sliceArea = []
936
+ if (val) {
937
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
938
+ data: {
939
+ items: 'name',
940
+ tablename: 't_zone',
941
+ condition: `parentid in ${val}`,
942
+ orderitem: 'id'
943
+ }
944
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
945
+ this.sliceArea.push({
946
+ label: '全部',
947
+ value: ''
948
+ })
949
+ res.data.forEach(ress => {
950
+ this.sliceArea.push({
951
+ label: ress.name,
952
+ value: ress.name
953
+ })
954
+ })
955
+
956
+ })
957
+ }
958
+ },
959
+ getAllMeterBook (val) {
960
+ //tag
961
+ //tag
962
+ this.cbcs = []
963
+ if (val) {
964
+ new HttpResetClass().load('POST', `/rs/sql/tel_singleTable_OrderBy`, {
965
+ data: {
966
+ items: 'f_book_name,f_book_slice_area,id',
967
+ tablename: 't_meter_book',
968
+ condition: `f_filiale_id in ${val}`,
969
+ orderitem: 'id'
970
+ }
971
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
972
+ res.data.forEach(ress => {
973
+ this.cbcs.push({
974
+ id: ress.id,
975
+ f_book_name: ress.f_book_name,
976
+ f_book_slice_area: ress.f_book_slice_area
977
+ })
978
+ })
979
+ this.cbc = []
980
+ this.cbc.push({
981
+ label: '全部',
982
+ value: ''
983
+ })
984
+ this.cbcs.forEach(res => {
985
+ this.cbc.push({
986
+ label: res.f_book_name,
987
+ value: res.id
988
+ })
989
+ })
990
+ })
991
+ }
992
+ },
993
+ hiddenr () {
994
+ this.$parent.showItem = !this.$parent.showItem
995
+ },
996
+ hidden () {
997
+ this.criteriaShow = !this.criteriaShow
998
+ },
999
+ search (args) {
1000
+ //tag
1001
+ if (this.f_check_plan.f_plan_name) {
1002
+ args.condition += ` and f_check_plan_id = '${this.f_check_plan.id}'`
1003
+ }
1004
+ this.checkes = []
1005
+ this.checkAll = false
1006
+ this.model.search(args.condition, args.model)
1007
+ },
1008
+ getRes (obj) {
1009
+ //tag
1010
+ this.resids = {res: obj.res[0], resids: obj.resids[0]}
1011
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids)
1012
+ this.Mreadibook(this.model.f_filialeids)
1013
+ this.getAllMeterBook(this.model.f_filialeids)
1014
+ },
1015
+ showChooser () {
1016
+ this.showModal = true
1017
+ },
1018
+ ok () {
1019
+ this.showModal = false
1020
+ if (this.$refs.modal.$children[0].selectedRow.id) {
1021
+ this.f_check_plan = this.$refs.modal.$children[0].selectedRow
1022
+ }
1023
+ },
1024
+ cancel () {
1025
+ this.showModal = false
1026
+ this.f_check_plan = {f_plan_name: '', id: ''}
1027
+ },
1028
+ async asyncReady (self) {
1029
+ // 获取配置信息
1030
+ try {
1031
+ let res = await new HttpResetClass().load('post', 'rs/sql/tel_singleTable_OrderBy', {
1032
+ data: {
1033
+ items: 'f_dir',
1034
+ tablename: 't_organization',
1035
+ condition: `id = '${self.$login.f.orgid}'`,
1036
+ orderitem: 'id'
1037
+ }
1038
+ })/*.then(res=>{*/
1039
+ //tag
1040
+ //tag)
1041
+ if (!res.data[0].f_dir) {
1042
+ self.$showMessage("该公司无组织目录,无法获取配置文件,请联系管理员确认")
1043
+ } else {
1044
+ //this.f_dir=res.data[0].f_dir
1045
+ try {
1046
+ let res1 = await new HttpResetClass().load('GET', `/safecheck/rs/vue/DevicesConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {}, {
1047
+ resolveMsg: '获取居民配置项成功!',
1048
+ rejectMsg: '获取居民配置项出错!'
1049
+ })
1050
+ this.DevicesConfig = res1.data
1051
+ let res2 = await new HttpResetClass().load('GET', `/safecheck/rs/vue/DevicesSetConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {}, {
1052
+ resolveMsg: '获取非居民配置项成功!',
1053
+ rejectMsg: '获取非居民配置项出错!'
1054
+ })
1055
+ this.DevicesSetConfig = res2.data
1056
+ } catch (e) {
1057
+ self.$showMessage("获取配置文件失败" + e)
1058
+ }
1059
+ }
1060
+ } catch (error) {
1061
+ // 忽略704,文件找不到异常R
1062
+ if (error.status !== 704) {
1063
+ throw error
1064
+ }
1065
+ }
1066
+ }
1067
+ },
1068
+ ready () {
1069
+ //tag
1070
+ this.$refs.paged.$refs.criteria.model.f_has_defect = '有隐患'
1071
+ this.getEmp()
1072
+ let gen = select(this)
1073
+ // this.Mreadibook(`('${this.$login.f.orgid}')`)
1074
+ co(gen)
1075
+ this.asyncReady(this).then(()=>{
1076
+ let defectTypeSet = new Set()
1077
+ if (this.DevicesConfig) {
1078
+ for (const key in this.DevicesConfig) {
1079
+ if (Object.hasOwnProperty.call(this.DevicesConfig, key)) {
1080
+ for (const ke in this.DevicesConfig[key]['items']) {
1081
+ defectTypeSet.add(ke)
1082
+ }
1083
+ }
1084
+ }
1085
+ }
1086
+ if (this.DevicesSetConfig) {
1087
+ for (const key in this.DevicesSetConfig) {
1088
+ if (Object.hasOwnProperty.call(this.DevicesConfig, key)) {
1089
+ for (const ke in this.DevicesConfig[key]['items']) {
1090
+ defectTypeSet.add(ke)
1091
+ }
1092
+ }
1093
+ }
1094
+ }
1095
+ defectTypeSet.forEach((item) => {
1096
+ this.f_defect_contents.push({label: item, value: item})
1097
+ })
1098
+ })
1099
+ },
1100
+ watch: {
1101
+ 'timercount' () {
1102
+ if (this.timercount === 0) {
1103
+ this.progressbarWidth = '0'
1104
+ } else {
1105
+ //tag
1106
+ //tag
1107
+ this.progressbarWidth = parseInt(this.timercount * 100 / (this.callSends.length + 1))
1108
+ }
1109
+
1110
+ }
1111
+ },
1112
+ computed: {
1113
+ selected () {
1114
+ return this.$refs.paged.$refs.grid.selected
1115
+ },
1116
+ getfield () {
1117
+ //tag
1118
+ let data = {}
1119
+ this.bodyData.forEach((value, index) => {
1120
+ data[this.bodyData[index]] = this.headData[index]
1121
+ })
1122
+ //合计字段打印
1123
+ this.tfoot = `<tr><th colspan=${this.modelval.length}>全表汇总信息: `
1124
+ if (this.sumsmodel) {
1125
+ Object.keys(this.sumsmodel).forEach((key) => {
1126
+ this.tfoot += this.fields[key] + '合计: ' + `<font color="blue">${this.sumsmodel[key]} </font>`
1127
+ })
1128
+ } else {
1129
+ this.tfoot += '暂无'
1130
+ }
1131
+ this.tfoot += '</th></tr>'
1132
+ return data
1133
+ }
1134
+ }
1135
+ }
1136
+ </script>