safecheck-client 3.0.30-3 → 3.0.30-34

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