safecheck-client 3.0.30-6 → 3.0.30-8

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