safecheck-client 3.0.39-44 → 3.0.39-46

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