safecheck-client 3.0.30-81 → 3.0.30-82

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