telephone-clients 4.0.0-1-28 → 4.0.0-1-30

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,968 +1,970 @@
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
- goHandPlan(){
517
- if (this.msg.f_userinfo_id){
518
- let http = new HttpResetClass()
519
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
520
- data: {
521
- items: 'count(0) as num',
522
- tablename: 't_userfiles',
523
- condition: `f_userinfo_id = '${this.service.f_userinfo_id}' and f_meter_classify != '物联网表'`,
524
- orderitem: '1'
525
- }
526
- }, {resolveMsg: null, rejectMsg: null}).then((response) => {
527
- if (response.data[0].num > 0 ){
528
- let _this = this
529
- this.$showMessage(`是否前往抄表`, ['confirm', 'cancel']).then((res) => {
530
- if (res === 'confirm') {
531
- let param = {}
532
- let http = new HttpResetClass()
533
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-readmeter/sql/PcHandInfo`, {data:{
534
- sort: `asc`,
535
- condition:`f_userinfo_id = '${_this.msg.f_userinfo_id}'`
536
- }
537
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
538
- param = res.data[0]
539
- param.f_new_tablebase = _this.msg.f_new_tablebase
540
- param.tabname="在线抄表"
541
- var pardate = {
542
- _this:this.$parent.$parent,
543
- tittle:'抄表单信息',
544
- safe:false
545
- }
546
- this.$dispatch('gotoson',pardate)
547
- this.$parent.$parent.$goto('phone-hand-edit', {data:param,source:'抄表',type:'save'}, 'self', function (){
548
- _this.$parent.$parent.$dispatch('confirm')
549
- _this.$parent.$parent.$dispatch('tijiao')
550
- }
551
- )
552
- })
553
- }else {
554
- this.$dispatch('tijiao')
555
- }
556
- })
557
- }
558
- })
559
- }
560
- },
561
- goSafe(){
562
- let _this = this
563
- const go_safe = this.$appdata.getSingleValue('维修后进行安检')
564
- if (go_safe){
565
- this.$showMessage(`是否前往安检`, ['confirm', 'cancel']).then((res) => {
566
- let info = this.msg
567
- if (res === 'confirm') {
568
- if (!this.msg.f_userinfo_id){
569
- var pardate = {
570
- _this:this.$parent.$parent,
571
- tittle:'在线安检',
572
- safe:false
573
- }
574
- this.$dispatch('gotoson',pardate)
575
- this.$parent.$parent.$goto('add-plan-item', {item: info}, 'self', function (){
576
- _this.$parent.$parent.$dispatch('confirm')
577
- _this.$parent.$parent.$dispatch('tijiao')
578
- }
579
- )
580
- }else {
581
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/查询计划项表信息`,{data:{f_userid:this.msg.f_userinfo_id}}).then((response)=>{
582
- if(response.data.length!=1){
583
- this.$showMessage("当前用户有多条表信息,请联系管理员核实进行处理!")
584
- }else {
585
- info.f_userinfoid = this.msg.f_userinfo_id
586
- info.f_userinfo_id = this.msg.f_userinfo_id
587
- info['f_plan_meters'] = response.data
588
- info.f_no_checkplan = '无计划安检'
589
- info.show_temporary_save = 'no'
590
- var pardate = {
591
- _this:this.$parent.$parent,
592
- tittle:'安检详情',
593
- safe:false
594
- }
595
- this.$dispatch('gotoson',pardate)
596
- this.$parent.$parent.$goto('safecheck-order-v', {item: info, role: 'inspect',parentPage:'CurrentCreate'}, 'self', function (){
597
- _this.$parent.$parent.$dispatch('confirm')
598
- _this.$parent.$parent.$dispatch('tijiao')
599
- }
600
- )
601
- }
602
- })
603
- }
604
- }else {
605
- this.$dispatch('tijiao')
606
- }
607
- })
608
- }else{
609
- this.$dispatch('tijiao')
610
- }
611
- },
612
- uploadCallback(res){
613
- let _this = this
614
- if(res.state == 'ok'){
615
- let result = JSON.parse(res.result)
616
- if (result.result === '成功' ) {
617
- const go_hand_plan = this.$appdata.getSingleValue('维修后进行抄表')
618
- if (go_hand_plan){
619
- this.goHandPlan()
620
- }else{
621
- this.$dispatch('tijiao')
622
- }
623
- } else {
624
- this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
625
- }
626
- this.showNorepair = false
627
- this.showCannotrepair = false
628
- }else {
629
- this.$showMessage(`保存提交失败!`, ['confirm'])
630
- }
631
- },
632
- // 检验是否必填 返回 error:{msg:'111',ismust:true}
633
- checkismust(){
634
- var error ={
635
- msg:'',
636
- ifmust:false
637
- }
638
- for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
639
- for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
640
- if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
641
- break;
642
- }
643
- 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){
644
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
645
- error.ifmust = true
646
- return error
647
- }
648
- 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' ){
649
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
650
- error.ifmust = true
651
- return error
652
- }
653
- 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){
654
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}的维修照片`
655
- error.ifmust = true
656
- return error
657
- }
658
- 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){
659
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
660
- error.ifmust = true
661
- return error
662
- }
663
- }
664
- }
665
- return error
666
- },
667
- // checkzhihuanwork 检测置换作业是否正常
668
- checkzhihuanwork(){
669
- var isstatus = true
670
- if(this.zhihuan){
671
- for(var i = 0;i<this.zhihuan.details.length;i++){
672
- if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
673
- if(this.zhihuan.details[i].f_status == 'false'){
674
- isstatus = false
675
- break;
676
- }
677
- }
678
- }
679
- }
680
- return isstatus
681
- },
682
- checkzhihuanimg(){
683
- var isstatus = {
684
- check: true,
685
- title:''
686
- }
687
- if(Vue.config.telephone.Outlay.data != undefined){
688
- let checkimgs = ''
689
- //tag
690
- //tag+'22222222222222222')
691
- if(this.service.f_user_type == '民用'){
692
- checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
693
- }else{
694
- checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
695
- }
696
- if(checkimgs.length>0){
697
- for(var i =0;i<checkimgs.length;i++){
698
- var checkimgstype = checkimgs[i].title
699
- if(checkimgs[i].checkmust){
700
- var flag = false
701
- for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
702
- if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
703
- flag = true
704
- break;
705
- }
706
- }
707
- if(!flag){
708
- isstatus.check = false
709
- isstatus.title = checkimgstype
710
- break;
711
- }
712
- }
713
- }
714
- }
715
- }
716
- return isstatus
717
- },
718
- checkservice(){
719
- // 1.先判断灶具
720
- if(this.zaoju){
721
- var iszaoju = false
722
- for(var i = 0;i<this.zaoju.details.length;i++){
723
- if(this.zaoju.details[i].f_project == '有无灶具设备'){
724
- if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
725
- iszaoju = true
726
- break;
727
- }
728
- }
729
- }
730
- if(iszaoju){
731
- for(var i = 0;i<this.zaoju.details.length;i++){
732
- if(this.zaoju.details[i].type == 'picture'){
733
- //tag
734
- //tag
735
- if(this.zaoju.imgs.length == 0){
736
- this.$showMessage('灶具设备未拍照!', ['confirm'])
737
- return false
738
- }
739
- }else{
740
- if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
741
- this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
742
- return false
743
- }
744
- }
745
- }
746
- }
747
- }
748
- // 2.判断热水器
749
- if(this.reshuiqi){
750
- var isreshuiqi = false
751
- for(var i = 0;i<this.reshuiqi.details.length;i++){
752
- if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
753
- if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
754
- isreshuiqi = true
755
- break;
756
- }
757
- }
758
- }
759
- if(isreshuiqi){
760
- for(var i = 0;i<this.reshuiqi.details.length;i++){
761
- if(this.reshuiqi.details[i].type == 'picture'){
762
- if(this.reshuiqi.imgs.length == 0){
763
- this.$showMessage('热水器设备未拍照!', ['confirm'])
764
- return false
765
- }
766
- }else{
767
- if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
768
- this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
769
- return false
770
- }
771
- }
772
- }
773
- }
774
- }
775
- // 3.判断壁挂炉
776
- if(this.bigualu){
777
- var isbigualu = false
778
- for(var i = 0;i<this.bigualu.details.length;i++){
779
- if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
780
- if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
781
- isbigualu = true
782
- break;
783
- }
784
- }
785
- }
786
- if(isbigualu){
787
- for(var i = 0;i<this.bigualu.details.length;i++){
788
- if(this.bigualu.details[i].type == 'picture'){
789
- if(this.bigualu.imgs.length == 0){
790
- this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
791
- return false
792
- }
793
- }else{
794
- if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
795
- this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
796
- return false
797
- }
798
- }
799
- }
800
- }
801
- }
802
- return true
803
- },
804
- cannotRepaer() {
805
- this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
806
- this.msg.loginid = Vue.user.id
807
- let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
808
- if (result.result === '成功') {
809
- this.$showMessage('保存提交成功!', ['confirm'])
810
- } else {
811
- this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
812
- }
813
- this.showNorepair = false
814
- this.showCannotrepair = false
815
- this.$dispatch('tijiao')
816
- },
817
- saveCompeleted() {
818
- this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
819
- this.closely(false) // 保存本地,不删除录音文件停止录音
820
- this.$androidUtil.bzLogic('SaveCompeleted', { row: this.msg})
821
- },
822
- sortDetais(result, type) {
823
- let door = Object.assign({}, result)
824
- door.details = []
825
- for (let i = 0; i < result.details.length; i++) {
826
- if (typeof (result.details[i].f_contentmessage) === 'object') {
827
- for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
828
- if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
829
- let k = result.details[i].f_contentmessage[j].indexOf('-')
830
- let newObj = {}
831
- newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
832
- newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
833
- newObj.f_project = result.details[i].f_project
834
- newObj.f_type = type
835
- door.details.push(newObj)
836
- }
837
- }
838
- }
839
- if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
840
- // //tag
841
- for (let l = 0; l < result.details[i].f_content.length; l++) {
842
- let new0bj = {}
843
- new0bj.f_content = result.details[i].f_content[l]
844
- new0bj.f_project = result.details[i].f_project
845
- new0bj.f_type = 'a'
846
- door.details.push(new0bj)
847
- }
848
- }
849
- if (typeof(result.details[i].f_content) === 'string') {
850
- door.details.push(result.details[i])
851
- }
852
- }
853
- return door
854
- },
855
- close() {
856
- this.showhead = true
857
- this.showNorepair = false
858
- }
859
- ,
860
- close1() {
861
- this.showhead = true
862
- this.showCannotrepair = false
863
- },
864
- showmateria(){
865
- this.selectdata = {
866
- f_process_id :this.msg.f_processid,
867
- model:this.msg
868
- }
869
- console.log("传递数据",this.msg)
870
- this.showmaterial = true
871
- },
872
- close2(){
873
- this.showmaterial = false
874
- this.selectdata ={}
875
- }
876
- },
877
- async ready () {
878
- this.savebutten = Vue.config2.telephone.FaultAll.savebutten
879
- this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
880
- },
881
- computed: {
882
- stateNoRepair() {
883
- return this.msg.serviceacitivity.find((row) => {
884
- return row.f_result_status === '未维修'
885
- })
886
- },
887
- hunei() {
888
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
889
- return row.f_type === '户内维修' // 换表
890
- })
891
- return this.sortDetais(result, 'a')
892
- },
893
- hitchAll() {
894
- let hitchMsg = []
895
- let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
896
- return row.f_type === '户内维修' // 户内维修
897
- })
898
- this.obj.details.forEach((row) => {
899
- hitchMsg.push(row)
900
- })
901
- return hitchMsg
902
- },
903
- gaiGuan() {
904
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
905
- // return row.f_service_type === '改管'
906
- return row.f_type === '改管'
907
- })
908
- },
909
- zhihuan() {
910
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
911
- // return row.f_service_type === '改管'
912
- return row.f_type === '置换作业'
913
- })
914
- },
915
- zaoju() {
916
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
917
- // return row.f_service_type === '立管维修'
918
- return row.f_type === '灶具信息'
919
- })
920
- },
921
- reshuiqi() {
922
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
923
- // return row.f_service_type === '立管维修'
924
- return row.f_type === '热水器信息'
925
- })
926
- },
927
- bigualu() {
928
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
929
- // return row.f_service_type === '立管维修'
930
- return row.f_type === '壁挂炉信息'
931
- })
932
- },
933
- sanhuanzhuang() {
934
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
935
- // return row.f_service_type === '立管维修'
936
- return row.f_type === '散户安装'
937
- })
938
- },
939
- sheBeiRepairAll() {
940
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
941
- return row.f_type === '设备维修' // 换表
942
- })
943
- //tag)
944
- return this.sortDetais(result, 'b')
945
- },
946
- zaoJuRepairAll() {
947
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
948
- return row.f_type === '灶具维修' // 换表
949
- })
950
- return this.sortDetais(result, 'c')
951
- },
952
- troubleDeal() {
953
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
954
- return row.f_type === '事故处理'
955
- })
956
- }
957
- },
958
- components: {
959
- 'failure-edit': FailureEdit,
960
- 'appinstallation-material': AppInstallationMaterial
961
- }
962
- }
963
- </script>
964
- <style scoped>
965
- .pd-top {
966
- padding-top: 7px;
967
- }
968
- </style>
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
+ goHandPlan(){
517
+ if (this.msg.f_userinfo_id){
518
+ let http = new HttpResetClass()
519
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
520
+ data: {
521
+ items: 'count(0) as num',
522
+ tablename: 't_userfiles',
523
+ condition: `f_userinfo_id = '${this.service.f_userinfo_id}' and f_meter_classify != '物联网表'`,
524
+ orderitem: '1'
525
+ }
526
+ }, {resolveMsg: null, rejectMsg: null}).then((response) => {
527
+ if (response.data[0].num > 0 ){
528
+ let _this = this
529
+ this.$showMessage(`是否前往抄表`, ['confirm', 'cancel']).then((res) => {
530
+ if (res === 'confirm') {
531
+ let param = {}
532
+ let http = new HttpResetClass()
533
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/af-readmeter/sql/PcHandInfo`, {data:{
534
+ sort: `asc`,
535
+ condition:`f_userinfo_id = '${_this.msg.f_userinfo_id}'`
536
+ }
537
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
538
+ param = res.data[0]
539
+ param.f_new_tablebase = _this.msg.f_new_tablebase
540
+ param.tabname="在线抄表"
541
+ var pardate = {
542
+ _this:this.$parent.$parent,
543
+ tittle:'抄表单信息',
544
+ safe:false
545
+ }
546
+ this.$dispatch('gotoson',pardate)
547
+ this.$parent.$parent.$goto('phone-hand-edit', {data:param,source:'抄表',type:'save'}, 'self', function (){
548
+ _this.$parent.$parent.$dispatch('confirm')
549
+ _this.$parent.$parent.$dispatch('tijiao')
550
+ }
551
+ )
552
+ })
553
+ }else {
554
+ this.$dispatch('tijiao')
555
+ }
556
+ })
557
+ }else {
558
+ this.$dispatch('tijiao')
559
+ }
560
+ })
561
+ }
562
+ },
563
+ goSafe(){
564
+ let _this = this
565
+ const go_safe = this.$appdata.getSingleValue('维修后进行安检')
566
+ if (go_safe){
567
+ this.$showMessage(`是否前往安检`, ['confirm', 'cancel']).then((res) => {
568
+ let info = this.msg
569
+ if (res === 'confirm') {
570
+ if (!this.msg.f_userinfo_id){
571
+ var pardate = {
572
+ _this:this.$parent.$parent,
573
+ tittle:'在线安检',
574
+ safe:false
575
+ }
576
+ this.$dispatch('gotoson',pardate)
577
+ this.$parent.$parent.$goto('add-plan-item', {item: info}, 'self', function (){
578
+ _this.$parent.$parent.$dispatch('confirm')
579
+ _this.$parent.$parent.$dispatch('tijiao')
580
+ }
581
+ )
582
+ }else {
583
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/查询计划项表信息`,{data:{f_userid:this.msg.f_userinfo_id}}).then((response)=>{
584
+ if(response.data.length!=1){
585
+ this.$showMessage("当前用户有多条表信息,请联系管理员核实进行处理!")
586
+ }else {
587
+ info.f_userinfoid = this.msg.f_userinfo_id
588
+ info.f_userinfo_id = this.msg.f_userinfo_id
589
+ info['f_plan_meters'] = response.data
590
+ info.f_no_checkplan = '无计划安检'
591
+ info.show_temporary_save = 'no'
592
+ var pardate = {
593
+ _this:this.$parent.$parent,
594
+ tittle:'安检详情',
595
+ safe:false
596
+ }
597
+ this.$dispatch('gotoson',pardate)
598
+ this.$parent.$parent.$goto('safecheck-order-v', {item: info, role: 'inspect',parentPage:'CurrentCreate'}, 'self', function (){
599
+ _this.$parent.$parent.$dispatch('confirm')
600
+ _this.$parent.$parent.$dispatch('tijiao')
601
+ }
602
+ )
603
+ }
604
+ })
605
+ }
606
+ }else {
607
+ this.$dispatch('tijiao')
608
+ }
609
+ })
610
+ }else{
611
+ this.$dispatch('tijiao')
612
+ }
613
+ },
614
+ uploadCallback(res){
615
+ let _this = this
616
+ if(res.state == 'ok'){
617
+ let result = JSON.parse(res.result)
618
+ if (result.result === '成功' ) {
619
+ const go_hand_plan = this.$appdata.getSingleValue('维修后进行抄表')
620
+ if (go_hand_plan){
621
+ this.goHandPlan()
622
+ }else{
623
+ this.$dispatch('tijiao')
624
+ }
625
+ } else {
626
+ this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
627
+ }
628
+ this.showNorepair = false
629
+ this.showCannotrepair = false
630
+ }else {
631
+ this.$showMessage(`保存提交失败!`, ['confirm'])
632
+ }
633
+ },
634
+ // 检验是否必填 返回 error{msg:'111',ismust:true}
635
+ checkismust(){
636
+ var error ={
637
+ msg:'',
638
+ ifmust:false
639
+ }
640
+ for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
641
+ for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
642
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
643
+ break;
644
+ }
645
+ 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){
646
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
647
+ error.ifmust = true
648
+ return error
649
+ }
650
+ 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' ){
651
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
652
+ error.ifmust = true
653
+ return error
654
+ }
655
+ 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){
656
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}的维修照片`
657
+ error.ifmust = true
658
+ return error
659
+ }
660
+ 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){
661
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
662
+ error.ifmust = true
663
+ return error
664
+ }
665
+ }
666
+ }
667
+ return error
668
+ },
669
+ // checkzhihuanwork 检测置换作业是否正常
670
+ checkzhihuanwork(){
671
+ var isstatus = true
672
+ if(this.zhihuan){
673
+ for(var i = 0;i<this.zhihuan.details.length;i++){
674
+ if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
675
+ if(this.zhihuan.details[i].f_status == 'false'){
676
+ isstatus = false
677
+ break;
678
+ }
679
+ }
680
+ }
681
+ }
682
+ return isstatus
683
+ },
684
+ checkzhihuanimg(){
685
+ var isstatus = {
686
+ check: true,
687
+ title:''
688
+ }
689
+ if(Vue.config.telephone.Outlay.data != undefined){
690
+ let checkimgs = ''
691
+ //tag
692
+ //tag+'22222222222222222')
693
+ if(this.service.f_user_type == '民用'){
694
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
695
+ }else{
696
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
697
+ }
698
+ if(checkimgs.length>0){
699
+ for(var i =0;i<checkimgs.length;i++){
700
+ var checkimgstype = checkimgs[i].title
701
+ if(checkimgs[i].checkmust){
702
+ var flag = false
703
+ for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
704
+ if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
705
+ flag = true
706
+ break;
707
+ }
708
+ }
709
+ if(!flag){
710
+ isstatus.check = false
711
+ isstatus.title = checkimgstype
712
+ break;
713
+ }
714
+ }
715
+ }
716
+ }
717
+ }
718
+ return isstatus
719
+ },
720
+ checkservice(){
721
+ // 1.先判断灶具
722
+ if(this.zaoju){
723
+ var iszaoju = false
724
+ for(var i = 0;i<this.zaoju.details.length;i++){
725
+ if(this.zaoju.details[i].f_project == '有无灶具设备'){
726
+ if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
727
+ iszaoju = true
728
+ break;
729
+ }
730
+ }
731
+ }
732
+ if(iszaoju){
733
+ for(var i = 0;i<this.zaoju.details.length;i++){
734
+ if(this.zaoju.details[i].type == 'picture'){
735
+ //tag
736
+ //tag
737
+ if(this.zaoju.imgs.length == 0){
738
+ this.$showMessage('灶具设备未拍照!', ['confirm'])
739
+ return false
740
+ }
741
+ }else{
742
+ if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
743
+ this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
744
+ return false
745
+ }
746
+ }
747
+ }
748
+ }
749
+ }
750
+ // 2.判断热水器
751
+ if(this.reshuiqi){
752
+ var isreshuiqi = false
753
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
754
+ if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
755
+ if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
756
+ isreshuiqi = true
757
+ break;
758
+ }
759
+ }
760
+ }
761
+ if(isreshuiqi){
762
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
763
+ if(this.reshuiqi.details[i].type == 'picture'){
764
+ if(this.reshuiqi.imgs.length == 0){
765
+ this.$showMessage('热水器设备未拍照!', ['confirm'])
766
+ return false
767
+ }
768
+ }else{
769
+ if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
770
+ this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
771
+ return false
772
+ }
773
+ }
774
+ }
775
+ }
776
+ }
777
+ // 3.判断壁挂炉
778
+ if(this.bigualu){
779
+ var isbigualu = false
780
+ for(var i = 0;i<this.bigualu.details.length;i++){
781
+ if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
782
+ if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
783
+ isbigualu = true
784
+ break;
785
+ }
786
+ }
787
+ }
788
+ if(isbigualu){
789
+ for(var i = 0;i<this.bigualu.details.length;i++){
790
+ if(this.bigualu.details[i].type == 'picture'){
791
+ if(this.bigualu.imgs.length == 0){
792
+ this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
793
+ return false
794
+ }
795
+ }else{
796
+ if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
797
+ this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
798
+ return false
799
+ }
800
+ }
801
+ }
802
+ }
803
+ }
804
+ return true
805
+ },
806
+ cannotRepaer() {
807
+ this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
808
+ this.msg.loginid = Vue.user.id
809
+ let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
810
+ if (result.result === '成功') {
811
+ this.$showMessage('保存提交成功!', ['confirm'])
812
+ } else {
813
+ this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
814
+ }
815
+ this.showNorepair = false
816
+ this.showCannotrepair = false
817
+ this.$dispatch('tijiao')
818
+ },
819
+ saveCompeleted() {
820
+ this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
821
+ this.closely(false) // 保存本地,不删除录音文件停止录音
822
+ this.$androidUtil.bzLogic('SaveCompeleted', { row: this.msg})
823
+ },
824
+ sortDetais(result, type) {
825
+ let door = Object.assign({}, result)
826
+ door.details = []
827
+ for (let i = 0; i < result.details.length; i++) {
828
+ if (typeof (result.details[i].f_contentmessage) === 'object') {
829
+ for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
830
+ if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
831
+ let k = result.details[i].f_contentmessage[j].indexOf('-')
832
+ let newObj = {}
833
+ newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
834
+ newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
835
+ newObj.f_project = result.details[i].f_project
836
+ newObj.f_type = type
837
+ door.details.push(newObj)
838
+ }
839
+ }
840
+ }
841
+ if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
842
+ // //tag
843
+ for (let l = 0; l < result.details[i].f_content.length; l++) {
844
+ let new0bj = {}
845
+ new0bj.f_content = result.details[i].f_content[l]
846
+ new0bj.f_project = result.details[i].f_project
847
+ new0bj.f_type = 'a'
848
+ door.details.push(new0bj)
849
+ }
850
+ }
851
+ if (typeof(result.details[i].f_content) === 'string') {
852
+ door.details.push(result.details[i])
853
+ }
854
+ }
855
+ return door
856
+ },
857
+ close() {
858
+ this.showhead = true
859
+ this.showNorepair = false
860
+ }
861
+ ,
862
+ close1() {
863
+ this.showhead = true
864
+ this.showCannotrepair = false
865
+ },
866
+ showmateria(){
867
+ this.selectdata = {
868
+ f_process_id :this.msg.f_processid,
869
+ model:this.msg
870
+ }
871
+ console.log("传递数据",this.msg)
872
+ this.showmaterial = true
873
+ },
874
+ close2(){
875
+ this.showmaterial = false
876
+ this.selectdata ={}
877
+ }
878
+ },
879
+ async ready () {
880
+ this.savebutten = Vue.config2.telephone.FaultAll.savebutten
881
+ this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
882
+ },
883
+ computed: {
884
+ stateNoRepair() {
885
+ return this.msg.serviceacitivity.find((row) => {
886
+ return row.f_result_status === '未维修'
887
+ })
888
+ },
889
+ hunei() {
890
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
891
+ return row.f_type === '户内维修' // 换表
892
+ })
893
+ return this.sortDetais(result, 'a')
894
+ },
895
+ hitchAll() {
896
+ let hitchMsg = []
897
+ let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
898
+ return row.f_type === '户内维修' // 户内维修
899
+ })
900
+ this.obj.details.forEach((row) => {
901
+ hitchMsg.push(row)
902
+ })
903
+ return hitchMsg
904
+ },
905
+ gaiGuan() {
906
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
907
+ // return row.f_service_type === '改管'
908
+ return row.f_type === '改管'
909
+ })
910
+ },
911
+ zhihuan() {
912
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
913
+ // return row.f_service_type === '改管'
914
+ return row.f_type === '置换作业'
915
+ })
916
+ },
917
+ zaoju() {
918
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
919
+ // return row.f_service_type === '立管维修'
920
+ return row.f_type === '灶具信息'
921
+ })
922
+ },
923
+ reshuiqi() {
924
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
925
+ // return row.f_service_type === '立管维修'
926
+ return row.f_type === '热水器信息'
927
+ })
928
+ },
929
+ bigualu() {
930
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
931
+ // return row.f_service_type === '立管维修'
932
+ return row.f_type === '壁挂炉信息'
933
+ })
934
+ },
935
+ sanhuanzhuang() {
936
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
937
+ // return row.f_service_type === '立管维修'
938
+ return row.f_type === '散户安装'
939
+ })
940
+ },
941
+ sheBeiRepairAll() {
942
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
943
+ return row.f_type === '设备维修' // 换表
944
+ })
945
+ //tag)
946
+ return this.sortDetais(result, 'b')
947
+ },
948
+ zaoJuRepairAll() {
949
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
950
+ return row.f_type === '灶具维修' // 换表
951
+ })
952
+ return this.sortDetais(result, 'c')
953
+ },
954
+ troubleDeal() {
955
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
956
+ return row.f_type === '事故处理'
957
+ })
958
+ }
959
+ },
960
+ components: {
961
+ 'failure-edit': FailureEdit,
962
+ 'appinstallation-material': AppInstallationMaterial
963
+ }
964
+ }
965
+ </script>
966
+ <style scoped>
967
+ .pd-top {
968
+ padding-top: 7px;
969
+ }
970
+ </style>