safecheck-client 3.0.34-74 → 3.0.34-76

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,972 +1,1041 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged @sort="sort">
5
- <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row">
8
- <div class="form-group col-sm-2" >
9
- <label class="font_normal_body">模糊查询</label>
10
- <input type="text" class="input_search" v-model="model.f_userinfo"
11
- style="width: 60%" placeholder="编号 名称 电话 地址"
12
- 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 '%${}%')">
13
- </div>
14
- <div class="form-group col-sm-2" >
15
- <label class="font_normal_body">客户编号</label>
16
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
17
- style="width: 60%" placeholder="客户编号" condition="f_userinfo_code='{}'">
18
- </div>
19
- <div class="form-group col-sm-2" >
20
- <label class="font_normal_body">客户名称</label>
21
- <input type="text" class="input_search" v-model="model.f_user_name"
22
- style="width: 60%" placeholder="客户名称" condition="f_user_name like '%{}%'">
23
- </div>
24
- <div class="form-group col-sm-2" >
25
- <label class="font_normal_body">客户电话</label>
26
- <input type="text" class="input_search" v-model="model.f_user_phone"
27
- style="width: 60%" placeholder="客户电话" condition=" ( f_user_phone like '%{}%' or f_zuhu_phone like '%${}%' or f_rent_phone like '%${}%' )">
28
- </div>
29
- <div class="form-group col-sm-4" style="display: flex; gap: 15px">
30
- <export-excel-safe :data="$parent.$parent.searchData"
31
- :field="$parent.$parent.excelHeaders"
32
- progress="safeGetExportProgress"
33
- sqlurl="rs/logic/SafeExportExcel" sql-name="defectDetails" template-name='安检隐患明细'></export-excel-safe>
34
- <button class="button_search" @click="$parent.$parent.showaudio()" v-if="$parent.$parent.audioshow">隐藏</button>
35
- <button class="button_search" @click="$parent.$parent.toRepair" v-if="$parent.$parent.canToRepair == '是'">转维修</button>
36
- <button class="button_search" @click="search()">查询</button>
37
- <div class="button_spacing"
38
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
39
- @click="$parent.$parent.hidden()"></div>
40
- </div>
41
-
42
- </div>
43
- <div class="row">
44
- <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
45
- <role-selector-safe
46
- role-name="安检员"
47
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
48
- @re-res="$parent.$parent.getRes"
49
- :value.sync="model.f_checker_id"
50
- v-model="model.f_checker_id"
51
- :value-multiple="true"
52
- :value-close="false"
53
- condition="f_checker_name in {}">
54
- </role-selector-safe>
55
- </div>
56
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
57
- <label class="font_normal_body">小&emsp;&emsp;区</label>
58
- <input type="text" class="input_search" v-model="model.f_residential_area"
59
- style="width: 60%" placeholder="小区" condition="f_residential_area like '%{}%'">
60
- </div>
61
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
62
- <label class="font_normal_body">检&ensp;查&ensp;项</label>
63
- <v-select :value.sync="model.f_device_type"
64
- v-model="model.f_device_type"
65
- style="width: 60%"
66
- class="select_list select"
67
- :options='$parent.$parent.device_types'
68
- placeholder='检查项'
69
- :multiple="true"
70
- condition="f_device_type in {}"></v-select>
71
- <!--<input type="text" class="input_search" v-model="model.f_device_type"-->
72
- <!--style="width: 60%" placeholder="检&ensp;查&ensp;项" condition="f_device_type like '%{}%'">-->
73
- </div>
74
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
75
- <label class="font_normal_body">隐患名称</label>
76
- <v-select :value.sync="model.f_item_name"
77
- v-model='model.f_item_name'
78
- style="width: 60%"
79
- class="select_list select"
80
- :options='$parent.$parent.DefectConfigs'
81
- placeholder='隐患名称'
82
- :multiple="true"
83
- condition="f_item_name in {}"></v-select>
84
- </div>
85
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
86
- <label class="font_normal_body">安检起始</label>
87
- <datepicker
88
- class="select_list select"
89
- :value.sync="model.f_check_start"
90
- placeholder='安检起始时间' style="width: 60%"
91
- :disabled-days-of-week="[]"
92
- :format="'yyyy-MM-dd'"
93
- :show-rest-button="reset"
94
- v-model="model.f_check_start"
95
- condition="f_offsite_time > ='{} 00:00:00'">
96
- </datepicker>
97
- </div>
98
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
99
- <label class="font_normal_body">安检结束</label>
100
- <datepicker
101
- class="select_list select"
102
- :value.sync="model.f_check_end"
103
- placeholder='安检结束时间' style="width: 60%"
104
- :disabled-days-of-week="[]"
105
- :format="'yyyy-MM-dd'"
106
- :show-rest-button="reset"
107
- v-model="model.f_check_end"
108
- condition="f_offsite_time <= '{} 23:59:59'">
109
- </datepicker>
110
- </div>
111
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
112
- <label class="font_normal_body">用户类型</label>
113
- <v-select :value.sync="model.f_check_type" v-model='model.f_check_type'
114
- :value-single="true" style="width: 60%"
115
- class="select_list select"
116
- :options='$parent.$parent.f_check_type' placeholder='请选择'
117
- close-on-select
118
- condition="f_check_type = '{}'"></v-select>
119
- </div>
120
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
121
- <label class="font_normal_body">处理方式</label>
122
- <v-select :value.sync="model.f_deal_dispose"
123
- v-model='model.f_deal_dispose'
124
- style="width: 60%"
125
- class="select_list select"
126
- :options='$parent.$parent.deal_dispose' placeholder='请选择'
127
- :multiple="true"
128
- condition="f_deal_dispose in {}"></v-select>
129
- </div>
130
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
131
- <label class="font_normal_body">详细地址</label>
132
- <input type="text" class="input_search" v-model="model.f_address"
133
- style="width: 60%" placeholder="详细地址" condition="f_address like '%{}%'">
134
- </div>
135
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
136
- <label class="font_normal_body">隐患状态</label>
137
- <v-select :value.sync="model.f_is_repaired"
138
- v-model='model.f_is_repaired'
139
- style="width: 60%"
140
- class="select_list select"
141
- :options='$parent.$parent.repairStateOptions' placeholder='请选择'
142
- :multiple="true"
143
- condition="f_is_repaired in {}"></v-select>
144
- </div>
145
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
146
- <label class="font_normal_body">处理人</label>
147
- <input type="text" class="input_search" v-model="model.f_repairman"
148
- style="width: 60%" placeholder="处理人" condition="f_repairman = '{}'">
149
- </div>
150
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
151
- <label for="startDate" class="font_normal_body">处理时间:</label>
152
- <datepicker id="startDate" placeholder="处理开始日期"
153
- style="width: 60%!important;"
154
- v-model="model.sq_startDate"
155
- :value.sync="model.sq_startDate"
156
- :format="'yyyy-MM-dd 00:00:00'"
157
- :show-reset-button="true"
158
- condition="f_repair_date >= '{}'">
159
- </datepicker>
160
- </div>
161
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
162
- <label for="endDate" class="font_normal_body">处理时间:</label>
163
- <datepicker id="endDate" placeholder="处理结束日期"
164
- style="width: 60%!important;"
165
- v-model="model.sq_endDate"
166
- :value.sync="model.sq_endDate"
167
- :format="'yyyy-MM-dd 23:59:59'"
168
- :show-reset-button="true"
169
- condition="f_repair_date<= '{}'">
170
- </datepicker>
171
- </div>
172
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
173
- <label class="font_normal_body">首次通气开始</label>
174
- <datepicker
175
- :value.sync="model.f_gas_start"
176
- placeholder='首次通气开始时间' style="width: 60%"
177
- :disabled-days-of-week="[]"
178
- :format="'yyyy-MM-dd'"
179
- :show-rest-button="reset"
180
- v-model="model.f_gas_start"
181
- condition="f_uservent_date >='{} 00:00:00'">
182
- </datepicker>
183
- </div>
184
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
185
- <label class="font_normal_body">首次通气结束</label>
186
- <datepicker
187
- :value.sync="model.f_gas_end"
188
- placeholder='首次通气结束时间' style="width: 60%"
189
- :disabled-days-of-week="[]"
190
- :format="'yyyy-MM-dd'"
191
- :show-rest-button="reset"
192
- v-model="model.f_gas_end"
193
- condition="f_uservent_date <= '{} 23:59:59'">
194
- </datepicker>
195
- </div>
196
- </div>
197
- <modal :show.sync="$parent.$parent.showModal" v-ref:modal>
198
- <div slot="modal-header" class="modal-header">
199
- <h4 class="modal-title">
200
- 选择计划
201
- </h4>
202
- </div>
203
- <div slot="modal-body" class="modal-body">
204
- <plan-chooser :f.sync="$parent.$parent.fun" v-ref:chooser></plan-chooser>
205
- </div>
206
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
207
- <button class="button_search" @click="$parent.$parent.ok">确认</button>
208
- <button class="button_search" @click="$parent.$parent.cancel">取消</button>
209
- </div>
210
- </modal>
211
- </div>
212
- </criteria>
213
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
214
- <template partial='head'>
215
- <tr>
216
- <th v-if="$parent.$parent.$parent.canToRepair=='是'"><nobr>选择</nobr></th>
217
- <th>
218
- <nobr>检查项</nobr>
219
- </th>
220
- <th>
221
- <nobr>隐患原因</nobr>
222
- </th>
223
- <th>
224
- <nobr>隐患级别</nobr>
225
- </th>
226
- <th>
227
- <nobr>客户编号</nobr>
228
- </th>
229
- <th>
230
- <nobr>客户名称</nobr>
231
- </th>
232
- <th>
233
- <nobr>客户电话</nobr>
234
- </th>
235
- <th>
236
- <nobr>客户小区</nobr>
237
- </th>
238
- <th>
239
- <data-order field="f_address" name="客户地址"></data-order>
240
- </th>
241
- <th>
242
- <nobr>首次通气时间</nobr>
243
- </th>
244
- <th>
245
- <data-order field="f_offsite_time" name="安检时间"></data-order>
246
- </th>
247
- <th>
248
- <nobr>安检员</nobr>
249
- </th>
250
- <th>
251
- <nobr>隐患状态</nobr>
252
- </th>
253
- <th>
254
- <nobr>处理人</nobr>
255
- </th>
256
- <th>
257
- <nobr>处理方式</nobr>
258
- </th>
259
- <th>
260
- <nobr>处理时间</nobr>
261
- </th>
262
- <th>
263
- <nobr>工单编号</nobr>
264
- </th>
265
- <th>
266
- <nobr>转单类型</nobr>
267
- </th>
268
- <th>
269
- <nobr>接收人</nobr>
270
- </th>
271
- </tr>
272
- </template>
273
- <template partial='body'>
274
- <td v-if="$parent.$parent.$parent.canToRepair=='是'" style="text-align: center;white-space:nowrap;"><input type="checkbox" v-if="['用户自行整改', '现场已处理', '维修已处理', '转维修'].indexOf(row.f_is_repaired) == -1" @click="$event.cancelBubble=true" :checked="$parent.$parent.$parent.isChecked(row)" @change="$parent.$parent.$parent.setCheckes(row)"></input></td>
275
- <td style="text-align: center">{{row.f_device_type}}</td>
276
- <td style="text-align: center">{{row.f_item_name}}/{{row.f_item_value}}</td>
277
- <td style="text-align: center">{{row.f_defect_level}}</td>
278
- <td style="text-align: center">{{row.f_userinfo_code}}</td>
279
- <td style="text-align: center">{{row.f_user_name}}</td>
280
- <td style="text-align: center">{{row.f_user_phone}}</td>
281
- <td style="text-align: center">{{row.f_residential_area}}</td>
282
- <td style="text-align: center">{{row.f_address}}</td>
283
- <td style="text-align: center;white-space:nowrap;">{{row.f_uservent_date}}</td>
284
- <td style="text-align: center">{{row.f_offsite_time}}</td>
285
- <td style="text-align: center">{{row.f_checker_name}}</td>
286
- <td style="text-align: center" v-if="row.f_is_repaired == '隐患未处理' && $parent.$parent.$parent.inrole()" @click="$parent.$parent.$parent.showSolve(row)"><a>{{row.f_is_repaired}}</a></td>
287
- <td style="text-align: center" v-else>{{row.f_is_repaired}}</td>
288
- <td style="text-align: center">{{row.f_repairman}}</td>
289
- <td style="text-align: center">{{row.f_deal_dispose}}</td>
290
- <td style="text-align: center">{{row.f_repair_date}}</td>
291
- <td style="text-align: center">{{row.f_service_id}}</td>
292
- <td style="text-align: center">{{row.f_handlingtype}}</td>
293
- <td style="text-align: center">{{row.f_order_man}}</td>
294
- </template>
295
- </data-grid>
296
- </criteria-paged>
297
- <check-msg v-if="showcheckmsg" :show="showcheckmsg" :data="checkInfo"></check-msg>
298
- <modal :show.sync="showModal2" :backdrop="false">
299
- <div slot="modal-header" class="modal-header">
300
- <h4 class="modal-title">
301
- 转维修
302
- </h4>
303
- </div>
304
- <div slot="modal-body" class="modal-body">
305
- <div v-if="true">
306
- <div>
307
-
308
- </div>
309
- <!-- <div v-for="(index, item) in dangerGroup">-->
310
-
311
- <!-- </div>-->
312
- <div class="row" style="margin-top: 10px">
313
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">派发类型</label>
314
- <div class="col-xs-8 col-md-8">
315
- <v-select :value.sync="selectData.dispatchType" :value-single="true" v-model="selectData.dispatchType"
316
- :options='dispatchTypeOptions' placeholder='派发类型'
317
- close-on-select>
318
- </v-select>
319
- </div>
320
- </div>
321
- <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给维修员'">
322
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">维&ensp;修&ensp;员</label>
323
- <div class="col-xs-8 col-md-8">
324
- <v-select
325
- :value.sync="selectData.f_repairman"
326
- :value-single="true"
327
- :options='repairers'
328
- placeholder='请选择维修员'
329
- close-on-select></v-select>
330
- </div>
331
- </div>
332
- <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给站点'">
333
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">站&ensp;&ensp;&ensp;&ensp;点</label>
334
- <div class="col-xs-8 col-md-8">
335
- <right-tree
336
- islist
337
- :userid="userid"
338
- :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
339
- @re-res="getSiteRes"></right-tree>
340
- </div>
341
- </div>
342
- <div class="row" style="margin-top: 10px">
343
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">报修类型</label>
344
- <div class="col-xs-8 col-md-8">
345
- <v-select :value.sync="selectData.f_repairtype" style="width:60%"
346
- class="select select_list"
347
- :value-single="true"
348
- :options='repairTypeOptions'
349
- close-on-select>
350
- </v-select>
351
- </div>
352
- </div>
353
- <div class="row" style="margin-top: 10px">
354
- <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
355
- <div class="col-xs-8 col-md-8">
356
- <textarea style="width: 60%; height: 100px" v-model="selectData.f_remarks"></textarea>
357
- </div>
358
- </div>
359
- </div>
360
- </div>
361
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
362
- <button class="button_search" @click="rectification">转维修</button>
363
- <button class="button_search" @click="cancel1">取消</button>
364
- </div>
365
- </modal>
366
- <modal :show.sync="showModal3">
367
- <div slot="modal-header" class="modal-header">
368
- <h4 class="modal-title">
369
- 转维修进度{{ progressbarWidth }}%
370
- </h4>
371
- </div>
372
- <div slot="modal-body" class="modal-body">
373
- <div class="progress">
374
- <div class="progress-bar" role="progressbar" aria-valuenow="60"
375
- aria-valuemin="0" aria-valuemax="100" :style="'width:'+ progressbarWidth+'%'">
376
- </div>
377
- </div>
378
- </div>
379
- <div slot="modal-footer" class="modal-footer" style="text-align: center" v-show="false"></div>
380
- </modal>
381
- <modal :show.sync="showSolveModal" v-ref:solveModal>
382
- <div slot="modal-header" class="modal-header">
383
- <h4 class="modal-title">
384
- 处理隐患
385
- </h4>
386
- </div>
387
- <div slot="modal-body" class="modal-body">
388
- <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left">
389
- <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
390
- <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理前</p></div>
391
- </div>
392
-
393
- <div class="col-sm-6" style="margin-top: 10px">
394
- <label class="font_normal_body">安&nbsp;检&nbsp;员</label>
395
- <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="solve.model.f_checker_name" placeholder="安检员">
396
- </div>
397
- <div class="col-sm-6" style="margin-top: 10px">
398
- <label class="font_normal_body">安检时间</label>
399
- <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="solve.model.f_offsite_time" placeholder="安检时间">
400
- </div>
401
- <div class="col-sm-12" style="margin-bottom: 10px" v-if="solve.model.defectImg">
402
- <label class="font_normal_body">隐患图片</label>
403
- <img-self :width="200" :height="200" :src="solve.model.defectImg"></img-self>
404
- </div>
405
- <div class="col-sm-12" style="margin-bottom: 10px">
406
- <label class="font_normal_body">处理后图片</label>
407
- <avatar-upload :width="200" :height="200" :img-src.sync="solve.imgSrc" :filename.sync="solve.filename" v-ref:imginfo></avatar-upload>
408
- </div>
409
- </div>
410
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
411
- <button class="button_search" @click="okDefect">确认</button>
412
- <button class="button_search" @click="cancelsolveDefect">取消</button>
413
- </div>
414
- </modal>
415
- </div>
416
- </div>
417
- </template>
418
-
419
- <script>
420
- import {PagedList} from 'vue-client'
421
- import Vue from 'vue'
422
- import co from 'co'
423
- import AppData from '../../../stores/AppData'
424
- import * as Util from '../../Util'
425
- import getNowDate from "../../../utils/getNowDate";
426
- import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
427
- import BenzAMRRecorder from 'benz-amr-recorder'
428
- const upSolveDefect = function * (self) {
429
- self.solve.f_deal_dispose = self.solve.f_deal_dispose || '已处理'
430
- self.$resetpost('/rs/logic/pcRepairDefectNew', self.solve, {resolveMsg: null, rejectMsg: null})
431
- .then(res => {
432
- if (res.data.code === 200) {
433
- self.$showMessage('隐患已处理。')
434
- self.showSolveModal = false
435
- self.search()
436
- self.solve={
437
- model:{},
438
- id: '',
439
- f_repairman: self.$login.f.name,
440
- f_repair_date: Util.getNowDate().substr(0, 10),
441
- f_repair_path: '',
442
- imgSrc: '',
443
- filename: '',
444
- f_defect_remark:''
445
- }
446
- }
447
- })
448
- }
449
- //获取json配置文件
450
- let asyncReady = async function (self) {
451
- // 获取配置信息
452
- try {
453
- let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
454
- Vue.config = res.data
455
- self.getDefectInfoConfig(res.data)
456
- } catch (error) {
457
- // 忽略704,文件找不到异常R
458
- if (error.status !== 704) {
459
- throw error
460
- }
461
- }
462
- }
463
-
464
- let select = function* (self) {
465
- let http = new HttpResetClass()
466
- let getGasman = yield http.load('POST', '/rs/search', {
467
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
468
- userid: self.$login.f.id
469
- }, {resolveMsg: null, rejectMsg: null})
470
- ////tag
471
- self.checkersid.push({label: '全部', value: ''})
472
- getGasman.data.forEach((checker) => {
473
- self.checkersid.push({label: checker.name, value: checker.id})
474
- })
475
- }
476
-
477
- export default {
478
- title: '隐患明细查看',
479
- data() {
480
- let model = new PagedList('rs/sql/defectDetails', 20,{
481
- f_filialeid: 'this.f_filialeid'
482
- })
483
- model.f_plan_id = ''
484
- model.f_approved = ''
485
- model.f_entry = ''
486
- model.f_no_checkplan = ''
487
- model.f_check_type=''
488
- model.f_filialeid = `('${this.$login.f.orgid}')`
489
- return {
490
- audioshow:false,
491
-
492
- model: model,
493
- deal_dispose:[{label:'全部',value:''},{label:'报修',value:'报修'},{label:'现场整改',value:'现场整改'},{label:'自行处理',value:'自行处理'},{label:'未处理',value:'未处理'}],
494
- repairStateOptions: this.getSafeParam('隐患状态'),
495
- //searchData:searchData,
496
- excelHeaders: {
497
- 'f_device_type': '检查项',
498
- 'f_item_name': '隐患名称',
499
- 'f_userinfo_code': '客户编号',
500
- 'f_user_name': '客户姓名',
501
- 'f_user_phone': '客户电话',
502
- 'f_residential_area': '小区',
503
- 'f_address': '客户地址',
504
- 'f_uservent_date': '首次通气时间',
505
- 'f_offsite_time': '安检时间',
506
- 'f_checker_name': '安检员',
507
- 'f_deal_dispose': '处理方式',
508
- 'f_is_repaired': '隐患状态',
509
- 'f_repairman':'处理人',
510
- 'f_repair_date':'处理时间'
511
- },
512
- fun: this.$login.f,
513
- checkersid: [],
514
- safetype: this.getSafeParam('安检类型'),
515
- criteriaShow: false,
516
- showModal: false,
517
- f_approval_states: this.getSafeParam('安检单审核状态'),
518
- f_entry_status:this.getSafeParam('安检状态'),
519
- f_checkplans: this.getSafeParam('有无计划'),
520
- showcheckmsg: false,
521
- checkInfo: {},
522
- orderDefault: "'f_offsite_time'",
523
- orderFields: {
524
- f_offsite_time: 'no'
525
- },
526
- sliceArea: [],
527
- cbc:[],
528
- DefectConfig:'' ,
529
- DefectConfigs:[{label:'全部',value:''},{label: '金额异常差值', value: '金额异常差值'},{label: '气量异常差值', value: '气量异常差值'}],
530
- device_types:[{label:'全部',value:''}],
531
- f_check_type:[{label:'全部',value:''},{label:'民用',value:'民用'},{label:'非民用',value:'非民用'}],
532
- showModal2: false,
533
- selectData:{
534
- dispatchType:'',
535
- f_repairman:'',
536
- f_remarks:'',
537
- f_repairtype:''
538
- },
539
- repairers: [],
540
- repairTypeOptions:this.$appdata.getParam('报修类型'),
541
- dispatchTypeOptions: [{label: '派发给站点', value: '派发给站点'},{label: '派发给维修员', value: '派发给维修员'}],
542
- dangerGroups: [],
543
- showModal3: false,
544
- progressbarWidth:'0',
545
- canToRepair: this.$appdata.getSingleValue('隐患明细转维修'),
546
- checkes: [],
547
- solve:{
548
- model:{},
549
- id: '',
550
- f_repairman: this.$login.f.name,
551
- f_repair_date: Util.getNowDate().substr(0, 10),
552
- f_repair_path: '',
553
- imgSrc: '',
554
- filename: '',
555
- f_defect_remark:''
556
- },
557
- showSolveModal:false
558
- }
559
- },
560
- computed :{
561
- searchData() {
562
- return {condition: this.model.condition}
563
- }
564
- },
565
- methods: {
566
- isChecked(row) {
567
- return this.checkes.findIndex(item => item.f_defect_id == row.f_defect_id) != -1
568
- },
569
- setCheckes(row) {
570
- let index=this.checkes.findIndex(item => item.f_defect_id == row.f_defect_id)
571
- if(index<0){
572
- this.checkes.push(row)
573
- }else{
574
- this.checkes.splice(index,1)
575
- }
576
- console.log('this.checkes=', JSON.stringify(this.checkes))
577
- },
578
- toRepair(){
579
- console.log('this.checkes=', JSON.stringify(this.checkes))
580
- if(this.checkes.length==0){
581
- return this.$showMessage('请先选择需要转维修的隐患!')
582
- }
583
-
584
- const dangerGroups = []
585
- for (const danger of this.checkes) {
586
- let i = dangerGroups.findIndex(dangerGroup => dangerGroup.f_userinfo_code === danger.f_userinfo_code)
587
- if (i == -1){
588
- dangerGroups.push({
589
- f_userinfo_code: danger.f_userinfo_code,
590
- dangers: []
591
- })
592
- i = dangerGroups.length - 1
593
- }
594
- dangerGroups[i].dangers.push(danger)
595
- }
596
- this.dangerGroups = dangerGroups
597
- console.log('this.dangerGroups=', JSON.stringify(this.dangerGroups))
598
- this.showModal2=true
599
- },
600
- getEmp() {
601
- 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}`}
602
- let http = new HttpResetClass()
603
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
604
- let str=''
605
- res.data.forEach((item,idx,arr) => {
606
- //tag
607
- if(idx+1==arr.length){
608
- str += item.id
609
- }else{
610
- str += item.id+','
611
- }
612
-
613
- })
614
- let http1 = new HttpResetClass()
615
- http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
616
- data: {
617
- items: 'id,f_user_telephone',
618
- tablename: 't_user',
619
- condition: `id in (${str})`,
620
- orderitem: 'id'
621
- }
622
- }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
623
-
624
- res.data.forEach((user)=>{
625
- try {
626
- ress.data.forEach((tel,tidx,arr)=>{
627
- //tag
628
- if(user.id==tel.id){
629
- this.repairers.push({label: `${user.name}:${tel.f_user_telephone}`, value: user.name})
630
- ress.data.splice(tidx,1)
631
- //tag
632
- throw new Error("跳出循环");
633
- }
634
- })
635
- }catch (e) {
636
- //tag
637
- }
638
- })
639
- })
640
-
641
- })
642
- },
643
- getSiteRes(obj) {
644
- console.log('siteRes ---> ')
645
- console.log(obj)
646
- if(obj.resids[0]){
647
- this.selectData.f_meetunit = obj.res.join('.')
648
- this.selectData.f_reciever = obj.resids.join('.')
649
- this.selectData.f_outlets = obj.res[obj.res.length - 1]
650
- }else {
651
- this.selectData.f_meetunit = ''
652
- this.selectData.f_reciever = ''
653
- this.selectData.f_outlets = ''
654
- }
655
- },
656
- cancel1(){
657
- this.showModal2=false
658
- this.selectData={
659
- dispatchType:'',
660
- f_repairman:'',
661
- f_remarks:'',
662
- f_repairtype:''
663
- }
664
- },
665
- async rectification(){
666
- if(this.selectData.dispatchType){
667
- if(this.selectData.dispatchType=='派发给站点'){
668
- if(!this.selectData.f_reciever){
669
- this.$showMessage('请选择部门!')
670
- return
671
- }
672
- }else{
673
- if(!this.selectData.f_repairman){
674
- this.$showMessage('请选择维修员!')
675
- return
676
- }
677
- }
678
- }else {
679
- this.$showMessage('请选择派发类型!')
680
- return
681
- }
682
-
683
- if(!this.selectData.f_repairtype){
684
- this.$showMessage('请选择报修类型!')
685
- return
686
- }
687
- this.showModal3=true
688
- let act={}
689
- let toRepair=''
690
- let successCount=0
691
- if(this.selectData.dispatchType=='派发给站点'){
692
- act={f_meetunit:this.selectData.f_meetunit,f_reciever:this.selectData.f_reciever,f_service_acitivity_type:'派单'}
693
- toRepair=null
694
- }else{
695
- console.log('派发给维修员---------'+this.selectData.f_repairman)
696
- act={f_meetunit:'',f_reciever:this.selectData.f_repairman,f_service_acitivity_type:'派单'}
697
- toRepair='一级派单'
698
- }
699
- let rep={
700
- loginUser: {
701
- name: this.$login.f.name,
702
- ename: this.$login.f.ename
703
- },
704
- f_meetunit: this.$login.f.deps,
705
- f_attendant: this.$login.f.name,
706
- f_outlets: this.$login.f.deps,
707
- f_remarks: this.selectData.f_remarks,
708
- f_repairtype: this.selectData.f_repairtype,
709
- toRepair: toRepair,
710
- activity:act
711
- }
712
- for(let i=0; i<this.dangerGroups.length; i++){
713
- let defectIdStr = ''
714
- const defectIds = []
715
- for (let j = 0; j < this.dangerGroups[i].dangers.length; j++) {
716
- defectIds.push(`'${this.dangerGroups[i].dangers[j].f_defect_id}'`)
717
- }
718
- defectIdStr = `(${defectIds.join(',')})`
719
- const data = {
720
- id:this.dangerGroups[i].dangers[0].f_paper_id,
721
- repData:rep,
722
- source:'pc',
723
- defectIdStr: defectIdStr
724
- }
725
- console.log('data=', JSON.stringify(data))
726
- try {
727
- let result =await new HttpResetClass().load('post','/rs/logic/phoneUploadRectification', data, {resolveMsg: null, rejectMsg: null})
728
- if (result.data.code==200) {
729
- successCount += result.data.successcon
730
- this.progressbarWidth=Math.ceil((i+1)*100/(this.dangerGroups.length))
731
- }
732
- }catch (e) {
733
- this.showModal3=false
734
- this.$showMessage('网络异常,请稍后再试!')
735
- return
736
- }
737
- }
738
- this.showModal3=false
739
- this.cancel1()
740
- this.$showMessage('本次转维修成功'+successCount+'单')
741
- },
742
- getDefectInfoConfig(val){
743
- try {
744
- if (val.safecheck.DevicesSetConfig != undefined) {
745
- this.DefectConfig = val.safecheck.DevicesConfig
746
- // 获取到配置项,进行遍历,获取每个隐患项
747
- for (var Key1 in this.DefectConfig){
748
- this.device_types.push({label:Key1,value:Key1})
749
- for(var Key2 in this.DefectConfig[Key1].items){
750
- this.DefectConfigs.push({label:Key2,value:Key2})
751
- }
752
- }
753
- // 非民用或其他配置项加入,在进行遍历
754
- }
755
- }catch (e) {
756
- //tag
757
- }
758
- },
759
- showaudio(){
760
- //tag
761
- this.audioshow=!this.audioshow
762
- //tag
763
- },
764
- getmeterbook(val){
765
- this.cbc=[]
766
- this.cbc.push({
767
- label:'全部',
768
- value:''
769
- })
770
- if (val==''){
771
-
772
- this.cbcs.forEach(res=>{
773
- this.cbc.push({
774
- label:res.f_book_name,
775
- value:res.id
776
- })
777
- })
778
- }else{
779
- this.cbcs.forEach(res=>{
780
- if (res.f_book_slice_area==val){
781
- this.cbc.push({
782
- label:res.f_book_name,
783
- value:res.id
784
- })
785
- }
786
- })
787
- }
788
- },
789
- getSafeParam(val){
790
- if(this.$appdata.getParam(val)){
791
- return [{label: '全部', value: ''}, ...this.$appdata.getParam(val)]
792
- }else{
793
- return [{label: '全部', value: ''}]
794
- }
795
-
796
- },
797
- Mreadibook(val){
798
- ////tag
799
- ////tag
800
- this.sliceArea=[]
801
- if (val){
802
- new HttpResetClass().load('POST',`/rs/sql/safe_singleTable_OrderBy`, {data: {
803
- items: 'name',
804
- tablename: 't_zone',
805
- condition: `parentid in ${val}`,
806
- orderitem: 'id'
807
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
808
- this.sliceArea.push({
809
- label:'全部',
810
- value:''
811
- })
812
- res.data.forEach(ress=>{
813
- this.sliceArea.push({
814
- label:ress.name,
815
- value:ress.name
816
- })
817
- })
818
-
819
- })
820
- }
821
- },
822
- getAllMeterBook(val){
823
- ////tag
824
- ////tag
825
- this.cbcs=[]
826
- if (val){
827
- new HttpResetClass().load('POST',`/rs/sql/safe_singleTable_OrderBy`, {data: {
828
- items: 'f_book_name,f_book_slice_area,id',
829
- tablename: 't_meter_book',
830
- condition: `f_filiale_id in ${val}`,
831
- orderitem: 'id'
832
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
833
- res.data.forEach(ress=>{
834
- this.cbcs.push({
835
- id:ress.id,
836
- f_book_name:ress.f_book_name,
837
- f_book_slice_area:ress.f_book_slice_area
838
- })
839
- })
840
- this.cbc=[]
841
- this.cbc.push({
842
- label:'全部',
843
- value:''
844
- })
845
- this.cbcs.forEach(res=>{
846
- this.cbc.push({
847
- label:res.f_book_name,
848
- value:res.id
849
- })
850
- })
851
- })
852
- }
853
- },
854
- getRes(obj) {
855
- this.model.f_filialeid = this.$login.convertToIn(obj.resids);
856
- this.searchData.f_filialeid = this.$login.convertToIn(obj.resids);
857
- this.Mreadibook(this.model.f_filialeid)
858
- this.getAllMeterBook(this.model.f_filialeid)
859
- //this.$refs.paged.$refs.criteria.search()
860
- },
861
-
862
- change(row) {
863
- // Vue.$login = {jwt: row.f_checker_id}
864
- asyncReady(this).then(() => {
865
- ////tag)
866
- row.f_upload_state = '已传'
867
- this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
868
- }).catch(
869
- (respanse) => {
870
- alert('获取配置文件失败')
871
- })
872
- },
873
- readConfig() {
874
- let gen = asyncReady(this)
875
- return co(gen)
876
- },
877
- showChooser() {
878
- this.showModal = true
879
- },
880
- hidden() {
881
- this.criteriaShow = !this.criteriaShow
882
- },
883
- refresh() {
884
- this.$refs.paged.$refs.criteria.search()
885
- },
886
- ok() {
887
- this.showModal = false
888
- if (this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id) {
889
- this.model.f_plan_id = this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id
890
- this.model.f_check_plan=this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow
891
- }
892
- },
893
- cancel() {
894
- this.showModal = false
895
- this.model.f_check_plan = {f_plan_name: '', id: ''}
896
- this.model.f_plan_id=''
897
- },
898
- print(row) {
899
- this.showcheckmsg = true
900
- this.checkInfo = row
901
- },
902
-
903
- sort(field, rule) {
904
- // 将所有排序方式设为不排序,实现相互排斥
905
- for (let key in this.orderFields) {
906
- if (key === field) {
907
- this.orderFields[key] = rule
908
- } else {
909
- this.orderFields[key] = 'no'
910
- }
911
- }
912
- // 如果新规则不排序,还原为默认排序
913
- if (rule === 'no') {
914
- this.model.paramSource.orderitem = `'${this.orderDefault}'`
915
- } else {
916
- this.model.paramSource.orderitem = `'${field} ${rule}'`
917
- }
918
- this.search()
919
- },
920
- search() {
921
- this.$refs.paged.$refs.criteria.search()
922
- },
923
- selfSearch(args) {
924
- ////tag
925
- args.condition += ` and f_filialeid in ${this.model.f_filialeid}`
926
- this.model.search(args.condition, args.model, args.condValue)
927
- },
928
- cancelsolveDefect() {
929
- this.showSolveModal = false
930
- this.solve = {
931
- model:{},
932
- id: '',
933
- f_repairman: this.$login.f.name,
934
- f_repair_date: Util.getNowDate().substr(0, 10),
935
- f_repair_path: '',
936
- imgSrc: '',
937
- filename: '',
938
- f_defect_remark:''
939
- }
940
- },
941
- okDefect(){
942
- if (!(this.solve.filename && this.solve.filename.length > 0)) {
943
- this.$showMessage('请录入处理后照片')
944
- return
945
- }
946
- co(upSolveDefect(this))
947
- },
948
- showSolve(row){
949
- this.showSolveModal = true
950
- this.solve.model = row
951
- this.solve.model.defectImg = row.f_path?'/rs/image/file/' + row.f_path:null
952
- this.solve.id = row.f_defect_id
953
- },
954
- inrole(){
955
- return this.$login.f.rolestr.indexOf('安检隐患处理') != -1
956
- }
957
- },
958
-
959
- ready() {
960
- this.getEmp()
961
- this.readConfig()
962
- ////tag
963
- this.function = this.f
964
- ////tag
965
-
966
- let gen = select(this)
967
- //this.pianqu()
968
- this.Mreadibook(`('${this.$login.f.orgid}')`)
969
- co(gen)
970
- }
971
- }
972
- </script>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged @sort="sort">
5
+ <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row">
8
+ <div class="form-group col-sm-2" >
9
+ <label class="font_normal_body">模糊查询</label>
10
+ <input type="text" class="input_search" v-model="model.f_userinfo"
11
+ style="width: 60%" placeholder="编号 名称 电话 地址"
12
+ 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 '%${}%')">
13
+ </div>
14
+ <div class="form-group col-sm-2" >
15
+ <label class="font_normal_body">客户编号</label>
16
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
17
+ style="width: 60%" placeholder="客户编号" condition="f_userinfo_code='{}'">
18
+ </div>
19
+ <div class="form-group col-sm-2" >
20
+ <label class="font_normal_body">客户名称</label>
21
+ <input type="text" class="input_search" v-model="model.f_user_name"
22
+ style="width: 60%" placeholder="客户名称" condition="f_user_name like '%{}%'">
23
+ </div>
24
+ <div class="form-group col-sm-2" >
25
+ <label class="font_normal_body">客户电话</label>
26
+ <input type="text" class="input_search" v-model="model.f_user_phone"
27
+ style="width: 60%" placeholder="客户电话" condition=" ( f_user_phone like '%{}%' or f_zuhu_phone like '%${}%' or f_rent_phone like '%${}%' )">
28
+ </div>
29
+ <div class="form-group col-sm-4" style="display: flex; gap: 15px">
30
+ <export-excel-safe :data="$parent.$parent.searchData"
31
+ :field="$parent.$parent.excelHeaders"
32
+ progress="safeGetExportProgress"
33
+ sqlurl="rs/logic/SafeExportExcel" sql-name="defectDetails" template-name='安检隐患明细'></export-excel-safe>
34
+ <button class="button_search" @click="$parent.$parent.showaudio()" v-if="$parent.$parent.audioshow">隐藏</button>
35
+ <button class="button_search" @click="$parent.$parent.toRepair">转维修</button>
36
+ <button class="button_search" @click="search()">查询</button>
37
+ <div class="button_spacing"
38
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
39
+ @click="$parent.$parent.hidden()"></div>
40
+ </div>
41
+
42
+ </div>
43
+ <div class="row">
44
+ <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
45
+ <role-selector-safe
46
+ role-name="安检员"
47
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
48
+ @re-res="$parent.$parent.getRes"
49
+ :value.sync="model.f_checker_id"
50
+ v-model="model.f_checker_id"
51
+ :value-multiple="true"
52
+ :value-close="false"
53
+ condition="f_checker_name in {}">
54
+ </role-selector-safe>
55
+ </div>
56
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
57
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
58
+ <input type="text" class="input_search" v-model="model.f_residential_area"
59
+ style="width: 60%" placeholder="小区" condition="f_residential_area like '%{}%'">
60
+ </div>
61
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
62
+ <label class="font_normal_body">检&ensp;查&ensp;项</label>
63
+ <v-select :value.sync="model.f_device_type"
64
+ v-model="model.f_device_type"
65
+ style="width: 60%"
66
+ class="select_list select"
67
+ :options='$parent.$parent.device_types'
68
+ placeholder='检查项'
69
+ :multiple="true"
70
+ condition="f_device_type in {}"></v-select>
71
+ <!--<input type="text" class="input_search" v-model="model.f_device_type"-->
72
+ <!--style="width: 60%" placeholder="检&ensp;查&ensp;项" condition="f_device_type like '%{}%'">-->
73
+ </div>
74
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
75
+ <label class="font_normal_body">隐患名称</label>
76
+ <v-select :value.sync="model.f_item_name"
77
+ v-model='model.f_item_name'
78
+ style="width: 60%"
79
+ class="select_list select"
80
+ :options='$parent.$parent.DefectConfigs'
81
+ placeholder='隐患名称'
82
+ :multiple="true"
83
+ condition="f_item_name in {}"></v-select>
84
+ </div>
85
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
86
+ <label class="font_normal_body">安检起始</label>
87
+ <datepicker
88
+ class="select_list select"
89
+ :value.sync="model.f_check_start"
90
+ placeholder='安检起始时间' style="width: 60%"
91
+ :disabled-days-of-week="[]"
92
+ :format="'yyyy-MM-dd'"
93
+ :show-rest-button="reset"
94
+ v-model="model.f_check_start"
95
+ condition="f_offsite_time > ='{} 00:00:00'">
96
+ </datepicker>
97
+ </div>
98
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
99
+ <label class="font_normal_body">安检结束</label>
100
+ <datepicker
101
+ class="select_list select"
102
+ :value.sync="model.f_check_end"
103
+ placeholder='安检结束时间' style="width: 60%"
104
+ :disabled-days-of-week="[]"
105
+ :format="'yyyy-MM-dd'"
106
+ :show-rest-button="reset"
107
+ v-model="model.f_check_end"
108
+ condition="f_offsite_time <= '{} 23:59:59'">
109
+ </datepicker>
110
+ </div>
111
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
112
+ <label class="font_normal_body">用户类型</label>
113
+ <v-select :value.sync="model.f_check_type" v-model='model.f_check_type'
114
+ :value-single="true" style="width: 60%"
115
+ class="select_list select"
116
+ :options='$parent.$parent.f_check_type' placeholder='请选择'
117
+ close-on-select
118
+ condition="f_check_type = '{}'"></v-select>
119
+ </div>
120
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
121
+ <label class="font_normal_body">处理方式</label>
122
+ <v-select :value.sync="model.f_deal_dispose"
123
+ v-model='model.f_deal_dispose'
124
+ style="width: 60%"
125
+ class="select_list select"
126
+ :options='$parent.$parent.deal_dispose' placeholder='请选择'
127
+ :multiple="true"
128
+ condition="f_deal_dispose in {}"></v-select>
129
+ </div>
130
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
131
+ <label class="font_normal_body">详细地址</label>
132
+ <input type="text" class="input_search" v-model="model.f_address"
133
+ style="width: 60%" placeholder="详细地址" condition="f_address like '%{}%'">
134
+ </div>
135
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
136
+ <label class="font_normal_body">隐患状态</label>
137
+ <v-select :value.sync="model.f_is_repaired"
138
+ v-model='model.f_is_repaired'
139
+ style="width: 60%"
140
+ class="select_list select"
141
+ :options='$parent.$parent.repairStateOptions' placeholder='请选择'
142
+ :multiple="true"
143
+ condition="f_is_repaired in {}"></v-select>
144
+ </div>
145
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
146
+ <label class="font_normal_body">处理人</label>
147
+ <input type="text" class="input_search" v-model="model.f_repairman"
148
+ style="width: 60%" placeholder="处理人" condition="f_repairman = '{}'">
149
+ </div>
150
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
151
+ <label for="startDate" class="font_normal_body">处理时间:</label>
152
+ <datepicker id="startDate" placeholder="处理开始日期"
153
+ style="width: 60%!important;"
154
+ v-model="model.sq_startDate"
155
+ :value.sync="model.sq_startDate"
156
+ :format="'yyyy-MM-dd 00:00:00'"
157
+ :show-reset-button="true"
158
+ condition="f_repair_date >= '{}'">
159
+ </datepicker>
160
+ </div>
161
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
162
+ <label for="endDate" class="font_normal_body">处理时间:</label>
163
+ <datepicker id="endDate" placeholder="处理结束日期"
164
+ style="width: 60%!important;"
165
+ v-model="model.sq_endDate"
166
+ :value.sync="model.sq_endDate"
167
+ :format="'yyyy-MM-dd 23:59:59'"
168
+ :show-reset-button="true"
169
+ condition="f_repair_date<= '{}'">
170
+ </datepicker>
171
+ </div>
172
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
173
+ <label class="font_normal_body">首次通气开始</label>
174
+ <datepicker
175
+ :value.sync="model.f_gas_start"
176
+ placeholder='首次通气开始时间' style="width: 60%"
177
+ :disabled-days-of-week="[]"
178
+ :format="'yyyy-MM-dd'"
179
+ :show-rest-button="reset"
180
+ v-model="model.f_gas_start"
181
+ condition="f_uservent_date >='{} 00:00:00'">
182
+ </datepicker>
183
+ </div>
184
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
185
+ <label class="font_normal_body">首次通气结束</label>
186
+ <datepicker
187
+ :value.sync="model.f_gas_end"
188
+ placeholder='首次通气结束时间' style="width: 60%"
189
+ :disabled-days-of-week="[]"
190
+ :format="'yyyy-MM-dd'"
191
+ :show-rest-button="reset"
192
+ v-model="model.f_gas_end"
193
+ condition="f_uservent_date <= '{} 23:59:59'">
194
+ </datepicker>
195
+ </div>
196
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
197
+ <label class="font_normal_body">回访状态</label>
198
+ <v-select :value.sync="model.f_is_visit"
199
+ v-model='model.f_is_visit'
200
+ style="width: 60%"
201
+ class="select_list select"
202
+ :options='$parent.$parent.is_visits' placeholder='请选择'
203
+ close-on-select :value-single="true"></v-select>
204
+ </div>
205
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
206
+ <label class="font_normal_body">回访备注</label>
207
+ <input type="text" class="input_search" v-model="model.f_bz"
208
+ style="width: 60%" placeholder="回访备注" condition="f_bz like '%{}%'">
209
+ </div>
210
+ </div>
211
+ <modal :show.sync="$parent.$parent.showModal" v-ref:modal>
212
+ <div slot="modal-header" class="modal-header">
213
+ <h4 class="modal-title">
214
+ 选择计划
215
+ </h4>
216
+ </div>
217
+ <div slot="modal-body" class="modal-body">
218
+ <plan-chooser :f.sync="$parent.$parent.fun" v-ref:chooser></plan-chooser>
219
+ </div>
220
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
221
+ <button class="button_search" @click="$parent.$parent.ok">确认</button>
222
+ <button class="button_search" @click="$parent.$parent.cancel">取消</button>
223
+ </div>
224
+ </modal>
225
+ </div>
226
+ </criteria>
227
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
228
+ <template partial='head'>
229
+ <tr>
230
+ <th>
231
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.selectAll"></input>全选</nobr>
232
+ </th>
233
+ <th>
234
+ <nobr>检查项</nobr>
235
+ </th>
236
+ <th>
237
+ <nobr>隐患原因</nobr>
238
+ </th>
239
+ <th>
240
+ <nobr>隐患级别</nobr>
241
+ </th>
242
+ <th>
243
+ <nobr>客户编号</nobr>
244
+ </th>
245
+ <th>
246
+ <nobr>客户名称</nobr>
247
+ </th>
248
+ <th>
249
+ <nobr>客户电话</nobr>
250
+ </th>
251
+ <th>
252
+ <nobr>客户小区</nobr>
253
+ </th>
254
+ <th>
255
+ <data-order field="f_address" name="客户地址"></data-order>
256
+ </th>
257
+ <th>
258
+ <nobr>首次通气时间</nobr>
259
+ </th>
260
+ <th>
261
+ <data-order field="f_offsite_time" name="安检时间"></data-order>
262
+ </th>
263
+ <th>
264
+ <nobr>安检员</nobr>
265
+ </th>
266
+ <th>
267
+ <nobr>隐患状态</nobr>
268
+ </th>
269
+ <th>
270
+ <nobr>处理人</nobr>
271
+ </th>
272
+ <th>
273
+ <nobr>处理方式</nobr>
274
+ </th>
275
+ <th>
276
+ <nobr>处理时间</nobr>
277
+ </th>
278
+ <th>
279
+ <nobr>工单编号</nobr>
280
+ </th>
281
+ <th>
282
+ <nobr>转单类型</nobr>
283
+ </th>
284
+ <th>
285
+ <nobr>接收人</nobr>
286
+ </th>
287
+ <th>
288
+ <nobr>回访状态</nobr>
289
+ </th>
290
+ <th>
291
+ <nobr>回访备注</nobr>
292
+ </th>
293
+ <th>
294
+ <nobr>回访</nobr>
295
+ </th>
296
+ </tr>
297
+ </template>
298
+ <template partial='body'>
299
+ <td style="text-align: center;white-space:nowrap;"><input type="checkbox" v-if="['用户自行整改', '现场已处理', '维修已处理', '转维修'].indexOf(row.f_is_repaired) == -1" @click="$event.cancelBubble=true" :checked="$parent.$parent.$parent.isChecked(row)" @change="$parent.$parent.$parent.setCheckes(row)"></input></td>
300
+ <td style="text-align: center">{{row.f_device_type}}</td>
301
+ <td style="text-align: center">{{row.f_item_name}}/{{row.f_item_value}}</td>
302
+ <td style="text-align: center">{{row.f_defect_level}}</td>
303
+ <td style="text-align: center">{{row.f_userinfo_code}}</td>
304
+ <td style="text-align: center">{{row.f_user_name}}</td>
305
+ <td style="text-align: center">{{row.f_user_phone}}</td>
306
+ <td style="text-align: center">{{row.f_residential_area}}</td>
307
+ <td style="text-align: center">{{row.f_address}}</td>
308
+ <td style="text-align: center;white-space:nowrap;">{{row.f_uservent_date}}</td>
309
+ <td style="text-align: center">{{row.f_offsite_time}}</td>
310
+ <td style="text-align: center">{{row.f_checker_name}}</td>
311
+ <td style="text-align: center" v-if="row.f_is_repaired == '隐患未处理' && $parent.$parent.$parent.inrole()" @click="$parent.$parent.$parent.showSolve(row)"><a>{{row.f_is_repaired}}</a></td>
312
+ <td style="text-align: center" v-else>{{row.f_is_repaired}}</td>
313
+ <td style="text-align: center">{{row.f_repairman}}</td>
314
+ <td style="text-align: center">{{row.f_deal_dispose}}</td>
315
+ <td style="text-align: center">{{row.f_repair_date}}</td>
316
+ <td style="text-align: center">{{row.f_service_id}}</td>
317
+ <td style="text-align: center">{{row.f_handlingtype}}</td>
318
+ <td style="text-align: center">{{row.f_order_man}}</td>
319
+ <td style="text-align: center">{{row.f_is_visit}}</td>
320
+ <td style="text-align: center">{{row.f_bz}}</td>
321
+ <td style="text-align: center">
322
+ <button-link v-if="row.f_is_repaired == '用户自行整改'" type="button" class="btn btn-link" @click="$parent.$parent.$parent.playWav(row.f_user_phone, row)">回访
323
+ </button-link></td>
324
+ </template>
325
+ </data-grid>
326
+ </criteria-paged>
327
+ <check-msg v-if="showcheckmsg" :show="showcheckmsg" :data="checkInfo"></check-msg>
328
+ <modal :show.sync="showModal2" :backdrop="false">
329
+ <div slot="modal-header" class="modal-header">
330
+ <h4 class="modal-title">
331
+ 转维修
332
+ </h4>
333
+ </div>
334
+ <div slot="modal-body" class="modal-body">
335
+ <div v-if="true">
336
+ <div>
337
+
338
+ </div>
339
+ <!-- <div v-for="(index, item) in dangerGroup">-->
340
+
341
+ <!-- </div>-->
342
+ <div class="row" style="margin-top: 10px">
343
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">派发类型</label>
344
+ <div class="col-xs-8 col-md-8">
345
+ <v-select :value.sync="selectData.dispatchType" :value-single="true" v-model="selectData.dispatchType"
346
+ :options='dispatchTypeOptions' placeholder='派发类型'
347
+ close-on-select>
348
+ </v-select>
349
+ </div>
350
+ </div>
351
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给维修员'">
352
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">维&ensp;修&ensp;员</label>
353
+ <div class="col-xs-8 col-md-8">
354
+ <v-select
355
+ :value.sync="selectData.f_repairman"
356
+ :value-single="true"
357
+ :options='repairers'
358
+ placeholder='请选择维修员'
359
+ close-on-select></v-select>
360
+ </div>
361
+ </div>
362
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给站点'">
363
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">站&ensp;&ensp;&ensp;&ensp;点</label>
364
+ <div class="col-xs-8 col-md-8">
365
+ <right-tree
366
+ islist
367
+ :userid="userid"
368
+ :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
369
+ @re-res="getSiteRes"></right-tree>
370
+ </div>
371
+ </div>
372
+ <div class="row" style="margin-top: 10px">
373
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">报修类型</label>
374
+ <div class="col-xs-8 col-md-8">
375
+ <v-select :value.sync="selectData.f_repairtype" style="width:60%"
376
+ class="select select_list"
377
+ :value-single="true"
378
+ :options='repairTypeOptions'
379
+ close-on-select>
380
+ </v-select>
381
+ </div>
382
+ </div>
383
+ <div class="row" style="margin-top: 10px">
384
+ <label class="control-label font text-left" style="float:left;margin-left:20%;margin-top:5px">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
385
+ <div class="col-xs-8 col-md-8">
386
+ <textarea style="width: 60%; height: 100px" v-model="selectData.f_remarks"></textarea>
387
+ </div>
388
+ </div>
389
+ </div>
390
+ </div>
391
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
392
+ <button class="button_search" @click="rectification">转维修</button>
393
+ <button class="button_search" @click="cancel1">取消</button>
394
+ </div>
395
+ </modal>
396
+ <modal :show.sync="showModal3">
397
+ <div slot="modal-header" class="modal-header">
398
+ <h4 class="modal-title">
399
+ 转维修进度{{ progressbarWidth }}%
400
+ </h4>
401
+ </div>
402
+ <div slot="modal-body" class="modal-body">
403
+ <div class="progress">
404
+ <div class="progress-bar" role="progressbar" aria-valuenow="60"
405
+ aria-valuemin="0" aria-valuemax="100" :style="'width:'+ progressbarWidth+'%'">
406
+ </div>
407
+ </div>
408
+ </div>
409
+ <div slot="modal-footer" class="modal-footer" style="text-align: center" v-show="false"></div>
410
+ </modal>
411
+ <modal :show.sync="showSolveModal" v-ref:solveModal>
412
+ <div slot="modal-header" class="modal-header">
413
+ <h4 class="modal-title">
414
+ 处理隐患
415
+ </h4>
416
+ </div>
417
+ <div slot="modal-body" class="modal-body">
418
+ <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left">
419
+ <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
420
+ <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理前</p></div>
421
+ </div>
422
+
423
+ <div class="col-sm-6" style="margin-top: 10px">
424
+ <label class="font_normal_body">安&nbsp;检&nbsp;员</label>
425
+ <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="solve.model.f_checker_name" placeholder="安检员">
426
+ </div>
427
+ <div class="col-sm-6" style="margin-top: 10px">
428
+ <label class="font_normal_body">安检时间</label>
429
+ <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="solve.model.f_offsite_time" placeholder="安检时间">
430
+ </div>
431
+ <div class="col-sm-12" style="margin-bottom: 10px" v-if="solve.model.defectImg">
432
+ <label class="font_normal_body">隐患图片</label>
433
+ <img-self :width="200" :height="200" :src="solve.model.defectImg"></img-self>
434
+ </div>
435
+ <div class="col-sm-12" style="margin-bottom: 10px">
436
+ <label class="font_normal_body">处理后图片</label>
437
+ <avatar-upload :width="200" :height="200" :img-src.sync="solve.imgSrc" :filename.sync="solve.filename" v-ref:imginfo></avatar-upload>
438
+ </div>
439
+ </div>
440
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
441
+ <button class="button_search" @click="okDefect">确认</button>
442
+ <button class="button_search" @click="cancelsolveDefect">取消</button>
443
+ </div>
444
+ </modal>
445
+ <modal :show.sync="showVisit" v-ref:modal backdrop="false">
446
+ <header slot="modal-header" class="modal-header">
447
+ </header>
448
+ <article slot="modal-body" class="modal-body">
449
+ <safe-visit-info v-if="showVisit" :row="visitrow" :phone="wavflie" @show-obj="watchShow"></safe-visit-info>
450
+ </article>
451
+ <footer slot="modal-footer" class="modal-footer">
452
+ </footer>
453
+ </modal>
454
+ </div>
455
+ </div>
456
+ </template>
457
+
458
+ <script>
459
+ import {PagedList} from 'vue-client'
460
+ import Vue from 'vue'
461
+ import co from 'co'
462
+ import AppData from '../../../stores/AppData'
463
+ import * as Util from '../../Util'
464
+ import getNowDate from "../../../utils/getNowDate";
465
+ import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
466
+ import BenzAMRRecorder from 'benz-amr-recorder'
467
+ const upSolveDefect = function * (self) {
468
+ self.solve.f_deal_dispose = self.solve.f_deal_dispose || '已处理'
469
+ self.$resetpost('/rs/logic/pcRepairDefectNew', self.solve, {resolveMsg: null, rejectMsg: null})
470
+ .then(res => {
471
+ if (res.data.code === 200) {
472
+ self.$showMessage('隐患已处理。')
473
+ self.showSolveModal = false
474
+ self.search()
475
+ self.solve={
476
+ model:{},
477
+ id: '',
478
+ f_repairman: self.$login.f.name,
479
+ f_repair_date: Util.getNowDate().substr(0, 10),
480
+ f_repair_path: '',
481
+ imgSrc: '',
482
+ filename: '',
483
+ f_defect_remark:''
484
+ }
485
+ }
486
+ })
487
+ }
488
+ //获取json配置文件
489
+ let asyncReady = async function (self) {
490
+ // 获取配置信息
491
+ try {
492
+ let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
493
+ Vue.config = res.data
494
+ self.getDefectInfoConfig(res.data)
495
+ } catch (error) {
496
+ // 忽略704,文件找不到异常R
497
+ if (error.status !== 704) {
498
+ throw error
499
+ }
500
+ }
501
+ }
502
+
503
+ let select = function* (self) {
504
+ let http = new HttpResetClass()
505
+ let getGasman = yield http.load('POST', '/rs/search', {
506
+ source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
507
+ userid: self.$login.f.id
508
+ }, {resolveMsg: null, rejectMsg: null})
509
+ ////tag
510
+ self.checkersid.push({label: '全部', value: ''})
511
+ getGasman.data.forEach((checker) => {
512
+ self.checkersid.push({label: checker.name, value: checker.id})
513
+ })
514
+ }
515
+
516
+ export default {
517
+ title: '隐患明细查看',
518
+ data() {
519
+ let model = new PagedList('rs/sql/defectDetails', 20,{
520
+ f_filialeid: 'this.f_filialeid'
521
+ })
522
+ model.f_plan_id = ''
523
+ model.f_approved = ''
524
+ model.f_entry = ''
525
+ model.f_no_checkplan = ''
526
+ model.f_check_type=''
527
+ model.f_filialeid = `('${this.$login.f.orgid}')`
528
+ return {
529
+ showVisit: false,
530
+ visitrow: {},
531
+ wavflie: '',
532
+ audioshow:false,
533
+ selectAll:false,
534
+ model: model,
535
+ is_visits:[{label:'全部',value:''},{label:'已回访',value:'已回访'},{label:'未回访',value:'未回访'}],
536
+ deal_dispose:[{label:'全部',value:''},{label:'报修',value:'报修'},{label:'现场整改',value:'现场整改'},{label:'自行处理',value:'自行处理'},{label:'未处理',value:'未处理'}],
537
+ repairStateOptions: this.getSafeParam('隐患状态'),
538
+ //searchData:searchData,
539
+ excelHeaders: {
540
+ 'f_device_type': '检查项',
541
+ 'f_item_name': '隐患名称',
542
+ 'f_userinfo_code': '客户编号',
543
+ 'f_user_name': '客户姓名',
544
+ 'f_user_phone': '客户电话',
545
+ 'f_residential_area': '小区',
546
+ 'f_address': '客户地址',
547
+ 'f_uservent_date': '首次通气时间',
548
+ 'f_offsite_time': '安检时间',
549
+ 'f_checker_name': '安检员',
550
+ 'f_deal_dispose': '处理方式',
551
+ 'f_is_repaired': '隐患状态',
552
+ 'f_repairman':'处理人',
553
+ 'f_repair_date':'处理时间'
554
+ },
555
+ fun: this.$login.f,
556
+ checkersid: [],
557
+ safetype: this.getSafeParam('安检类型'),
558
+ criteriaShow: false,
559
+ showModal: false,
560
+ f_approval_states: this.getSafeParam('安检单审核状态'),
561
+ f_entry_status:this.getSafeParam('安检状态'),
562
+ f_checkplans: this.getSafeParam('有无计划'),
563
+ showcheckmsg: false,
564
+ checkInfo: {},
565
+ orderDefault: "'f_offsite_time'",
566
+ orderFields: {
567
+ f_offsite_time: 'no'
568
+ },
569
+ sliceArea: [],
570
+ cbc:[],
571
+ DefectConfig:'' ,
572
+ DefectConfigs:[{label:'全部',value:''},{label: '金额异常差值', value: '金额异常差值'},{label: '气量异常差值', value: '气量异常差值'}],
573
+ device_types:[{label:'全部',value:''}],
574
+ f_check_type:[{label:'全部',value:''},{label:'民用',value:'民用'},{label:'非民用',value:'非民用'}],
575
+ showModal2: false,
576
+ selectData:{
577
+ dispatchType:'',
578
+ f_repairman:'',
579
+ f_remarks:'',
580
+ f_repairtype:''
581
+ },
582
+ repairers: [],
583
+ repairTypeOptions:this.$appdata.getParam('报修类型'),
584
+ dispatchTypeOptions: [{label: '派发给站点', value: '派发给站点'},{label: '派发给维修员', value: '派发给维修员'}],
585
+ dangerGroups: [],
586
+ showModal3: false,
587
+ progressbarWidth:'0',
588
+ canToRepair: this.$appdata.getSingleValue('隐患明细转维修'),
589
+ checkes: [],
590
+ solve:{
591
+ model:{},
592
+ id: '',
593
+ f_repairman: this.$login.f.name,
594
+ f_repair_date: Util.getNowDate().substr(0, 10),
595
+ f_repair_path: '',
596
+ imgSrc: '',
597
+ filename: '',
598
+ f_defect_remark:''
599
+ },
600
+ showSolveModal:false
601
+ }
602
+ },
603
+ computed :{
604
+ searchData() {
605
+ return {condition: this.model.condition}
606
+ }
607
+ },
608
+ watch:{
609
+ 'selectAll'(val){
610
+ if(!val){
611
+ this.checkes=[]
612
+ }
613
+ this.checkes=[]
614
+ for (let row of this.model.rows){
615
+ this.checkes.push(row)
616
+ }
617
+ }
618
+ },
619
+ methods: {
620
+ watchShow() {
621
+ this.visitrow = {}
622
+ this.showVisit = false
623
+ this.selfSearch()
624
+ },
625
+ playWav(val, val2) {
626
+ this.wavflie = val
627
+ this.visitrow = val2
628
+ this.showVisit = true
629
+ },
630
+ isChecked(row) {
631
+ return this.checkes.findIndex(item => item.f_defect_id == row.f_defect_id) != -1
632
+ },
633
+ setCheckes(row) {
634
+ let index=this.checkes.findIndex(item => item.f_defect_id == row.f_defect_id)
635
+ if(index<0){
636
+ this.checkes.push(row)
637
+ }else{
638
+ this.checkes.splice(index,1)
639
+ }
640
+ console.log('this.checkes=', JSON.stringify(this.checkes))
641
+ },
642
+ toRepair(){
643
+ console.log('this.checkes=', JSON.stringify(this.checkes))
644
+ if(this.checkes.length==0){
645
+ return this.$showMessage('请先选择需要转维修的隐患!')
646
+ }
647
+
648
+ const dangerGroups = []
649
+ for (const danger of this.checkes) {
650
+ let i = dangerGroups.findIndex(dangerGroup => dangerGroup.f_userinfo_code === danger.f_userinfo_code)
651
+ if (i == -1){
652
+ dangerGroups.push({
653
+ f_userinfo_code: danger.f_userinfo_code,
654
+ dangers: []
655
+ })
656
+ i = dangerGroups.length - 1
657
+ }
658
+ dangerGroups[i].dangers.push(danger)
659
+ }
660
+ this.dangerGroups = dangerGroups
661
+ console.log('this.dangerGroups=', JSON.stringify(this.dangerGroups))
662
+ this.showModal2=true
663
+ },
664
+ getEmp() {
665
+ 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}`}
666
+ let http = new HttpResetClass()
667
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
668
+ let str=''
669
+ res.data.forEach((item,idx,arr) => {
670
+ //tag
671
+ if(idx+1==arr.length){
672
+ str += item.id
673
+ }else{
674
+ str += item.id+','
675
+ }
676
+
677
+ })
678
+ let http1 = new HttpResetClass()
679
+ http1.load('POST', 'rs/sql/tel_singleTable_OrderBy', {
680
+ data: {
681
+ items: 'id,f_user_telephone',
682
+ tablename: 't_user',
683
+ condition: `id in (${str})`,
684
+ orderitem: 'id'
685
+ }
686
+ }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
687
+
688
+ res.data.forEach((user)=>{
689
+ try {
690
+ ress.data.forEach((tel,tidx,arr)=>{
691
+ //tag
692
+ if(user.id==tel.id){
693
+ this.repairers.push({label: `${user.name}:${tel.f_user_telephone}`, value: user.name})
694
+ ress.data.splice(tidx,1)
695
+ //tag
696
+ throw new Error("跳出循环");
697
+ }
698
+ })
699
+ }catch (e) {
700
+ //tag
701
+ }
702
+ })
703
+ })
704
+
705
+ })
706
+ },
707
+ getSiteRes(obj) {
708
+ console.log('siteRes ---> ')
709
+ console.log(obj)
710
+ if(obj.resids[0]){
711
+ this.selectData.f_meetunit = obj.res.join('.')
712
+ this.selectData.f_reciever = obj.resids.join('.')
713
+ this.selectData.f_outlets = obj.res[obj.res.length - 1]
714
+ }else {
715
+ this.selectData.f_meetunit = ''
716
+ this.selectData.f_reciever = ''
717
+ this.selectData.f_outlets = ''
718
+ }
719
+ },
720
+ cancel1(){
721
+ this.showModal2=false
722
+ this.selectData={
723
+ dispatchType:'',
724
+ f_repairman:'',
725
+ f_remarks:'',
726
+ f_repairtype:''
727
+ }
728
+ },
729
+ async rectification(){
730
+ if(this.selectData.dispatchType){
731
+ if(this.selectData.dispatchType=='派发给站点'){
732
+ if(!this.selectData.f_reciever){
733
+ this.$showMessage('请选择部门!')
734
+ return
735
+ }
736
+ }else{
737
+ if(!this.selectData.f_repairman){
738
+ this.$showMessage('请选择维修员!')
739
+ return
740
+ }
741
+ }
742
+ }else {
743
+ this.$showMessage('请选择派发类型!')
744
+ return
745
+ }
746
+
747
+ if(!this.selectData.f_repairtype){
748
+ this.$showMessage('请选择报修类型!')
749
+ return
750
+ }
751
+ this.showModal3=true
752
+ let act={}
753
+ let toRepair=''
754
+ let successCount=0
755
+ if(this.selectData.dispatchType=='派发给站点'){
756
+ act={f_meetunit:this.selectData.f_meetunit,f_reciever:this.selectData.f_reciever,f_service_acitivity_type:'派单'}
757
+ toRepair=null
758
+ }else{
759
+ console.log('派发给维修员---------'+this.selectData.f_repairman)
760
+ act={f_meetunit:'',f_reciever:this.selectData.f_repairman,f_service_acitivity_type:'派单'}
761
+ toRepair='一级派单'
762
+ }
763
+ let rep={
764
+ loginUser: {
765
+ name: this.$login.f.name,
766
+ ename: this.$login.f.ename
767
+ },
768
+ f_meetunit: this.$login.f.deps,
769
+ f_attendant: this.$login.f.name,
770
+ f_outlets: this.$login.f.deps,
771
+ f_remarks: this.selectData.f_remarks,
772
+ f_repairtype: this.selectData.f_repairtype,
773
+ toRepair: toRepair,
774
+ activity:act
775
+ }
776
+ for(let i=0; i<this.dangerGroups.length; i++){
777
+ let defectIdStr = ''
778
+ const defectIds = []
779
+ for (let j = 0; j < this.dangerGroups[i].dangers.length; j++) {
780
+ defectIds.push(`'${this.dangerGroups[i].dangers[j].f_defect_id}'`)
781
+ }
782
+ defectIdStr = `(${defectIds.join(',')})`
783
+ const data = {
784
+ id:this.dangerGroups[i].dangers[0].f_paper_id,
785
+ repData:rep,
786
+ source:'pc',
787
+ defectIdStr: defectIdStr
788
+ }
789
+ console.log('data=', JSON.stringify(data))
790
+ try {
791
+ let result =await new HttpResetClass().load('post','/rs/logic/phoneUploadRectification', data, {resolveMsg: null, rejectMsg: null})
792
+ if (result.data.code==200) {
793
+ successCount += result.data.successcon
794
+ this.progressbarWidth=Math.ceil((i+1)*100/(this.dangerGroups.length))
795
+ }
796
+ }catch (e) {
797
+ this.showModal3=false
798
+ this.$showMessage('网络异常,请稍后再试!')
799
+ return
800
+ }
801
+ }
802
+ this.showModal3=false
803
+ this.cancel1()
804
+ this.$showMessage('本次转维修成功'+successCount+'单')
805
+ },
806
+ getDefectInfoConfig(val){
807
+ try {
808
+ if (val.safecheck.DevicesSetConfig != undefined) {
809
+ this.DefectConfig = val.safecheck.DevicesConfig
810
+ // 获取到配置项,进行遍历,获取每个隐患项
811
+ for (var Key1 in this.DefectConfig){
812
+ this.device_types.push({label:Key1,value:Key1})
813
+ for(var Key2 in this.DefectConfig[Key1].items){
814
+ this.DefectConfigs.push({label:Key2,value:Key2})
815
+ }
816
+ }
817
+ // 非民用或其他配置项加入,在进行遍历
818
+ }
819
+ }catch (e) {
820
+ //tag
821
+ }
822
+ },
823
+ showaudio(){
824
+ //tag
825
+ this.audioshow=!this.audioshow
826
+ //tag
827
+ },
828
+ getmeterbook(val){
829
+ this.cbc=[]
830
+ this.cbc.push({
831
+ label:'全部',
832
+ value:''
833
+ })
834
+ if (val==''){
835
+
836
+ this.cbcs.forEach(res=>{
837
+ this.cbc.push({
838
+ label:res.f_book_name,
839
+ value:res.id
840
+ })
841
+ })
842
+ }else{
843
+ this.cbcs.forEach(res=>{
844
+ if (res.f_book_slice_area==val){
845
+ this.cbc.push({
846
+ label:res.f_book_name,
847
+ value:res.id
848
+ })
849
+ }
850
+ })
851
+ }
852
+ },
853
+ getSafeParam(val){
854
+ if(this.$appdata.getParam(val)){
855
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam(val)]
856
+ }else{
857
+ return [{label: '全部', value: ''}]
858
+ }
859
+
860
+ },
861
+ Mreadibook(val){
862
+ ////tag
863
+ ////tag
864
+ this.sliceArea=[]
865
+ if (val){
866
+ new HttpResetClass().load('POST',`/rs/sql/safe_singleTable_OrderBy`, {data: {
867
+ items: 'name',
868
+ tablename: 't_zone',
869
+ condition: `parentid in ${val}`,
870
+ orderitem: 'id'
871
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
872
+ this.sliceArea.push({
873
+ label:'全部',
874
+ value:''
875
+ })
876
+ res.data.forEach(ress=>{
877
+ this.sliceArea.push({
878
+ label:ress.name,
879
+ value:ress.name
880
+ })
881
+ })
882
+
883
+ })
884
+ }
885
+ },
886
+ getAllMeterBook(val){
887
+ ////tag
888
+ ////tag
889
+ this.cbcs=[]
890
+ if (val){
891
+ new HttpResetClass().load('POST',`/rs/sql/safe_singleTable_OrderBy`, {data: {
892
+ items: 'f_book_name,f_book_slice_area,id',
893
+ tablename: 't_meter_book',
894
+ condition: `f_filiale_id in ${val}`,
895
+ orderitem: 'id'
896
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
897
+ res.data.forEach(ress=>{
898
+ this.cbcs.push({
899
+ id:ress.id,
900
+ f_book_name:ress.f_book_name,
901
+ f_book_slice_area:ress.f_book_slice_area
902
+ })
903
+ })
904
+ this.cbc=[]
905
+ this.cbc.push({
906
+ label:'全部',
907
+ value:''
908
+ })
909
+ this.cbcs.forEach(res=>{
910
+ this.cbc.push({
911
+ label:res.f_book_name,
912
+ value:res.id
913
+ })
914
+ })
915
+ })
916
+ }
917
+ },
918
+ getRes(obj) {
919
+ this.model.f_filialeid = this.$login.convertToIn(obj.resids);
920
+ this.searchData.f_filialeid = this.$login.convertToIn(obj.resids);
921
+ this.Mreadibook(this.model.f_filialeid)
922
+ this.getAllMeterBook(this.model.f_filialeid)
923
+ //this.$refs.paged.$refs.criteria.search()
924
+ },
925
+
926
+ change(row) {
927
+ // Vue.$login = {jwt: row.f_checker_id}
928
+ asyncReady(this).then(() => {
929
+ ////tag)
930
+ row.f_upload_state = '已传'
931
+ this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
932
+ }).catch(
933
+ (respanse) => {
934
+ alert('获取配置文件失败')
935
+ })
936
+ },
937
+ readConfig() {
938
+ let gen = asyncReady(this)
939
+ return co(gen)
940
+ },
941
+ showChooser() {
942
+ this.showModal = true
943
+ },
944
+ hidden() {
945
+ this.criteriaShow = !this.criteriaShow
946
+ },
947
+ refresh() {
948
+ this.$refs.paged.$refs.criteria.search()
949
+ },
950
+ ok() {
951
+ this.showModal = false
952
+ if (this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id) {
953
+ this.model.f_plan_id = this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id
954
+ this.model.f_check_plan=this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow
955
+ }
956
+ },
957
+ cancel() {
958
+ this.showModal = false
959
+ this.model.f_check_plan = {f_plan_name: '', id: ''}
960
+ this.model.f_plan_id=''
961
+ },
962
+ print(row) {
963
+ this.showcheckmsg = true
964
+ this.checkInfo = row
965
+ },
966
+
967
+ sort(field, rule) {
968
+ // 将所有排序方式设为不排序,实现相互排斥
969
+ for (let key in this.orderFields) {
970
+ if (key === field) {
971
+ this.orderFields[key] = rule
972
+ } else {
973
+ this.orderFields[key] = 'no'
974
+ }
975
+ }
976
+ // 如果新规则不排序,还原为默认排序
977
+ if (rule === 'no') {
978
+ this.model.paramSource.orderitem = `'${this.orderDefault}'`
979
+ } else {
980
+ this.model.paramSource.orderitem = `'${field} ${rule}'`
981
+ }
982
+ this.search()
983
+ },
984
+ search() {
985
+ this.$refs.paged.$refs.criteria.search()
986
+ },
987
+ selfSearch(args) {
988
+ ////tag
989
+ if (args.model.f_is_visit == '已回访'){
990
+ args.condition += ` and f_is_visit = '是'`
991
+ }else if (args.model.f_is_visit == '未回访'){
992
+ args.condition += ` and f_is_visit is null`
993
+ }
994
+ args.condition += ` and f_filialeid in ${this.model.f_filialeid}`
995
+ this.model.search(args.condition, args.model, args.condValue)
996
+ },
997
+ cancelsolveDefect() {
998
+ this.showSolveModal = false
999
+ this.solve = {
1000
+ model:{},
1001
+ id: '',
1002
+ f_repairman: this.$login.f.name,
1003
+ f_repair_date: Util.getNowDate().substr(0, 10),
1004
+ f_repair_path: '',
1005
+ imgSrc: '',
1006
+ filename: '',
1007
+ f_defect_remark:''
1008
+ }
1009
+ },
1010
+ okDefect(){
1011
+ if (!(this.solve.filename && this.solve.filename.length > 0)) {
1012
+ this.$showMessage('请录入处理后照片')
1013
+ return
1014
+ }
1015
+ co(upSolveDefect(this))
1016
+ },
1017
+ showSolve(row){
1018
+ this.showSolveModal = true
1019
+ this.solve.model = row
1020
+ this.solve.model.defectImg = row.f_path?'/rs/image/file/' + row.f_path:null
1021
+ this.solve.id = row.f_defect_id
1022
+ },
1023
+ inrole(){
1024
+ return this.$login.f.rolestr.indexOf('安检隐患处理') != -1
1025
+ }
1026
+ },
1027
+
1028
+ ready() {
1029
+ this.getEmp()
1030
+ this.readConfig()
1031
+ ////tag
1032
+ this.function = this.f
1033
+ ////tag
1034
+
1035
+ let gen = select(this)
1036
+ //this.pianqu()
1037
+ this.Mreadibook(`('${this.$login.f.orgid}')`)
1038
+ co(gen)
1039
+ }
1040
+ }
1041
+ </script>