safecheck-client 3.0.39-81 → 3.0.39-82

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,1255 +1,1256 @@
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">
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">
34
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="uploadCheckPaper">
35
- 上传
36
- </button>
37
- </div>
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- </ul>
45
- </div>
46
- </div>
47
- </template>
48
-
49
- <script>
50
- import Vue from 'vue'
51
- import * as Util from '../../Util'
52
- import { HttpResetClass } from 'vue-client'
53
- import co from 'co'
54
- import $ from "jquery";
55
- let loadParamGem = async function (self) {
56
- await self.$LoadParams.loadParam()
57
- }
58
-
59
- export default {
60
- title: '安检单',
61
- props: ['f_plan_id', 'item', 'role','parentPage','source'],
62
- // props: ['f_plan_id', 'role'],
63
- data() {
64
- return {
65
- data: {
66
- f_noanswer_path:'',
67
- f_nongasuser_path:'',
68
- f_devices: [],
69
- f_defect_content:'',
70
- f_recording1_path:'',
71
- f_visit_number:'',
72
- f_remark:''
73
- },
74
- imgsnum:this.$appdata.getSingleValue('安检总体照片数量') ? this.$appdata.getSingleValue('安检总体照片数量'):1, // 安检整体照片默认必须拍1张
75
- updateuserphone:false, //安检时是否更新用户电话
76
- updatemetermodel:false, //安检时是否更新表型号
77
- updatemeternumber:false, //安检时是否更新表号
78
- beforephone:'',
79
- isUpload:false,
80
- show_torepair: false,
81
- onlySave:true, //判断保存还是保存并上传
82
- livedispose:'',
83
- refuseinspection:'', // 拒捡拍照是否提示
84
- notencountered:'', // 到访不遇拍照是否提示
85
- startClick:false, //开始安检按钮是否可点击
86
- isStrat: false, //是否开始安检
87
- checkResult:{},//查询结果
88
- newcheckResult:{},
89
- repairDefect : {
90
- result: '正常',
91
- data: []
92
- },
93
- rowCodata:{},
94
- repairers: [],
95
- timer: null,
96
- showModal: false,
97
- showModal2:false,
98
- pic_to_be_viewed: '',
99
- showBack:true,
100
- devices: [],
101
- f_devices : [],
102
- isToRepair:false,
103
- clickBack:true, //是否点击返回按钮
104
- isSafeCheckToRepair:false,//是否转维修
105
- Url:this.$androidUtil.getProxyUrl(),
106
- detail:{},
107
- defectDevice:{},
108
- user:{},
109
- is_has_jingweidu: this.$appdata.getSingleValue('照片水印加经纬度') || 'false',
110
- dispatchTypeOptions: [{label: '派发给维修员', value: '派发给维修员'},{label: '派发给站点', value: '派发给站点'}],
111
- selectData:{
112
- dispatchType:'派发给维修员',
113
- f_repairman:'',
114
- f_remarks:'',
115
- f_repairtype:'整改'
116
- },
117
- model: { //转维修数据
118
- // 一次派单
119
- serviceacitivity: [{
120
- f_service_acitivity_type: '派单'
121
- }],
122
- f_source:'安检',
123
- f_service_id: '',
124
- f_contact_phone: '',
125
- f_meetunit: '',
126
- f_phone: '',
127
- f_user_name: '',
128
- f_address: '',
129
- f_repair_date: Util.toStandardTimeString(),
130
- f_card_id: '',
131
- // f_department: '', 站点选择
132
- f_reciever:'',
133
- f_remarks: '',
134
- f_user_type: '',
135
- f_area: '',
136
- f_unit_name:'',
137
- f_street: '',
138
- f_residential_area: '',
139
- f_building: '',
140
- f_unit: '',
141
- f_floor: '',
142
- f_room: '',
143
- aState: null,
144
- f_repairtype: '',
145
- f_repairitems:{},
146
- },
147
- repairitems:[],
148
- selecData:[],
149
- meading:'转站点',
150
- config: {
151
- "信息填写":{
152
- "checkmust":true,
153
- "index":1,
154
- "items":{
155
- "地址信息":{"index":1,"type":"string","readonly":false,"checkmust": true},
156
- "入户状态":{"index":2,"multiple":false,"type":"selector","options":[{"data":"入户","isdefault":true},{"data":"到访不遇"},{"data":"拒检"}],"checkmust":true},
157
- "到访不遇/拒检照片":{"index":3,"type":"picture","readonly":false,"checkmust": false,"isshow":false},
158
- "气表品牌":{"index":4,"type":"string","readonly":false,"checkmust": true},
159
- "表号":{"index":5,"type":"string","readonly":false,"checkmust": true},
160
- "用户姓名":{"index":6,"type":"string","readonly":false,"checkmust": false},
161
- "用户电话":{"index":7,"type":"string","readonly":false,"checkmust": false},
162
- "表具照片":{"index":8,"type":"picture","readonly":false,"checkmust": true},
163
- "安装日期":{"index":9,"type":"date","readonly":false,"checkmust": true},
164
- "左右表":{"index":10,"multiple":false,"type":"selector","options":[{"data":"左表"},{"data":"右表"}],"checkmust":true},
165
- "检验时间":{"index":11,"type":"date","readonly":false,"checkmust": true}
166
- }
167
- },
168
- "其他隐患":{
169
- "checkmust":true,
170
- "index":2,
171
- "items":{
172
- "有无其他隐患":{"index":1,"multiple":false,"type":"radio","options":[{"data":"无隐患","isdefault":true},{"data":"有其他隐患","isdefault":false,"isdefect":true}],"checkmust":true}
173
- }
174
- },
175
- "点火":{
176
- "checkmust":true,
177
- "index":3,
178
- "items":{
179
- "检查类型":{"index":1,"multiple":false,"type":"selector","options":[{"data":"普通检查","isdefault":true},{"data":"点火检查"}],"checkmust":true},
180
- "证件号码":{"index":2,"type":"string","checkmust":false,"isshow":false},
181
- "用户用气类型":{"index":3,"multiple":false,"type":"selector","options":this.selecData,"checkmust":false,"isshow":false},
182
- }
183
- }
184
- },
185
- isneedDate:'',
186
- routeShow:true,
187
- number:0,
188
- shupingshow:false,
189
- pipeline: {},
190
- details: [],
191
- ids: '',
192
- savevalid: {
193
- uservalid: false,
194
- doorvalid: true,
195
- changetable: false
196
- },
197
- doordetails: {},
198
- devicedetails: {},
199
- cookdetails: {},
200
- componentName: 'safecheck-devices-temp',
201
- header:'客户信息',
202
- tabs: [],
203
- faultshow:{
204
- number : 8
205
- } // 控制 故障汇总 在 菜单里显示与否,
206
- }
207
- },
208
- computed: {
209
- actionEnabled: {
210
- get() {
211
- return this.role == 'inspect'
212
- }
213
- }
214
- },
215
- methods: {
216
- showmod(){
217
- // this.saveNoclick()
218
- let errString = this.errorVerify()
219
- if (errString) {
220
- console.log(errString)
221
- console.log('Vue.android',Vue.android)
222
- console.log('this.isUpload',this.isUpload)
223
- if (Vue.android){
224
- this.$showMessage(errString)
225
- }
226
- return
227
- }
228
- //清空转维修列表重新进行数据组织
229
- this.repairDefect = {
230
- result: '正常',
231
- data: []
232
- }
233
- this.data.f_complete = '已完成'
234
- this.$set('data.f_offsite_time', Util.toStandardTimeString())
235
- this.assemblyCodata()
236
- if(this.repairDefect.result=='正常'){
237
- this.$showMessage("未发现有选择需要转维修的隐患,请检查填写的数据。如需转维修请在处理方式中选择 '转维修' !")
238
- return
239
- }
240
- console.log("准备保存!")
241
- this.disableTimer()
242
- this.getEmp()
243
- this.showModal2=true
244
- },
245
- cancel1(){
246
- this.showModal2=false
247
- this.selectData={
248
- dispatchType:'派发给维修员',
249
- f_repairman:'',
250
- f_remarks:'',
251
- f_repairtype:'整改'
252
- }
253
- },
254
- getSiteRes(obj) {
255
- console.log('siteRes ---> ')
256
- console.log(obj)
257
- if(obj.resids[0]){
258
- this.selectData.f_meetunit = obj.res.join('.')
259
- this.selectData.f_reciever = obj.resids.join('.')
260
- this.selectData.f_outlets = obj.res[obj.res.length - 1]
261
- }else {
262
- this.selectData.f_meetunit = ''
263
- this.selectData.f_reciever = ''
264
- this.selectData.f_outlets = ''
265
- }
266
- },
267
- rectification(){
268
- if(this.selectData.dispatchType){
269
- if(this.selectData.dispatchType=='派发给站点'){
270
- if(!this.selectData.f_reciever){
271
- this.$showMessage('请选择部门!')
272
- return
273
- }
274
- }else{
275
- if(!this.selectData.f_repairman){
276
- this.$showMessage('请选择维修员!')
277
- return
278
- }
279
- }
280
- }else {
281
- this.$showMessage('请选择派发类型!')
282
- return
283
- }
284
- /*if(!this.selectData.f_repairtype){
285
- this.$showMessage('请选择报修类型!')
286
- return
287
- }*/
288
- //关闭录音
289
- this.closely(false) // 保存本地,不删除录音文件暂停录音
290
- let act={}
291
- let toRepair=''
292
- if(this.selectData.dispatchType=='派发给站点'){
293
- act={f_meetunit:this.selectData.f_meetunit,f_reciever:this.selectData.f_reciever,f_service_acitivity_type:'派单'}
294
- toRepair=null
295
- }else{
296
- console.log('派发给维修员---------'+this.selectData.f_repairman)
297
- act={f_meetunit:'',f_reciever:this.selectData.f_repairman,f_service_acitivity_type:'派单'}
298
- toRepair='一级派单'
299
- }
300
- let repData={
301
- toRepair:toRepair,
302
- activity:act,
303
- deps:Vue.user.deps,
304
- depids:Vue.user.depids,
305
- f_remarks:this.selectData.f_remarks,
306
- f_repairtype:this.selectData.f_repairtype,
307
- f_attendant: Vue.user.name,
308
- loginUser:{name:Vue.user.name,ename:Vue.user.id,id:Vue.user.id},
309
- }
310
- this.rowCodata.istoRepair='转维修'
311
- this.rowCodata.repData=repData
312
- console.log("当前组装好的转维修数据--"+JSON.stringify(repData))
313
- this.onlySave = false
314
- this.save()
315
- },
316
- // 获取维修员
317
- getEmp() {
318
- this.repairers=[]
319
- let per = {source: 'this.getRights().where(row.getType()==$user$).where(row.getAttributes().get($rolestr$).indexOf($维修员$) != -1))', userid: `${Vue.user.id}`}
320
- let http = new HttpResetClass()
321
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/search`, {data: per}, {resolveMsg: null, rejectMsg: null}).then((res) => {
322
- res.data.forEach((user)=>{
323
- this.repairers.push({label:user.name, value: user.name})
324
- })
325
- })
326
- },
327
- closely(isdelete){
328
- try {
329
- var startOrStopAudioClipStr;
330
- if (isdelete===true) {
331
- //tag
332
- startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止并删除录音') //停止并删除录音
333
- }else {
334
- //tag
335
- startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止录音') //停止录音
336
- }
337
- if (startOrStopAudioClipStr.code == 200) {
338
- //tag
339
- return true;
340
- }else {
341
- return false;
342
- }
343
- } catch (e) {
344
- console.error("关闭录音方法异常")
345
- console.error(e)
346
- return false;
347
- }
348
- },
349
- // 录音方法
350
- record() {
351
- //tag
352
- let fileName
353
- if (!this.data.f_recording1_path) {
354
- fileName = Util.guid() + '.amr'
355
- } else {
356
- fileName = Util.getFileName(this.data.f_recording1_path)
357
- }
358
- //HostApp.__this__ = this
359
- /*调用无限制录音模块*/
360
- let startOrStopState = HostApp.startOrStopAudioClip(fileName,"开始录音")
361
- //tag
362
- if (startOrStopState.code == 200) {
363
- this.data.f_recording1_path = "file:///storage/emulated/0/safecheck/" + fileName
364
- //tag
365
- return true;
366
- }else {
367
- return false;
368
- }
369
-
370
- },
371
- saveNoclick() {
372
- // 禁用点击事件
373
- $("#savebut").addClass("noclickbut");
374
- //tag
375
-
376
- // 5秒后启用点击事件
377
- setTimeout(function(){
378
- $("#savebut").removeClass("noclickbut");
379
- },5000);
380
- },
381
- timeSet(val){
382
- if (!val){
383
- return
384
- }
385
- let time =new Date(val).getTime()
386
- let time2=new Date().getTime()
387
- if (time2>time) {
388
- return true
389
- }
390
- },
391
- imgback(val,isheader){
392
- if(val && this.routeShow && isheader){
393
- return require('../../../assets/xiangxia1.png')
394
- }else{
395
- return require('../../../assets/xiangyou1.png')
396
- }
397
- },
398
- changediv(val){
399
- //tag
400
- return val
401
- },
402
- // 选择tab
403
- tabSelect (item,number) {
404
- this.header = item.header
405
- if(this.number == number && !this.routeShow ){
406
- this.routeShow = true
407
- }else if(this.number == number && this.routeShow){
408
- this.routeShow = false
409
- }else if(this.number != item.complete){
410
- this.routeShow = true
411
- }
412
- this.number = number
413
- this.componentName = item.complete
414
- if(item.complete == 'safecheck-devices-temp'){
415
- if(this.data['device'+item.number].length == 0){
416
- this.data['device' + item.number].push({})
417
- }
418
- let idx=this.data['device' + item.number].length - 1
419
- let itemprops = {
420
- config:this.config,
421
- device:this.devices[item.number-1],
422
- idx:idx,
423
- role:'inspect'
424
- }
425
- if(this.routeShow){
426
- this.$goto(item.complete, itemprops, 'repair')
427
- }
428
- }else{
429
- if(this.routeShow){
430
- this.$goto(item.complete, {userinfo:this.data}, 'repair')
431
- }
432
- }
433
- this.shupingshow = true
434
- },
435
- sortDetails(){
436
- for (let i = 0; i < this.details.length; i++) {
437
- if (this.details[i].details.length) {
438
- for (let j = 0; j < this.details[i].details.length; j++) {
439
- if (this.details[i].details[j].f_type === 'a') {
440
- this.doordetails = {details: this.details[i].details}
441
- break
442
- }
443
- if (this.details[i].details[j].f_type === 'b') {
444
- this.devicedetails = {details: this.details[i].details}
445
- break
446
- }
447
- if (this.details[i].details[j].f_type === 'c') {
448
- this.cookdetails = {details: this.details[i].details}
449
- break
450
- }
451
- }
452
- }
453
- }
454
- },
455
- // 复制数据
456
- back () {
457
- let _this = this
458
- if(this.issee){
459
- _this.$back()
460
- return
461
- }
462
- this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
463
- if (res === 'confirm') {
464
- this.closely()
465
- _this.$back()
466
- }
467
- })
468
- },
469
- confirm(){
470
- this.$dispatch('confirm')
471
- },
472
- tick() {
473
- this.timer = null
474
- this.data.f_offsite_time = Util.toStandardTimeString()
475
- this.timer = window.setTimeout(this.tick, 1000)
476
- },
477
- getRepairState() {
478
- let repaired = true
479
- this.data.f_defects.forEach((defect) => {
480
- repaired = repaired & (defect.f_ratification == '已处理')
481
- })
482
- return repaired
483
- },
484
- verifyRepairDefects() {
485
- this.data.f_repair_date = Util.toStandardTimeString()
486
- this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
487
- },
488
- errorVerify() {
489
- if(this.data.f_entry_status){
490
- if(['到访不遇', '拒检'].includes(this.data.f_entry_status)) {
491
- if(!this.data.f_noanswer_path && !this.data.f_nongasuser_path){
492
- return "到访不遇/拒检照片未拍摄"
493
- }
494
- return
495
- }
496
- }else{
497
- return "入户状态未选择"
498
- }
499
- for (let dev in this.config) {
500
- if (this.config[dev].checkmust == true) {
501
- let error = true
502
- for(let device in this.data) {
503
- if (device.startsWith("device")) {
504
- for (let item in this.data[device]) {
505
- if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
506
- error = false
507
- }
508
- }
509
- }
510
- }
511
- if (error) {
512
- return "请检查" + dev
513
- }
514
- }
515
- }
516
-
517
- for (let dev in this.config) {
518
- for(let device in this.data) {
519
- if (device.startsWith("device")) {
520
- for (let item in this.data[device]) {
521
- //检查每一条安检结果
522
- if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
523
- for (let i in this.data[device][item].f_items) {
524
- for (let it in this.config[dev].items) {
525
- if (it == this.data[device][item].f_items[i].f_item_name) {
526
- let check=false
527
- if (!this.data[device][item].f_items[i].f_item_value){
528
- check=true
529
- }else if (Array.isArray(this.data[device][item].f_items[i].f_item_value)){
530
- if (this.data[device][item].f_items[i].f_item_value.length==0){
531
- check=true
532
- }
533
- }
534
-
535
- if(this.config[dev].items[it].type=='picture' && this.config[dev].items[it].checkmust == true && !this.data[device][item].f_items[i].f_path){
536
- return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
537
- }
538
- if (this.config[dev].items[it].type !='picture' && this.config[dev].items[it].checkmust == true && check) {
539
- return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
540
- }
541
- }
542
- }
543
- //检查安检下拉结果
544
- if (this.data[device][item].f_items[i].type == 'selector' || this.data[device][item].f_items[i].type == 'radio') {
545
- if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
546
- 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 + "选中必须拍照"
547
- }
548
- }
549
- }
550
- }
551
- }
552
- }
553
- }
554
- }
555
- },
556
- getAllDefect() {
557
- let checkResults = {
558
- result: '正常',
559
- data: []
560
- }
561
- let value = ''
562
- let codata = JSON.parse(JSON.stringify(this.data))
563
- codata.f_devices = []
564
- this.f_devices = []
565
- for (let device in codata) {
566
- let f_device_type
567
- if (device.startsWith("device")) {
568
- //tag)
569
- let hasOther = ''
570
- let otherValue = null
571
- for (let item in codata[device]) {
572
- if(typeof codata[device][item]=='function'){
573
- continue
574
- }
575
- codata[device][item].f_create_time = Util.toStandardTimeString()
576
- if (codata[device].length > 1) {
577
- let j = Number.parseInt(item) + 1
578
- f_device_type = `${codata[device][item].f_device_type}${j}`
579
- } else {
580
- f_device_type = codata[device][item].f_device_type
581
- }
582
- //tag
583
- //tag
584
- //tag)
585
- //tag)
586
- if(item == 'sum' || item == 'removeEmpty'){
587
- continue
588
- }
589
- for (let i = 0; i < codata[device][item].f_items.length ; i++) {
590
- //tag
591
- if(i == 'sum' || i == 'removeEmpty'){
592
- continue
593
- }
594
- //tag)
595
- var items = codata[device][item].f_items[i]
596
- items.f_create_time = Util.toStandardTimeString()
597
- //tag)
598
- items.f_item_lists = []
599
- //tag)
600
- // //tag)
601
- // //tag} name => ${JSON.stringify(items.f_item_name)} value => ${JSON.stringify(items.f_item_value)}`)
602
- // console.log(`f_is_defect => ${this.config[codata[device][item]
603
- // .f_device_type]
604
- // .items[items.f_item_name]
605
- // .options
606
- // .find((option)=>option.data === items.f_item_value)
607
- // .map((option)=>option.f_is_defect)}`)
608
- // if (items.f_is_defect && (items.f_is_defect == true || items.f_is_defect == 'true')) {
609
- // //tag
610
- // checkResults.result = '有隐患'
611
- // //tag)
612
- // //tag)
613
- // // this.$set('checkResult.' + items.f_item_name, items.f_item_value)
614
- // this.checkResult[items.f_item_name] = items.f_item_value
615
- // //tag)
616
- // // this.$set('checkResultsss.' + items.f_item_name, `${f_device_type}${items.f_item_value}`)
617
- // // //tag)
618
- // }
619
- if (items.type == 'selector') {
620
- items.selected = []
621
- } else if (items.type == 'inputSelector') {
622
- items.selected = ''
623
- }
624
- //遍历配置项 将所选隐患项的配置信息放入保存的数据中
625
- let f_is_defect //是否是隐患
626
- let f_defect_level //是否是隐患
627
- let f_item_name = items.f_item_name
628
- let f_item_value
629
- let f_is_eliminate //隐患是否消除
630
- let f_meternumber = ''
631
- let f_user_defects = [] // 用户所有隐患
632
- //tag
633
- //tag
634
- if (items.type == 'selector' || items.type == 'checkbox' || items.type == 'radio') {
635
- for (let i in items.f_item_value) {
636
- if(typeof items.f_item_value[i]=='function'){
637
- continue
638
- }
639
- let configItems = this.config[codata[device][item].f_device_type].items[f_item_name]
640
- //tag)
641
- for (let k in configItems.options) {
642
- if(typeof configItems.options[k]=='function'){
643
- continue
644
- }
645
- //tag)
646
- if (items.f_item_value[i] === configItems.options[k].data) {
647
-
648
- f_is_defect = configItems.options[k].isdefect
649
- f_item_value = items.f_item_value[i]
650
- f_defect_level = configItems.options[k].level
651
-
652
- //tag
653
- //tag
654
- //tag
655
-
656
- if (f_is_defect) {
657
- if (checkResults.result !== '有隐患') {
658
- checkResults.result = '有隐患'
659
- }
660
- console.log('items'+items)
661
- if(items.f_deal_dispose=='报修'){
662
- console.log("检测到需要转维修++++++++++++")
663
- this.repairDefect.result='未处理'
664
- this.repairDefect.data.push(`${f_item_name} : ${f_item_value}`)
665
- }
666
- if (!this.checkResult.hasOwnProperty(f_device_type+'-'+f_item_name)) {
667
- //tag
668
- this.checkResult[f_device_type+'-'+f_item_name] = []
669
- }
670
-
671
- //tag
672
- this.checkResult[f_device_type+'-'+f_item_name].push(f_item_value)
673
-
674
- }
675
-
676
- let items_list = {
677
- f_is_defect: f_is_defect,
678
- f_item_value: f_item_value,
679
- f_defect_level: f_defect_level,
680
- f_is_eliminate: null,
681
- f_create_time: Util.toStandardTimeString()
682
- }
683
- if (!items.f_item_lists) {
684
- //tag
685
- items.f_item_lists = []
686
- //tag)
687
- if (JSON.stringify(items_list) !== '{}') {
688
- //tag
689
- items.f_item_lists.push(items_list)
690
- }
691
- } else {
692
- //tag)
693
- if (JSON.stringify(items_list) !== '{}') {
694
- //tag
695
- items.f_item_lists.push(items_list)
696
- }
697
- }
698
- }
699
- }
700
- }
701
- } else {
702
- let configItems = this.config[codata[device][item].f_device_type].items[items.f_item_name]
703
- f_is_defect = items.f_is_defect
704
- f_defect_level = items.level
705
- f_item_value = items.f_item_value
706
- let items_list = {
707
- f_is_defect: f_is_defect,
708
- f_item_value: f_item_value,
709
- f_defect_level: f_defect_level,
710
- f_create_time: Util.toStandardTimeString()
711
- }
712
- if (f_is_defect && f_item_value) {
713
- items.f_is_defect = true
714
- if (checkResults.result !== '有隐患') {
715
- checkResults.result = '有隐患'
716
- }
717
- if (!this.checkResult.hasOwnProperty(items.f_item_name)) {
718
- //tag
719
- this.checkResult[items.f_item_name] = []
720
- }
721
-
722
- //tag
723
- this.checkResult[items.f_item_name].push(f_item_value)
724
-
725
- }
726
- //tag)
727
- //tag)
728
- if (!items.f_item_lists) {
729
- //tag
730
- items.f_item_lists = []
731
- if (JSON.stringify(items_list) != '{}') {
732
- //tag
733
- items.f_item_lists.push(items_list)
734
- }
735
- } else {
736
- // items.f_item_lists[0].f_item_value = f_item_value
737
- if (JSON.stringify(items_list) != '{}') {
738
- //tag
739
- //tag)
740
- //tag)
741
- //tag
742
- items.f_item_lists.push(items_list)
743
- }
744
- }
745
- }
746
- if (hasOther !== '' && otherValue !== null) {
747
- //tag
748
- this.checkResult[hasOther].push(otherValue)
749
- hasOther = ''
750
- otherValue = null
751
- }
752
- items.f_item_value = ''
753
- }
754
- //tag)
755
- this.f_devices.push(codata[device][item])
756
- }
757
- }
758
- }
759
- if (this.checkResult) {
760
- for (let key in this.checkResult) {
761
- if(typeof this.checkResult[key]=='function'){
762
- continue
763
- }
764
- // 上次安检结果数据组织
765
- //tag
766
- //tag
767
- let temp = {}
768
- temp[key] = this.checkResult[key].join(',')
769
- checkResults.data.push(temp)
770
- // this.newcheckResult[key] = this.checkResult[key]
771
- // checkResults.data.push(this.newcheckResult)
772
- //tag)
773
- // this.newcheckResult = {}
774
- }
775
- this.checkResult = {}
776
- }
777
- if (checkResults.data.length > 0) {
778
- let msg = ''
779
- for (let a = 0; a < checkResults.data.length; a++) {
780
- for (let datumKey in checkResults.data[a]) {
781
- msg += datumKey + ':' + checkResults.data[a][datumKey] + ';'
782
- }
783
- }
784
- this.data.f_defect_text = msg
785
- codata.f_defect_text = msg
786
- }
787
- codata.f_defect_content = JSON.stringify(checkResults)
788
- this.data.f_defect_content = JSON.stringify(checkResults)
789
- //tag
790
- return codata
791
- },
792
- uploadCheckPaper(){
793
- this.saveNoclick()
794
- this.closely(false) // 保存本地,不删除录音文件停止录音
795
- let errString = this.errorVerify()
796
- if (errString) {
797
- this.disableTimer()
798
- this.$showMessage(errString)
799
- return
800
- } else {
801
- this.$set('data.f_offsite_time', Util.toStandardTimeString())
802
- this.$set('data.f_upload_time', Util.toStandardTimeString())
803
- this.$set('data.f_upload_date', Util.toStandardTimeString())
804
- this.data.f_complete = '已完成'
805
- this.disableTimer()
806
- }
807
- this.onlySave = false
808
- this.assemblyCodata()
809
- let res = this.save()
810
- },
811
- //将数据组装提出
812
- assemblyCodata(){
813
- let codata = this.getAllDefect()
814
- console.log(`codata类型 开始组装codeta数据-->${typeof codata}`)
815
- console.log(`codata内容-->${JSON.stringify(codata)}`)
816
- for (let key in codata) {
817
- if (key.startsWith("device")) {
818
- console.log('this.data.' + key + JSON.stringify(codata[key]))
819
- codata[key] = []
820
- }
821
- }
822
- codata.f_devices = this.f_devices
823
- this.rowCodata=codata
824
- },
825
- save() {
826
- let codata = this.getAllDefect()
827
- for (let key in codata){
828
- if(key.startsWith("device")){
829
- codata[key] = []
830
- }
831
- }
832
- codata.f_devices = this.f_devices
833
- this.rowCodata = codata
834
- let param = {
835
- f_check_item_id: this.data.f_check_item_id,
836
- f_checker_id: this.data.f_checker_id,
837
- // row: codata
838
- row: this.rowCodata
839
- }
840
- //tag)
841
- let paramStr = JSON.stringify(param)
842
- // 多长截断一次
843
- let subLength = 800
844
- for (let i = 0; i < paramStr.length; i += subLength) {
845
- HostApp.param_cache(paramStr.substr(i, subLength))
846
- }
847
- HostApp.__this__ = this
848
- HostApp.syncLogic({
849
- // logic别名,key必须为logic
850
- 'logic': '上传安检信息',
851
- // 回调执行方法名,key必须为callback
852
- 'callback': 'javascript:HostApp.__this__.uploadCallBack()',
853
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
854
- // 执行回调方法传入key为backresult
855
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
856
- 'backresult': 1
857
- })
858
- },
859
- runSyncLogic(logic,callback,backresult){
860
- HostApp.runSyncLogic({
861
- 'logic': logic,
862
- 'callback': callback,
863
- 'backresult':backresult
864
- })
865
- },
866
- logicWithHint(logic,data,callback,backresult){
867
- HostApp.logicWithHint({
868
- 'logic': logic,
869
- 'callback': callback,
870
- 'data': data,
871
- 'backresult':backresult
872
- })
873
- },
874
- uploadCallBack(jo){
875
- let url = ""
876
- if(Vue.config.safecheck != undefined) {
877
- if (Vue.config.safecheck.ApproveConfig != undefined) {
878
- if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
879
- url = Vue.config.safecheck.ApproveConfig.weixinurl
880
- }
881
- }
882
- }
883
- if(jo.state == 'ok'){
884
- let res = JSON.parse(jo.result)
885
- //tag)
886
- //tag)
887
- if(res.code == 200){
888
- this.$set('data.f_paper_id', res.id)
889
- this.isStrat=false
890
- if(url != ""){
891
- this.$resetpost(`${url}`,{data:WxResult})
892
- }
893
- if(this.isToRepair){
894
- for (let device in this.data){
895
- if(device.startsWith("device")){
896
- this.data[device] = []
897
- if(res.data.length > 0){
898
- for(let i in res.data[0].f_devices){
899
- if(this.data[device].length > 0){
900
- if(this.data[device][0].f_device_type == res.data[0].f_devices[i].f_device_type){
901
- this.data[device].push(res.data[0].f_devices[i])
902
- res.data[0].f_devices.splice(i,1)
903
- }
904
- }else{
905
- this.data[device].push(res.data[0].f_devices[i])
906
- res.data[0].f_devices.splice(i,1)
907
- }
908
- }
909
- }
910
- }
911
- }
912
- this.todo()
913
- }else{
914
- this.$showMessage('上传成功!')
915
- //tag
916
- this.$dispatch('confirm')
917
- // this.$back()
918
- }
919
- }else if(res.code == 309){
920
- this.$showMessage('该安检单已作废!')
921
- //tag
922
- this.$dispatch('confirm')
923
- }else if(res.code == 710){
924
- this.$showMessage('上传照片失败,请检查网络是否正常!'+res.msg)
925
- return
926
- }else if(res.code == 711){
927
- this.$showMessage('该安检单已被管理员调整,请联系管理员!')
928
- return
929
- }else if(res.code == 712){
930
- this.$showMessage('网络异常,请重新上传,多次上传失败请联系管理员!')
931
- return
932
- }
933
- else{
934
- this.$showMessage('上传失败!')
935
- }
936
- }else {
937
- this.$showMessage('网络异常,上传失败!')
938
- }
939
- this.onlySave = true
940
- },
941
- safecheckToRepairCallBack(jo){
942
- //获取微信推送路径
943
- if(jo.state == 'ok'){
944
- let res = JSON.parse(jo.result)
945
- //tag)
946
- if(res.code == 200){
947
- //tag
948
- if(res.data.code == 200){
949
- this.$showMessage('上传并转维修成功!')
950
- }else{
951
- this.$showMessage('上传并转维修成功,回写安检单失败!')
952
- }
953
- this.$dispatch('confirm')
954
- // this.$back()
955
- }else{
956
- this.$showMessage('上传失败!')
957
- this.onlySave = true
958
- }
959
- }else{
960
- this.$showMessage('网络异常,上传失败!')
961
- this.onlySave = true
962
- }
963
- },
964
- todo(){
965
- let gen = getRepairParam(this)
966
- co(gen)
967
- },
968
- undo(){
969
- this.showCheckToRepair = !this.showCheckToRepair
970
- this.model.serviceacitivity[0].f_reciever = ''
971
- this.model.serviceacitivity[0].f_meetunit = ''
972
- this.model.f_repairtype = ''
973
- this.meading = '转站点'
974
- },
975
- disableTimer() {
976
- if(this.timer) {
977
- window.clearTimeout(this.timer)
978
- this.timer = null
979
- }
980
- },
981
- S4() {
982
- return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
983
- },
984
- extend(initalObj, finalObj) {
985
- var obj = finalObj || {};
986
- for (var i in initalObj) {
987
- var prop = initalObj[i];
988
-
989
- // 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
990
- if (prop === obj) {
991
- continue;
992
- }
993
-
994
- if (typeof prop === 'object') {
995
- if (obj[i]) {
996
- this.extend(obj[i], prop)
997
- } else {
998
- obj[i] = prop;
999
- }
1000
- }
1001
- }
1002
- return obj;
1003
- },
1004
- init () {
1005
- this.data.isupdateplanitem = this.$appdata.getSingleValue('在线安检回更有计划') ? this.$appdata.getSingleValue('在线安检回更有计划') : 'false'
1006
- this.data.f_SafeToRepair_id = ''
1007
- this.data.ename = Vue.user.ename
1008
- this.data.f_outlets = Vue.user.f_parentname
1009
- this.data.f_meetunit = Vue.user.orgpathnames
1010
- this.data.orgpathstr = Vue.user.orgpathstr
1011
- this.data.f_check_item_id = ''
1012
- this.data.f_check_plan_id = this.f_plan_id
1013
- this.data.f_checker_id = Vue.user.id
1014
- this.data.f_checker_name = Vue.user.name
1015
- this.data.f_check_type = ''
1016
- this.data.f_safecheck_type = ''
1017
- this.data.f_subcompany = ''
1018
- this.data.f_approved = ''
1019
- this.data.f_repair_approved = ''
1020
- this.data.f_no_checkplan = '无计划安检'
1021
- this.data.f_approved = ''
1022
- this.data.f_filialeid = Vue.user.orgid
1023
- this.data.f_orgstr = ''
1024
- this.data.version = ''
1025
- this.data.f_check_version=''
1026
- this.$set('data.f_meters', '')
1027
- this.$set('data.f_userinfo_code', '')
1028
- this.$set('data.f_entry_status', '入户')
1029
- this.$set('data.f_safe_type', '已挂表未办卡安检')
1030
- this.$set('data.f_usegas', '未使用')
1031
- this.$set('data.f_state','')
1032
- this.$set('data.f_source', this.source?this.source:'安检')
1033
- this.$set('data.f_other_checker_name', '')
1034
- this.$set('data.f_user_name', '')
1035
- this.$set('data.f_onsite_time', Util.toStandardTimeString())
1036
- this.$set('data.f_rent_phone', '')
1037
- this.$set('data.f_user_phone', '')
1038
- this.$set('data.f_userinfoid', '')
1039
- this.$set('data.f_address', '')
1040
- this.$set('data.f_card_id', '')
1041
- this.$set('data.f_slice_area', '')
1042
- this.$set('data.f_recheck_id', '')
1043
- this.$set('rowCodata.f_recheck_id', '')
1044
- this.$set('data.f_street','')
1045
- this.$set('data.f_room', '')
1046
- this.$set('data.f_building', '')
1047
- this.$set('data.f_unit', '')
1048
- this.$set('data.f_floor', '')
1049
- this.$set('data.f_residential_area' , '')
1050
- this.$set('data.f_idnumber', '')
1051
- this.$set('data.f_comments', '')
1052
- this.$set('data.f_userproperties', '')
1053
- this.$set('data.f_client_evaluation', '满意')
1054
- this.$set('data.f_userfiles_id', '')
1055
- this.$set('data.f_valve_state', '')
1056
- this.$set('data.f_off_valve_reason', '')
1057
- this.$set('data.f_gas_guidelines', true)
1058
- this.$set('data.f_safety_warning', true)
1059
- this.$set('data.f_gas_manual', true)
1060
- this.$set('data.f_no_gas_device', false)
1061
- this.$set('data.f_close_valve', false)
1062
- this.$set('data.f_unload_battery', false)
1063
- this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1064
- }
1065
- },
1066
- watch: {
1067
- 'row' () {
1068
- //tag
1069
- this.copy()
1070
- }
1071
- },
1072
- ready () {
1073
- HostApp.startOrStopAudioClip("----",'停止并删除录音')
1074
- //获取用户用气类型
1075
- let useType=this.$appdata.getParam('用户用气类型')
1076
- if(useType){
1077
- for (let i = 0; i < useType.length; i++) {
1078
- var obj={data:useType[i].value}
1079
- this.selecData.push(obj)
1080
- }
1081
- }
1082
- this.config['点火'].items['用户用气类型'].options = this.selecData
1083
- this.tab=[]
1084
- for (let i in this.config) {
1085
- let n = this.config[i].index
1086
- this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
1087
- this.$set('data.' + 'device' + n, [])
1088
- this.tabs[n-1] = {
1089
- header: i,
1090
- complete: 'safecheck-devices-temp',
1091
- class: 'repair-details-class',
1092
- number: n
1093
- }
1094
- }
1095
- this.tabs.push({
1096
- header: '拍照签名',complete:'paper-feedback-temp', class: 'outlay-class', props: null
1097
- })
1098
- this.faultshow.number = this.tabs.length
1099
- this.init()
1100
- this.$showMessage("为了保证服务质量,将会被全程录音!")
1101
- let resse = this.record()
1102
- this.tabSelect({
1103
- "header": "信息填写",
1104
- "complete": "safecheck-devices-temp",
1105
- "class": "repair-details-class",
1106
- "number": 1
1107
- },0)
1108
- },
1109
- events: {
1110
- 'tijiao': function () {
1111
- this.confirm()
1112
- }
1113
- }
1114
- }
1115
- </script>
1116
- <style lang="less">
1117
- @import "../../../../src/bootstrap/less/variables.less";
1118
- .noclickbut {
1119
- pointer-events: none;
1120
- }
1121
- .tab-befor-img (@url) {
1122
- content: '';
1123
- background-image: url("@{url}");
1124
- background-size: 20px;
1125
- display: inline-block;
1126
- margin-right: 8px;
1127
- margin-top: 0.3em;
1128
- height: 1.3em;
1129
- width: 1.3em;
1130
- vertical-align: -35%;
1131
- }
1132
-
1133
- @media screen and (min-width: 768px) {
1134
- .android-repair-order > div > ul a {
1135
- font-size: @font-size-h2;
1136
- margin: 0.3em 0;
1137
- }
1138
- }
1139
- .repair-details-class{
1140
- &::before {
1141
- .tab-befor-img("../../../assets/huneiweixiu1.png");
1142
- }
1143
- }
1144
- .repair-info-class {
1145
- &::before {
1146
- .tab-befor-img("../../../assets/baoxiuxinxi1.png");
1147
- }
1148
- }
1149
- .repair-user-info-class {
1150
- &::before {
1151
- .tab-befor-img("../../../assets/jibenxinxi1.png")
1152
- }
1153
- }
1154
-
1155
- .door-service-class {
1156
- &::before {
1157
- .tab-befor-img("../../../assets/huneiweixiu1.png")
1158
- }
1159
- }
1160
-
1161
- .pipeline-class {
1162
- &::before {
1163
- .tab-befor-img("../../../assets/guandao1.png")
1164
- }
1165
- }
1166
-
1167
- .device-service-class {
1168
- &::before {
1169
- .tab-befor-img("../../../assets/shebeiweixiu1.png")
1170
- }
1171
- }
1172
-
1173
- .trouble-removal-class {
1174
- &::before {
1175
- .tab-befor-img("../../../assets/shiguchuli.png")
1176
- }
1177
- }
1178
-
1179
- .cooking-utensils-class {
1180
- &::before {
1181
- .tab-befor-img("../../../assets/zaoju1.png")
1182
- }
1183
- }
1184
-
1185
- .outlay-class {
1186
- &::before {
1187
- .tab-befor-img("../../../assets/feiyong1.png")
1188
- }
1189
- }
1190
-
1191
- .fault-all-class {
1192
- &::before {
1193
- .tab-befor-img("../../../assets/guzhanghuizong1.png")
1194
- }
1195
- }
1196
- .photo-write-class {
1197
- &::before {
1198
- .tab-befor-img("../../../assets/zaoju.png")
1199
- }
1200
- }
1201
- .delay-apply-class {
1202
- &::before {
1203
- .tab-befor-img("../../../assets/yonghubaoxiu.png")
1204
- }
1205
- }
1206
-
1207
- .repair-back-class {
1208
- &::before {
1209
- .tab-befor-img("../../../assets/fanhui.png")
1210
- }
1211
- }
1212
- .butt2 {
1213
- display: inline;
1214
- float: right;
1215
- width: 10px;
1216
- text-align: center;
1217
- align-items:center;
1218
- position: absolute;
1219
- top:50%;
1220
-
1221
- left:90%;
1222
- transform: translate(-50%,-50%);
1223
- }
1224
- .linesty{
1225
- display: inline-block;
1226
- height:1px;
1227
- width:100%;
1228
- background:#d0d0d0;
1229
- overflow:hidden;
1230
- vertical-align: middle;
1231
- }
1232
- .spanboder{
1233
- border-bottom:2px solid #499edf;
1234
- padding-bottom: 8px
1235
- }
1236
- .app-botton {
1237
- position:fixed;
1238
- background: #87b2dd;
1239
- right:8px;
1240
- color: #FFF;
1241
- padding: 8px;
1242
- text-align: center;
1243
- font-size: 1.2em;
1244
- z-index: 10;
1245
- opacity:0.5;
1246
- bottom: 50px;
1247
- margin-top: -10px;
1248
- height: 40px;
1249
- }
1250
- .android-repair-order > div > ul a {
1251
- font-size: 12px;
1252
- color: #333333;
1253
- padding: 13px 16px;
1254
- }
1255
- </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">
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">
34
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="uploadCheckPaper">
35
+ 上传
36
+ </button>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </ul>
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ import Vue from 'vue'
51
+ import * as Util from '../../Util'
52
+ import { HttpResetClass } from 'vue-client'
53
+ import co from 'co'
54
+ import $ from "jquery";
55
+ let loadParamGem = async function (self) {
56
+ await self.$LoadParams.loadParam()
57
+ }
58
+
59
+ export default {
60
+ title: '安检单',
61
+ props: ['f_plan_id', 'item', 'role','parentPage','source'],
62
+ // props: ['f_plan_id', 'role'],
63
+ data() {
64
+ return {
65
+ data: {
66
+ f_noanswer_path:'',
67
+ f_nongasuser_path:'',
68
+ f_devices: [],
69
+ f_defect_content:'',
70
+ f_recording1_path:'',
71
+ f_visit_number:'',
72
+ f_remark:''
73
+ },
74
+ imgsnum:this.$appdata.getSingleValue('安检总体照片数量') ? this.$appdata.getSingleValue('安检总体照片数量'):1, // 安检整体照片默认必须拍1张
75
+ updateuserphone:false, //安检时是否更新用户电话
76
+ updatemetermodel:false, //安检时是否更新表型号
77
+ updatemeternumber:false, //安检时是否更新表号
78
+ beforephone:'',
79
+ isUpload:false,
80
+ show_torepair: false,
81
+ onlySave:true, //判断保存还是保存并上传
82
+ livedispose:'',
83
+ refuseinspection:'', // 拒捡拍照是否提示
84
+ notencountered:'', // 到访不遇拍照是否提示
85
+ startClick:false, //开始安检按钮是否可点击
86
+ isStrat: false, //是否开始安检
87
+ checkResult:{},//查询结果
88
+ newcheckResult:{},
89
+ repairDefect : {
90
+ result: '正常',
91
+ data: []
92
+ },
93
+ rowCodata:{},
94
+ repairers: [],
95
+ timer: null,
96
+ showModal: false,
97
+ showModal2:false,
98
+ pic_to_be_viewed: '',
99
+ showBack:true,
100
+ devices: [],
101
+ f_devices : [],
102
+ isToRepair:false,
103
+ clickBack:true, //是否点击返回按钮
104
+ isSafeCheckToRepair:false,//是否转维修
105
+ Url:this.$androidUtil.getProxyUrl(),
106
+ detail:{},
107
+ defectDevice:{},
108
+ user:{},
109
+ is_has_jingweidu: this.$appdata.getSingleValue('照片水印加经纬度') || 'false',
110
+ dispatchTypeOptions: [{label: '派发给维修员', value: '派发给维修员'},{label: '派发给站点', value: '派发给站点'}],
111
+ selectData:{
112
+ dispatchType:'派发给维修员',
113
+ f_repairman:'',
114
+ f_remarks:'',
115
+ f_repairtype:'整改'
116
+ },
117
+ model: { //转维修数据
118
+ // 一次派单
119
+ serviceacitivity: [{
120
+ f_service_acitivity_type: '派单'
121
+ }],
122
+ f_source:'安检',
123
+ f_service_id: '',
124
+ f_contact_phone: '',
125
+ f_meetunit: '',
126
+ f_phone: '',
127
+ f_user_name: '',
128
+ f_address: '',
129
+ f_repair_date: Util.toStandardTimeString(),
130
+ f_card_id: '',
131
+ // f_department: '', 站点选择
132
+ f_reciever:'',
133
+ f_remarks: '',
134
+ f_user_type: '',
135
+ f_area: '',
136
+ f_unit_name:'',
137
+ f_street: '',
138
+ f_residential_area: '',
139
+ f_building: '',
140
+ f_unit: '',
141
+ f_floor: '',
142
+ f_room: '',
143
+ aState: null,
144
+ f_repairtype: '',
145
+ f_repairitems:{},
146
+ },
147
+ repairitems:[],
148
+ selecData:[],
149
+ meading:'转站点',
150
+ config: {
151
+ "信息填写":{
152
+ "checkmust":true,
153
+ "index":1,
154
+ "items":{
155
+ "地址信息":{"index":1,"type":"string","readonly":false,"checkmust": true},
156
+ "入户状态":{"index":2,"multiple":false,"type":"selector","options":[{"data":"入户","isdefault":true},{"data":"到访不遇"},{"data":"拒检"},{"data":"入户未点"}],"checkmust":true},
157
+ "到访不遇/拒检照片":{"index":3,"type":"picture","readonly":false,"checkmust": false,"isshow":false},
158
+ "气表品牌":{"index":4,"type":"string","readonly":false,"checkmust": true},
159
+ "表号":{"index":5,"type":"string","readonly":false,"checkmust": true},
160
+ "用户姓名":{"index":6,"type":"string","readonly":false,"checkmust": false},
161
+ "用户电话":{"index":7,"type":"string","readonly":false,"checkmust": false},
162
+ "表具照片":{"index":8,"type":"picture","readonly":false,"checkmust": true},
163
+ "安装日期":{"index":9,"type":"date","readonly":false,"checkmust": true},
164
+ "左右表":{"index":10,"multiple":false,"type":"selector","options":[{"data":"左表"},{"data":"右表"}],"checkmust":true},
165
+ "检验时间":{"index":11,"type":"date","readonly":false,"checkmust": true}
166
+ }
167
+ },
168
+ "其他隐患":{
169
+ "checkmust":true,
170
+ "index":2,
171
+ "items":{
172
+ "有无其他隐患":{"index":1,"multiple":false,"type":"radio","options":[{"data":"无隐患","isdefault":true},{"data":"有其他隐患","isdefault":false,"isdefect":true}],"checkmust":true}
173
+ }
174
+ },
175
+ "点火":{
176
+ "checkmust":true,
177
+ "index":3,
178
+ "items":{
179
+ "检查类型":{"index":1,"multiple":false,"type":"selector","options":[{"data":"普通检查","isdefault":true},{"data":"点火检查"}],"checkmust":true},
180
+ "点火类型":{"index":2,"multiple":false,"type":"selector","options":[{"data":"正常点火"},{"data":"点火条件不符未点"}],"checkmust":false,"isshow":false},
181
+ "证件号码":{"index":3,"type":"string","checkmust":false,"isshow":false},
182
+ "用户用气类型":{"index":4,"multiple":false,"type":"selector","options":this.selecData,"checkmust":false,"isshow":false},
183
+ }
184
+ }
185
+ },
186
+ isneedDate:'',
187
+ routeShow:true,
188
+ number:0,
189
+ shupingshow:false,
190
+ pipeline: {},
191
+ details: [],
192
+ ids: '',
193
+ savevalid: {
194
+ uservalid: false,
195
+ doorvalid: true,
196
+ changetable: false
197
+ },
198
+ doordetails: {},
199
+ devicedetails: {},
200
+ cookdetails: {},
201
+ componentName: 'safecheck-devices-temp',
202
+ header:'客户信息',
203
+ tabs: [],
204
+ faultshow:{
205
+ number : 8
206
+ } // 控制 故障汇总 在 菜单里显示与否,
207
+ }
208
+ },
209
+ computed: {
210
+ actionEnabled: {
211
+ get() {
212
+ return this.role == 'inspect'
213
+ }
214
+ }
215
+ },
216
+ methods: {
217
+ showmod(){
218
+ // this.saveNoclick()
219
+ let errString = this.errorVerify()
220
+ if (errString) {
221
+ console.log(errString)
222
+ console.log('Vue.android',Vue.android)
223
+ console.log('this.isUpload',this.isUpload)
224
+ if (Vue.android){
225
+ this.$showMessage(errString)
226
+ }
227
+ return
228
+ }
229
+ //清空转维修列表重新进行数据组织
230
+ this.repairDefect = {
231
+ result: '正常',
232
+ data: []
233
+ }
234
+ this.data.f_complete = '已完成'
235
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
236
+ this.assemblyCodata()
237
+ if(this.repairDefect.result=='正常'){
238
+ this.$showMessage("未发现有选择需要转维修的隐患,请检查填写的数据。如需转维修请在处理方式中选择 '转维修' !")
239
+ return
240
+ }
241
+ console.log("准备保存!")
242
+ this.disableTimer()
243
+ this.getEmp()
244
+ this.showModal2=true
245
+ },
246
+ cancel1(){
247
+ this.showModal2=false
248
+ this.selectData={
249
+ dispatchType:'派发给维修员',
250
+ f_repairman:'',
251
+ f_remarks:'',
252
+ f_repairtype:'整改'
253
+ }
254
+ },
255
+ getSiteRes(obj) {
256
+ console.log('siteRes ---> ')
257
+ console.log(obj)
258
+ if(obj.resids[0]){
259
+ this.selectData.f_meetunit = obj.res.join('.')
260
+ this.selectData.f_reciever = obj.resids.join('.')
261
+ this.selectData.f_outlets = obj.res[obj.res.length - 1]
262
+ }else {
263
+ this.selectData.f_meetunit = ''
264
+ this.selectData.f_reciever = ''
265
+ this.selectData.f_outlets = ''
266
+ }
267
+ },
268
+ rectification(){
269
+ if(this.selectData.dispatchType){
270
+ if(this.selectData.dispatchType=='派发给站点'){
271
+ if(!this.selectData.f_reciever){
272
+ this.$showMessage('请选择部门!')
273
+ return
274
+ }
275
+ }else{
276
+ if(!this.selectData.f_repairman){
277
+ this.$showMessage('请选择维修员!')
278
+ return
279
+ }
280
+ }
281
+ }else {
282
+ this.$showMessage('请选择派发类型!')
283
+ return
284
+ }
285
+ /*if(!this.selectData.f_repairtype){
286
+ this.$showMessage('请选择报修类型!')
287
+ return
288
+ }*/
289
+ //关闭录音
290
+ this.closely(false) // 保存本地,不删除录音文件暂停录音
291
+ let act={}
292
+ let toRepair=''
293
+ if(this.selectData.dispatchType=='派发给站点'){
294
+ act={f_meetunit:this.selectData.f_meetunit,f_reciever:this.selectData.f_reciever,f_service_acitivity_type:'派单'}
295
+ toRepair=null
296
+ }else{
297
+ console.log('派发给维修员---------'+this.selectData.f_repairman)
298
+ act={f_meetunit:'',f_reciever:this.selectData.f_repairman,f_service_acitivity_type:'派单'}
299
+ toRepair='一级派单'
300
+ }
301
+ let repData={
302
+ toRepair:toRepair,
303
+ activity:act,
304
+ deps:Vue.user.deps,
305
+ depids:Vue.user.depids,
306
+ f_remarks:this.selectData.f_remarks,
307
+ f_repairtype:this.selectData.f_repairtype,
308
+ f_attendant: Vue.user.name,
309
+ loginUser:{name:Vue.user.name,ename:Vue.user.id,id:Vue.user.id},
310
+ }
311
+ this.rowCodata.istoRepair='转维修'
312
+ this.rowCodata.repData=repData
313
+ console.log("当前组装好的转维修数据--"+JSON.stringify(repData))
314
+ this.onlySave = false
315
+ this.save()
316
+ },
317
+ // 获取维修员
318
+ getEmp() {
319
+ this.repairers=[]
320
+ let per = {source: 'this.getRights().where(row.getType()==$user$).where(row.getAttributes().get($rolestr$).indexOf($维修员$) != -1))', userid: `${Vue.user.id}`}
321
+ let http = new HttpResetClass()
322
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/search`, {data: per}, {resolveMsg: null, rejectMsg: null}).then((res) => {
323
+ res.data.forEach((user)=>{
324
+ this.repairers.push({label:user.name, value: user.name})
325
+ })
326
+ })
327
+ },
328
+ closely(isdelete){
329
+ try {
330
+ var startOrStopAudioClipStr;
331
+ if (isdelete===true) {
332
+ //tag
333
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止并删除录音') //停止并删除录音
334
+ }else {
335
+ //tag
336
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止录音') //停止录音
337
+ }
338
+ if (startOrStopAudioClipStr.code == 200) {
339
+ //tag
340
+ return true;
341
+ }else {
342
+ return false;
343
+ }
344
+ } catch (e) {
345
+ console.error("关闭录音方法异常")
346
+ console.error(e)
347
+ return false;
348
+ }
349
+ },
350
+ // 录音方法
351
+ record() {
352
+ //tag
353
+ let fileName
354
+ if (!this.data.f_recording1_path) {
355
+ fileName = Util.guid() + '.amr'
356
+ } else {
357
+ fileName = Util.getFileName(this.data.f_recording1_path)
358
+ }
359
+ //HostApp.__this__ = this
360
+ /*调用无限制录音模块*/
361
+ let startOrStopState = HostApp.startOrStopAudioClip(fileName,"开始录音")
362
+ //tag
363
+ if (startOrStopState.code == 200) {
364
+ this.data.f_recording1_path = "file:///storage/emulated/0/safecheck/" + fileName
365
+ //tag
366
+ return true;
367
+ }else {
368
+ return false;
369
+ }
370
+
371
+ },
372
+ saveNoclick() {
373
+ // 禁用点击事件
374
+ $("#savebut").addClass("noclickbut");
375
+ //tag
376
+
377
+ // 5秒后启用点击事件
378
+ setTimeout(function(){
379
+ $("#savebut").removeClass("noclickbut");
380
+ },5000);
381
+ },
382
+ timeSet(val){
383
+ if (!val){
384
+ return
385
+ }
386
+ let time =new Date(val).getTime()
387
+ let time2=new Date().getTime()
388
+ if (time2>time) {
389
+ return true
390
+ }
391
+ },
392
+ imgback(val,isheader){
393
+ if(val && this.routeShow && isheader){
394
+ return require('../../../assets/xiangxia1.png')
395
+ }else{
396
+ return require('../../../assets/xiangyou1.png')
397
+ }
398
+ },
399
+ changediv(val){
400
+ //tag
401
+ return val
402
+ },
403
+ // 选择tab
404
+ tabSelect (item,number) {
405
+ this.header = item.header
406
+ if(this.number == number && !this.routeShow ){
407
+ this.routeShow = true
408
+ }else if(this.number == number && this.routeShow){
409
+ this.routeShow = false
410
+ }else if(this.number != item.complete){
411
+ this.routeShow = true
412
+ }
413
+ this.number = number
414
+ this.componentName = item.complete
415
+ if(item.complete == 'safecheck-devices-temp'){
416
+ if(this.data['device'+item.number].length == 0){
417
+ this.data['device' + item.number].push({})
418
+ }
419
+ let idx=this.data['device' + item.number].length - 1
420
+ let itemprops = {
421
+ config:this.config,
422
+ device:this.devices[item.number-1],
423
+ idx:idx,
424
+ role:'inspect'
425
+ }
426
+ if(this.routeShow){
427
+ this.$goto(item.complete, itemprops, 'repair')
428
+ }
429
+ }else{
430
+ if(this.routeShow){
431
+ this.$goto(item.complete, {userinfo:this.data}, 'repair')
432
+ }
433
+ }
434
+ this.shupingshow = true
435
+ },
436
+ sortDetails(){
437
+ for (let i = 0; i < this.details.length; i++) {
438
+ if (this.details[i].details.length) {
439
+ for (let j = 0; j < this.details[i].details.length; j++) {
440
+ if (this.details[i].details[j].f_type === 'a') {
441
+ this.doordetails = {details: this.details[i].details}
442
+ break
443
+ }
444
+ if (this.details[i].details[j].f_type === 'b') {
445
+ this.devicedetails = {details: this.details[i].details}
446
+ break
447
+ }
448
+ if (this.details[i].details[j].f_type === 'c') {
449
+ this.cookdetails = {details: this.details[i].details}
450
+ break
451
+ }
452
+ }
453
+ }
454
+ }
455
+ },
456
+ // 复制数据
457
+ back () {
458
+ let _this = this
459
+ if(this.issee){
460
+ _this.$back()
461
+ return
462
+ }
463
+ this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
464
+ if (res === 'confirm') {
465
+ this.closely()
466
+ _this.$back()
467
+ }
468
+ })
469
+ },
470
+ confirm(){
471
+ this.$dispatch('confirm')
472
+ },
473
+ tick() {
474
+ this.timer = null
475
+ this.data.f_offsite_time = Util.toStandardTimeString()
476
+ this.timer = window.setTimeout(this.tick, 1000)
477
+ },
478
+ getRepairState() {
479
+ let repaired = true
480
+ this.data.f_defects.forEach((defect) => {
481
+ repaired = repaired & (defect.f_ratification == '已处理')
482
+ })
483
+ return repaired
484
+ },
485
+ verifyRepairDefects() {
486
+ this.data.f_repair_date = Util.toStandardTimeString()
487
+ this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
488
+ },
489
+ errorVerify() {
490
+ if(this.data.f_entry_status){
491
+ if(['到访不遇', '拒检'].includes(this.data.f_entry_status)) {
492
+ if(!this.data.f_noanswer_path && !this.data.f_nongasuser_path){
493
+ return "到访不遇/拒检照片未拍摄"
494
+ }
495
+ return
496
+ }
497
+ }else{
498
+ return "入户状态未选择"
499
+ }
500
+ for (let dev in this.config) {
501
+ if (this.config[dev].checkmust == true) {
502
+ let error = true
503
+ for(let device in this.data) {
504
+ if (device.startsWith("device")) {
505
+ for (let item in this.data[device]) {
506
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
507
+ error = false
508
+ }
509
+ }
510
+ }
511
+ }
512
+ if (error) {
513
+ return "请检查" + dev
514
+ }
515
+ }
516
+ }
517
+
518
+ for (let dev in this.config) {
519
+ for(let device in this.data) {
520
+ if (device.startsWith("device")) {
521
+ for (let item in this.data[device]) {
522
+ //检查每一条安检结果
523
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
524
+ for (let i in this.data[device][item].f_items) {
525
+ for (let it in this.config[dev].items) {
526
+ if (it == this.data[device][item].f_items[i].f_item_name) {
527
+ let check=false
528
+ if (!this.data[device][item].f_items[i].f_item_value){
529
+ check=true
530
+ }else if (Array.isArray(this.data[device][item].f_items[i].f_item_value)){
531
+ if (this.data[device][item].f_items[i].f_item_value.length==0){
532
+ check=true
533
+ }
534
+ }
535
+
536
+ if(this.config[dev].items[it].type=='picture' && this.config[dev].items[it].checkmust == true && !this.data[device][item].f_items[i].f_path){
537
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
538
+ }
539
+ if (this.config[dev].items[it].type !='picture' && this.config[dev].items[it].checkmust == true && check) {
540
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
541
+ }
542
+ }
543
+ }
544
+ //检查安检下拉结果
545
+ if (this.data[device][item].f_items[i].type == 'selector' || this.data[device][item].f_items[i].type == 'radio') {
546
+ if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
547
+ 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 + "选中必须拍照"
548
+ }
549
+ }
550
+ }
551
+ }
552
+ }
553
+ }
554
+ }
555
+ }
556
+ },
557
+ getAllDefect() {
558
+ let checkResults = {
559
+ result: '正常',
560
+ data: []
561
+ }
562
+ let value = ''
563
+ let codata = JSON.parse(JSON.stringify(this.data))
564
+ codata.f_devices = []
565
+ this.f_devices = []
566
+ for (let device in codata) {
567
+ let f_device_type
568
+ if (device.startsWith("device")) {
569
+ //tag)
570
+ let hasOther = ''
571
+ let otherValue = null
572
+ for (let item in codata[device]) {
573
+ if(typeof codata[device][item]=='function'){
574
+ continue
575
+ }
576
+ codata[device][item].f_create_time = Util.toStandardTimeString()
577
+ if (codata[device].length > 1) {
578
+ let j = Number.parseInt(item) + 1
579
+ f_device_type = `${codata[device][item].f_device_type}${j}`
580
+ } else {
581
+ f_device_type = codata[device][item].f_device_type
582
+ }
583
+ //tag
584
+ //tag
585
+ //tag)
586
+ //tag)
587
+ if(item == 'sum' || item == 'removeEmpty'){
588
+ continue
589
+ }
590
+ for (let i = 0; i < codata[device][item].f_items.length ; i++) {
591
+ //tag
592
+ if(i == 'sum' || i == 'removeEmpty'){
593
+ continue
594
+ }
595
+ //tag)
596
+ var items = codata[device][item].f_items[i]
597
+ items.f_create_time = Util.toStandardTimeString()
598
+ //tag)
599
+ items.f_item_lists = []
600
+ //tag)
601
+ // //tag)
602
+ // //tag} name => ${JSON.stringify(items.f_item_name)} value => ${JSON.stringify(items.f_item_value)}`)
603
+ // console.log(`f_is_defect => ${this.config[codata[device][item]
604
+ // .f_device_type]
605
+ // .items[items.f_item_name]
606
+ // .options
607
+ // .find((option)=>option.data === items.f_item_value)
608
+ // .map((option)=>option.f_is_defect)}`)
609
+ // if (items.f_is_defect && (items.f_is_defect == true || items.f_is_defect == 'true')) {
610
+ // //tag
611
+ // checkResults.result = '有隐患'
612
+ // //tag)
613
+ // //tag)
614
+ // // this.$set('checkResult.' + items.f_item_name, items.f_item_value)
615
+ // this.checkResult[items.f_item_name] = items.f_item_value
616
+ // //tag)
617
+ // // this.$set('checkResultsss.' + items.f_item_name, `${f_device_type}${items.f_item_value}`)
618
+ // // //tag)
619
+ // }
620
+ if (items.type == 'selector') {
621
+ items.selected = []
622
+ } else if (items.type == 'inputSelector') {
623
+ items.selected = ''
624
+ }
625
+ //遍历配置项 将所选隐患项的配置信息放入保存的数据中
626
+ let f_is_defect //是否是隐患
627
+ let f_defect_level //是否是隐患
628
+ let f_item_name = items.f_item_name
629
+ let f_item_value
630
+ let f_is_eliminate //隐患是否消除
631
+ let f_meternumber = ''
632
+ let f_user_defects = [] // 用户所有隐患
633
+ //tag
634
+ //tag
635
+ if (items.type == 'selector' || items.type == 'checkbox' || items.type == 'radio') {
636
+ for (let i in items.f_item_value) {
637
+ if(typeof items.f_item_value[i]=='function'){
638
+ continue
639
+ }
640
+ let configItems = this.config[codata[device][item].f_device_type].items[f_item_name]
641
+ //tag)
642
+ for (let k in configItems.options) {
643
+ if(typeof configItems.options[k]=='function'){
644
+ continue
645
+ }
646
+ //tag)
647
+ if (items.f_item_value[i] === configItems.options[k].data) {
648
+
649
+ f_is_defect = configItems.options[k].isdefect
650
+ f_item_value = items.f_item_value[i]
651
+ f_defect_level = configItems.options[k].level
652
+
653
+ //tag
654
+ //tag
655
+ //tag
656
+
657
+ if (f_is_defect) {
658
+ if (checkResults.result !== '有隐患') {
659
+ checkResults.result = '有隐患'
660
+ }
661
+ console.log('items'+items)
662
+ if(items.f_deal_dispose=='报修'){
663
+ console.log("检测到需要转维修++++++++++++")
664
+ this.repairDefect.result='未处理'
665
+ this.repairDefect.data.push(`${f_item_name} : ${f_item_value}`)
666
+ }
667
+ if (!this.checkResult.hasOwnProperty(f_device_type+'-'+f_item_name)) {
668
+ //tag
669
+ this.checkResult[f_device_type+'-'+f_item_name] = []
670
+ }
671
+
672
+ //tag
673
+ this.checkResult[f_device_type+'-'+f_item_name].push(f_item_value)
674
+
675
+ }
676
+
677
+ let items_list = {
678
+ f_is_defect: f_is_defect,
679
+ f_item_value: f_item_value,
680
+ f_defect_level: f_defect_level,
681
+ f_is_eliminate: null,
682
+ f_create_time: Util.toStandardTimeString()
683
+ }
684
+ if (!items.f_item_lists) {
685
+ //tag
686
+ items.f_item_lists = []
687
+ //tag)
688
+ if (JSON.stringify(items_list) !== '{}') {
689
+ //tag
690
+ items.f_item_lists.push(items_list)
691
+ }
692
+ } else {
693
+ //tag)
694
+ if (JSON.stringify(items_list) !== '{}') {
695
+ //tag
696
+ items.f_item_lists.push(items_list)
697
+ }
698
+ }
699
+ }
700
+ }
701
+ }
702
+ } else {
703
+ let configItems = this.config[codata[device][item].f_device_type].items[items.f_item_name]
704
+ f_is_defect = items.f_is_defect
705
+ f_defect_level = items.level
706
+ f_item_value = items.f_item_value
707
+ let items_list = {
708
+ f_is_defect: f_is_defect,
709
+ f_item_value: f_item_value,
710
+ f_defect_level: f_defect_level,
711
+ f_create_time: Util.toStandardTimeString()
712
+ }
713
+ if (f_is_defect && f_item_value) {
714
+ items.f_is_defect = true
715
+ if (checkResults.result !== '有隐患') {
716
+ checkResults.result = '有隐患'
717
+ }
718
+ if (!this.checkResult.hasOwnProperty(items.f_item_name)) {
719
+ //tag
720
+ this.checkResult[items.f_item_name] = []
721
+ }
722
+
723
+ //tag
724
+ this.checkResult[items.f_item_name].push(f_item_value)
725
+
726
+ }
727
+ //tag)
728
+ //tag)
729
+ if (!items.f_item_lists) {
730
+ //tag
731
+ items.f_item_lists = []
732
+ if (JSON.stringify(items_list) != '{}') {
733
+ //tag
734
+ items.f_item_lists.push(items_list)
735
+ }
736
+ } else {
737
+ // items.f_item_lists[0].f_item_value = f_item_value
738
+ if (JSON.stringify(items_list) != '{}') {
739
+ //tag
740
+ //tag)
741
+ //tag)
742
+ //tag
743
+ items.f_item_lists.push(items_list)
744
+ }
745
+ }
746
+ }
747
+ if (hasOther !== '' && otherValue !== null) {
748
+ //tag
749
+ this.checkResult[hasOther].push(otherValue)
750
+ hasOther = ''
751
+ otherValue = null
752
+ }
753
+ items.f_item_value = ''
754
+ }
755
+ //tag)
756
+ this.f_devices.push(codata[device][item])
757
+ }
758
+ }
759
+ }
760
+ if (this.checkResult) {
761
+ for (let key in this.checkResult) {
762
+ if(typeof this.checkResult[key]=='function'){
763
+ continue
764
+ }
765
+ // 上次安检结果数据组织
766
+ //tag
767
+ //tag
768
+ let temp = {}
769
+ temp[key] = this.checkResult[key].join(',')
770
+ checkResults.data.push(temp)
771
+ // this.newcheckResult[key] = this.checkResult[key]
772
+ // checkResults.data.push(this.newcheckResult)
773
+ //tag)
774
+ // this.newcheckResult = {}
775
+ }
776
+ this.checkResult = {}
777
+ }
778
+ if (checkResults.data.length > 0) {
779
+ let msg = ''
780
+ for (let a = 0; a < checkResults.data.length; a++) {
781
+ for (let datumKey in checkResults.data[a]) {
782
+ msg += datumKey + ':' + checkResults.data[a][datumKey] + ';'
783
+ }
784
+ }
785
+ this.data.f_defect_text = msg
786
+ codata.f_defect_text = msg
787
+ }
788
+ codata.f_defect_content = JSON.stringify(checkResults)
789
+ this.data.f_defect_content = JSON.stringify(checkResults)
790
+ //tag
791
+ return codata
792
+ },
793
+ uploadCheckPaper(){
794
+ this.saveNoclick()
795
+ this.closely(false) // 保存本地,不删除录音文件停止录音
796
+ let errString = this.errorVerify()
797
+ if (errString) {
798
+ this.disableTimer()
799
+ this.$showMessage(errString)
800
+ return
801
+ } else {
802
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
803
+ this.$set('data.f_upload_time', Util.toStandardTimeString())
804
+ this.$set('data.f_upload_date', Util.toStandardTimeString())
805
+ this.data.f_complete = '已完成'
806
+ this.disableTimer()
807
+ }
808
+ this.onlySave = false
809
+ this.assemblyCodata()
810
+ let res = this.save()
811
+ },
812
+ //将数据组装提出
813
+ assemblyCodata(){
814
+ let codata = this.getAllDefect()
815
+ console.log(`codata类型 开始组装codeta数据-->${typeof codata}`)
816
+ console.log(`codata内容-->${JSON.stringify(codata)}`)
817
+ for (let key in codata) {
818
+ if (key.startsWith("device")) {
819
+ console.log('this.data.' + key + JSON.stringify(codata[key]))
820
+ codata[key] = []
821
+ }
822
+ }
823
+ codata.f_devices = this.f_devices
824
+ this.rowCodata=codata
825
+ },
826
+ save() {
827
+ let codata = this.getAllDefect()
828
+ for (let key in codata){
829
+ if(key.startsWith("device")){
830
+ codata[key] = []
831
+ }
832
+ }
833
+ codata.f_devices = this.f_devices
834
+ this.rowCodata = codata
835
+ let param = {
836
+ f_check_item_id: this.data.f_check_item_id,
837
+ f_checker_id: this.data.f_checker_id,
838
+ // row: codata
839
+ row: this.rowCodata
840
+ }
841
+ //tag)
842
+ let paramStr = JSON.stringify(param)
843
+ // 多长截断一次
844
+ let subLength = 800
845
+ for (let i = 0; i < paramStr.length; i += subLength) {
846
+ HostApp.param_cache(paramStr.substr(i, subLength))
847
+ }
848
+ HostApp.__this__ = this
849
+ HostApp.syncLogic({
850
+ // logic别名,key必须为logic
851
+ 'logic': '上传安检信息',
852
+ // 回调执行方法名,key必须为callback
853
+ 'callback': 'javascript:HostApp.__this__.uploadCallBack()',
854
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
855
+ // 执行回调方法传入key为backresult
856
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
857
+ 'backresult': 1
858
+ })
859
+ },
860
+ runSyncLogic(logic,callback,backresult){
861
+ HostApp.runSyncLogic({
862
+ 'logic': logic,
863
+ 'callback': callback,
864
+ 'backresult':backresult
865
+ })
866
+ },
867
+ logicWithHint(logic,data,callback,backresult){
868
+ HostApp.logicWithHint({
869
+ 'logic': logic,
870
+ 'callback': callback,
871
+ 'data': data,
872
+ 'backresult':backresult
873
+ })
874
+ },
875
+ uploadCallBack(jo){
876
+ let url = ""
877
+ if(Vue.config.safecheck != undefined) {
878
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
879
+ if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
880
+ url = Vue.config.safecheck.ApproveConfig.weixinurl
881
+ }
882
+ }
883
+ }
884
+ if(jo.state == 'ok'){
885
+ let res = JSON.parse(jo.result)
886
+ //tag)
887
+ //tag)
888
+ if(res.code == 200){
889
+ this.$set('data.f_paper_id', res.id)
890
+ this.isStrat=false
891
+ if(url != ""){
892
+ this.$resetpost(`${url}`,{data:WxResult})
893
+ }
894
+ if(this.isToRepair){
895
+ for (let device in this.data){
896
+ if(device.startsWith("device")){
897
+ this.data[device] = []
898
+ if(res.data.length > 0){
899
+ for(let i in res.data[0].f_devices){
900
+ if(this.data[device].length > 0){
901
+ if(this.data[device][0].f_device_type == res.data[0].f_devices[i].f_device_type){
902
+ this.data[device].push(res.data[0].f_devices[i])
903
+ res.data[0].f_devices.splice(i,1)
904
+ }
905
+ }else{
906
+ this.data[device].push(res.data[0].f_devices[i])
907
+ res.data[0].f_devices.splice(i,1)
908
+ }
909
+ }
910
+ }
911
+ }
912
+ }
913
+ this.todo()
914
+ }else{
915
+ this.$showMessage('上传成功!')
916
+ //tag
917
+ this.$dispatch('confirm')
918
+ // this.$back()
919
+ }
920
+ }else if(res.code == 309){
921
+ this.$showMessage('该安检单已作废!')
922
+ //tag
923
+ this.$dispatch('confirm')
924
+ }else if(res.code == 710){
925
+ this.$showMessage('上传照片失败,请检查网络是否正常!'+res.msg)
926
+ return
927
+ }else if(res.code == 711){
928
+ this.$showMessage('该安检单已被管理员调整,请联系管理员!')
929
+ return
930
+ }else if(res.code == 712){
931
+ this.$showMessage('网络异常,请重新上传,多次上传失败请联系管理员!')
932
+ return
933
+ }
934
+ else{
935
+ this.$showMessage('上传失败!')
936
+ }
937
+ }else {
938
+ this.$showMessage('网络异常,上传失败!')
939
+ }
940
+ this.onlySave = true
941
+ },
942
+ safecheckToRepairCallBack(jo){
943
+ //获取微信推送路径
944
+ if(jo.state == 'ok'){
945
+ let res = JSON.parse(jo.result)
946
+ //tag)
947
+ if(res.code == 200){
948
+ //tag
949
+ if(res.data.code == 200){
950
+ this.$showMessage('上传并转维修成功!')
951
+ }else{
952
+ this.$showMessage('上传并转维修成功,回写安检单失败!')
953
+ }
954
+ this.$dispatch('confirm')
955
+ // this.$back()
956
+ }else{
957
+ this.$showMessage('上传失败!')
958
+ this.onlySave = true
959
+ }
960
+ }else{
961
+ this.$showMessage('网络异常,上传失败!')
962
+ this.onlySave = true
963
+ }
964
+ },
965
+ todo(){
966
+ let gen = getRepairParam(this)
967
+ co(gen)
968
+ },
969
+ undo(){
970
+ this.showCheckToRepair = !this.showCheckToRepair
971
+ this.model.serviceacitivity[0].f_reciever = ''
972
+ this.model.serviceacitivity[0].f_meetunit = ''
973
+ this.model.f_repairtype = ''
974
+ this.meading = '转站点'
975
+ },
976
+ disableTimer() {
977
+ if(this.timer) {
978
+ window.clearTimeout(this.timer)
979
+ this.timer = null
980
+ }
981
+ },
982
+ S4() {
983
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
984
+ },
985
+ extend(initalObj, finalObj) {
986
+ var obj = finalObj || {};
987
+ for (var i in initalObj) {
988
+ var prop = initalObj[i];
989
+
990
+ // 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
991
+ if (prop === obj) {
992
+ continue;
993
+ }
994
+
995
+ if (typeof prop === 'object') {
996
+ if (obj[i]) {
997
+ this.extend(obj[i], prop)
998
+ } else {
999
+ obj[i] = prop;
1000
+ }
1001
+ }
1002
+ }
1003
+ return obj;
1004
+ },
1005
+ init () {
1006
+ this.data.isupdateplanitem = this.$appdata.getSingleValue('在线安检回更有计划') ? this.$appdata.getSingleValue('在线安检回更有计划') : 'false'
1007
+ this.data.f_SafeToRepair_id = ''
1008
+ this.data.ename = Vue.user.ename
1009
+ this.data.f_outlets = Vue.user.f_parentname
1010
+ this.data.f_meetunit = Vue.user.orgpathnames
1011
+ this.data.orgpathstr = Vue.user.orgpathstr
1012
+ this.data.f_check_item_id = ''
1013
+ this.data.f_check_plan_id = this.f_plan_id
1014
+ this.data.f_checker_id = Vue.user.id
1015
+ this.data.f_checker_name = Vue.user.name
1016
+ this.data.f_check_type = ''
1017
+ this.data.f_safecheck_type = ''
1018
+ this.data.f_subcompany = ''
1019
+ this.data.f_approved = ''
1020
+ this.data.f_repair_approved = ''
1021
+ this.data.f_no_checkplan = '无计划安检'
1022
+ this.data.f_approved = ''
1023
+ this.data.f_filialeid = Vue.user.orgid
1024
+ this.data.f_orgstr = ''
1025
+ this.data.version = ''
1026
+ this.data.f_check_version=''
1027
+ this.$set('data.f_meters', '')
1028
+ this.$set('data.f_userinfo_code', '')
1029
+ this.$set('data.f_entry_status', '入户')
1030
+ this.$set('data.f_safe_type', '已挂表未办卡安检')
1031
+ this.$set('data.f_usegas', '未使用')
1032
+ this.$set('data.f_state','')
1033
+ this.$set('data.f_source', this.source?this.source:'安检')
1034
+ this.$set('data.f_other_checker_name', '')
1035
+ this.$set('data.f_user_name', '')
1036
+ this.$set('data.f_onsite_time', Util.toStandardTimeString())
1037
+ this.$set('data.f_rent_phone', '')
1038
+ this.$set('data.f_user_phone', '')
1039
+ this.$set('data.f_userinfoid', '')
1040
+ this.$set('data.f_address', '')
1041
+ this.$set('data.f_card_id', '')
1042
+ this.$set('data.f_slice_area', '')
1043
+ this.$set('data.f_recheck_id', '')
1044
+ this.$set('rowCodata.f_recheck_id', '')
1045
+ this.$set('data.f_street','')
1046
+ this.$set('data.f_room', '')
1047
+ this.$set('data.f_building', '')
1048
+ this.$set('data.f_unit', '')
1049
+ this.$set('data.f_floor', '')
1050
+ this.$set('data.f_residential_area' , '')
1051
+ this.$set('data.f_idnumber', '')
1052
+ this.$set('data.f_comments', '')
1053
+ this.$set('data.f_userproperties', '')
1054
+ this.$set('data.f_client_evaluation', '满意')
1055
+ this.$set('data.f_userfiles_id', '')
1056
+ this.$set('data.f_valve_state', '')
1057
+ this.$set('data.f_off_valve_reason', '')
1058
+ this.$set('data.f_gas_guidelines', true)
1059
+ this.$set('data.f_safety_warning', true)
1060
+ this.$set('data.f_gas_manual', true)
1061
+ this.$set('data.f_no_gas_device', false)
1062
+ this.$set('data.f_close_valve', false)
1063
+ this.$set('data.f_unload_battery', false)
1064
+ this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1065
+ }
1066
+ },
1067
+ watch: {
1068
+ 'row' () {
1069
+ //tag
1070
+ this.copy()
1071
+ }
1072
+ },
1073
+ ready () {
1074
+ HostApp.startOrStopAudioClip("----",'停止并删除录音')
1075
+ //获取用户用气类型
1076
+ let useType=this.$appdata.getParam('用户用气类型')
1077
+ if(useType){
1078
+ for (let i = 0; i < useType.length; i++) {
1079
+ var obj={data:useType[i].value}
1080
+ this.selecData.push(obj)
1081
+ }
1082
+ }
1083
+ this.config['点火'].items['用户用气类型'].options = this.selecData
1084
+ this.tab=[]
1085
+ for (let i in this.config) {
1086
+ let n = this.config[i].index
1087
+ this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
1088
+ this.$set('data.' + 'device' + n, [])
1089
+ this.tabs[n-1] = {
1090
+ header: i,
1091
+ complete: 'safecheck-devices-temp',
1092
+ class: 'repair-details-class',
1093
+ number: n
1094
+ }
1095
+ }
1096
+ this.tabs.push({
1097
+ header: '拍照签名',complete:'paper-feedback-temp', class: 'outlay-class', props: null
1098
+ })
1099
+ this.faultshow.number = this.tabs.length
1100
+ this.init()
1101
+ this.$showMessage("为了保证服务质量,将会被全程录音!")
1102
+ let resse = this.record()
1103
+ this.tabSelect({
1104
+ "header": "信息填写",
1105
+ "complete": "safecheck-devices-temp",
1106
+ "class": "repair-details-class",
1107
+ "number": 1
1108
+ },0)
1109
+ },
1110
+ events: {
1111
+ 'tijiao': function () {
1112
+ this.confirm()
1113
+ }
1114
+ }
1115
+ }
1116
+ </script>
1117
+ <style lang="less">
1118
+ @import "../../../../src/bootstrap/less/variables.less";
1119
+ .noclickbut {
1120
+ pointer-events: none;
1121
+ }
1122
+ .tab-befor-img (@url) {
1123
+ content: '';
1124
+ background-image: url("@{url}");
1125
+ background-size: 20px;
1126
+ display: inline-block;
1127
+ margin-right: 8px;
1128
+ margin-top: 0.3em;
1129
+ height: 1.3em;
1130
+ width: 1.3em;
1131
+ vertical-align: -35%;
1132
+ }
1133
+
1134
+ @media screen and (min-width: 768px) {
1135
+ .android-repair-order > div > ul a {
1136
+ font-size: @font-size-h2;
1137
+ margin: 0.3em 0;
1138
+ }
1139
+ }
1140
+ .repair-details-class{
1141
+ &::before {
1142
+ .tab-befor-img("../../../assets/huneiweixiu1.png");
1143
+ }
1144
+ }
1145
+ .repair-info-class {
1146
+ &::before {
1147
+ .tab-befor-img("../../../assets/baoxiuxinxi1.png");
1148
+ }
1149
+ }
1150
+ .repair-user-info-class {
1151
+ &::before {
1152
+ .tab-befor-img("../../../assets/jibenxinxi1.png")
1153
+ }
1154
+ }
1155
+
1156
+ .door-service-class {
1157
+ &::before {
1158
+ .tab-befor-img("../../../assets/huneiweixiu1.png")
1159
+ }
1160
+ }
1161
+
1162
+ .pipeline-class {
1163
+ &::before {
1164
+ .tab-befor-img("../../../assets/guandao1.png")
1165
+ }
1166
+ }
1167
+
1168
+ .device-service-class {
1169
+ &::before {
1170
+ .tab-befor-img("../../../assets/shebeiweixiu1.png")
1171
+ }
1172
+ }
1173
+
1174
+ .trouble-removal-class {
1175
+ &::before {
1176
+ .tab-befor-img("../../../assets/shiguchuli.png")
1177
+ }
1178
+ }
1179
+
1180
+ .cooking-utensils-class {
1181
+ &::before {
1182
+ .tab-befor-img("../../../assets/zaoju1.png")
1183
+ }
1184
+ }
1185
+
1186
+ .outlay-class {
1187
+ &::before {
1188
+ .tab-befor-img("../../../assets/feiyong1.png")
1189
+ }
1190
+ }
1191
+
1192
+ .fault-all-class {
1193
+ &::before {
1194
+ .tab-befor-img("../../../assets/guzhanghuizong1.png")
1195
+ }
1196
+ }
1197
+ .photo-write-class {
1198
+ &::before {
1199
+ .tab-befor-img("../../../assets/zaoju.png")
1200
+ }
1201
+ }
1202
+ .delay-apply-class {
1203
+ &::before {
1204
+ .tab-befor-img("../../../assets/yonghubaoxiu.png")
1205
+ }
1206
+ }
1207
+
1208
+ .repair-back-class {
1209
+ &::before {
1210
+ .tab-befor-img("../../../assets/fanhui.png")
1211
+ }
1212
+ }
1213
+ .butt2 {
1214
+ display: inline;
1215
+ float: right;
1216
+ width: 10px;
1217
+ text-align: center;
1218
+ align-items:center;
1219
+ position: absolute;
1220
+ top:50%;
1221
+
1222
+ left:90%;
1223
+ transform: translate(-50%,-50%);
1224
+ }
1225
+ .linesty{
1226
+ display: inline-block;
1227
+ height:1px;
1228
+ width:100%;
1229
+ background:#d0d0d0;
1230
+ overflow:hidden;
1231
+ vertical-align: middle;
1232
+ }
1233
+ .spanboder{
1234
+ border-bottom:2px solid #499edf;
1235
+ padding-bottom: 8px
1236
+ }
1237
+ .app-botton {
1238
+ position:fixed;
1239
+ background: #87b2dd;
1240
+ right:8px;
1241
+ color: #FFF;
1242
+ padding: 8px;
1243
+ text-align: center;
1244
+ font-size: 1.2em;
1245
+ z-index: 10;
1246
+ opacity:0.5;
1247
+ bottom: 50px;
1248
+ margin-top: -10px;
1249
+ height: 40px;
1250
+ }
1251
+ .android-repair-order > div > ul a {
1252
+ font-size: 12px;
1253
+ color: #333333;
1254
+ padding: 13px 16px;
1255
+ }
1256
+ </style>