safecheck-client 3.0.34-34 → 3.0.34-35

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