safecheck-client 3.0.33-66 → 3.0.33-68

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