safecheck-client 4.0.0-103 → 4.0.0-104

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,2422 @@
1
+ <template>
2
+ <div id="savebut" class="no-close row android-repair-order" style="background-color: #f9f9f9">
3
+ <div class="col-sm-12 col-xs-12" >
4
+ <ul class="nav nav-tabs" style="background:#ffffff;overflow-y: hidden">
5
+ <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
6
+ v-if="$index < number+1 && $index < faultshow.number" >
7
+ <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
8
+ <span class="spanboder">{{row.header}}</span>
9
+ <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
10
+ <p></p>
11
+ </li>
12
+ <div class="col-sm-12 col-xs-12 repair-bg" v-show="routeShow">
13
+ <route name='repair' :reuse="false"></route>
14
+ </div>
15
+ <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
16
+ v-if="$index > number && $index < faultshow.number ">
17
+ <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
18
+ <span class="spanboder">{{row.header}}</span>
19
+ <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
20
+ <p></p>
21
+ </li>
22
+ <div class="col-sm-12 col-xs-12 repair-bg" v-if="actionEnabled ">
23
+ <div class="auto select-overspread form-horizontal repair-bg " style="padding-bottom:5px;">
24
+ <div class="bq-parent">
25
+ <blockquote class="blockquote">
26
+ <p>安检上传</p>
27
+ </blockquote>
28
+ </div>
29
+ <div class="panel panel-default auto repair-info-content">
30
+ <div class="panel-body ">
31
+ <div class="row auto">
32
+ <!--<div class="col-xs-12 col-sm-12 col-md-12" :style="timeSet(this.isneedDate)?'':'display:none'">-->
33
+ <!--<label>请输入超期原因:</label><br/>-->
34
+ <!--<textarea style="width: 100%;" v-model=""></textarea>-->
35
+ <!--</div>-->
36
+ <div class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;">
37
+ <div class="col-xs-3 col-sm-3 col-md-3" v-if="parentPage=='CurrentCreate'">
38
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="save('temp')">
39
+ 临时保存
40
+ </button>
41
+ </div>
42
+ <div class="col-xs-3 col-sm-3 col-md-3">
43
+ <button class="col-sm-3 btn btn-primary" @click="save('finish')">
44
+ 本地缓存
45
+ </button>
46
+ </div>
47
+ <div class="col-xs-3 col-sm-3 col-md-3">
48
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="uploadCheckPaper">
49
+ 上传
50
+ </button>
51
+ </div>
52
+ <div v-if="show_torepair">
53
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="showmod">
54
+ 转维修
55
+ </button>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </ul>
64
+ </div>
65
+ <modal :show.sync="showModal2" :backdrop="false" style="font-size: 15px">
66
+ <div slot="modal-header" class="modal-header upuserinfo_sel">
67
+ <h4 class="modal-title">
68
+ 转维修
69
+ </h4>
70
+ </div>
71
+ <div slot="modal-body" class="modal-body">
72
+ <div class="row">
73
+ <ol style="border: 1px solid green;padding: 15px 0 15px 20px">
74
+ <li v-for="row in repairDefect.data" >{{row}}</li>
75
+ </ol>
76
+ </div>
77
+ <div class="row" style="margin-top: 10px">
78
+ <label class="font_normal_body">派发类型</label>
79
+ <v-select :value.sync="selectData.dispatchType" :value-single="true" v-model="selectData.dispatchType"
80
+ :options='dispatchTypeOptions' placeholder='派发类型'
81
+ close-on-select>
82
+ </v-select>
83
+ </div>
84
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给维修员'">
85
+ <label class="font_normal_body">维&ensp;修&ensp;员</label>
86
+ <v-select
87
+ :value.sync="selectData.f_repairman"
88
+ :value-single="true"
89
+ :options='repairers'
90
+ placeholder='请选择维修员'
91
+ close-on-select></v-select>
92
+ </div>
93
+ <div class="row" style="margin-top: 10px" v-if="selectData.dispatchType=='派发给站点'">
94
+ <label class="font_normal_body">站&ensp;&ensp;&ensp;&ensp;点</label>
95
+ <safe-right-tree
96
+ islist
97
+ :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
98
+ @re-res="getSiteRes"></safe-right-tree>
99
+ </div>
100
+ <div class="row" style="margin-top: 10px">
101
+ <label class="font_normal_body">报修类型</label>
102
+ <v-select :value.sync="selectData.f_repairtype"
103
+ class="select select_list" @change="getDays"
104
+ :value-single="true"
105
+ :options='repairTypeOptions'
106
+ close-on-select>
107
+ </v-select>
108
+ </div>
109
+ <div class="row" style="margin-top: 10px">
110
+ <label class="font_normal_body">截止天数</label>
111
+ <v-select :value="selectData.day" :value-single="true"
112
+ v-model="selectData.day" class="select select_list"
113
+ :options='days' placeholder='请选择截止天数'
114
+ close-on-select
115
+ v-on:change="daychange" style="width: 60%"></v-select>
116
+ </div>
117
+ <div class="row" style="margin-top: 10px">
118
+ <label class="font_normal_body">截止时间</label>
119
+ <datepicker placeholder="请选择截至时间"
120
+ :value.sync="selectData.f_finish_date"
121
+ v-model="selectData.f_finish_date"
122
+ :format="'yyyy-MM-dd HH:mm:ss'"
123
+ style="width: 60%"
124
+ :disabled="true"></datepicker>
125
+ </div>
126
+ <div class="row" style="margin-top: 10px">
127
+ <label class="font_normal_body" >备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
128
+ <div class="btn-group" style="width:60%">
129
+ <textarea style="width:100%;height: 100px" v-model="selectData.f_remarks"></textarea>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
134
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="rectification">转维修</button>
135
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="cancel1">取消</button>
136
+ </div>
137
+ </modal>
138
+ </div>
139
+ </template>
140
+
141
+ <script>
142
+ import Vue from 'vue'
143
+ import * as Util from '../../../components/Util'
144
+ import { HttpResetClass } from 'vue-client'
145
+ import co from 'co'
146
+ import $ from "jquery";
147
+ import MeterReading from './MeterReading'
148
+ let loadParamGem = async function (self) {
149
+ await self.$LoadParams.loadParam()
150
+ }
151
+
152
+ export default {
153
+ title: '安检单',
154
+ props: ['f_plan_id', 'item', 'role','parentPage','source'],
155
+ // props: ['f_plan_id', 'role'],
156
+ data() {
157
+ return {
158
+ //测试数据
159
+ // f_plan_id:'',
160
+ // role:'inspect',
161
+ // item:{"f_approved_time":null,"f_user_family_remarks":null,"f_street":"测试街道","f_repair_approved_time":null,
162
+ // "f_user_type":null,"f_approved_by":null,"f_card_id":null,"f_remark":null,"f_building":"1","f_batch_number":null,
163
+ // "f_idnumber":null,"f_state":"未检","id":"0EFE0EE2-B155-46F9-8DE0-38C022664A4D","f_complete":null,"f_check_state":null,"f_last_check_state":"拒检",
164
+ // "f_user_inhome_time":null,"f_residential_area":"测试小区1","version":1,"f_processid":null,"f_last_check_result":"{\"result\":\"正常\",\"data\":[]}",
165
+ // "f_area":null,"f_usegas":null,"f_user_phone":"16566546548","f_slice_area":"营业大区","f_approved":"未审核","f_upload_state":"未传","f_user_check_time":null,
166
+ // "f_unit":"1","f_user_spare_phone":null,"f_last_check_date":null,"f_userproperties":null,"f_userfile_id":null,"f_prearranged_date":null,"f_filialeid":"453",
167
+ // "f_branch":null,"f_orgstr":null,"f_plan_year":2020,"f_orgid":null,"f_approval_notified":null,"f_plan_month":4,"f_approved_note":null,"f_filialeids":null,
168
+ // "f_floor":"1","f_flag":null,"f_repair_approved_note":null,"f_userinfo_code":"00000002","f_create_time":"2020-05-10 18:56:03","f_meter_no":"","f_station":null,
169
+ // "f_repair_approved":"未审核","f_no_checkplan":"有计划安检","f_plan_name":"关于","f_repair_approved_by":null,"f_room":"1","f_office":null,"f_comments":null,
170
+ // "f_address":"兰山街道泰盛小区1栋1单元1层1室","id_back":null,"f_userinfoid":"2","f_subcompany":null,"f_addressid":null,"f_user_phone2":null,
171
+ // "f_user_equipment_remarks":null,"f_plan_id":"0819ea6707ad4d9dad217c06a87f4227","f_user_name":"用户二",
172
+ // "f_plan_meters":[{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2119035714","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":3,"f_maker":null,"f_metergasnums":0,"f_total_fee":100,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663},{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2118999901","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":1,"f_maker":null,"f_metergasnums":0,"f_total_fee":0,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663}]
173
+ // },
174
+
175
+ data: {
176
+ f_devices: [],
177
+ f_defect_content:'',
178
+ f_recording1_path:'',
179
+ f_visit_number:'',
180
+ f_remark:''
181
+ },
182
+ imgsnum:this.$appdata.getSingleValue('安检总体照片数量') ? this.$appdata.getSingleValue('安检总体照片数量'):1, // 安检整体照片默认必须拍1张
183
+ updateuserphone:false, //安检时是否更新用户电话
184
+ updatemetermodel:false, //安检时是否更新表型号
185
+ updatemeternumber:false, //安检时是否更新表号
186
+ beforephone:'',
187
+ isUpload:false,
188
+ show_torepair: false,
189
+ onlySave:true, //判断保存还是保存并上传
190
+ livedispose:'',
191
+ refuseinspection:'', // 拒检拍照是否提示
192
+ notencountered:'', // 到访不遇拍照是否提示
193
+ startClick:false, //开始安检按钮是否可点击
194
+ isStrat: false, //是否开始安检
195
+ checkResult:{},//查询结果
196
+ newcheckResult:{},
197
+ repairDefect : {
198
+ result: '正常',
199
+ data: []
200
+ },
201
+ rowCodata:{},
202
+ repairers: [],
203
+ timer: null,
204
+ showModal: false,
205
+ showModal2:false,
206
+ pic_to_be_viewed: '',
207
+ showBack:true,
208
+ devices: [],
209
+ f_devices : [],
210
+ isToRepair:false,
211
+ clickBack:true, //是否点击返回按钮
212
+ isSafeCheckToRepair:false,//是否转维修
213
+ Url:this.$androidUtil.getProxyUrl(),
214
+ detail:{},
215
+ defectDevice:{},
216
+ user:{},
217
+ is_has_jingweidu: this.$appdata.getSingleValue('照片水印加经纬度') || 'false',
218
+ dispatchTypeOptions: [{label: '派发给维修员', value: '派发给维修员'},{label: '派发给站点', value: '派发给站点'}],
219
+ selectData:{
220
+ f_finish_date:'',
221
+ day:'',
222
+ dispatchType:'派发给站点',
223
+ f_repairman:'',
224
+ f_remarks:'',
225
+ f_repairtype:'安检隐患',
226
+ f_reciever:'459568766930518018',
227
+ f_meetunit:'热线',
228
+ f_outlets:'热线',
229
+ },
230
+ model: { //转维修数据
231
+ // 一次派单
232
+ serviceacitivity: [{
233
+ f_service_acitivity_type: '派单'
234
+ }],
235
+ f_source:'安检',
236
+ f_service_id: '',
237
+ f_contact_phone: '',
238
+ f_meetunit: '',
239
+ f_phone: '',
240
+ f_user_name: '',
241
+ f_address: '',
242
+ f_repair_date: Util.toStandardTimeString(),
243
+ f_card_id: '',
244
+ // f_department: '', 站点选择
245
+ f_reciever:'',
246
+ f_remarks: '',
247
+ f_user_type: '',
248
+ f_area: '',
249
+ f_unit_name:'',
250
+ f_street: '',
251
+ f_residential_area: '',
252
+ f_building: '',
253
+ f_unit: '',
254
+ f_floor: '',
255
+ f_room: '',
256
+ aState: null,
257
+ f_repairtype: '',
258
+ f_repairitems:{},
259
+ },
260
+ repairitems:[],
261
+ meading:'转站点',
262
+ repairTypeOptions:this.$appdata.getParam('报修类型'),
263
+ config: {
264
+ "燃气表":{
265
+ "checkmust":true,
266
+ "index":1,
267
+ "items":{
268
+ //"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
269
+ "基表编号":{"index":1,"type":"string","readonly":true},
270
+ "气表型号":{"index":2,"type":"string","readonly":true},
271
+ "气表品牌":{"index":3,"type":"string","readonly":true},
272
+ "表向":{"index":4,"type":"string","readonly":true},
273
+ "初始表底":{"index":5,"type":"number","isshow":false,"readonly":true},
274
+ "上期表读数":{"index":6,"type":"number","readonly":true,isshow:false},
275
+ "累购气量":{"index":7,"type":"number","readonly":true},
276
+ "累购金额":{"index":7,"type":"number","readonly":true},
277
+ "已用气量":{"index":8,"type":"number","checkmust": false},//基表数
278
+ "已用金额":{"index":8,"type":"number","checkmust": false},
279
+ "剩余气量":{"index":9,"type":"number","checkmust": false},//累购-已用
280
+ //显示屏数 --实际剩余气量
281
+ "剩余金额":{"index":9,"type":"number","checkmust": false},
282
+ "气量异常差值":{"index":10,"type":"number","readonly": true},
283
+ "金额异常差值":{"index":10,"type":"number","readonly": true},
284
+ "系统余额":{"index":10,"type":"number","readonly": true},
285
+ "表封号":{"index":11,"type":"string","readonly": true},
286
+ "燃气表照片":{"index":12,"type":"picture","checkmust": false}
287
+ }
288
+ // 注意,配置项的index必须与上面的固定配置保持'顺序'
289
+ },
290
+ // "燃气表2":{
291
+ // "checkmust":true,
292
+ // "index":2,src
293
+ // "items":{
294
+ // "燃气表照片":{"index":1,"type":"picture"},
295
+ // "表品牌":{"index":2,"type":"string","readonly":true},
296
+ // "表号":{"index":3,"type":"string","readonly":true},
297
+ // "表封号":{"index":4,"type":"number","readonly":true},
298
+ // "表型号":{"index":5,"type":"string","readonly":true},
299
+ // "位置":{"index":6,"type":"string","readonly":true},
300
+ // "表底数":{"index":7,"type":"number","readonly":true},
301
+ // "累购气量":{"index":8,"type":"number","readonly":true},
302
+ // "累购金额":{"index":8,"type":"number","readonly":true}
303
+ // }
304
+ // }
305
+ },
306
+ // 维修项
307
+ isneedDate:'',
308
+ days: this.$appdata.getParam('截止天数'),
309
+ routeShow:true,
310
+ number:0,
311
+ shupingshow:false,
312
+ pipeline: {},
313
+ details: [],
314
+ ids: '',
315
+ savevalid: {
316
+ uservalid: false,
317
+ doorvalid: true,
318
+ changetable: false
319
+ },
320
+ doordetails: {},
321
+ devicedetails: {},
322
+ cookdetails: {},
323
+ componentName: 'safecheck-userinfo',
324
+ header:'客户信息',
325
+ tabs: [
326
+ // 参数全部设置成空,在ready时,等model处理好了,再添加
327
+ {
328
+ header: '客户信息',complete:'safecheck-userinfo',class: 'repair-info-class', props: null
329
+ },
330
+ {
331
+ header: '拍照签名',complete:'paper-feedback', class: 'outlay-class', props: null
332
+ }
333
+ ],
334
+ faultshow:{
335
+ number : 8
336
+ } // 控制 故障汇总 在 菜单里显示与否,
337
+ }
338
+ },
339
+ components: {
340
+ 'meter-reading': MeterReading,
341
+ },
342
+ computed: {
343
+ actionEnabled: {
344
+ get() {
345
+ return (this.role == 'inspect' && (this.item.f_last_check_state == '到访不遇' || this.item.f_last_check_state == '拒检' || this.item.f_approved == '不通过' )) || (this.role == 'inspect' && this.item.f_complete !='已完成' && this.item.f_complete !='已传' )
346
+ }
347
+ }
348
+ },
349
+ methods: {
350
+ getDays(val){
351
+ console.log(val)
352
+ this.days = this.$appdata.getParam(val+'截止天数')
353
+ this.selectData.day = this.$appdata.getSingleValue(val+'默认截止天数') || 1
354
+ },
355
+ daychange(val) {
356
+ this.selectData.day = val
357
+ if (val == '其他') {
358
+ this.flag = false
359
+ } else {
360
+ if(val){
361
+ this.flag = true
362
+ this.selectData.f_finish_date = this.getSecondDay(val)
363
+ }else {
364
+ this.selectData.f_finish_date = this.getSecondDay(1)
365
+ }
366
+
367
+ }
368
+ },
369
+ getSecondDay(val){
370
+ let t = new Date();
371
+ let t1 = t.getTime()
372
+ val = val * 1000
373
+ t.setTime(t1 + val * 60 * 60 * 24);
374
+ let Y = t.getFullYear() + '-'
375
+ let M = (t.getMonth() + 1 < 10 ? '0' + (t.getMonth() + 1) : t.getMonth() + 1) + '-'
376
+ let D = (t.getDate() < 10 ? '0' + t.getDate() : t.getDate()) + ' '
377
+ let h = (t.getHours() < 10 ? '0' + t.getHours() : t.getHours()) + ':'
378
+ let m = (t.getMinutes() < 10 ? '0' + t.getMinutes() : t.getMinutes()) + ':'
379
+ let s = t.getSeconds() < 10 ? '0' + t.getSeconds() : t.getSeconds()
380
+ return Y + M + D + h + m + s
381
+ },
382
+ showmod(){
383
+ // this.saveNoclick()
384
+ let errString = this.errorVerify()
385
+ if (errString) {
386
+ console.log(errString)
387
+ console.log('Vue.android',Vue.android)
388
+ console.log('this.isUpload',this.isUpload)
389
+ if (Vue.android){
390
+ this.$showMessage(errString)
391
+ }
392
+ return
393
+ }
394
+ //清空转维修列表重新进行数据组织
395
+ this.repairDefect = {
396
+ result: '正常',
397
+ data: []
398
+ }
399
+ this.data.f_complete = '已完成'
400
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
401
+ this.assemblyCodata()
402
+ if(this.repairDefect.result=='正常'){
403
+ this.$showMessage("未发现有选择需要转维修的隐患,请检查填写的数据。如需转维修请在处理方式中选择 '转维修' !")
404
+ return
405
+ }
406
+ console.log("准备保存!")
407
+ this.disableTimer()
408
+ this.getEmp()
409
+ this.showModal2=true
410
+ },
411
+ cancel1(){
412
+ this.showModal2=false
413
+ this.selectData={
414
+ dispatchType:'派发给站点',
415
+ f_repairman:'',
416
+ f_remarks:'',
417
+ f_repairtype:'安检隐患',
418
+ f_reciever:'459568766930518018',
419
+ f_meetunit:'热线',
420
+ f_outlets:'热线',
421
+ }
422
+ },
423
+ getSiteRes(obj) {
424
+ console.log('siteRes ---> ')
425
+ console.log(obj)
426
+ if(obj.resids[0]){
427
+ this.selectData.f_meetunit = obj.res.join('.')
428
+ this.selectData.f_reciever = obj.resids.join('.')
429
+ this.selectData.f_outlets = obj.res[obj.res.length - 1]
430
+ }else {
431
+ this.selectData.f_meetunit = '热线'
432
+ this.selectData.f_reciever ='459568766930518018'
433
+ this.selectData.f_outlets ='热线'
434
+ }
435
+ },
436
+ rectification(){
437
+ if(this.selectData.dispatchType){
438
+ if(this.selectData.dispatchType=='派发给站点'){
439
+ if(!this.selectData.f_reciever){
440
+ this.selectData.f_meetunit = '热线'
441
+ this.selectData.f_reciever ='459568766930518018'
442
+ this.selectData.f_outlets ='热线'
443
+ }
444
+ }else{
445
+ if(!this.selectData.f_repairman){
446
+ this.$showMessage('请选择维修员!')
447
+ return
448
+ }
449
+ }
450
+ }else {
451
+ this.$showMessage('请选择派发类型!')
452
+ return
453
+ }
454
+ if(!this.selectData.f_repairtype){
455
+ this.$showMessage('请选择报修类型!')
456
+ return
457
+ }
458
+ //关闭录音
459
+ this.closely(false) // 保存本地,不删除录音文件暂停录音
460
+ let act={}
461
+ let toRepair=''
462
+ if(this.selectData.dispatchType=='派发给站点'){
463
+ act={f_meetunit:this.selectData.f_meetunit,f_reciever:this.selectData.f_reciever,f_service_acitivity_type:'派单'}
464
+ toRepair=null
465
+ }else{
466
+ console.log('派发给维修员---------'+this.selectData.f_repairman)
467
+ act={f_meetunit:'',f_reciever:this.selectData.f_repairman,f_service_acitivity_type:'派单'}
468
+ toRepair='一级派单'
469
+ }
470
+ let repData={
471
+ toRepair:toRepair,
472
+ activity:act,
473
+ deps:Vue.user.deps,
474
+ depids:Vue.user.depids,
475
+ f_remarks:this.selectData.f_remarks,
476
+ f_repairtype:this.selectData.f_repairtype,
477
+ f_finish_date:this.selectData.f_finish_date,
478
+ dispatchType: this.selectData.dispatchType,
479
+ f_attendant: Vue.user.name,
480
+ loginUser:{name:Vue.user.name,ename:Vue.user.id,id:Vue.user.id},
481
+ }
482
+ this.rowCodata.istoRepair='转维修'
483
+ this.rowCodata.repData=repData
484
+ console.log("当前组装好的转维修数据--"+JSON.stringify(repData))
485
+ this.onlySave = false
486
+ this.save()
487
+ },
488
+ // 获取维修员
489
+ getEmp() {
490
+ this.repairers=[]
491
+ let per = {source: 'this.getRights().where(row.getType()==$user$).where(row.getAttributes().get($rolestr$).indexOf($维修员$) != -1))', userid: `${Vue.user.id}`}
492
+ let http = new HttpResetClass()
493
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/search`, {data: per}, {resolveMsg: null, rejectMsg: null}).then((res) => {
494
+ res.data.forEach((user)=>{
495
+ this.repairers.push({label:user.name, value: user.name})
496
+ })
497
+ })
498
+ },
499
+ closely(isdelete){
500
+ try {
501
+ var startOrStopAudioClipStr;
502
+ if (isdelete===true) {
503
+ //tag
504
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止并删除录音') //停止并删除录音
505
+ }else {
506
+ //tag
507
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止录音') //停止录音
508
+ }
509
+ if (startOrStopAudioClipStr.code == 200) {
510
+ //tag
511
+ return true;
512
+ }else {
513
+ return false;
514
+ }
515
+ } catch (e) {
516
+ console.error("关闭录音方法异常")
517
+ console.error(e)
518
+ return false;
519
+ }
520
+ },
521
+ // 录音方法
522
+ record() {
523
+ //tag
524
+ if (this.role != 'inspect') {
525
+ if (this.data.f_recording1_path != '') {
526
+ window.location = "/rs/file"+this.data.f_recording1_path
527
+ }
528
+ } else {
529
+ //tag
530
+ let fileName
531
+ if (!this.data.f_recording1_path) {
532
+ fileName = Util.guid() + '.amr'
533
+ } else {
534
+ fileName = Util.getFileName(this.data.f_recording1_path)
535
+ }
536
+ //HostApp.__this__ = this
537
+ /*调用无限制录音模块*/
538
+ let startOrStopState = HostApp.startOrStopAudioClip(fileName,"开始录音")
539
+ //tag
540
+ if (startOrStopState.code == 200) {
541
+ this.data.f_recording1_path = "file:///storage/emulated/0/safecheck/" + fileName
542
+ //tag
543
+ return true;
544
+ }else {
545
+ return false;
546
+ }
547
+ }
548
+ },
549
+ saveNoclick() {
550
+ // 禁用点击事件
551
+ $("#savebut").addClass("noclickbut");
552
+ //tag
553
+
554
+ // 5秒后启用点击事件
555
+ setTimeout(function(){
556
+ $("#savebut").removeClass("noclickbut");
557
+ },5000);
558
+ },
559
+ timeSet(val){
560
+ if (!val){
561
+ return
562
+ }
563
+ let time =new Date(val).getTime()
564
+ let time2=new Date().getTime()
565
+ if (time2>time) {
566
+ return true
567
+ }
568
+ },
569
+ imgback(val,isheader){
570
+ if(val && this.routeShow && isheader){
571
+ return require('../../../assets/xiangxia1.png')
572
+ }else{
573
+ return require('../../../assets/xiangyou1.png')
574
+ }
575
+ },
576
+ changediv(val){
577
+ return val
578
+ },
579
+ // 选择tab
580
+ tabSelect (item,number) {
581
+ window.scrollTo(0, 0)
582
+ this.header = item.header;
583
+ // 处理关闭/显示 内容
584
+ if(this.number == number && !this.routeShow ){
585
+ this.routeShow = true
586
+ }else if(this.number == number && this.routeShow){
587
+ this.routeShow = false
588
+ }else if(this.number != item.complete){
589
+ this.routeShow = true
590
+ }
591
+ this.number = number
592
+ this.componentName = item.complete
593
+ if(item.complete == 'safecheck-devices'){
594
+ if(item.header != '燃气表' && this.data['device'+item.number].length == 0){
595
+ this.data['device' + item.number].push({})
596
+ }
597
+ let idx=this.data['device' + item.number].length - 1
598
+ let itemprops = {
599
+ config:this.config,
600
+ device:this.devices[item.number-1],
601
+ idx:idx,
602
+ role:'inspect'
603
+ }
604
+ if(this.routeShow){
605
+ this.$goto(item.complete, itemprops, 'repair')
606
+ }
607
+ }else if (item.complete == 'meter-reading'){
608
+ if(this.routeShow){
609
+ this.$goto(item.complete, {service:this.data}, 'repair')
610
+ }
611
+ }else{
612
+ if(this.routeShow){
613
+ this.$goto(item.complete, {userinfo:this.data}, 'repair')
614
+ }
615
+ }
616
+ this.shupingshow = true
617
+ },
618
+ // 给组件添加参数
619
+ getImgPath() {
620
+ for (var i = 0; i < this.model.serviceacitivity[0].imgs.length; i++) {
621
+ this.ids += this.model.serviceacitivity[0].imgs[i].imgid + ','
622
+ }
623
+ this.ids = this.ids.substring(0, this.ids.length - 1)
624
+ if(this.ids){
625
+ this.getImgGen();
626
+ }
627
+ },
628
+ getImgGen(){
629
+ let http = new HttpResetClass()
630
+ http.load('POST','api/af-safecheck/sql/safe_singleTable_OrderBy', {data: {
631
+ items: '*',
632
+ tablename: 't_files',
633
+ condition: `id in (${this.ids})`,
634
+ orderitem: 'id'
635
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
636
+ for (let i = 0; i < res.data.length; i++) {
637
+ for (let j = 0; j < this.model.serviceacitivity[0].imgs.length; j++) {
638
+ if (res.data[i].id.toString() === this.model.serviceacitivity[0].imgs[j].imgid) {
639
+ this.model.serviceacitivity[0].imgs[j] = Object.assign({}, res.data[i], this.model.serviceacitivity[0].imgs[j])
640
+ }
641
+ }
642
+
643
+ }
644
+ })
645
+ },
646
+
647
+ sortDetails(){
648
+ for (let i = 0; i < this.details.length; i++) {
649
+ if (this.details[i].details.length) {
650
+ for (let j = 0; j < this.details[i].details.length; j++) {
651
+ if (this.details[i].details[j].f_type === 'a') {
652
+ this.doordetails = {details: this.details[i].details}
653
+ break
654
+ }
655
+ if (this.details[i].details[j].f_type === 'b') {
656
+ this.devicedetails = {details: this.details[i].details}
657
+ break
658
+ }
659
+ if (this.details[i].details[j].f_type === 'c') {
660
+ this.cookdetails = {details: this.details[i].details}
661
+ break
662
+ }
663
+ }
664
+ }
665
+ }
666
+ },
667
+ // 复制数据
668
+ back () {
669
+ let _this = this
670
+ if(this.issee){
671
+ _this.$back()
672
+ return
673
+ }
674
+ this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
675
+ if (res === 'confirm') {
676
+ this.closely()
677
+ _this.$back()
678
+ }
679
+ })
680
+ },
681
+ confirm(){
682
+ this.$dispatch('confirm')
683
+ },
684
+ tick() {
685
+ this.timer = null
686
+ this.data.f_offsite_time = Util.toStandardTimeString()
687
+ this.timer = window.setTimeout(this.tick, 1000)
688
+ },
689
+ getRepairState() {
690
+ let repaired = true
691
+ this.data.f_defects.forEach((defect) => {
692
+ repaired = repaired & (defect.f_ratification == '已处理')
693
+ })
694
+ return repaired
695
+ },
696
+ verifyRepairDefects() {
697
+ this.data.f_repair_date = Util.toStandardTimeString()
698
+ this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
699
+ },
700
+ errorVerify() {
701
+ let hasError = this.verifyState()
702
+ if(hasError)
703
+ return hasError
704
+
705
+ if(this.data.f_entry_status != '入户' || this.data.f_usegas == '未用气')
706
+ return null
707
+ hasError = this.verifyUser()
708
+ if(hasError)
709
+ return hasError
710
+ hasError = this.verifyDevices()
711
+ if(hasError)
712
+ return hasError
713
+ hasError = this.verifyFeedback()
714
+ if(hasError)
715
+ return hasError
716
+ },
717
+ verifyState() {
718
+ if(Vue.android && this.data.f_usegas == '未用气' && (this.data.f_nongasuser_path == Vue.nopic || this.data.f_nongasuser_path == ''))
719
+ return '未使用天然气则必须拍照'
720
+ if(Vue.android && this.data.f_entry_status == '到访不遇' && this.notencountered && (this.data.f_noanswer_path == Vue.nopic || this.data.f_noanswer_path == ''))
721
+ return '到访不遇必须拍照'
722
+ if(Vue.android && this.data.f_entry_status == '拒检' && this.refuseinspection && (this.data.f_rejectcheck_path == Vue.nopic || this.data.f_rejectcheck_path == ''))
723
+ return '拒检必须拍照'
724
+ },
725
+ verifyUser() {
726
+ let prefix = '用户基本信息:'
727
+ if(Util.required(this.data.f_user_name))
728
+ return prefix + '用户名必须输入'
729
+ if (!this.data.f_user_phone){
730
+ return '请输入正确的电话号码'
731
+ }
732
+ if(!(/^\d{11}$/.test(this.data.f_user_phone.trim()))) {
733
+ return '请输入正确的电话号码'
734
+ }
735
+ // if(Util.required(this.data.f_residential_area))
736
+ // return prefix + '小区名称必须输入'
737
+ // if(Util.required(this.data.f_address))
738
+ // return prefix + '地址必须输入'
739
+ },
740
+ verifyDevices() {
741
+ for (let dev in this.config) {
742
+ if (this.config[dev].checkmust == true) {
743
+ let error = true
744
+ for(let device in this.data) {
745
+ if (device.startsWith("device")) {
746
+ for (let item in this.data[device]) {
747
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
748
+ error = false
749
+ }
750
+ }
751
+ }
752
+ }
753
+ if (error) {
754
+ return "请检查" + dev
755
+ }
756
+ }
757
+ }
758
+
759
+ for (let dev in this.config) {
760
+ for(let device in this.data) {
761
+ if (device.startsWith("device")) {
762
+ for (let item in this.data[device]) {
763
+ //检查每一条安检结果
764
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
765
+ for (let i in this.data[device][item].f_items) {
766
+ for (let it in this.config[dev].items) {
767
+ if (it == this.data[device][item].f_items[i].f_item_name) {
768
+ let check=false
769
+ if (!this.data[device][item].f_items[i].f_item_value){
770
+ check=true
771
+ }else if (Array.isArray(this.data[device][item].f_items[i].f_item_value)){
772
+ if (this.data[device][item].f_items[i].f_item_value.length==0){
773
+ check=true
774
+ }
775
+ }
776
+
777
+ if(this.config[dev].items[it].type=='picture' && this.config[dev].items[it].checkmust == true && !this.data[device][item].f_items[i].f_path){
778
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
779
+ }
780
+ if (this.config[dev].items[it].type !='picture' && this.config[dev].items[it].checkmust == true && check) {
781
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
782
+ }
783
+ }
784
+ }
785
+ //检查安检下拉结果
786
+ if (this.data[device][item].f_items[i].type == 'selector' || this.data[device][item].f_items[i].type == 'radio') {
787
+ if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
788
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + this.data[device][item].f_items[i].f_item_value + "选中必须拍照"
789
+ }
790
+ }
791
+ }
792
+ }
793
+ }
794
+ }
795
+ }
796
+ }
797
+ },
798
+ verifyFeedback() {
799
+ let prefix = '拍照签名:'
800
+ if(Vue.android && (!this.data.f_overall_imgs || this.data.f_overall_imgs.length < this.imgsnum) && this.data.f_entry_status == '入户')
801
+ return prefix + `必须有${this.imgsnum}安检总体照片`
802
+ /*if(Vue.android && (!this.data.f_sign_path || this.data.f_sign_path.length == 0) && this.data.f_entry_status == '入户')
803
+ return prefix + '必须有用户签名'*/
804
+ if(Vue.android && this.data.f_defect_notified && this.data.f_notified_path == Vue.nopic)
805
+ return prefix + '下发安检通知书则必须给通知书拍照'
806
+ if(Vue.android && this.data.f_blacklist && this.data.f_blocking_cause=='')
807
+ return prefix + '请填写拉黑原因'
808
+ if(!this.data.f_client_evaluation && this.data.f_entry_status == '入户')
809
+ return prefix + '请选择服务评价'
810
+ },
811
+ getAllDefect() {
812
+ let checkResults = {
813
+ result: '正常',
814
+ data: []
815
+ }
816
+ let value = ''
817
+ let codata = JSON.parse(JSON.stringify(this.data))
818
+ codata.f_devices = []
819
+ this.f_devices = []
820
+ for (let device in codata) {
821
+ let f_device_type
822
+ if (device.startsWith("device")) {
823
+ let hasOther = ''
824
+ let otherValue = null
825
+ for (let item in codata[device]) {
826
+ if(typeof codata[device][item]=='function'){
827
+ continue
828
+ }
829
+ codata[device][item].f_create_time = Util.toStandardTimeString()
830
+ if (codata[device].length > 1) {
831
+ let j = Number.parseInt(item) + 1
832
+ f_device_type = `${codata[device][item].f_device_type}${j}`
833
+ } else {
834
+ f_device_type = codata[device][item].f_device_type
835
+ }
836
+ if(item == 'sum' || item == 'removeEmpty'){
837
+ continue
838
+ }
839
+ for (let i = 0; i < codata[device][item].f_items.length ; i++) {
840
+ //tag
841
+ if(i == 'sum' || i == 'removeEmpty'){
842
+ continue
843
+ }
844
+ var items = codata[device][item].f_items[i]
845
+ items.f_create_time = Util.toStandardTimeString()
846
+ items.f_item_lists = []
847
+ if (items.type == 'selector') {
848
+ items.selected = []
849
+ } else if (items.type == 'inputSelector') {
850
+ items.selected = ''
851
+ }
852
+ //遍历配置项 将所选隐患项的配置信息放入保存的数据中
853
+ let f_is_defect //是否是隐患
854
+ let f_defect_level //是否是隐患
855
+ let f_item_name = items.f_item_name
856
+ let f_item_value
857
+ if (items.type == 'selector' || items.type == 'checkbox' || items.type == 'radio') {
858
+ for (let i in items.f_item_value) {
859
+ if(typeof items.f_item_value[i]=='function'){
860
+ continue
861
+ }
862
+ let configItems = this.config[codata[device][item].f_device_type].items[f_item_name]
863
+ //tag)
864
+ for (let k in configItems.options) {
865
+ if(typeof configItems.options[k]=='function'){
866
+ continue
867
+ }
868
+ //tag)
869
+ if (items.f_item_value[i] === configItems.options[k].data) {
870
+
871
+ f_is_defect = configItems.options[k].isdefect
872
+ f_item_value = items.f_item_value[i]
873
+ f_defect_level = configItems.options[k].level
874
+ if (f_is_defect) {
875
+ if (checkResults.result !== '有隐患') {
876
+ checkResults.result = '有隐患'
877
+ }
878
+ console.log('items'+items)
879
+ if(items.f_deal_dispose=='报修'){
880
+ console.log("检测到需要转维修++++++++++++")
881
+ this.repairDefect.result='未处理'
882
+ this.repairDefect.data.push(`${f_item_name} : ${f_item_value}`)
883
+ }
884
+ if (!this.checkResult.hasOwnProperty(f_device_type+'-'+f_item_name)) {
885
+ this.checkResult[f_device_type+'-'+f_item_name] = []
886
+ }
887
+ this.checkResult[f_device_type+'-'+f_item_name].push(f_item_value)
888
+
889
+ }
890
+
891
+ let items_list = {
892
+ f_is_defect: f_is_defect,
893
+ f_item_value: f_item_value,
894
+ f_defect_level: f_defect_level,
895
+ f_is_eliminate: null,
896
+ f_create_time: Util.toStandardTimeString()
897
+ }
898
+ if (!items.f_item_lists) {
899
+ items.f_item_lists = []
900
+ if (JSON.stringify(items_list) !== '{}') {
901
+ items.f_item_lists.push(items_list)
902
+ }
903
+ } else {
904
+ if (JSON.stringify(items_list) !== '{}') {
905
+ items.f_item_lists.push(items_list)
906
+ }
907
+ }
908
+ }
909
+ }
910
+ }
911
+ } else {
912
+ let configItems = this.config[codata[device][item].f_device_type].items[items.f_item_name]
913
+ f_is_defect = items.f_is_defect
914
+ f_defect_level = items.level
915
+ f_item_value = items.f_item_value
916
+ let items_list = {
917
+ f_is_defect: f_is_defect,
918
+ f_item_value: f_item_value,
919
+ f_defect_level: f_defect_level,
920
+ f_create_time: Util.toStandardTimeString()
921
+ }
922
+ if (f_is_defect && f_item_value) {
923
+ items.f_is_defect = true
924
+ if (checkResults.result !== '有隐患') {
925
+ checkResults.result = '有隐患'
926
+ }
927
+ if (!this.checkResult.hasOwnProperty(items.f_item_name)) {
928
+ this.checkResult[items.f_item_name] = []
929
+ }
930
+
931
+ this.checkResult[items.f_item_name].push(f_item_value)
932
+
933
+ }
934
+ if (!items.f_item_lists) {
935
+ items.f_item_lists = []
936
+ if (JSON.stringify(items_list) != '{}') {
937
+ items.f_item_lists.push(items_list)
938
+ }
939
+ } else {
940
+ if (JSON.stringify(items_list) != '{}') {
941
+ items.f_item_lists.push(items_list)
942
+ }
943
+ }
944
+ }
945
+ if (hasOther !== '' && otherValue !== null) {
946
+ this.checkResult[hasOther].push(otherValue)
947
+ hasOther = ''
948
+ otherValue = null
949
+ }
950
+ items.f_item_value = ''
951
+ }
952
+ this.f_devices.push(codata[device][item])
953
+ }
954
+ }
955
+ }
956
+ if (this.checkResult) {
957
+ for (let key in this.checkResult) {
958
+ if(typeof this.checkResult[key]=='function'){
959
+ continue
960
+ }
961
+ // 上次安检结果数据组织
962
+ let temp = {}
963
+ temp[key] = this.checkResult[key].join(',')
964
+ checkResults.data.push(temp)
965
+ }
966
+ this.checkResult = {}
967
+ }
968
+ if (checkResults.data.length > 0) {
969
+ let msg = ''
970
+ for (let a = 0; a < checkResults.data.length; a++) {
971
+ for (let datumKey in checkResults.data[a]) {
972
+ msg += datumKey + ':' + checkResults.data[a][datumKey] + ';'
973
+ }
974
+ }
975
+ this.data.f_defect_text = msg
976
+ codata.f_defect_text = msg
977
+ }
978
+ codata.f_defect_content = JSON.stringify(checkResults)
979
+ this.data.f_defect_content = JSON.stringify(checkResults)
980
+ return codata
981
+ },
982
+ uploadCheckPaper(){
983
+ this.saveNoclick()
984
+ this.closely(false) // 保存本地,不删除录音文件停止录音
985
+ let errString = this.errorVerify()
986
+ if (errString) {
987
+ if (Vue.android){
988
+ this.$showMessage(errString)
989
+ }
990
+ return
991
+ } else {
992
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
993
+ this.$set('data.f_upload_time', Util.toStandardTimeString())
994
+ this.$set('data.f_upload_date', Util.toStandardTimeString())
995
+ this.data.f_complete = '已完成'
996
+ this.disableTimer()
997
+ }
998
+ this.onlySave = false
999
+ this.assemblyCodata()
1000
+ if (this.repairDefect.result != '正常') {
1001
+ return this.$showMessage('有隐患的处理方式为转维修,请点击转维修')
1002
+ }
1003
+ this.save()
1004
+
1005
+ },
1006
+ //将数据组装提出
1007
+ assemblyCodata(){
1008
+ let codata = this.getAllDefect()
1009
+ console.log(`codata类型 开始组装codeta数据-->${typeof codata}`)
1010
+ console.log(`codata内容-->${JSON.stringify(codata)}`)
1011
+ for (let key in codata) {
1012
+ if (key.startsWith("device")) {
1013
+ console.log('this.data.' + key + JSON.stringify(codata[key]))
1014
+ codata[key] = []
1015
+ }
1016
+ }
1017
+ codata.f_devices = this.f_devices
1018
+ this.rowCodata=codata
1019
+ },
1020
+ save(type) {
1021
+ if (type == 'temp' || type == 'finish') {
1022
+ this.assemblyCodata()
1023
+ }
1024
+ //禁用事件
1025
+ this.saveNoclick()
1026
+ if(type == 'temp'){
1027
+ this.data.f_complete = '未完成'
1028
+ this.rowCodata.f_complete = '未完成'
1029
+ // 关闭录音方法
1030
+ this.closely(true) //临时保存,删除录音文件并暂停录音
1031
+ this.disableTimer()
1032
+ }else {
1033
+ // 关闭录音方法
1034
+ this.closely(false) // 保存本地,不删除录音文件暂停录音
1035
+ let errString = this.errorVerify()
1036
+ if (errString) {
1037
+ if (Vue.android){
1038
+ this.$showMessage(errString)
1039
+ }
1040
+ return
1041
+ } else {
1042
+ this.data.f_complete = '已完成'
1043
+ this.rowCodata.f_complete = '已完成'
1044
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
1045
+ this.$set('rowCodata.f_offsite_time', Util.toStandardTimeString())
1046
+ this.disableTimer()
1047
+ }
1048
+ }
1049
+ if(this.data.f_blacklist!='是'){
1050
+ delete this.data.f_blocking_cause
1051
+ }
1052
+ if (this.data.f_entry_status == '入户') {
1053
+ this.data.f_rejectchecks_path = []
1054
+ this.data.f_rejectcheck_path = null
1055
+ this.data.f_rejectcheck1_path = null
1056
+ this.data.f_rejectcheck2_path = null
1057
+ this.data.f_noanswers_path=[]
1058
+ this.data.f_noanswer_path = null
1059
+ this.data.f_noanswer1_path = null
1060
+ this.data.f_noanswer2_path = null
1061
+ }else if (this.data.f_entry_status == '到访不遇') {
1062
+ this.data.f_rejectchecks_path = []
1063
+ this.data.f_rejectcheck_path = null
1064
+ this.data.f_rejectcheck1_path = null
1065
+ this.data.f_rejectcheck2_path = null
1066
+ }else if (this.data.f_entry_status == '拒检') {
1067
+ this.data.f_noanswers_path=[]
1068
+ this.data.f_noanswer_path = null
1069
+ this.data.f_noanswer1_path = null
1070
+ this.data.f_noanswer2_path = null
1071
+ }
1072
+ let codata = this.rowCodata
1073
+ for (let key in codata) {
1074
+ if (key.startsWith("device")) {
1075
+ codata[key] = []
1076
+ }
1077
+ }
1078
+ codata.f_complete = this.data.f_complete
1079
+ if (Vue.android) {
1080
+ let value = this.$androidUtil.path({
1081
+ alias: 'getUserinfomation',
1082
+ data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan in ('无计划安检','复检')"}
1083
+ })
1084
+ if ((this.item.f_no_checkplan == '无计划安检' || this.item.f_no_checkplan == '复检') && this.item.f_no_checkplan != '打回') {
1085
+ codata.f_devices = this.f_devices
1086
+ if (this.rowCodata && this.rowCodata.istoRepair=='转维修') {
1087
+ this.rowCodata = Object.assign({},this.rowCodata,codata)
1088
+ } else {
1089
+ this.rowCodata = codata
1090
+ }
1091
+ this.rowCodata.f_tablebase = this.data.f_new_tablebase
1092
+ let param = {
1093
+ f_check_item_id: this.data.f_check_item_id,
1094
+ f_checker_id: this.data.f_checker_id,
1095
+ f_upload_state: '未传',
1096
+ row: this.rowCodata
1097
+ }
1098
+ let paramStr = JSON.stringify(param)
1099
+ // 多长截断一次
1100
+ let subLength = 800
1101
+ for (let i = 0; i < paramStr.length; i += subLength) {
1102
+ HostApp.param_cache(paramStr.slice(i, i + subLength))
1103
+ }
1104
+ HostApp.__this__ = this
1105
+ HostApp.syncLogic({
1106
+ // logic别名,key必须为logic
1107
+ 'logic': 'SafeSaveNoPaper',
1108
+ // 回调执行方法名,key必须为callback
1109
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1110
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1111
+ // 执行回调方法传入key为backresult
1112
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1113
+ 'backresult': 1
1114
+ })
1115
+ } else {
1116
+ codata.f_devices = this.f_devices
1117
+ if (this.rowCodata && this.rowCodata.istoRepair=='转维修') {
1118
+ this.rowCodata = Object.assign({},this.rowCodata,codata)
1119
+ } else {
1120
+ this.rowCodata = codata
1121
+ }
1122
+ this.rowCodata.f_tablebase = this.data.f_new_tablebase
1123
+ let param = {
1124
+ f_check_item_id: this.data.f_check_item_id,
1125
+ f_checker_id: this.data.f_checker_id,
1126
+ row: this.rowCodata
1127
+ }
1128
+ let paramStr = JSON.stringify(param)
1129
+ // 多长截断一次
1130
+ let subLength = 800
1131
+ for (let i = 0; i < paramStr.length; i += subLength) {
1132
+ HostApp.param_cache(paramStr.slice(i, i + subLength))
1133
+ }
1134
+ HostApp.__this__ = this
1135
+ HostApp.syncLogic({
1136
+ // logic别名,key必须为logic
1137
+ 'logic': '保存安检单信息',
1138
+ // 回调执行方法名,key必须为callback
1139
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1140
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1141
+ // 执行回调方法传入key为backresult
1142
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1143
+ 'backresult': 1
1144
+ })
1145
+ }
1146
+
1147
+ } else {
1148
+ let value = this.$androidUtil.path({
1149
+ alias: 'getUserinfomation',
1150
+ data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan in ('无计划安检','复检')"}
1151
+ })
1152
+ if (this.rowCodata && this.rowCodata.istoRepair=='转维修') {
1153
+ this.rowCodata = Object.assign({},this.rowCodata,codata)
1154
+ } else {
1155
+ this.rowCodata = codata
1156
+ }
1157
+ if ((this.item.f_no_checkplan == '无计划安检' || this.item.f_no_checkplan == '复检') && value.data.length == 0 && this.item.f_no_checkplan != '打回') {
1158
+ this.$androidUtil.bzLogic('SafeSaveNoPaper', {
1159
+ f_check_item_id: this.data.f_check_item_id,
1160
+ f_checker_id: this.data.f_checker_id,
1161
+ f_upload_state: '未传',
1162
+ row: this.rowCodata
1163
+ }).then((res) => {
1164
+ if (res.data.code == 200) {
1165
+ //保存devices
1166
+ this.$androidUtil.bzLogic('getPaperInfo', {
1167
+ f_check_item_id: this.data.f_check_item_id
1168
+ }).then((res) => {
1169
+ if (res.data.code == 200) {
1170
+ let f_paper_id = res.data.data[0].id
1171
+ for (let device of this.f_devices) {
1172
+ device.f_paper_id = f_paper_id
1173
+ this.$androidUtil.bzLogic('saveDevice', {
1174
+ row: device
1175
+ }).then((ret) => {
1176
+ if (ret.code != 200) {
1177
+ //TODO 失败后处理
1178
+ this.$showMessage("保存失败!")
1179
+ return false
1180
+ }
1181
+ })
1182
+ }
1183
+ }
1184
+ })
1185
+ this.$showMessage('保存成功!')
1186
+ return true
1187
+ } else {
1188
+ this.$showMessage("保存失败!")
1189
+ return false
1190
+ }
1191
+ })
1192
+ }
1193
+ else {
1194
+ this.$androidUtil.bzLogic('保存安检单信息', {
1195
+ f_check_item_id: this.data.f_check_item_id,
1196
+ f_checker_id: this.data.f_checker_id,
1197
+ row: this.rowCodata
1198
+ }).then((res) => {
1199
+ if (res.data.code == 200) {
1200
+ //保存devices
1201
+ this.$androidUtil.bzLogic('getPaperInfo', {
1202
+ f_check_item_id: this.data.f_check_item_id
1203
+ }).then((res) => {
1204
+ if (res.data.code == 200) {
1205
+
1206
+ let f_paper_id = res.data.data[0].id
1207
+ for (let device of this.f_devices) {
1208
+ device.f_paper_id = f_paper_id
1209
+ this.$androidUtil.bzLogic('saveDevice', {
1210
+ row: device
1211
+ }).then((ret) => {
1212
+ if (ret.code != 200) {
1213
+ //TODO 失败后处理
1214
+ this.$showMessage("保存失败!")
1215
+ return false
1216
+ }
1217
+ })
1218
+ }
1219
+ }
1220
+ })
1221
+ this.$showMessage('保存成功!')
1222
+ return true
1223
+ } else {
1224
+ this.$showMessage("保存失败!")
1225
+ return false
1226
+ }
1227
+ })
1228
+ }
1229
+ }
1230
+ },
1231
+ runSyncLogic(logic,callback,backresult){
1232
+ HostApp.runSyncLogic({
1233
+ // logic别名,key必须为logic
1234
+ 'logic': logic,
1235
+ // 回调执行方法名,key必须为callback
1236
+ 'callback': callback,
1237
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1238
+ // 执行回调方法传入key为backresult
1239
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1240
+ 'backresult':backresult
1241
+ })
1242
+ },
1243
+ logicWithHint(logic,data,callback,backresult){
1244
+ HostApp.logicWithHint({
1245
+ // logic别名,key必须为logic
1246
+ 'logic': logic,
1247
+ // 回调执行方法名,key必须为callback
1248
+ 'callback': callback,
1249
+ // logic执行需要的业务参数
1250
+ 'data': data,
1251
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1252
+ // 执行回调方法传入key为backresult
1253
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1254
+ 'backresult':backresult
1255
+ })
1256
+ },
1257
+ saveCallBack(jo){
1258
+ if(jo.state == 'ok'){
1259
+ let res = JSON.parse(jo.result)
1260
+ if(res.code == 200){
1261
+ if(!this.onlySave){
1262
+ let codata = this.getAllDefect()
1263
+ //获取微信推送内容
1264
+ // let WxResult = this.getWeixin(codata)
1265
+ let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
1266
+ f_check_item_id: this.data.f_check_item_id
1267
+ })
1268
+ //如果是转维修上传,则不做校验,上传完成后自动转维修
1269
+ if(!this.isToRepair){
1270
+ if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
1271
+ if(!this.isSafeCheckToRepair){
1272
+
1273
+ }
1274
+ }
1275
+ }
1276
+ for (let key in codata){
1277
+ if(key.startsWith("device")){
1278
+ codata[key] = []
1279
+ }
1280
+ }
1281
+ codata.f_devices = this.f_devices
1282
+ if (this.rowCodata && this.rowCodata.istoRepair=='转维修') {
1283
+ this.rowCodata = Object.assign({},this.rowCodata,codata)
1284
+ } else {
1285
+ this.rowCodata = codata
1286
+ }
1287
+ this.rowCodata.f_tablebase = null
1288
+ let param = {
1289
+ f_check_item_id: this.data.f_check_item_id,
1290
+ f_checker_id: this.data.f_checker_id,
1291
+ row: this.rowCodata
1292
+ }
1293
+ let paramStr = JSON.stringify(param)
1294
+ // 多长截断一次
1295
+ let subLength = 800
1296
+ for (let i = 0; i < paramStr.length; i += subLength) {
1297
+ HostApp.param_cache(paramStr.slice(i, i + subLength))
1298
+ }
1299
+ HostApp.__this__ = this
1300
+ HostApp.syncLogic({
1301
+ // logic别名,key必须为logic
1302
+ 'logic': '上传安检信息',
1303
+ // 回调执行方法名,key必须为callback
1304
+ 'callback': 'javascript:HostApp.__this__.uploadCallBack()',
1305
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1306
+ // 执行回调方法传入key为backresult
1307
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1308
+ 'backresult': 1
1309
+ })
1310
+ }else{
1311
+ this.$showMessage('保存成功!')
1312
+ if(this.clickBack){
1313
+ this.isStrat = false
1314
+ this.$dispatch('confirm')
1315
+ }
1316
+ }
1317
+ }else{
1318
+ this.$showMessage('保存失败!')
1319
+ return
1320
+ }
1321
+ }else{
1322
+ this.$showMessage('服务器内部错误,保存失败!')
1323
+ return
1324
+ }
1325
+ },
1326
+ uploadCallBack(jo){
1327
+ //获取微信推送路径
1328
+ let url = ""
1329
+ if(Vue.config.safecheck != undefined) {
1330
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
1331
+ if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
1332
+ url = Vue.config.safecheck.ApproveConfig.weixinurl
1333
+ }
1334
+ }
1335
+ }
1336
+ if(jo.state == 'ok'){
1337
+ let res = JSON.parse(jo.result)
1338
+ if(res.code == 200){
1339
+ this.$set('data.f_paper_id', res.id)
1340
+ this.isStrat=false
1341
+ if(url != ""){
1342
+ this.$resetpost(`${url}`,{data:WxResult})
1343
+ }
1344
+ // 预约安检回更预约安检单
1345
+ if(this.data.isupdateplanitem == 'true' && this.data.f_SafeToRepair_id){
1346
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-safecheck/logic/ReturnSafeService`, {data:{
1347
+ f_paper_id:this.data.f_paper_id,
1348
+ f_service_id:this.data.f_SafeToRepair_id
1349
+ }
1350
+ }).then((ret) => {
1351
+ if(ret.data && ret.data.code == 200){
1352
+ console.log('预约安检回更成功')
1353
+ }
1354
+ })
1355
+ }
1356
+ if(this.isToRepair){
1357
+ for (let device in this.data){
1358
+ if(device.startsWith("device")){
1359
+ this.data[device] = []
1360
+ if(res.data.length > 0){
1361
+ for(let i in res.data[0].f_devices){
1362
+ if(this.data[device].length > 0){
1363
+ if(this.data[device][0].f_device_type == res.data[0].f_devices[i].f_device_type){
1364
+ this.data[device].push(res.data[0].f_devices[i])
1365
+ res.data[0].f_devices.splice(i,1)
1366
+ }
1367
+ }else{
1368
+ this.data[device].push(res.data[0].f_devices[i])
1369
+ res.data[0].f_devices.splice(i,1)
1370
+ }
1371
+ }
1372
+ }
1373
+ }
1374
+ }
1375
+ this.todo()
1376
+ }else{
1377
+ this.$showMessage('安检上传成功!')
1378
+ if (this.data.f_userinfoid){
1379
+ let http = new HttpResetClass()
1380
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
1381
+ data: {
1382
+ items: 'count(0) as num',
1383
+ tablename: 't_userfiles a left join t_userinfo b on a.f_userinfo_id = b.f_userinfo_id',
1384
+ condition: `a.f_userinfo_id = '${this.item.f_userinfoid}' and a.f_meter_classify != '物联网表' and a.f_table_state = '正常' and b.f_user_state='正常'`,
1385
+ orderitem: '1'
1386
+ }
1387
+ }, {resolveMsg: null, rejectMsg: null}).then((response) => {
1388
+ if (response.data[0].num > 0 ){
1389
+ let _this = this
1390
+ this.$showMessage(`是否前往抄表`, ['confirm', 'cancel']).then((res) => {
1391
+ if (res === 'confirm') {
1392
+ let http = new HttpResetClass()
1393
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-readmeter/sql/PcHandInfo`, {data:{
1394
+ sort: `asc`,
1395
+ condition:`f_userinfo_id = '${_this.data.f_userinfoid}'`
1396
+ }
1397
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
1398
+ let param = {}
1399
+ param = res.data[0]
1400
+ param.f_new_tablebase = _this.data.f_new_tablebase
1401
+ param.tabname="在线抄表"
1402
+ var pardate = {
1403
+ _this:this,
1404
+ tittle:'抄表单信息',
1405
+ safe:false
1406
+ }
1407
+ this.$dispatch('gotoson',pardate)
1408
+ this.$goto('phone-hand-edit', {data:param,source:'抄表',type:'save'}, 'self', function (){
1409
+ _this.$dispatch('confirm')
1410
+ }
1411
+ )
1412
+ })
1413
+ }else {
1414
+ this.$dispatch('tijiao')
1415
+ }
1416
+ })
1417
+ }else {
1418
+ this.$dispatch('tijiao')
1419
+ }
1420
+ })
1421
+ }else{
1422
+ this.$dispatch('tijiao')
1423
+ }
1424
+ }
1425
+ }else if(res.code == 309){
1426
+ this.$showMessage('该安检单已作废!')
1427
+ this.$dispatch('confirm')
1428
+ }else if(res.code == 710){
1429
+ this.$showMessage('上传照片失败,请检查网络是否正常!'+res.msg)
1430
+ this.onlySave = true
1431
+ return
1432
+ }else if(res.code == 711){
1433
+ this.$showMessage('该安检单已被管理员调整,请联系管理员!')
1434
+ this.onlySave = true
1435
+ return
1436
+ }else if(res.code == 712){
1437
+ this.$showMessage('网络异常,请缓存后重新尝试上传,多次上传失败请联系管理员!')
1438
+ this.onlySave = true
1439
+ return
1440
+ }
1441
+ else{
1442
+ this.$showMessage('上传失败!')
1443
+ }
1444
+ }else {
1445
+ this.$showMessage('网络异常,上传失败!')
1446
+ }
1447
+ this.onlySave = true
1448
+ },
1449
+ safecheckToRepairCallBack(jo){
1450
+ //获取微信推送路径
1451
+ if(jo.state == 'ok'){
1452
+ let res = JSON.parse(jo.result)
1453
+ if(res.code == 200){
1454
+ if(res.data.code == 200){
1455
+ this.$showMessage('上传并转维修成功!')
1456
+ }else{
1457
+ this.$showMessage('上传并转维修成功,回写安检单失败!')
1458
+ }
1459
+ this.$dispatch('confirm')
1460
+ }else{
1461
+ this.$showMessage('上传失败!')
1462
+ this.onlySave = true
1463
+ }
1464
+ }else{
1465
+ this.$showMessage('网络异常,上传失败!')
1466
+ this.onlySave = true
1467
+ }
1468
+ },
1469
+ todo(){
1470
+ let gen = getRepairParam(this)
1471
+ co(gen)
1472
+ },
1473
+ undo(){
1474
+ this.showCheckToRepair = !this.showCheckToRepair
1475
+ this.model.serviceacitivity[0].f_reciever = ''
1476
+ this.model.serviceacitivity[0].f_meetunit = ''
1477
+ this.model.f_repairtype = ''
1478
+ this.meading = '转站点'
1479
+ },
1480
+ disableTimer() {
1481
+ if(this.timer) {
1482
+ window.clearTimeout(this.timer)
1483
+ this.timer = null
1484
+ }
1485
+ },
1486
+ loaded(paper) {
1487
+ if(!paper.hasOwnProperty('id')) {
1488
+ this.$showMessage("该安检单在手机上已经不存在,可能是卸载过程序。可以进入重新安检,或返回安检计划。")
1489
+ this.init()
1490
+ } else {
1491
+ Util.booleanFilter(paper)
1492
+ HostApp.__this__.$set('data', paper)
1493
+ HostApp.__this__.$goto('safecheck-userinfo', {}, 'paper-router')
1494
+ // 如果打回重检则重新计时
1495
+ if(HostApp.__this__.role == 'inspect'
1496
+ && HostApp.__this__.data.f_approved
1497
+ && HostApp.__this__.data.f_approved == '打回') {
1498
+ HostApp.__this__.data.f_onsite_time = Util.toStandardTimeString()
1499
+ HostApp.__this__.tick()
1500
+ }
1501
+ }
1502
+ HostApp.__callback__ = null
1503
+ HostApp.__this__ = null
1504
+ },
1505
+ S4() {
1506
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
1507
+ },
1508
+ extend(initalObj, finalObj) {
1509
+ var obj = finalObj || {};
1510
+ for (var i in initalObj) {
1511
+ var prop = initalObj[i];
1512
+
1513
+ // 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
1514
+ if (prop === obj) {
1515
+ continue;
1516
+ }
1517
+
1518
+ if (typeof prop === 'object') {
1519
+ if (obj[i]) {
1520
+ this.extend(obj[i], prop)
1521
+ } else {
1522
+ obj[i] = prop;
1523
+ }
1524
+ }
1525
+ }
1526
+ return obj;
1527
+ },
1528
+ putDevices() {
1529
+ this.$set('data.approve', "true")
1530
+ this.$set('data.writeback', "false")
1531
+ if (Vue.config.safecheck != undefined) {
1532
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
1533
+ if (Vue.config.safecheck.ApproveConfig.approve != undefined) {
1534
+ this.$set('data.approve', Vue.config.safecheck.ApproveConfig.approve)
1535
+ }
1536
+ if (Vue.config.safecheck.ApproveConfig.writeback != undefined) {
1537
+ this.$set('data.writeback', Vue.config.safecheck.ApproveConfig.writeback)
1538
+ }
1539
+ if (Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
1540
+ this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
1541
+ }
1542
+ if (Vue.config.safecheck.ApproveConfig.showtorepair) {
1543
+ this.show_torepair = Vue.config.safecheck.ApproveConfig.showtorepair
1544
+ }
1545
+ if (Vue.config.safecheck.ApproveConfig.notencountered != undefined){
1546
+ this.notencountered = Vue.config.safecheck.ApproveConfig.notencountered
1547
+ }
1548
+ if (Vue.config.safecheck.ApproveConfig.refuseinspection != undefined){
1549
+ this.refuseinspection = Vue.config.safecheck.ApproveConfig.refuseinspection
1550
+ }
1551
+ }
1552
+ if(this.item.f_user_type == '非民用'){
1553
+ // 非民用
1554
+ if (Vue.config.safecheck.DevicesSetConfig != undefined){
1555
+ if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1556
+ this.config = this.extend(this.config, Vue.config.safecheck.DevicesSetConfig)
1557
+ }else{
1558
+ this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type]])
1559
+ }
1560
+ }
1561
+
1562
+ }else{
1563
+ // 民用户
1564
+ if (Vue.config.safecheck.DevicesConfig != undefined){
1565
+ if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1566
+ this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
1567
+ }else{
1568
+ this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type?this.item.f_user_type:'民用']])
1569
+ }
1570
+ }
1571
+ }
1572
+
1573
+ }
1574
+ // 预留设备项位置
1575
+ for (let i in this.config) {
1576
+ this.tabs.splice(1,0,null)
1577
+ }
1578
+ //遍历安检项配置
1579
+ for (let i in this.config) {
1580
+ //取得安检项索引值
1581
+ let n = this.config[i].index
1582
+ this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
1583
+ this.$set('data.' + 'device' + n, [])
1584
+ this.tabs[n] = {
1585
+ header: i,
1586
+ complete: 'safecheck-devices',
1587
+ class: 'repair-details-class',
1588
+ number: n
1589
+ }
1590
+
1591
+ if(this.config[i].quantity && this.config[i].quantity >0){
1592
+ let items = []
1593
+ for (let it in this.config[i].items) {
1594
+ //赋值下拉选项
1595
+ if (this.config[i].items[it].type == 'selector') {
1596
+ for (let op in this.config[i].items[it].options) {
1597
+ if (this.config[i].items[it].options[op].isdefault == true) {
1598
+ items.push({
1599
+ f_defect_level: this.config[i].items[it].options[op].level,
1600
+ f_is_defect: this.config[i].items[it].options[op].isdefect,
1601
+ f_item_name: it,
1602
+ f_item_value: this.config[i].items[it].options[op].data,
1603
+ f_path: "",
1604
+ type: "selector"
1605
+ })
1606
+ }
1607
+ }
1608
+ }
1609
+ }
1610
+ for(let q =0;q<this.config[i].quantity;q++) {
1611
+ this.data['device' + n].push(
1612
+ {f_device_type: i, f_items:items}
1613
+ )
1614
+ }
1615
+ }
1616
+ n = n + 1
1617
+ }
1618
+ this.faultshow.number = this.tabs.length
1619
+ },
1620
+ init () {
1621
+ // 无计划安检是否回更待办计划
1622
+ this.data.isupdateplanitem = this.$appdata.getSingleValue('在线安检回更有计划') ? this.$appdata.getSingleValue('在线安检回更有计划') : 'false'
1623
+ // 预约安检单工单编号
1624
+ this.data.f_SafeToRepair_id = this.item.f_service_id
1625
+ this.data.ename = Vue.user.ename
1626
+ this.data.f_outlets = Vue.user.f_parentname
1627
+ this.data.f_meetunit = Vue.user.orgpathnames
1628
+ this.data.orgpathstr = Vue.user.orgpathstr
1629
+ this.data.f_check_item_id = this.item.id
1630
+ this.data.f_check_plan_id = this.f_plan_id
1631
+ this.data.f_checker_id = Vue.user.id
1632
+ this.data.f_checker_name = Vue.user.name
1633
+ this.data.f_check_type = this.item.f_user_type
1634
+ this.data.f_safecheck_type = this.item.f_safecheck_type
1635
+ this.data.f_subcompany = this.item.f_subcompany
1636
+ this.data.f_approved = this.item.f_approvedf_read_instructions
1637
+ this.data.f_repair_approved = this.item.f_repair_approved
1638
+ this.data.f_no_checkplan = this.item.f_no_checkplan
1639
+ this.data.f_approved = this.item.f_approved
1640
+ this.data.f_filialeid = this.item.f_filialeid || Vue.user.orgid
1641
+ this.data.f_orgstr = this.item.f_orgstr
1642
+ this.data.version = this.item.version
1643
+ this.data.f_check_version=this.item.f_check_version
1644
+ this.$set('data.f_meters', this.item.f_plan_meters)
1645
+ this.$set('data.f_userinfo_code', this.item.f_userinfo_code)
1646
+ // 安检状态
1647
+ this.$set('data.f_entry_status', '入户')
1648
+ this.$set('data.f_safe_type', '年度安检')
1649
+ this.$set('data.f_usegas', '已使用')
1650
+ this.$set('data.f_state',this.item.f_state)
1651
+ this.$set('data.f_source', this.source?this.source:'安检')
1652
+ this.$set('data.f_other_checker_name', '')
1653
+ this.$set('data.f_defect_notified', true)
1654
+ // 用户信息
1655
+ this.$set('data.f_user_name', this.item.f_user_name)
1656
+ this.$set('data.f_rent_phone', this.item.f_rent_phone)
1657
+ this.$set('data.f_user_phone', this.item.f_user_phone || this.item.f_plan_meters[0].f_user_phone)
1658
+ this.$set('data.f_userinfoid', this.item.f_userinfoid)
1659
+ this.$set('data.f_address', this.item.f_address)
1660
+ this.$set('data.f_card_id', this.item.f_card_id)
1661
+ this.$set('data.f_slice_area', this.item.f_slice_area)
1662
+ this.$set('data.f_recheck_id', this.item.id)
1663
+ this.$set('rowCodata.f_recheck_id', this.item.id)
1664
+ this.$set('data.f_street', this.item.f_street)
1665
+ this.$set('data.f_room', this.item.f_room)
1666
+ this.$set('data.f_building', this.item.f_building)
1667
+ this.$set('data.f_unit', this.item.f_unit)
1668
+ this.$set('data.f_floor', this.item.f_floor)
1669
+ this.$set('data.f_residential_area' , this.item.f_residential_area)
1670
+ this.$set('data.f_idnumber', this.item.f_idnumber)
1671
+ this.$set('data.f_comments', this.item.f_comments)
1672
+ this.$set('data.f_userproperties', this.item.f_userproperties)
1673
+ this.$set('data.f_client_evaluation', '满意')
1674
+ this.$set('data.f_userfiles_id', this.item.f_plan_meters[0].f_userfiles_id)
1675
+ this.$set('data.f_valve_state', this.item.f_plan_meters[0].f_valve_state)
1676
+ this.$set('data.f_off_valve_reason', this.item.f_plan_meters[0].f_off_valve_reason)
1677
+ // 处置方式
1678
+ this.$set('data.f_gas_guidelines', true)
1679
+ this.$set('data.f_safety_warning', true)
1680
+ this.$set('data.f_gas_manual', true)
1681
+ this.$set('data.f_no_gas_device', false)
1682
+ this.$set('data.f_close_valve', false)
1683
+ this.$set('data.f_unload_battery', false)
1684
+ if (this.data.f_check_item_id == '' && this.item.f_no_checkplan == '无计划安检' ) {
1685
+ this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1686
+ }
1687
+ if(this.item.f_no_checkplan == '复检'){
1688
+ this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1689
+ }
1690
+ if(this.item.f_plan_meters) {
1691
+ for (let de in this.devices) {
1692
+ if(typeof this.devices[de]=='function'){
1693
+ continue
1694
+ }
1695
+ this.$set('data.device' + this.devices[de].n, [])
1696
+ for (let i = 0; i < this.item.f_plan_meters.length; i++) {
1697
+ if (this.item.f_plan_meters[i].f_meter_type) {
1698
+ this.data.f_meter_type=this.item.f_plan_meters[i].f_meter_type
1699
+ //tag)
1700
+ if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('机表') >= 0) {
1701
+ this.data['device' + this.devices[de].n].push({
1702
+ f_device_type: "燃气表",
1703
+ f_items: [
1704
+ {
1705
+ f_defect_level: null,
1706
+ f_device_id: "",
1707
+ f_is_defect: "",
1708
+ f_item_name: "基表编号",
1709
+ f_item_value: this.item.f_plan_meters[i].f_meter_no,
1710
+ f_path: "",
1711
+ type: "number"
1712
+ },
1713
+ {
1714
+ f_defect_level: null,
1715
+ f_device_id: "",
1716
+ f_is_defect: "",
1717
+ f_item_name: "气表型号",
1718
+ f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1719
+ f_path: "",
1720
+ type: "string"
1721
+ },
1722
+ {
1723
+ f_defect_level: null,
1724
+ f_device_id: "",
1725
+ f_is_defect: "",
1726
+ f_item_name: "气表品牌",
1727
+ f_item_value: this.item.f_plan_meters[i].f_aliasname,
1728
+ f_path: "",
1729
+ type: "string"
1730
+ },
1731
+ {
1732
+ f_defect_level: null,
1733
+ f_device_id: "",
1734
+ f_is_defect: "",
1735
+ f_item_name: "表向",
1736
+ f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1737
+ f_path: "",
1738
+ type: "string"
1739
+ },
1740
+ {
1741
+ f_defect_level: null,
1742
+ f_device_id: "",
1743
+ f_is_defect: "",
1744
+ f_item_name: "上期表读数",
1745
+ f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1746
+ f_path: "",
1747
+ type: "number"
1748
+ },
1749
+ {
1750
+ f_defect_level: null,
1751
+ f_device_id: "",
1752
+ f_is_defect: "",
1753
+ f_item_name: "表封号",
1754
+ f_item_value: this.item.f_plan_meters[i].f_metertitles,
1755
+ f_path: "",
1756
+ type: "string"
1757
+ }
1758
+ ]
1759
+ })
1760
+ }
1761
+ else if (this.devices[de].device == "燃气表") {
1762
+ this.data['device' + this.devices[de].n].push({
1763
+ f_device_type: "燃气表",
1764
+ f_items: [
1765
+ {
1766
+ f_defect_level: null,
1767
+ f_device_id: "",
1768
+ f_is_defect: "",
1769
+ f_item_name: "基表编号",
1770
+ f_item_value: this.item.f_plan_meters[i].f_meter_no,
1771
+ f_path: "",
1772
+ type: "number"
1773
+ },
1774
+ {
1775
+ f_defect_level: null,
1776
+ f_device_id: "",
1777
+ f_is_defect: "",
1778
+ f_item_name: "气表型号",
1779
+ f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1780
+ f_path: "",
1781
+ type: "string"
1782
+ },
1783
+ {
1784
+ f_defect_level: null,
1785
+ f_device_id: "",
1786
+ f_is_defect: "",
1787
+ f_item_name: "气表品牌",
1788
+ f_item_value: this.item.f_plan_meters[i].f_aliasname,
1789
+ f_path: "",
1790
+ type: "string"
1791
+ },
1792
+ {
1793
+ f_defect_level: null,
1794
+ f_device_id: "",
1795
+ f_is_defect: "",
1796
+ f_item_name: "表向",
1797
+ f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1798
+ f_path: "",
1799
+ type: "string"
1800
+ },
1801
+ {
1802
+ f_defect_level: null,
1803
+ f_device_id: "",
1804
+ f_is_defect: "",
1805
+ f_item_name: "上期表读数",
1806
+ f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1807
+ f_path: "",
1808
+ type: "number"
1809
+ },
1810
+ {
1811
+ f_defect_level: null,
1812
+ f_device_id: "",
1813
+ f_is_defect: "",
1814
+ f_item_name: "表封号",
1815
+ f_item_value: this.item.f_plan_meters[i].f_metertitles,
1816
+ f_path: "",
1817
+ type: "string"
1818
+ }
1819
+ ]
1820
+ })
1821
+ }
1822
+ if(this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('物联网表') >= 0){
1823
+ this.data['device' + this.devices[de].n].forEach(device => {
1824
+ if (!this.data.f_collection_type) {
1825
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1826
+ delete this.config['燃气表']['items']['累购气量']
1827
+ delete this.config['燃气表']['items']['已用金额']
1828
+ delete this.config['燃气表']['items']['剩余气量']
1829
+ delete this.config['燃气表']['items']['气量异常差值']
1830
+ delete this.config['燃气表']['items']['金额异常差值']
1831
+ device.f_items.push(
1832
+ {
1833
+ f_defect_level: null,
1834
+ f_device_id: "",
1835
+ f_is_defect: "",
1836
+ f_item_name: "初始表底",
1837
+ isshow: true,
1838
+ f_item_value: this.item.f_plan_meters[i].f_initial_base,
1839
+ f_path: "",
1840
+ type: "number"
1841
+ },
1842
+ {
1843
+ f_defect_level: null,
1844
+ f_device_id: "",
1845
+ f_is_defect: "",
1846
+ f_item_name: "累购金额",
1847
+ f_item_value: this.item.f_plan_meters[i].f_total_fee,
1848
+ f_path: "",
1849
+ type: "number"
1850
+ },
1851
+ {
1852
+ f_defect_level: null,
1853
+ f_device_id: "",
1854
+ f_is_defect: "",
1855
+ f_item_name: "已用气量",
1856
+ f_item_value: this.item.f_plan_meters[i].f_meter_base,
1857
+ f_path: "",
1858
+ type: "number"
1859
+ },
1860
+ {
1861
+ f_defect_level: null,
1862
+ f_device_id: "",
1863
+ f_is_defect: "",
1864
+ f_item_name: "剩余金额",
1865
+ f_item_value: '',
1866
+ f_path: "",
1867
+ type: "number"
1868
+ },
1869
+ {
1870
+ f_defect_level: null,
1871
+ f_device_id: "",
1872
+ f_is_defect: "",
1873
+ f_item_name: "系统余额",
1874
+ f_item_value: this.item.f_plan_meters[i].f_balance_amount,
1875
+ f_path: "",
1876
+ type: "number"
1877
+ }
1878
+ )
1879
+ }
1880
+ })
1881
+ } else if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_collection_type) {
1882
+ this.data['device' + this.devices[de].n].forEach(device => {
1883
+ /*
1884
+ "累购气量":{"index":8,"type":"number","readonly":true},
1885
+ "累购金额":{"index":8,"type":"number","readonly":true},
1886
+ "字轮读数":{"index":9,"type":"number","checkmust": true},
1887
+ "已用金额":{"index":9,"type":"number","checkmust": true},
1888
+ "剩余气量":{"index":10,"type":"number","checkmust": true},
1889
+ "剩余金额":{"index":10,"type":"number","checkmust": true},
1890
+ "气量异常差值":{"index":11,"type":"number","readonly": true},
1891
+ "金额异常差值":{"index":11,"type":"number","readonly": true}
1892
+ */
1893
+ if (this.item.f_plan_meters[i].f_collection_type == '按金额') {
1894
+ if (!this.data.f_collection_type) {
1895
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1896
+ delete this.config['燃气表']['items']['累购气量']
1897
+ delete this.config['燃气表']['items']['已用气量']
1898
+ delete this.config['燃气表']['items']['剩余气量']
1899
+ delete this.config['燃气表']['items']['气量异常差值']
1900
+ delete this.config['燃气表']['items']['系统余额']
1901
+ device.f_items.push(
1902
+ {
1903
+ f_defect_level: null,
1904
+ f_device_id: "",
1905
+ f_is_defect: "",
1906
+ f_item_name: "初始表底",
1907
+ isshow: false,
1908
+ f_item_value: '',
1909
+ f_path: "",
1910
+ type: "number"
1911
+ },
1912
+ {
1913
+ f_defect_level: null,
1914
+ f_device_id: "",
1915
+ f_is_defect: "",
1916
+ f_item_name: "累购金额",
1917
+ f_item_value: this.item.f_plan_meters[i].f_total_fee,
1918
+ f_path: "",
1919
+ type: "number"
1920
+ },
1921
+ {
1922
+ f_defect_level: null,
1923
+ f_device_id: "",
1924
+ f_is_defect: "",
1925
+ f_item_name: "已用金额",
1926
+ f_item_value: null,
1927
+ f_path: "",
1928
+ type: "number"
1929
+ },
1930
+ {
1931
+ f_defect_level: null,
1932
+ f_device_id: "",
1933
+ f_is_defect: "",
1934
+ f_item_name: "剩余金额",
1935
+ f_item_value: null,
1936
+ f_path: "",
1937
+ type: "number"
1938
+ },
1939
+ {
1940
+ f_defect_level: null,
1941
+ f_device_id: "",
1942
+ f_is_defect: "",
1943
+ f_item_name: "金额异常差值",
1944
+ f_item_value: null,
1945
+ f_path: "",
1946
+ type: "number"
1947
+ }
1948
+ )
1949
+ }
1950
+ } else
1951
+ if (this.item.f_plan_meters[i].f_collection_type == '按气量') {
1952
+ if (!this.data.f_collection_type) {
1953
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1954
+ delete this.config['燃气表']['items']['累购金额']
1955
+ delete this.config['燃气表']['items']['已用金额']
1956
+ delete this.config['燃气表']['items']['剩余金额']
1957
+ delete this.config['燃气表']['items']['金额异常差值']
1958
+ delete this.config['燃气表']['items']['系统余额']
1959
+ device.f_items.push(
1960
+ {
1961
+ f_defect_level: null,
1962
+ f_device_id: "",
1963
+ f_is_defect: "",
1964
+ f_item_name: "初始表底",
1965
+ isshow: true,
1966
+ f_item_value: this.item.f_plan_meters[i].f_initial_base,
1967
+ f_path: "",
1968
+ type: "number"
1969
+ },
1970
+ {
1971
+ f_defect_level: null,
1972
+ f_device_id: "",
1973
+ f_is_defect: "",
1974
+ f_item_name: "累购气量",
1975
+ f_item_value: this.item.f_plan_meters[i].f_total_gas,
1976
+ f_path: "",
1977
+ type: "number"
1978
+ },
1979
+ {
1980
+ f_defect_level: null,
1981
+ f_device_id: "",
1982
+ f_is_defect: "",
1983
+ f_item_name: "已用气量",
1984
+ f_item_value: this.item.f_plan_meters[i].f_meter_base,
1985
+ f_path: "",
1986
+ type: "number"
1987
+ },
1988
+ {
1989
+ f_defect_level: null,
1990
+ f_device_id: "",
1991
+ f_is_defect: "",
1992
+ f_item_name: "剩余气量",
1993
+ f_item_value: "",
1994
+ f_path: "",
1995
+ type: "number"
1996
+ },
1997
+ {
1998
+ f_defect_level: null,
1999
+ f_device_id: "",
2000
+ f_is_defect: "",
2001
+ f_item_name: "气量异常差值",
2002
+ f_item_value: null,
2003
+ f_path: "",
2004
+ type: "number"
2005
+ }
2006
+ )
2007
+ }
2008
+ }
2009
+ })
2010
+ } else if(this.devices[de].device == "燃气表"){
2011
+ this.data['device' + this.devices[de].n].forEach(device => {
2012
+ if (!this.data.f_collection_type) {
2013
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
2014
+ delete this.config['燃气表']['items']['累购金额']
2015
+ delete this.config['燃气表']['items']['已用金额']
2016
+ delete this.config['燃气表']['items']['剩余金额']
2017
+ delete this.config['燃气表']['items']['金额异常差值']
2018
+ delete this.config['燃气表']['items']['系统余额']
2019
+ device.f_items.push(
2020
+ {
2021
+ f_defect_level: null,
2022
+ f_device_id: "",
2023
+ f_is_defect: "",
2024
+ f_item_name: "初始表底",
2025
+ isshow: true,
2026
+ f_item_value: this.item.f_plan_meters[i].f_initial_base,
2027
+ f_path: "",
2028
+ type: "number"
2029
+ },
2030
+ {
2031
+ f_defect_level: null,
2032
+ f_device_id: "",
2033
+ f_is_defect: "",
2034
+ f_item_name: "累购气量",
2035
+ f_item_value: this.item.f_plan_meters[i].f_total_gas,
2036
+ f_path: "",
2037
+ type: "number"
2038
+ },
2039
+ {
2040
+ f_defect_level: null,
2041
+ f_device_id: "",
2042
+ f_is_defect: "",
2043
+ f_item_name: "已用气量",
2044
+ f_item_value: this.item.f_plan_meters[i].f_meter_base,
2045
+ f_path: "",
2046
+ type: "number"
2047
+ },
2048
+ {
2049
+ f_defect_level: null,
2050
+ f_device_id: "",
2051
+ f_is_defect: "",
2052
+ f_item_name: "剩余气量",
2053
+ f_item_value: '',
2054
+ f_path: "",
2055
+ type: "number"
2056
+ },
2057
+ {
2058
+ f_defect_level: null,
2059
+ f_device_id: "",
2060
+ f_is_defect: "",
2061
+ f_item_name: "气量异常差值",
2062
+ isshow:false,
2063
+ f_item_value: null,
2064
+ f_path: "",
2065
+ type: "number"
2066
+ }
2067
+ )
2068
+ }
2069
+ })
2070
+ }
2071
+ }
2072
+ }
2073
+ }
2074
+ }
2075
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2076
+ }
2077
+ },
2078
+ watch: {
2079
+ 'row' () {
2080
+ //tag
2081
+ this.copy()
2082
+ }
2083
+ },
2084
+ async ready () {
2085
+ try {
2086
+ if (this.item.f_userinfoid){
2087
+ let http = new HttpResetClass()
2088
+ let response = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
2089
+ data: {
2090
+ items: 'count(0) as num',
2091
+ tablename: 't_userfiles a left join t_userinfo b on a.f_userinfo_id = b.f_userinfo_id',
2092
+ condition: `a.f_userinfo_id = '${this.item.f_userinfoid}' and a.f_meter_classify != '物联网表' and a.f_table_state = '正常' and b.f_user_state='正常'`,
2093
+ orderitem: '1'
2094
+ }
2095
+ }, {resolveMsg: null, rejectMsg: null})
2096
+ if (response && response.data && response.data.length > 0 && response.data[0].num > 0 ){
2097
+ this.tabs.push({
2098
+ header: '抄表', complete: 'meter-reading', class: 'meter-reading-class', props: null
2099
+ })
2100
+ }else {
2101
+ console.log('无网络')
2102
+ }
2103
+ }
2104
+ }catch (e){
2105
+ console.log(e)
2106
+ console.log('无网络')
2107
+ }
2108
+ //送气超期功能
2109
+ //await this.isoverDate()
2110
+ this.putDevices()
2111
+ //如果已检,则提取安检单
2112
+ if (this.item.f_state != '未检') {
2113
+ if (this.role == 'inspect' || this.role == 'androidview') {
2114
+ HostApp.__callback__ = this.loaded
2115
+ HostApp.__this__ = this
2116
+ let that = this
2117
+ let value = {}
2118
+ if (this.role == 'inspect') {
2119
+ let condition=` f_check_item_id ='${this.item.id}'`
2120
+ if (this.item.f_no_checkplan == '无计划安检') {
2121
+ condition += ` and f_no_checkplan = '无计划安检'`
2122
+ }
2123
+ value = this.$androidUtil.bzLogic('path_getPhoneCheckPaper', {condition: condition})
2124
+ } else {
2125
+ value = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data: {condition: `id = '${this.item.f_paper_id}'`}})
2126
+ }
2127
+ Util.replaceFalse(value)
2128
+ if (value.data.length != 0) {
2129
+ that.$set('data', value.data[0])
2130
+ if (this.data.f_collection_type == '按气量') {
2131
+ delete this.config['燃气表']['items']['累购金额']
2132
+ delete this.config['燃气表']['items']['已用金额']
2133
+ delete this.config['燃气表']['items']['剩余金额']
2134
+ delete this.config['燃气表']['items']['金额异常差值']
2135
+ delete this.config['燃气表']['items']['系统余额']
2136
+ } else if (this.data.f_collection_type == '按金额') {
2137
+ delete this.config['燃气表']['items']['累购气量']
2138
+ delete this.config['燃气表']['items']['已用气量']
2139
+ delete this.config['燃气表']['items']['剩余气量']
2140
+ delete this.config['燃气表']['items']['气量异常差值']
2141
+ delete this.config['燃气表']['items']['系统余额']
2142
+ }
2143
+ //tag)
2144
+ if (value.data[0].f_devices) {
2145
+ for (let da in that.devices) {
2146
+ if(typeof that.devices[da]=='function'){
2147
+ continue
2148
+ }
2149
+ that.$set('data.device' + that.devices[da].n, [])
2150
+ }
2151
+ value.data[0].f_devices.forEach((item) => {
2152
+ for (let i in item.f_items) {
2153
+ if(typeof item.f_items[i]=='function'){
2154
+ continue
2155
+ }
2156
+ for (let de in that.config[item.f_device_type].items) {
2157
+ if(typeof that.config[item.f_device_type].items[de]=='function'){
2158
+ continue
2159
+ }
2160
+ if (item.f_items[i].f_item_name == de) {
2161
+ if (that.config[item.f_device_type].items[de].type == 'selector' || that.config[item.f_device_type].items[de].type == 'checkbox') {
2162
+ item.f_items[i].f_item_value = []
2163
+ } else {
2164
+ item.f_items[i].f_item_value = ''
2165
+ }
2166
+ }
2167
+ }
2168
+ for (let j in item.f_items[i].f_item_lists) {
2169
+ if(typeof item.f_items[i].f_item_lists[j]=='function'){
2170
+ continue
2171
+ }
2172
+ if (item.f_items[i].f_item_value instanceof Array) {
2173
+ item.f_items[i].f_item_value.push(item.f_items[i].f_item_lists[j].f_item_value)
2174
+ } else {
2175
+ item.f_items[i].f_item_value = item.f_items[i].f_item_lists[j].f_item_value
2176
+ }
2177
+ }
2178
+
2179
+ }
2180
+ for (let de in that.devices) {
2181
+ if(typeof that.devices[de]=='function'){
2182
+ continue
2183
+ }
2184
+ if (that.devices[de].device == item.f_device_type) {
2185
+ that.data['device' + that.devices[de].n].push({
2186
+ f_device_type: item.f_device_type,
2187
+ f_items: item.f_items
2188
+ })
2189
+ //tag)
2190
+ }
2191
+ }
2192
+ })
2193
+ if (this.role == 'androidview') {
2194
+ Util.androidRatifyPics(that.data, this.$androidUtil.getProxyUrl())
2195
+ Util.androidRatifyPics(that.picture, this.$androidUtil.getProxyUrl())
2196
+ Util.booleanFilter(that.data)
2197
+ }
2198
+ //tag)
2199
+ }
2200
+ } else {
2201
+ this.init()
2202
+ }
2203
+ if(this.parentPage && this.parentPage=='CurrentCreate'){
2204
+ let isRecodr = this.$appdata.getSingleValue('无限制录音'); //单值参数,为true则是开启全程录音
2205
+ if (isRecodr) {
2206
+ if (isRecodr=='true') {
2207
+ this.$showMessage("为了保证服务质量,您的电话将会被全程录音!")
2208
+ // 初始化录音
2209
+ let resse = this.record()
2210
+ }
2211
+ }
2212
+ }
2213
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2214
+ } else {
2215
+ let that = this
2216
+ let id
2217
+ if (this.role == 'view') {
2218
+ id = this.item.id
2219
+ }
2220
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data:{condition:`id = '${id}'`}}).then((respanse)=> {
2221
+ if (respanse.data.length != 0) {
2222
+ that.data = Object.assign(that.data,respanse.data[0])
2223
+ if(respanse.data[0].f_devices) {
2224
+ for (let da in that.devices) {
2225
+ that.$set('data.device' + that.devices[da].n, [])
2226
+ }
2227
+ respanse.data[0].f_devices.forEach((item) => {
2228
+ for (let de in that.devices) {
2229
+ if (that.devices[de].device == item.f_device_type) {
2230
+ that.data['device' + that.devices[de].n].push({
2231
+ f_device_type: item.f_device_type,
2232
+ f_items: item.f_items
2233
+ })
2234
+ }
2235
+ }
2236
+ })
2237
+ }
2238
+ Util.replaceFalse(that.data)
2239
+ Util.booleanFilter(that.data)
2240
+ if(this.role == 'view'){
2241
+ Util.ratifyPics(that.data)
2242
+ }else{
2243
+ Util.androidRatifyPics(that.data,this.$androidUtil.getProxyUrl())
2244
+ }
2245
+ } else {
2246
+ alert("该安检单可能已不在本地!")
2247
+ this.init()
2248
+ }
2249
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'paper-router')
2250
+ }
2251
+ ).catch(
2252
+ (respanse) => {
2253
+ alert('查找安检单失败')
2254
+ })
2255
+ }
2256
+ }else{
2257
+ if(this.parentPage && (this.parentPage == 'CurrentCreate' || this.parentPage == 'AddPlanItem') ){
2258
+ //tag
2259
+ let isRecodr = this.$appdata.getSingleValue('无限制录音'); //单值参数,为true则是开启全程录音
2260
+ if (isRecodr) {
2261
+ if (isRecodr=='true') {
2262
+ // this.$showMessage("为了保证服务质量,您的电话将会被全程录音!")
2263
+ // 初始化录音
2264
+ let resse = this.record()
2265
+ }
2266
+ }
2267
+ }
2268
+ this.init()
2269
+ }
2270
+ },
2271
+ events: {
2272
+ 'tijiao': function () {
2273
+ // 事件回调内的 `this` 自动绑定到注册它的实例上
2274
+ this.confirm()
2275
+ }
2276
+ }
2277
+ }
2278
+ </script>
2279
+ <style lang="less">
2280
+ @import "../../../../src/bootstrap/less/variables.less";
2281
+ .noclickbut {
2282
+ pointer-events: none;
2283
+ }
2284
+ .tab-befor-img (@url) {
2285
+ content: '';
2286
+ background-image: url("@{url}");
2287
+ background-size: 20px;
2288
+ display: inline-block;
2289
+ margin-right: 8px;
2290
+ margin-top: 0.3em;
2291
+ height: 1.3em;
2292
+ width: 1.3em;
2293
+ vertical-align: -35%;
2294
+ }
2295
+
2296
+ @media screen and (min-width: 768px) {
2297
+ .android-repair-order > div > ul a {
2298
+ font-size: @font-size-h2;
2299
+ margin: 0.3em 0;
2300
+ }
2301
+ }
2302
+ .repair-details-class{
2303
+ &::before {
2304
+ .tab-befor-img("../../../assets/huneiweixiu1.png");
2305
+ }
2306
+ }
2307
+ .repair-info-class {
2308
+ &::before {
2309
+ .tab-befor-img("../../../assets/baoxiuxinxi1.png");
2310
+ }
2311
+ }
2312
+ .repair-user-info-class {
2313
+ &::before {
2314
+ .tab-befor-img("../../../assets/jibenxinxi1.png")
2315
+ }
2316
+ }
2317
+
2318
+ .door-service-class {
2319
+ &::before {
2320
+ .tab-befor-img("../../../assets/huneiweixiu1.png")
2321
+ }
2322
+ }
2323
+
2324
+ .pipeline-class {
2325
+ &::before {
2326
+ .tab-befor-img("../../../assets/guandao1.png")
2327
+ }
2328
+ }
2329
+
2330
+ .device-service-class {
2331
+ &::before {
2332
+ .tab-befor-img("../../../assets/shebeiweixiu1.png")
2333
+ }
2334
+ }
2335
+
2336
+ .trouble-removal-class {
2337
+ &::before {
2338
+ .tab-befor-img("../../../assets/shiguchuli.png")
2339
+ }
2340
+ }
2341
+
2342
+ .cooking-utensils-class {
2343
+ &::before {
2344
+ .tab-befor-img("../../../assets/zaoju1.png")
2345
+ }
2346
+ }
2347
+
2348
+ .outlay-class {
2349
+ &::before {
2350
+ .tab-befor-img("../../../assets/feiyong1.png")
2351
+ }
2352
+ }
2353
+ .meter-reading-class {
2354
+ &::before {
2355
+ .tab-befor-img("../../../assets/guzhanghuizong1.png")
2356
+ }
2357
+ }
2358
+ .fault-all-class {
2359
+ &::before {
2360
+ .tab-befor-img("../../../assets/guzhanghuizong1.png")
2361
+ }
2362
+ }
2363
+ .photo-write-class {
2364
+ &::before {
2365
+ .tab-befor-img("../../../assets/zaoju.png")
2366
+ }
2367
+ }
2368
+ .delay-apply-class {
2369
+ &::before {
2370
+ .tab-befor-img("../../../assets/yonghubaoxiu.png")
2371
+ }
2372
+ }
2373
+
2374
+ .repair-back-class {
2375
+ &::before {
2376
+ .tab-befor-img("../../../assets/fanhui.png")
2377
+ }
2378
+ }
2379
+ .butt2 {
2380
+ display: inline;
2381
+ float: right;
2382
+ width: 10px;
2383
+ text-align: center;
2384
+ align-items:center;
2385
+ position: absolute;
2386
+ top:50%;
2387
+
2388
+ left:90%;
2389
+ transform: translate(-50%,-50%);
2390
+ }
2391
+ .linesty{
2392
+ display: inline-block;
2393
+ height:1px;
2394
+ width:100%;
2395
+ background:#d0d0d0;
2396
+ overflow:hidden;
2397
+ vertical-align: middle;
2398
+ }
2399
+ .spanboder{
2400
+ border-bottom:2px solid #499edf;
2401
+ padding-bottom: 8px
2402
+ }
2403
+ .app-botton {
2404
+ position:fixed;
2405
+ background: #87b2dd;
2406
+ right:8px;
2407
+ color: #FFF;
2408
+ padding: 8px;
2409
+ text-align: center;
2410
+ font-size: 1.2em;
2411
+ z-index: 10;
2412
+ opacity:0.5;
2413
+ bottom: 50px;
2414
+ margin-top: -10px;
2415
+ height: 40px;
2416
+ }
2417
+ .android-repair-order > div > ul a {
2418
+ font-size: 12px;
2419
+ color: #333333;
2420
+ padding: 13px 16px;
2421
+ }
2422
+ </style>