telephone-clients 4.0.0-1-10 → 4.0.0-1-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,914 @@
1
+ <template>
2
+ <div class="auto select-overspread form-horizontal repair-bg " style="padding-bottom:5px;" id="savePhonebut" >
3
+ <div class="bq-parent">
4
+ <blockquote class="blockquote">
5
+ <p>工单上传<a @click="$parent.mute()" style="float:right" href="javascript:void(0)" class="repair-mute-class"><img
6
+ src="../../../assets/novoice.png" width="25px;" alt=""><span style="margin-left:10px;color: #304A66">关闭声音</span></a>
7
+ </p>
8
+ </blockquote>
9
+ </div>
10
+ <div class="panel panel-default auto repair-info-content"
11
+ v-if="showhead && msg.serviceacitivity[0].f_result_status != '已完成'">
12
+ <div class="panel-body ">
13
+ <div class="row auto compatible">
14
+ <div class="row auto">
15
+ <div class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;" v-if="!show">
16
+ <div class="col-xs-3 col-sm-3 col-md-3">
17
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='confirm("已完成")'>
18
+ 工单完成
19
+ </button>
20
+ </div>
21
+ <div class="col-xs-3 col-sm-3 col-md-3" v-if="isNeedMaterial && !ischeck">
22
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='showmateria'>
23
+ 材料收费
24
+ </button>
25
+ </div>
26
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="sfbutten && !ischeck">
27
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='gotoOtherCharge'>
28
+ 工单收费
29
+ </button>
30
+ </div>
31
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="savebutten && !ischeck">
32
+ <button type="button" name="button" class="col-sm-3 btn btn-primary"
33
+ @click='workOrderSave'>
34
+ 临时保存
35
+ </button>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ <div class="panel panel-default auto repair-info-content"
43
+ v-if="msg.serviceacitivity[0].f_result_status == '已完成' && !show">
44
+ <div class="panel-body ">
45
+ <div class="row auto compatible">
46
+ <div class="row auto">
47
+ <div class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;" v-show="false">
48
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='saveCompeleted()'>
49
+ 保存
50
+ </button>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showNorepair">
57
+ <div>
58
+ <p><big><b>工单未完成</b></big></p>
59
+ </div>
60
+ <div class="row">
61
+ <div class="col-sm-12 form-group form-fix-width">
62
+ <label class="control-label">原因</label>
63
+ <textarea name="name" rows="2" class="form-control ver-textarea"
64
+ v-model="msg.serviceacitivity[0].f_reason"></textarea>
65
+ </div>
66
+ </div>
67
+ <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
68
+ </failure-edit>
69
+ <!--<div class="row">-->
70
+ <!--<div class="col-sm-12 form-group form-fix-width">-->
71
+ <!--<label class="control-label">选择站点</label>-->
72
+ <!--<v-select :value.sync="msg.serviceacitivity[0].f_department" :value-single="true"-->
73
+ <!--:options='repairers' placeholder='请选择站点'-->
74
+ <!--close-on-select></v-select>-->
75
+ <!--</div>-->
76
+ <!--</div>-->
77
+ <div class="form-group">
78
+ <button type="button" class="btn btn-default pull-right" @click='close'>取消</button>
79
+ <button type="button" class="btn btn-success pull-right" @click='confirm("未完成")'>确认</button>
80
+ </div>
81
+ </div>
82
+ <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showCannotrepair">
83
+ <div>
84
+ <p><big><b>无法完成</b></big></p>
85
+ </div>
86
+ <div class="row">
87
+ <div class="col-sm-12 form-group form-fix-width">
88
+ <label class="control-label">原因</label>
89
+ <textarea name="name" rows="2" class="form-control ver-textarea"
90
+ v-model="msg.serviceacitivity[0].f_reason"></textarea>
91
+ </div>
92
+ </div>
93
+ <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
94
+ </failure-edit>
95
+ <!--<div class="row">-->
96
+ <!--<div class="col-sm-12 form-group form-fix-width">-->
97
+ <!--<label class="control-label">选择站点</label>-->
98
+ <!--<v-select :value.sync="msg.serviceacitivity[0].f_department" :value-single="true"-->
99
+ <!--:options='repairers' placeholder='请选择站点'-->
100
+ <!--close-on-select></v-select>-->
101
+ <!--</div>-->
102
+ <!--</div>-->
103
+ <div class="row">
104
+ <div class="col-sm-12">
105
+ <button type="button" class="btn btn-default pull-right" @click='close1'>取消</button>
106
+ <button type="button" class="btn btn-success pull-right" @click='cannotRepaer()'>确认</button>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ <modal :show.sync="showmaterial" backdrop="false" style="overflow: scroll;height: 100%">
112
+ <header slot="modal-header" class="modal-header text-center">
113
+ <button type="button" class="close" @click="close2"><span>&times;</span></button>
114
+ <h4 class="modal-title">添加材料</h4>
115
+ </header>
116
+ <article slot="modal-body">
117
+ <appinstallation-material v-if="showmaterial" :selectdata = "selectdata"></appinstallation-material>
118
+ </article>
119
+ <footer slot="modal-footer"></footer>
120
+ </modal>
121
+ </template>
122
+ <script>
123
+ import Vue from 'vue'
124
+ import * as Util from '../../../components/Util'
125
+ import {HttpResetClass} from 'vue-client'
126
+ import FailureEdit from '../../../components/pc/FailureEdit'
127
+ import AppInstallationMaterial from './AppInstallationMaterial'
128
+ import $ from "jquery"
129
+
130
+ export default {
131
+ title: '故障汇总',
132
+ props: {
133
+ msg: {
134
+ type: Object
135
+ },
136
+ savevalid: {
137
+ type: Object
138
+ },
139
+ model: {
140
+ type: Object
141
+ },
142
+ show: {
143
+ type: Boolean,
144
+ default: false
145
+ },
146
+ row: {
147
+ type: Object
148
+ },
149
+ system: '',
150
+ parentPage:'',
151
+ ischeck:{
152
+ type: Boolean,
153
+ default: false
154
+ }
155
+ },
156
+ data() {
157
+ return {
158
+ savebutten:false, // 工单保存按钮
159
+ sfbutten:false, //收费按钮
160
+ fileName: '',
161
+ datajson: '',
162
+ norepair: '',
163
+ showNorepair: false,
164
+ showCannotrepair: false,
165
+ showhead: true,
166
+ repairers : this.$appdata.getParam('站点管理员'),
167
+ config:{},
168
+ othercharge_id: '',
169
+ showmaterial:false,
170
+ selectdata:{},
171
+ isNeedMaterial: this.$appdata.getSingleValue('材料收费') == '是',
172
+ }
173
+ },
174
+ methods: {
175
+ saveNoclick() {
176
+ // 禁用点击事件
177
+ $("#savePhonebut").addClass("noclickbut");
178
+ //tag
179
+
180
+ // 5秒后启用点击事件
181
+ setTimeout(function(){
182
+ $("#savePhonebut").removeClass("noclickbut");
183
+ },5000);
184
+ },
185
+ // 停止录音
186
+ closely(isdelete){
187
+ try {
188
+ var startOrStopAudioClipStr;
189
+ if (isdelete===true) {
190
+ //tag
191
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止并删除录音') //停止并删除录音
192
+ }else {
193
+ //tag
194
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止录音') //停止录音
195
+ }
196
+ if (startOrStopAudioClipStr.code == 200) {
197
+ //tag
198
+ return true;
199
+ }else {
200
+ return false;
201
+ }
202
+ } catch (e) {
203
+ console.error("关闭录音方法异常")
204
+ console.error(e)
205
+ return false;
206
+ }
207
+ },
208
+ /* // 录音方法
209
+ record() {
210
+ //tag
211
+ let fileName
212
+ if (!this.f_recording1_path) {
213
+ fileName = Util.guid() + '.amr'
214
+ } else {
215
+ fileName = Util.getFileName(this.f_recording1_path)
216
+ }
217
+ //HostApp.__this__ = this
218
+ /!*调用无限制录音模块*!/
219
+ let startOrStopState = HostApp.startOrStopAudioClip(fileName,"开始录音")
220
+ //tag
221
+ if (startOrStopState.code == 200) {
222
+ this.f_recording1_path = "file:///storage/emulated/0/safecheck/" + fileName
223
+ console.log("录音文件地址"+this.f_recording1_path)
224
+ //tag
225
+ return true;
226
+ }else {
227
+ return false;
228
+ }
229
+ },*/
230
+ // 工单收费
231
+ async gotoOtherCharge() {
232
+ //tag
233
+ let con = {
234
+ conndition: ` f_userinfo_id = '${this.msg.f_userinfo_id}' `
235
+ }
236
+ let http1 = new HttpResetClass()
237
+ let row = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/onlinequeryuser`, {data: con},{
238
+ resolveMsg: '物联网收费成功!!',
239
+ rejectMsg: '物联网收费出错!!!'
240
+ })
241
+ //tag))
242
+ // 去其他收费界面
243
+ let _this = this
244
+ var pardate = {
245
+ _this:_this,
246
+ title:'其他收费',
247
+ safe:false
248
+ }
249
+ this.closely(false)
250
+ _this.$dispatch('gotoson',pardate)
251
+ //tag
252
+ _this.$goto('other_charge', {row: row}, 'self',_this.payback)
253
+ // _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
254
+ },
255
+ payback(msg) {
256
+ if (msg) {
257
+ //tag)
258
+ this.othercharge_id = msg
259
+ }else {
260
+ //tag
261
+ this.$showMessage('支付失败!')
262
+ }
263
+ },
264
+ // 工单结案
265
+ finishRepair(){
266
+ var _this = this
267
+ this.$showMessage('请确认该工单结案!', ['confirm', 'cancel']).then((res) => {
268
+ if (res === 'confirm') {
269
+ this.closely(false)
270
+ _this.confirm("结案")
271
+ }
272
+ })
273
+ },
274
+ deleteEmptyProperty(object){
275
+ for (var i in object) {
276
+ var value = object[i];
277
+ if (typeof value === 'object') {
278
+ if (Array.isArray(value)) {
279
+ if (value.length == 0) {
280
+ delete object[i];
281
+ //tag;
282
+ continue;
283
+ }
284
+ }
285
+ this.deleteEmptyProperty(value);
286
+ if (this.isEmpty(value)) {
287
+ //tag;
288
+ delete object[i];
289
+ //tag;
290
+ }
291
+ } else {
292
+ if (value === '' || value === null || value === undefined) {
293
+ delete object[i];
294
+ //tag;
295
+ } else {
296
+ //tag;
297
+ }
298
+ }
299
+ }
300
+ },
301
+ isEmpty(object) {
302
+ for (var name in object) {
303
+ return false;
304
+ }
305
+ return true;
306
+ },
307
+ // 从图片中删除
308
+ remove(row) {
309
+ this.$androidUtil.delfile(row.android_file)
310
+ let pos = this.model.imgs.findIndex((value) => {
311
+ return value === row
312
+ })
313
+ this.model.imgs.splice(pos, 1)
314
+ },
315
+ // fileName: 回传文件名,传入的带安卓路径url
316
+ // prop: 传入的字段名,没做改动
317
+ cameraCallBack(prop, fileName) {
318
+ // 当前this只能通过HostApp.__tis__获取
319
+ let self = this.$androidUtil.getCallBack(this)
320
+ // 添加新图片
321
+ self.model.imgs.push({
322
+ android_file: self.fileName,
323
+ path: fileName
324
+ })
325
+ },
326
+ takePic() {
327
+ let prop = 'repair'
328
+ let idx = 'aofeng'
329
+ this.fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
330
+ this.$sandroidUtil.takePic(this, this.cameraCallBack, this.fileName)
331
+ },
332
+ newFailure(value) {
333
+ this.msg.serviceacitivity[0].failure = value
334
+ },
335
+ noRepair() {
336
+ this.showhead = false
337
+ this.showNorepair = true
338
+ this.closely()
339
+ HostApp.backupDatabase()
340
+ },
341
+ cannotRepair() {
342
+ this.showhead = false
343
+ this.showCannotrepair = true
344
+ this.closely()
345
+ // falg:0, 表示第一次上传,批量上传时,flag:1
346
+ // this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
347
+ },
348
+ // 测试环境下模拟上传失败
349
+ fail(param) {
350
+ this.msg.serviceacitivity[0].f_result_status = param
351
+ this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg, test: true})
352
+ },
353
+ async workOrderSave(){
354
+ this.norepair = false
355
+ if (this.hunei && this.hunei.details) {
356
+ for (let i = 0; i < this.hunei.details.length; i++) {
357
+ if (this.hunei.details[i].f_project === '未维修') {
358
+ this.norepair = true
359
+ }
360
+ }
361
+ }
362
+ // 用户基本信息转字符串
363
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
364
+ this.msg.serviceacitivity[0].f_result_status = '工单保存'
365
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
366
+ this.closely(true)
367
+ console.log("保存本地2"+this.msg.f_recording1_path)
368
+ this.deleteEmptyProperty(this.msg)
369
+ let dataone = {
370
+ row: this.msg
371
+ }
372
+ let paramStr = JSON.stringify(dataone)
373
+ // 多长截断一次
374
+ let subLength = 1000
375
+ for (let i = 0; i < paramStr.length; i += subLength) {
376
+ HostApp.param_cache(paramStr.slice(i, i + subLength))
377
+ }
378
+ HostApp.__this__ = this
379
+ HostApp.syncLogic({
380
+ // logic别名,key必须为logic
381
+ 'logic': 'workOrderSave',
382
+ // 回调执行方法名,key必须为callback
383
+ 'callback': 'javascript:HostApp.__this__.localSaveCallBack()',
384
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
385
+ // 执行回调方法传入key为backresult
386
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
387
+ 'backresult': 1
388
+ })
389
+ },
390
+ localSaveCallBack(res){
391
+ if(res.state == 'ok'){
392
+ let result = JSON.parse(res.result)
393
+ if(result.result == '成功'){
394
+ this.$showMessage('工单保存成功!', ['confirm'])
395
+ }else{
396
+ this.$showMessage(`工单保存失败! ${result.errMsg}`, ['confirm'])
397
+ }
398
+ this.$dispatch('tijiao')
399
+ }else {
400
+ this.$showMessage(`保存提交失败!`, ['confirm'])
401
+ }
402
+ },
403
+ // 工单上传
404
+ async confirm(param) {
405
+ this.msg.f_dealtype = this.msg.serviceacitivity[0].f_dealtype || null
406
+ /*//tag)
407
+ if(!this.model.ischange) {
408
+ this.$showMessage('您还为进行换表操作,工单为完成!,')
409
+ return
410
+ }*/
411
+
412
+ this.norepair = false
413
+ if (this.hunei && this.hunei.details) {
414
+ for (let i = 0; i < this.hunei.details.length; i++) {
415
+ if (this.hunei.details[i].f_project === '未维修') {
416
+ this.norepair = true
417
+ }
418
+ }
419
+ }
420
+ if(param != '结案'&& (this.msg.f_workorder_type == '置换通气单'||this.msg.f_workorder_type == '安装单')) {
421
+ // 检测验证是否必填
422
+ var isfinish = this.checkismust()
423
+ if(isfinish.ifmust){
424
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
425
+ return
426
+ }
427
+ // 检测签名是否完成
428
+ // if(!(this.msg.serviceacitivity[0].f_signname)) {
429
+ // this.$showMessage(`请完成客户签名!`, ['confirm'])
430
+ // return
431
+ // }
432
+ // 检测置换作业是否有异常
433
+ var yinhuanflag = this.checkzhihuanwork()
434
+ if(!yinhuanflag){
435
+ var resy = await this.$showMessage('是否确认该户置换作业异常?', ['confirm', 'cancel'])
436
+ if(resy == 'cancel'){
437
+ return
438
+ }
439
+ this.msg.f_is_abnormal = '异常'
440
+ this.msg.serviceacitivity[0].f_is_abnormal = '异常'
441
+ }
442
+ if(!this.msg.serviceacitivity[0].f_signname) {
443
+ this.$showMessage(`请完成客户签名!`, ['confirm'])
444
+ return
445
+ }
446
+ // 检测置换照片是否已拍
447
+ // var imgflag = this.checkzhihuanimg()
448
+ // if(!(imgflag.check)){
449
+ // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
450
+ // return
451
+ // }
452
+ }
453
+ else if(this.msg.f_workorder_type == '报修单' && param != '结案'){
454
+ // 兼容之前模式 做线上线下处理选择
455
+ let checkmust = true
456
+ if(this.msg.serviceacitivity[0].f_dealtype && this.msg.serviceacitivity[0].f_dealtype == '线上处理'){
457
+ checkmust = false
458
+ }
459
+ if(checkmust){
460
+ let isfinish = this.checkismust()
461
+ if(isfinish.ifmust){
462
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
463
+ return
464
+ }
465
+ if(!(this.msg.serviceacitivity[0].f_signname) && Vue.config.telephone.FaultAll.signature?Vue.config.telephone.FaultAll.signature:false) {
466
+ this.$showMessage(`请完成客户签名!`, ['confirm'])
467
+ return
468
+ }
469
+ let imgflag = this.checkzhihuanimg()
470
+ if(!(imgflag.check)){
471
+ this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
472
+ return
473
+ }
474
+ }
475
+ }
476
+
477
+ // }
478
+ // 用户基本信息转字符串
479
+ // if ((this.savevalid.uservalid && this.savevalid.doorvalid) || this.norepair || this.liGuanWeiXou || this.sheBeiRepairAll) {
480
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
481
+ this.msg.serviceacitivity[0].f_result_status = param
482
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
483
+ this.msg.loginid = Vue.user.id
484
+ this.msg.ischeck = this.ischeck
485
+ // if (!this.savevalid.changetable && this.model.servicerepair && this.model.servicerepair[0].f_if_change) {
486
+ // this.$showMessage('未上传收费!', ['confirm'])
487
+ // } else {
488
+ this.deleteEmptyProperty(this.msg)
489
+ //tag
490
+ this.closely(false) // 保存本地,不删除录音文件停止录音
491
+ // this.msg.f_recording1_path = this.data.f_recording1_path
492
+ console.log("保存本地", this.msg.f_recording1_path)
493
+ //tag)
494
+ this.saveNoclick()
495
+ //tag)
496
+ let dataone = { flag: 0, row: this.msg }
497
+ //tag)
498
+ let paramStr = JSON.stringify(dataone)
499
+ // 多长截断一次
500
+ let subLength = 1000
501
+ for (let i = 0; i < paramStr.length; i += subLength) {
502
+ HostApp.param_cache(paramStr.slice(i, i + subLength))
503
+ }
504
+ HostApp.__this__ = this
505
+ HostApp.syncLogic({
506
+ // logic别名,key必须为logic
507
+ 'logic': 'upload',
508
+ // 回调执行方法名,key必须为callback
509
+ 'callback': 'javascript:HostApp.__this__.uploadCallback()',
510
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
511
+ // 执行回调方法传入key为backresult
512
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
513
+ 'backresult': 1
514
+ })
515
+ },
516
+ uploadCallback(res){
517
+ let _this = this
518
+ if(res.state == 'ok'){
519
+ let result = JSON.parse(res.result)
520
+ if (result.result === '成功' ) {
521
+ const goSafe = this.$appdata.getSingleValue('维修后进行安检')
522
+ if (goSafe){
523
+ this.$showMessage(`是否前往安检`, ['confirm', 'cancel']).then((res) => {
524
+ let info = this.msg
525
+ if (res === 'confirm') {
526
+ if (!this.msg.f_userinfo_id){
527
+ var pardate = {
528
+ _this:this.$parent.$parent,
529
+ tittle:'在线安检',
530
+ safe:false
531
+ }
532
+ this.$dispatch('gotoson',pardate)
533
+ this.$parent.$parent.$goto('add-plan-item', {item: info}, 'self', function (){
534
+ _this.$parent.$parent.$dispatch('confirm')
535
+ _this.$parent.$parent.$dispatch('tijiao')
536
+ }
537
+ )
538
+ }else {
539
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/查询计划项表信息`,{data:{f_userid:this.msg.f_userinfo_id}}).then((response)=>{
540
+ if(response.data.length!=1){
541
+ this.$showMessage("当前用户有多条表信息,请联系管理员核实进行处理!")
542
+ }else {
543
+ info.f_userinfoid = this.msg.f_userinfo_id
544
+ info.f_userinfo_id = this.msg.f_userinfo_id
545
+ info['f_plan_meters'] = response.data
546
+ info.f_no_checkplan = '无计划安检'
547
+ info.show_temporary_save = 'no'
548
+ var pardate = {
549
+ _this:this.$parent.$parent,
550
+ tittle:'安检详情',
551
+ safe:false
552
+ }
553
+ this.$dispatch('gotoson',pardate)
554
+ this.$parent.$parent.$goto('safecheck-order-v', {item: info, role: 'inspect',parentPage:'CurrentCreate'}, 'self', function (){
555
+ _this.$parent.$parent.$dispatch('confirm')
556
+ _this.$parent.$parent.$dispatch('tijiao')
557
+ }
558
+ )
559
+ }
560
+ })
561
+ }
562
+ }else {
563
+ this.$dispatch('tijiao')
564
+ }
565
+ })
566
+ }else{
567
+ this.$dispatch('tijiao')
568
+ }
569
+ } else {
570
+ this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
571
+ }
572
+ this.showNorepair = false
573
+ this.showCannotrepair = false
574
+ }else {
575
+ this.$showMessage(`保存提交失败!`, ['confirm'])
576
+ }
577
+ },
578
+ // 检验是否必填 返回 error:{msg:'111',ismust:true}
579
+ checkismust(){
580
+ var error ={
581
+ msg:'',
582
+ ifmust:false
583
+ }
584
+ for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
585
+ for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
586
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
587
+ break;
588
+ }
589
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].f_is_must == 'true' && this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'picture' && this.msg.serviceacitivity[0].servicerepair[i].imgs.length == 0){
590
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
591
+ error.ifmust = true
592
+ return error
593
+ }
594
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].f_is_must == 'true' && !(this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content) && this.msg.serviceacitivity[0].servicerepair[i].details[j].type != 'picture' ){
595
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
596
+ error.ifmust = true
597
+ return error
598
+ }
599
+ if(this.msg.f_source == '安检' && this.msg.serviceacitivity[0].servicerepair[i].details[j].f_defect_id && this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '已处理'&& !this.msg.serviceacitivity[0].servicerepair[i].details[j].f_first_repairimg){
600
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}的维修照片`
601
+ error.ifmust = true
602
+ return error
603
+ }
604
+ if(this.msg.f_source == '安检' && this.msg.serviceacitivity[0].servicerepair[i].details[j].f_defect_id && !this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content){
605
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
606
+ error.ifmust = true
607
+ return error
608
+ }
609
+ }
610
+ }
611
+ return error
612
+ },
613
+ // checkzhihuanwork 检测置换作业是否正常
614
+ checkzhihuanwork(){
615
+ var isstatus = true
616
+ if(this.zhihuan){
617
+ for(var i = 0;i<this.zhihuan.details.length;i++){
618
+ if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
619
+ if(this.zhihuan.details[i].f_status == 'false'){
620
+ isstatus = false
621
+ break;
622
+ }
623
+ }
624
+ }
625
+ }
626
+ return isstatus
627
+ },
628
+ checkzhihuanimg(){
629
+ var isstatus = {
630
+ check: true,
631
+ title:''
632
+ }
633
+ if(Vue.config.telephone.Outlay.data != undefined){
634
+ let checkimgs = ''
635
+ //tag
636
+ //tag+'22222222222222222')
637
+ if(this.service.f_user_type == '民用'){
638
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
639
+ }else{
640
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
641
+ }
642
+ if(checkimgs.length>0){
643
+ for(var i =0;i<checkimgs.length;i++){
644
+ var checkimgstype = checkimgs[i].title
645
+ if(checkimgs[i].checkmust){
646
+ var flag = false
647
+ for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
648
+ if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
649
+ flag = true
650
+ break;
651
+ }
652
+ }
653
+ if(!flag){
654
+ isstatus.check = false
655
+ isstatus.title = checkimgstype
656
+ break;
657
+ }
658
+ }
659
+ }
660
+ }
661
+ }
662
+ return isstatus
663
+ },
664
+ checkservice(){
665
+ // 1.先判断灶具
666
+ if(this.zaoju){
667
+ var iszaoju = false
668
+ for(var i = 0;i<this.zaoju.details.length;i++){
669
+ if(this.zaoju.details[i].f_project == '有无灶具设备'){
670
+ if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
671
+ iszaoju = true
672
+ break;
673
+ }
674
+ }
675
+ }
676
+ if(iszaoju){
677
+ for(var i = 0;i<this.zaoju.details.length;i++){
678
+ if(this.zaoju.details[i].type == 'picture'){
679
+ //tag
680
+ //tag
681
+ if(this.zaoju.imgs.length == 0){
682
+ this.$showMessage('灶具设备未拍照!', ['confirm'])
683
+ return false
684
+ }
685
+ }else{
686
+ if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
687
+ this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
688
+ return false
689
+ }
690
+ }
691
+ }
692
+ }
693
+ }
694
+ // 2.判断热水器
695
+ if(this.reshuiqi){
696
+ var isreshuiqi = false
697
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
698
+ if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
699
+ if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
700
+ isreshuiqi = true
701
+ break;
702
+ }
703
+ }
704
+ }
705
+ if(isreshuiqi){
706
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
707
+ if(this.reshuiqi.details[i].type == 'picture'){
708
+ if(this.reshuiqi.imgs.length == 0){
709
+ this.$showMessage('热水器设备未拍照!', ['confirm'])
710
+ return false
711
+ }
712
+ }else{
713
+ if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
714
+ this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
715
+ return false
716
+ }
717
+ }
718
+ }
719
+ }
720
+ }
721
+ // 3.判断壁挂炉
722
+ if(this.bigualu){
723
+ var isbigualu = false
724
+ for(var i = 0;i<this.bigualu.details.length;i++){
725
+ if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
726
+ if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
727
+ isbigualu = true
728
+ break;
729
+ }
730
+ }
731
+ }
732
+ if(isbigualu){
733
+ for(var i = 0;i<this.bigualu.details.length;i++){
734
+ if(this.bigualu.details[i].type == 'picture'){
735
+ if(this.bigualu.imgs.length == 0){
736
+ this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
737
+ return false
738
+ }
739
+ }else{
740
+ if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
741
+ this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
742
+ return false
743
+ }
744
+ }
745
+ }
746
+ }
747
+ }
748
+ return true
749
+ },
750
+ cannotRepaer() {
751
+ this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
752
+ this.msg.loginid = Vue.user.id
753
+ let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
754
+ if (result.result === '成功') {
755
+ this.$showMessage('保存提交成功!', ['confirm'])
756
+ } else {
757
+ this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
758
+ }
759
+ this.showNorepair = false
760
+ this.showCannotrepair = false
761
+ this.$dispatch('tijiao')
762
+ },
763
+ saveCompeleted() {
764
+ this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
765
+ this.closely(false) // 保存本地,不删除录音文件停止录音
766
+ this.$androidUtil.bzLogic('SaveCompeleted', { row: this.msg})
767
+ },
768
+ sortDetais(result, type) {
769
+ let door = Object.assign({}, result)
770
+ door.details = []
771
+ for (let i = 0; i < result.details.length; i++) {
772
+ if (typeof (result.details[i].f_contentmessage) === 'object') {
773
+ for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
774
+ if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
775
+ let k = result.details[i].f_contentmessage[j].indexOf('-')
776
+ let newObj = {}
777
+ newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
778
+ newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
779
+ newObj.f_project = result.details[i].f_project
780
+ newObj.f_type = type
781
+ door.details.push(newObj)
782
+ }
783
+ }
784
+ }
785
+ if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
786
+ // //tag
787
+ for (let l = 0; l < result.details[i].f_content.length; l++) {
788
+ let new0bj = {}
789
+ new0bj.f_content = result.details[i].f_content[l]
790
+ new0bj.f_project = result.details[i].f_project
791
+ new0bj.f_type = 'a'
792
+ door.details.push(new0bj)
793
+ }
794
+ }
795
+ if (typeof(result.details[i].f_content) === 'string') {
796
+ door.details.push(result.details[i])
797
+ }
798
+ }
799
+ return door
800
+ },
801
+ close() {
802
+ this.showhead = true
803
+ this.showNorepair = false
804
+ }
805
+ ,
806
+ close1() {
807
+ this.showhead = true
808
+ this.showCannotrepair = false
809
+ },
810
+ showmateria(){
811
+ this.selectdata = {
812
+ f_process_id :this.msg.f_processid,
813
+ model:this.msg
814
+ }
815
+ console.log("传递数据",this.msg)
816
+ this.showmaterial = true
817
+ },
818
+ close2(){
819
+ this.showmaterial = false
820
+ this.selectdata ={}
821
+ }
822
+ },
823
+ async ready () {
824
+ this.savebutten = Vue.config2.telephone.FaultAll.savebutten
825
+ this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
826
+ },
827
+ computed: {
828
+ stateNoRepair() {
829
+ return this.msg.serviceacitivity.find((row) => {
830
+ return row.f_result_status === '未维修'
831
+ })
832
+ },
833
+ hunei() {
834
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
835
+ return row.f_type === '户内维修' // 换表
836
+ })
837
+ return this.sortDetais(result, 'a')
838
+ },
839
+ hitchAll() {
840
+ let hitchMsg = []
841
+ let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
842
+ return row.f_type === '户内维修' // 户内维修
843
+ })
844
+ this.obj.details.forEach((row) => {
845
+ hitchMsg.push(row)
846
+ })
847
+ return hitchMsg
848
+ },
849
+ gaiGuan() {
850
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
851
+ // return row.f_service_type === '改管'
852
+ return row.f_type === '改管'
853
+ })
854
+ },
855
+ zhihuan() {
856
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
857
+ // return row.f_service_type === '改管'
858
+ return row.f_type === '置换作业'
859
+ })
860
+ },
861
+ zaoju() {
862
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
863
+ // return row.f_service_type === '立管维修'
864
+ return row.f_type === '灶具信息'
865
+ })
866
+ },
867
+ reshuiqi() {
868
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
869
+ // return row.f_service_type === '立管维修'
870
+ return row.f_type === '热水器信息'
871
+ })
872
+ },
873
+ bigualu() {
874
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
875
+ // return row.f_service_type === '立管维修'
876
+ return row.f_type === '壁挂炉信息'
877
+ })
878
+ },
879
+ sanhuanzhuang() {
880
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
881
+ // return row.f_service_type === '立管维修'
882
+ return row.f_type === '散户安装'
883
+ })
884
+ },
885
+ sheBeiRepairAll() {
886
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
887
+ return row.f_type === '设备维修' // 换表
888
+ })
889
+ //tag)
890
+ return this.sortDetais(result, 'b')
891
+ },
892
+ zaoJuRepairAll() {
893
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
894
+ return row.f_type === '灶具维修' // 换表
895
+ })
896
+ return this.sortDetais(result, 'c')
897
+ },
898
+ troubleDeal() {
899
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
900
+ return row.f_type === '事故处理'
901
+ })
902
+ }
903
+ },
904
+ components: {
905
+ 'failure-edit': FailureEdit,
906
+ 'appinstallation-material': AppInstallationMaterial
907
+ }
908
+ }
909
+ </script>
910
+ <style scoped>
911
+ .pd-top {
912
+ padding-top: 7px;
913
+ }
914
+ </style>