telephone-clients 3.0.113 → 3.0.114

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,852 @@
1
+ <template>
2
+ <div class="auto select-overspread form-horizontal repair-bg " style="padding-bottom:5px;">
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">
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">
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">
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
+ <charges-list v-if="showmaterial" :selectdata = "selectdata"></charges-list>
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 ChargesList from './chargesList'
128
+ export default {
129
+ title: '故障汇总',
130
+ props: {
131
+ msg: {
132
+ type: Object
133
+ },
134
+ savevalid: {
135
+ type: Object
136
+ },
137
+ model: {
138
+ type: Object
139
+ },
140
+ show: {
141
+ type: Boolean,
142
+ default: false
143
+ },
144
+ row: {
145
+ type: Object
146
+ },
147
+ system: '',
148
+ parentPage:''
149
+ },
150
+ data() {
151
+ return {
152
+ savebutten:false, // 工单保存按钮
153
+ sfbutten:false, //收费按钮
154
+ fileName: '',
155
+ datajson: '',
156
+ norepair: '',
157
+ showNorepair: false,
158
+ showCannotrepair: false,
159
+ showhead: true,
160
+ repairers : this.$appdata.getParam('站点管理员'),
161
+ config:{},
162
+ othercharge_id: '',
163
+ showmaterial:false,
164
+ selectdata:{},
165
+ isNeedMaterial: this.$appdata.getSingleValue('材料收费') == '是',
166
+ }
167
+ },
168
+ methods: {
169
+ // 停止录音
170
+ closely(isdelete){
171
+ try {
172
+ var startOrStopAudioClipStr;
173
+ if (isdelete===true) {
174
+ //tag
175
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止并删除录音') //停止并删除录音
176
+ }else {
177
+ //tag
178
+ startOrStopAudioClipStr= HostApp.startOrStopAudioClip("----",'停止录音') //停止录音
179
+ }
180
+ if (startOrStopAudioClipStr.code == 200) {
181
+ //tag
182
+ return true;
183
+ }else {
184
+ return false;
185
+ }
186
+ } catch (e) {
187
+ console.error("关闭录音方法异常")
188
+ console.error(e)
189
+ return false;
190
+ }
191
+ },
192
+ /* // 录音方法
193
+ record() {
194
+ //tag
195
+ let fileName
196
+ if (!this.f_recording1_path) {
197
+ fileName = Util.guid() + '.amr'
198
+ } else {
199
+ fileName = Util.getFileName(this.f_recording1_path)
200
+ }
201
+ //HostApp.__this__ = this
202
+ /!*调用无限制录音模块*!/
203
+ let startOrStopState = HostApp.startOrStopAudioClip(fileName,"开始录音")
204
+ //tag
205
+ if (startOrStopState.code == 200) {
206
+ this.f_recording1_path = "file:///storage/emulated/0/safecheck/" + fileName
207
+ console.log("录音文件地址"+this.f_recording1_path)
208
+ //tag
209
+ return true;
210
+ }else {
211
+ return false;
212
+ }
213
+ },*/
214
+ // 工单收费
215
+ async gotoOtherCharge() {
216
+ //tag
217
+ let con = {
218
+ conndition: ` f_userinfo_id = '${this.msg.f_userinfo_id}' and f_table_state = '正常' `
219
+ }
220
+ let http1 = new HttpResetClass()
221
+ let row = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/onlinequeryuser`, {data: con},{
222
+ resolveMsg: '物联网收费成功!!',
223
+ rejectMsg: '物联网收费出错!!!'
224
+ })
225
+ //tag))
226
+ // 去其他收费界面
227
+ let _this = this
228
+ var pardate = {
229
+ _this:_this,
230
+ title:'其他收费',
231
+ safe:false
232
+ }
233
+ this.closely(false)
234
+ _this.$dispatch('gotoson',pardate)
235
+ //tag
236
+ _this.$goto('other_charge', {row: row}, 'self',_this.payback)
237
+ // _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
238
+ },
239
+ payback(msg) {
240
+ if (msg) {
241
+ //tag)
242
+ this.othercharge_id = msg
243
+ }else {
244
+ //tag
245
+ this.$showMessage('支付失败!')
246
+ }
247
+ },
248
+ // 工单结案
249
+ finishRepair(){
250
+ var _this = this
251
+ this.$showMessage('请确认该工单结案!', ['confirm', 'cancel']).then((res) => {
252
+ if (res === 'confirm') {
253
+ this.closely(false)
254
+ _this.confirm("结案")
255
+ }
256
+ })
257
+ },
258
+ deleteEmptyProperty(object){
259
+ for (var i in object) {
260
+ var value = object[i];
261
+ if (typeof value === 'object') {
262
+ if (Array.isArray(value)) {
263
+ if (value.length == 0) {
264
+ delete object[i];
265
+ //tag;
266
+ continue;
267
+ }
268
+ }
269
+ this.deleteEmptyProperty(value);
270
+ if (this.isEmpty(value)) {
271
+ //tag;
272
+ delete object[i];
273
+ //tag;
274
+ }
275
+ } else {
276
+ if (value === '' || value === null || value === undefined) {
277
+ delete object[i];
278
+ //tag;
279
+ } else {
280
+ //tag;
281
+ }
282
+ }
283
+ }
284
+ },
285
+ isEmpty(object) {
286
+ for (var name in object) {
287
+ return false;
288
+ }
289
+ return true;
290
+ },
291
+ // 从图片中删除
292
+ remove(row) {
293
+ this.$androidUtil.delfile(row.android_file)
294
+ let pos = this.model.imgs.findIndex((value) => {
295
+ return value === row
296
+ })
297
+ this.model.imgs.splice(pos, 1)
298
+ },
299
+ // fileName: 回传文件名,传入的带安卓路径url
300
+ // prop: 传入的字段名,没做改动
301
+ cameraCallBack(prop, fileName) {
302
+ // 当前this只能通过HostApp.__tis__获取
303
+ let self = this.$androidUtil.getCallBack(this)
304
+ // 添加新图片
305
+ self.model.imgs.push({
306
+ android_file: self.fileName,
307
+ path: fileName
308
+ })
309
+ },
310
+ takePic() {
311
+ let prop = 'repair'
312
+ let idx = 'aofeng'
313
+ this.fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
314
+ this.$sandroidUtil.takePic(this, this.cameraCallBack, this.fileName)
315
+ },
316
+ newFailure(value) {
317
+ this.msg.serviceacitivity[0].failure = value
318
+ },
319
+ noRepair() {
320
+ this.showhead = false
321
+ this.showNorepair = true
322
+ this.closely()
323
+ HostApp.backupDatabase()
324
+ },
325
+ cannotRepair() {
326
+ this.showhead = false
327
+ this.showCannotrepair = true
328
+ this.closely()
329
+ // falg:0, 表示第一次上传,批量上传时,flag:1
330
+ // this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
331
+ },
332
+ // 测试环境下模拟上传失败
333
+ fail(param) {
334
+ this.msg.serviceacitivity[0].f_result_status = param
335
+ this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg, test: true})
336
+ },
337
+ async workOrderSave(){
338
+ this.norepair = false
339
+ if (this.hunei && this.hunei.details) {
340
+ for (let i = 0; i < this.hunei.details.length; i++) {
341
+ if (this.hunei.details[i].f_project === '未维修') {
342
+ this.norepair = true
343
+ }
344
+ }
345
+ }
346
+ // 用户基本信息转字符串
347
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
348
+ this.msg.serviceacitivity[0].f_result_status = '工单保存'
349
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
350
+ this.closely(true)
351
+ console.log("保存本地2"+this.msg.f_recording1_path)
352
+ this.deleteEmptyProperty(this.msg)
353
+ HostApp.__this__ = this
354
+ HostApp.logicWithHint({
355
+ // logic别名,key必须为logic
356
+ 'logic': 'workOrderSave',
357
+ // 回调执行方法名,key必须为callback
358
+ 'callback': 'javascript:HostApp.__this__.localSaveCallBack()',
359
+ // logic执行需要的业务参数
360
+ 'data': {row: this.msg},
361
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
362
+ // 执行回调方法传入key为backresult
363
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
364
+ 'backresult': 1
365
+ })
366
+ },
367
+ localSaveCallBack(res){
368
+ if(res.state == 'ok'){
369
+ let result = JSON.parse(res.result)
370
+ if(result.result == '成功'){
371
+ this.$showMessage('工单保存成功!', ['confirm'])
372
+ }else{
373
+ this.$showMessage(`工单保存失败! ${result.errMsg}`, ['confirm'])
374
+ }
375
+ this.$dispatch('tijiao')
376
+ }else {
377
+ this.$showMessage(`保存提交失败!`, ['confirm'])
378
+ }
379
+ },
380
+ // 工单上传
381
+ async confirm(param) {
382
+ /*//tag)
383
+ if(!this.model.ischange) {
384
+ this.$showMessage('您还为进行换表操作,工单为完成!,')
385
+ return
386
+ }*/
387
+
388
+ this.norepair = false
389
+ if (this.hunei && this.hunei.details) {
390
+ for (let i = 0; i < this.hunei.details.length; i++) {
391
+ if (this.hunei.details[i].f_project === '未维修') {
392
+ this.norepair = true
393
+ }
394
+ }
395
+ }
396
+ if(param != '结案'&& (this.msg.f_workorder_type == '置换通气单'||this.msg.f_workorder_type == '安装单')) {
397
+ // 检测验证是否必填
398
+ var isfinish = this.checkismust()
399
+ if(isfinish.ifmust){
400
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
401
+ return
402
+ }
403
+ // 检测签名是否完成
404
+ // if(!(this.msg.serviceacitivity[0].f_signname)) {
405
+ // this.$showMessage(`请完成客户签名!`, ['confirm'])
406
+ // return
407
+ // }
408
+ // 检测置换作业是否有异常
409
+ var yinhuanflag = this.checkzhihuanwork()
410
+ if(!yinhuanflag){
411
+ var resy = await this.$showMessage('是否确认该户置换作业异常?', ['confirm', 'cancel'])
412
+ if(resy == 'cancel'){
413
+ return
414
+ }
415
+ this.msg.f_is_abnormal = '异常'
416
+ this.msg.serviceacitivity[0].f_is_abnormal = '异常'
417
+ }
418
+ // 检测置换照片是否已拍
419
+ // var imgflag = this.checkzhihuanimg()
420
+ // if(!(imgflag.check)){
421
+ // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
422
+ // return
423
+ // }
424
+ }
425
+ else if(this.msg.f_workorder_type == '报修单' && param != '结案'){
426
+ let isfinish = this.checkismust()
427
+ if(isfinish.ifmust){
428
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
429
+ return
430
+ }
431
+ if(!(this.msg.serviceacitivity[0].f_signname) && Vue.config.telephone.FaultAll.signature?Vue.config.telephone.FaultAll.signature:false) {
432
+ this.$showMessage(`请完成客户签名!`, ['confirm'])
433
+ return
434
+ }
435
+ let imgflag = this.checkzhihuanimg()
436
+ if(!(imgflag.check)){
437
+ this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
438
+ return
439
+ }
440
+ }
441
+ // }
442
+ // 用户基本信息转字符串
443
+ // if ((this.savevalid.uservalid && this.savevalid.doorvalid) || this.norepair || this.liGuanWeiXou || this.sheBeiRepairAll) {
444
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
445
+ this.msg.serviceacitivity[0].f_result_status = param
446
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
447
+ this.msg.loginid = Vue.user.id
448
+ // if (!this.savevalid.changetable && this.model.servicerepair && this.model.servicerepair[0].f_if_change) {
449
+ // this.$showMessage('未上传收费!', ['confirm'])
450
+ // } else {
451
+ this.deleteEmptyProperty(this.msg)
452
+ //tag
453
+ this.closely(false) // 保存本地,不删除录音文件停止录音
454
+ // this.msg.f_recording1_path = this.data.f_recording1_path
455
+ console.log("保存本地", this.msg.f_recording1_path)
456
+ //tag)
457
+ HostApp.__this__ = this
458
+ HostApp.logicWithHint({
459
+ // logic别名,key必须为logic
460
+ 'logic': 'upload',
461
+ // 回调执行方法名,key必须为callback
462
+ 'callback': 'javascript:HostApp.__this__.uploadCallback()',
463
+ // logic执行需要的业务参数
464
+ 'data': {flag: 0, row: this.msg},
465
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
466
+ // 执行回调方法传入key为backresult
467
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
468
+ 'backresult': 1
469
+ })
470
+ // let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
471
+ // } else {
472
+ // this.$showMessage('有未填写项', ['confirm'])
473
+ // }
474
+ },
475
+ uploadCallback(res){
476
+ let _this = this
477
+ if(res.state == 'ok'){
478
+ let result = JSON.parse(res.result)
479
+ if (result.result === '成功') {
480
+ this.$showMessage(`是否前往安检`, ['confirm', 'cancel']).then((res) => {
481
+ let info = this.msg
482
+ if (res === 'confirm') {
483
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/查询计划项表信息`,{data:{f_userid:this.msg.f_userinfo_id}}).then((response)=>{
484
+ if(response.data.length!=1){
485
+ this.$showMessage("当前用户有多条表信息,请联系管理员核实进行处理!")
486
+ }else {
487
+ info['f_plan_meters'] = response.data
488
+ info.f_no_checkplan = '无计划安检'
489
+ info.show_temporary_save = 'no'
490
+ var pardate = {
491
+ _this:this.$parent.$parent,
492
+ tittle:'安检详情',
493
+ safe:false
494
+ }
495
+ this.$dispatch('gotoson',pardate)
496
+ this.$parent.$parent.$goto('safecheck-order-v', {item: info, role: 'inspect',parentPage:'CurrentCreate'}, 'self', function (){
497
+ _this.$parent.$parent.$dispatch('confirm')
498
+ _this.$parent.$parent.$dispatch('tijiao')
499
+ }
500
+ )
501
+ }
502
+ })
503
+ }else {
504
+ this.$dispatch('tijiao')
505
+ }
506
+ })
507
+ } else {
508
+ this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
509
+ }
510
+ this.showNorepair = false
511
+ this.showCannotrepair = false
512
+ }else {
513
+ this.$showMessage(`保存提交失败!`, ['confirm'])
514
+ }
515
+ },
516
+ // 检验是否必填 返回 error:{msg:'111',ismust:true}
517
+ checkismust(){
518
+ var error ={
519
+ msg:'',
520
+ ifmust:false
521
+ }
522
+ for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
523
+ for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
524
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
525
+ break;
526
+ }
527
+ 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){
528
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
529
+ error.ifmust = true
530
+ return error
531
+ }
532
+ 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' ){
533
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
534
+ error.ifmust = true
535
+ return error
536
+ }
537
+ 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){
538
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}的维修照片`
539
+ error.ifmust = true
540
+ return error
541
+ }
542
+ 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){
543
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
544
+ error.ifmust = true
545
+ return error
546
+ }
547
+ }
548
+ }
549
+ return error
550
+ },
551
+ // checkzhihuanwork 检测置换作业是否正常
552
+ checkzhihuanwork(){
553
+ var isstatus = true
554
+ if(this.zhihuan){
555
+ for(var i = 0;i<this.zhihuan.details.length;i++){
556
+ if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
557
+ if(this.zhihuan.details[i].f_status == 'false'){
558
+ isstatus = false
559
+ break;
560
+ }
561
+ }
562
+ }
563
+ }
564
+ return isstatus
565
+ },
566
+ checkzhihuanimg(){
567
+ var isstatus = {
568
+ check: true,
569
+ title:''
570
+ }
571
+ if(Vue.config.telephone.Outlay.data != undefined){
572
+ let checkimgs = ''
573
+ //tag
574
+ //tag+'22222222222222222')
575
+ if(this.service.f_user_type == '民用'){
576
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
577
+ }else{
578
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
579
+ }
580
+ if(checkimgs.length>0){
581
+ for(var i =0;i<checkimgs.length;i++){
582
+ var checkimgstype = checkimgs[i].title
583
+ if(checkimgs[i].checkmust){
584
+ var flag = false
585
+ for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
586
+ if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
587
+ flag = true
588
+ break;
589
+ }
590
+ }
591
+ if(!flag){
592
+ isstatus.check = false
593
+ isstatus.title = checkimgstype
594
+ break;
595
+ }
596
+ }
597
+ }
598
+ }
599
+ }
600
+ return isstatus
601
+ },
602
+ checkservice(){
603
+ // 1.先判断灶具
604
+ if(this.zaoju){
605
+ var iszaoju = false
606
+ for(var i = 0;i<this.zaoju.details.length;i++){
607
+ if(this.zaoju.details[i].f_project == '有无灶具设备'){
608
+ if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
609
+ iszaoju = true
610
+ break;
611
+ }
612
+ }
613
+ }
614
+ if(iszaoju){
615
+ for(var i = 0;i<this.zaoju.details.length;i++){
616
+ if(this.zaoju.details[i].type == 'picture'){
617
+ //tag
618
+ //tag
619
+ if(this.zaoju.imgs.length == 0){
620
+ this.$showMessage('灶具设备未拍照!', ['confirm'])
621
+ return false
622
+ }
623
+ }else{
624
+ if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
625
+ this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
626
+ return false
627
+ }
628
+ }
629
+ }
630
+ }
631
+ }
632
+ // 2.判断热水器
633
+ if(this.reshuiqi){
634
+ var isreshuiqi = false
635
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
636
+ if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
637
+ if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
638
+ isreshuiqi = true
639
+ break;
640
+ }
641
+ }
642
+ }
643
+ if(isreshuiqi){
644
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
645
+ if(this.reshuiqi.details[i].type == 'picture'){
646
+ if(this.reshuiqi.imgs.length == 0){
647
+ this.$showMessage('热水器设备未拍照!', ['confirm'])
648
+ return false
649
+ }
650
+ }else{
651
+ if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
652
+ this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
653
+ return false
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ // 3.判断壁挂炉
660
+ if(this.bigualu){
661
+ var isbigualu = false
662
+ for(var i = 0;i<this.bigualu.details.length;i++){
663
+ if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
664
+ if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
665
+ isbigualu = true
666
+ break;
667
+ }
668
+ }
669
+ }
670
+ if(isbigualu){
671
+ for(var i = 0;i<this.bigualu.details.length;i++){
672
+ if(this.bigualu.details[i].type == 'picture'){
673
+ if(this.bigualu.imgs.length == 0){
674
+ this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
675
+ return false
676
+ }
677
+ }else{
678
+ if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
679
+ this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
680
+ return false
681
+ }
682
+ }
683
+ }
684
+ }
685
+ }
686
+ return true
687
+ },
688
+ cannotRepaer() {
689
+ this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
690
+ this.msg.loginid = Vue.user.id
691
+ let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
692
+ if (result.result === '成功') {
693
+ this.$showMessage('保存提交成功!', ['confirm'])
694
+ } else {
695
+ this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
696
+ }
697
+ this.showNorepair = false
698
+ this.showCannotrepair = false
699
+ this.$dispatch('tijiao')
700
+ },
701
+ saveCompeleted() {
702
+ this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
703
+ this.closely(false) // 保存本地,不删除录音文件停止录音
704
+ this.$androidUtil.bzLogic('SaveCompeleted', { row: this.msg})
705
+ },
706
+ sortDetais(result, type) {
707
+ let door = Object.assign({}, result)
708
+ door.details = []
709
+ for (let i = 0; i < result.details.length; i++) {
710
+ if (typeof (result.details[i].f_contentmessage) === 'object') {
711
+ for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
712
+ if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
713
+ let k = result.details[i].f_contentmessage[j].indexOf('-')
714
+ let newObj = {}
715
+ newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
716
+ newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
717
+ newObj.f_project = result.details[i].f_project
718
+ newObj.f_type = type
719
+ door.details.push(newObj)
720
+ }
721
+ }
722
+ }
723
+ if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
724
+ // //tag
725
+ for (let l = 0; l < result.details[i].f_content.length; l++) {
726
+ let new0bj = {}
727
+ new0bj.f_content = result.details[i].f_content[l]
728
+ new0bj.f_project = result.details[i].f_project
729
+ new0bj.f_type = 'a'
730
+ door.details.push(new0bj)
731
+ }
732
+ }
733
+ if (typeof(result.details[i].f_content) === 'string') {
734
+ door.details.push(result.details[i])
735
+ }
736
+ }
737
+ return door
738
+ },
739
+ close() {
740
+ this.showhead = true
741
+ this.showNorepair = false
742
+ }
743
+ ,
744
+ close1() {
745
+ this.showhead = true
746
+ this.showCannotrepair = false
747
+ },
748
+ showmateria(){
749
+ this.selectdata = {
750
+ f_process_id :this.msg.f_processid,
751
+ model:this.msg
752
+ }
753
+ console.log("传递数据",this.msg)
754
+ this.showmaterial = true
755
+ },
756
+ close2(){
757
+ this.showmaterial = false
758
+ this.selectdata ={}
759
+ }
760
+ },
761
+ async ready () {
762
+ this.savebutten = Vue.config2.telephone.FaultAll.savebutten
763
+ this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
764
+ },
765
+ computed: {
766
+ stateNoRepair() {
767
+ return this.msg.serviceacitivity.find((row) => {
768
+ return row.f_result_status === '未维修'
769
+ })
770
+ },
771
+ hunei() {
772
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
773
+ return row.f_type === '户内维修' // 换表
774
+ })
775
+ return this.sortDetais(result, 'a')
776
+ },
777
+ hitchAll() {
778
+ let hitchMsg = []
779
+ let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
780
+ return row.f_type === '户内维修' // 户内维修
781
+ })
782
+ this.obj.details.forEach((row) => {
783
+ hitchMsg.push(row)
784
+ })
785
+ return hitchMsg
786
+ },
787
+ gaiGuan() {
788
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
789
+ // return row.f_service_type === '改管'
790
+ return row.f_type === '改管'
791
+ })
792
+ },
793
+ zhihuan() {
794
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
795
+ // return row.f_service_type === '改管'
796
+ return row.f_type === '置换作业'
797
+ })
798
+ },
799
+ zaoju() {
800
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
801
+ // return row.f_service_type === '立管维修'
802
+ return row.f_type === '灶具信息'
803
+ })
804
+ },
805
+ reshuiqi() {
806
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
807
+ // return row.f_service_type === '立管维修'
808
+ return row.f_type === '热水器信息'
809
+ })
810
+ },
811
+ bigualu() {
812
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
813
+ // return row.f_service_type === '立管维修'
814
+ return row.f_type === '壁挂炉信息'
815
+ })
816
+ },
817
+ sanhuanzhuang() {
818
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
819
+ // return row.f_service_type === '立管维修'
820
+ return row.f_type === '散户安装'
821
+ })
822
+ },
823
+ sheBeiRepairAll() {
824
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
825
+ return row.f_type === '设备维修' // 换表
826
+ })
827
+ //tag)
828
+ return this.sortDetais(result, 'b')
829
+ },
830
+ zaoJuRepairAll() {
831
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
832
+ return row.f_type === '灶具维修' // 换表
833
+ })
834
+ return this.sortDetais(result, 'c')
835
+ },
836
+ troubleDeal() {
837
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
838
+ return row.f_type === '事故处理'
839
+ })
840
+ }
841
+ },
842
+ components: {
843
+ 'failure-edit': FailureEdit,
844
+ 'charges-list': ChargesList
845
+ }
846
+ }
847
+ </script>
848
+ <style scoped>
849
+ .pd-top {
850
+ padding-top: 7px;
851
+ }
852
+ </style>