telephone-clients 3.0.103-62 → 3.0.103-63

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,830 +1,830 @@
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="#" 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-show="wwcbutten">
22
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='noRepair'>
23
- 工单未完
24
- </button>
25
- </div>
26
- <div class="col-xs-3 col-sm-3 col-md-3" v-show="jabutten">
27
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='finishRepair'>
28
- 工单结案
29
- </button>
30
- </div>
31
- <div class="col-xs-3 col-sm-3 col-md-3" v-show="wwxbutten">
32
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='cannotRepair'>
33
- 无法完成
34
- </button>
35
- </div>
36
- <div class="col-xs-3 col-sm-3 col-md-3" v-show="sfbutten">
37
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='gotoOtherCharge'>
38
- 工单收费
39
- </button>
40
- </div>
41
- <div class="col-xs-3 col-sm-3 col-md-3" v-show="savebutten">
42
- <button type="button" name="button" class="col-sm-3 btn btn-primary"
43
- @click='workOrderSave'>
44
- 临时保存
45
- </button>
46
- </div>
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- </div>
52
- <div class="panel panel-default auto repair-info-content"
53
- v-if="msg.serviceacitivity[0].f_result_status == '已完成' && !show">
54
- <div class="panel-body ">
55
- <div class="row auto compatible">
56
- <div class="row auto">
57
- <div class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;" v-show="false">
58
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='saveCompeleted()'>
59
- 保存
60
- </button>
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- </div>
66
- <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showNorepair">
67
- <div>
68
- <p><big><b>工单未完成</b></big></p>
69
- </div>
70
- <div class="row">
71
- <div class="col-sm-12 form-group form-fix-width">
72
- <label class="control-label">原因</label>
73
- <textarea name="name" rows="2" class="form-control ver-textarea"
74
- v-model="msg.serviceacitivity[0].f_reason"></textarea>
75
- </div>
76
- </div>
77
- <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
78
- </failure-edit>
79
- <div class="form-group">
80
- <button type="button" class="btn btn-default pull-right" @click='close'>取消</button>
81
- <button type="button" class="btn btn-success pull-right" @click='confirm("未完成")'>确认</button>
82
- </div>
83
- </div>
84
- <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showCannotrepair">
85
- <div>
86
- <p><big><b>无法完成</b></big></p>
87
- </div>
88
- <div class="row">
89
- <div class="col-sm-12 form-group form-fix-width">
90
- <label class="control-label">原因</label>
91
- <textarea name="name" rows="2" class="form-control ver-textarea"
92
- v-model="msg.serviceacitivity[0].f_reason"></textarea>
93
- </div>
94
- </div>
95
- <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
96
- </failure-edit>
97
- <div class="row">
98
- <div class="col-sm-12">
99
- <button type="button" class="btn btn-default pull-right" @click='close1'>取消</button>
100
- <button type="button" class="btn btn-success pull-right" @click='cannotRepaer()'>确认</button>
101
- </div>
102
- </div>
103
- </div>
104
- </div>
105
- </template>
106
- <script>
107
- import Vue from 'vue'
108
- import * as Util from '../../../components/Util'
109
- import {HttpResetClass} from 'vue-client'
110
- import FailureEdit from '../../../components/pc/FailureEdit'
111
-
112
- export default {
113
- title: '故障汇总',
114
- props: {
115
- msg: {
116
- type: Object
117
- },
118
- savevalid: {
119
- type: Object
120
- },
121
- model: {
122
- type: Object
123
- },
124
- show: {
125
- type: Boolean,
126
- default: false
127
- },
128
- system: ''
129
- },
130
- data() {
131
- return {
132
- savebutten:false, // 工单保存按钮
133
- wwcbutten:false, // 未完成按钮
134
- wwxbutten:false, // 未维修按钮
135
- jabutten:false, //结案按钮
136
- sfbutten:false, //收费按钮
137
- fileName: '',
138
- datajson: '',
139
- norepair: '',
140
- showNorepair: false,
141
- showCannotrepair: false,
142
- showhead: true,
143
- repairers : this.$appdata.getParam('站点管理员'),
144
- config:{},
145
- othercharge_id: ''
146
- }
147
- },
148
- methods: {
149
- // 工单收费
150
- async gotoOtherCharge() {
151
- console.log('去工单收费界面!')
152
- let con = {
153
- conndition: ` f_userinfo_id = '${this.msg.f_userinfo_id}' and f_table_state = '正常' `
154
- }
155
- let http1 = new HttpResetClass()
156
- let row = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/onlinequeryuser`, {data: con},{
157
- resolveMsg: '物联网收费成功!!',
158
- rejectMsg: '物联网收费出错!!!'
159
- })
160
- console.log(JSON.stringify('获取用户信息返回==='+JSON.stringify(row)))
161
- // 去其他收费界面
162
- let _this = this
163
- var pardate = {
164
- _this:_this,
165
- title:'其他收费',
166
- safe:false
167
- }
168
- _this.$dispatch('gotoson',pardate)
169
- console.log('进入other_charge')
170
- _this.$goto('other_charge', {row: row}, 'self',_this.payback)
171
- // _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
172
- },
173
- payback(msg) {
174
- if (msg) {
175
- console.log('q其他收费记录id555555555'+JSON.stringify(msg))
176
- this.othercharge_id = msg
177
- }else {
178
- console.log('支付未成功!')
179
- this.$showMessage('支付失败!')
180
- }
181
- },
182
- // 工单结案
183
- finishRepair(){
184
- var _this = this
185
- this.$showMessage('请确认该工单结案!', ['confirm', 'cancel']).then((res) => {
186
- if (res === 'confirm') {
187
- _this.confirm("结案")
188
- }
189
- })
190
- },
191
- deleteEmptyProperty(object){
192
- for (var i in object) {
193
- var value = object[i];
194
- if (typeof value === 'object') {
195
- if (Array.isArray(value)) {
196
- if (value.length == 0) {
197
- delete object[i];
198
- console.log('delete Array', i);
199
- continue;
200
- }
201
- }
202
- this.deleteEmptyProperty(value);
203
- if (this.isEmpty(value)) {
204
- console.log('isEmpty true', i, value);
205
- delete object[i];
206
- console.log('delete a empty object');
207
- }
208
- } else {
209
- if (value === '' || value === null || value === undefined) {
210
- delete object[i];
211
- console.log('delete ', i);
212
- } else {
213
- console.log('check ', i, value);
214
- }
215
- }
216
- }
217
- },
218
- isEmpty(object) {
219
- for (var name in object) {
220
- return false;
221
- }
222
- return true;
223
- },
224
- // 从图片中删除
225
- remove(row) {
226
- this.$androidUtil.delfile(row.android_file)
227
- let pos = this.model.imgs.findIndex((value) => {
228
- return value === row
229
- })
230
- this.model.imgs.splice(pos, 1)
231
- },
232
- // fileName: 回传文件名,传入的带安卓路径url
233
- // prop: 传入的字段名,没做改动
234
- cameraCallBack(prop, fileName) {
235
- // 当前this只能通过HostApp.__tis__获取
236
- let self = this.$androidUtil.getCallBack(this)
237
- // 添加新图片
238
- self.model.imgs.push({
239
- android_file: self.fileName,
240
- path: fileName
241
- })
242
- },
243
- takePic() {
244
- let prop = 'repair'
245
- let idx = 'aofeng'
246
- this.fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
247
- this.$sandroidUtil.takePic(this, this.cameraCallBack, this.fileName)
248
- },
249
- newFailure(value) {
250
- this.msg.serviceacitivity[0].failure = value
251
- },
252
- noRepair() {
253
- this.showhead = false
254
- this.showNorepair = true
255
- HostApp.backupDatabase()
256
- },
257
- cannotRepair() {
258
- this.showhead = false
259
- this.showCannotrepair = true
260
- // falg:0, 表示第一次上传,批量上传时,flag:1
261
- // this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
262
- },
263
- // 测试环境下模拟上传失败
264
- fail(param) {
265
- this.msg.serviceacitivity[0].f_result_status = param
266
- this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg, test: true})
267
- },
268
- async workOrderSave(){
269
- this.norepair = false
270
- if (this.hunei && this.hunei.details) {
271
- for (let i = 0; i < this.hunei.details.length; i++) {
272
- if (this.hunei.details[i].f_project === '未维修') {
273
- this.norepair = true
274
- }
275
- }
276
- }
277
- // 用户基本信息转字符串
278
- this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
279
- this.msg.serviceacitivity[0].f_result_status = '工单保存'
280
- this.msg.serviceacitivity[0].f_order_man = Vue.user.name
281
- this.deleteEmptyProperty(this.msg)
282
- HostApp.__this__ = this
283
- HostApp.logicWithHint({
284
- // logic别名,key必须为logic
285
- 'logic': 'workOrderSave',
286
- // 回调执行方法名,key必须为callback
287
- 'callback': 'javascript:HostApp.__this__.localSaveCallBack()',
288
- // logic执行需要的业务参数
289
- 'data': {row: this.msg},
290
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
291
- // 执行回调方法传入key为backresult
292
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
293
- 'backresult': 1
294
- })
295
- },
296
- localSaveCallBack(res){
297
- if(res.state == 'ok'){
298
- let result = JSON.parse(res.result)
299
- if(result.result == '成功'){
300
- this.$showMessage('工单保存成功!', ['confirm'])
301
- this.$dispatch('tijiao')
302
- }else{
303
- this.$showMessage(`工单保存失败! ${result.errMsg}`, ['confirm'])
304
- }
305
- this.$dispatch('tijiao')
306
- }else {
307
- this.$showMessage(`保存提交失败!`, ['confirm'])
308
- }
309
- },
310
- // 工单上传
311
- async confirm(param) {
312
- /*console.log('是否换表----'+JSON.stringify(this.model.ischange))
313
- if(!this.model.ischange) {
314
- this.$showMessage('您还为进行换表操作,工单为完成!,')
315
- return
316
- }*/
317
-
318
- this.norepair = false
319
- if (this.hunei && this.hunei.details) {
320
- for (let i = 0; i < this.hunei.details.length; i++) {
321
- if (this.hunei.details[i].f_project === '未维修') {
322
- this.norepair = true
323
- }
324
- }
325
- }
326
- if(param != '结案'&& (this.msg.f_workorder_type == '置换通气单'||this.msg.f_workorder_type == '安装单')) {
327
- // 检测验证是否必填
328
- var isfinish = this.checkismust()
329
- if(isfinish.ifmust){
330
- this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
331
- return
332
- }
333
- // 检测签名是否完成
334
- // if(!(this.msg.serviceacitivity[0].f_signname)) {
335
- // this.$showMessage(`请完成客户签名!`, ['confirm'])
336
- // return
337
- // }
338
- // 检测置换作业是否有异常
339
- var yinhuanflag = this.checkzhihuanwork()
340
- if(!yinhuanflag){
341
- var resy = await this.$showMessage('是否确认该户置换作业异常?', ['confirm', 'cancel'])
342
- if(resy == 'cancel'){
343
- return
344
- }
345
- this.msg.f_is_abnormal = '异常'
346
- this.msg.serviceacitivity[0].f_is_abnormal = '异常'
347
- }
348
- // 检测置换照片是否已拍
349
- // var imgflag = this.checkzhihuanimg()
350
- // if(!(imgflag.check)){
351
- // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
352
- // return
353
- // }
354
- }
355
- else if(this.msg.f_workorder_type == '报修单' && param != '结案'){
356
- let isfinish = this.checkismust()
357
- if(isfinish.ifmust){
358
- this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
359
- return
360
- }
361
- // if(!(this.msg.serviceacitivity[0].f_signname)) {
362
- // this.$showMessage(`请完成客户签名!`, ['confirm'])
363
- // return
364
- // }
365
- // let imgflag = this.checkzhihuanimg()
366
- // if(!(imgflag.check)){
367
- // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
368
- // return
369
- // }
370
- }
371
- // }
372
- // 用户基本信息转字符串
373
- // if ((this.savevalid.uservalid && this.savevalid.doorvalid) || this.norepair || this.liGuanWeiXou || this.sheBeiRepairAll) {
374
- this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
375
- this.msg.serviceacitivity[0].f_result_status = param
376
- this.msg.serviceacitivity[0].f_order_man = Vue.user.name
377
- this.msg.loginid = Vue.user.id
378
- // if (!this.savevalid.changetable && this.model.servicerepair && this.model.servicerepair[0].f_if_change) {
379
- // this.$showMessage('未上传收费!', ['confirm'])
380
- // } else {
381
- this.deleteEmptyProperty(this.msg)
382
- console.log('上传参数11111111111')
383
- console.log(JSON.stringify(this.msg))
384
- HostApp.__this__ = this
385
- HostApp.logicWithHint({
386
- // logic别名,key必须为logic
387
- 'logic': 'upload',
388
- // 回调执行方法名,key必须为callback
389
- 'callback': 'javascript:HostApp.__this__.uploadCallback()',
390
- // logic执行需要的业务参数
391
- 'data': {flag: 0, row: this.msg},
392
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
393
- // 执行回调方法传入key为backresult
394
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
395
- 'backresult': 1
396
- })
397
- // let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
398
- // } else {
399
- // this.$showMessage('有未填写项', ['confirm'])
400
- // }
401
- },
402
- async uploadCallback(res){
403
- if(res.state == 'ok'){
404
- let result = JSON.parse(res.result)
405
- if (result.result === '成功') {
406
- if (this.msg.serviceacitivity.length && this.msg.serviceacitivity[0].servicerepair
407
- && this.msg.serviceacitivity[0].servicerepair.length && this.msg.f_workorder_type == '置换通气单'){
408
- let res = await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/saleSingleTable`, {data: {
409
- items:"*",
410
- tablename:"t_userfiles",
411
- condition:`f_userinfo_id = ${this.msg.serviceacitivity[0].baseuserinfo.f_userinfo_id} and f_table_state = '正常'`,
412
- orderitem:"f_userfiles_id"
413
- }})
414
- console.log('res=', JSON.stringify(res))
415
- let res2 = await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/saleSingleTable`, {data: {
416
- items:"*",
417
- tablename:"t_userfire",
418
- condition:`f_userfiles_id = '${res.data[0].f_userfiles_id}' and f_state = '有效'`,
419
- orderitem:"f_userfiles_id"
420
- }})
421
- let maps = {
422
- "镀锌管": "f_galvanize_pipe",
423
- "三通": "f_tee",
424
- "对丝": "f_nipple",
425
- "弯头": "f_elbow",
426
- "管卡": "f_pipe_strap",
427
- "灶前阀": "f_zqf",
428
- "胶管": "f_sebific_duct",
429
- "自闭阀": "f_zbf",
430
- "表前阀": "f_bqf_type",
431
- "报警器": "f_alarm_code",
432
- "灶具品牌": "f_gas_appliance",
433
- "壁挂炉品牌": "f_bgl",
434
- "热水器品牌": "f_geyser",
435
- "表封号": "f_metertitles",
436
- "表向": "f_aroundmeter",
437
- }
438
- if (this.msg.serviceacitivity[0].baseuserinfo.f_user_type != '民用'){
439
- maps = {
440
- "流量计品牌": "f_flowmeter_brand",
441
- "流量计型号": "f_flowmeter_model",
442
- "流量计类型": "f_llj_type",
443
- "流量范围(m³/h)": "f_llj_range",
444
-
445
- "控制器品牌": "f_control_brand",
446
- "控制器型号": "f_control_model",
447
- "控制器编号": "f_control_code",
448
-
449
- "灶具品牌": "f_appliance_brand",
450
- "灶具型号": "f_appliance_model",
451
-
452
- "气表品牌": "f_fire_gasbrand",
453
- "表向": "f_aroundmeter",
454
- }
455
- }
456
- const userfire = {
457
- id: res2.data[0].id,
458
- f_lgniter: Vue.user.name,
459
- f_operator: Vue.user.name,
460
- f_operatorid: Vue.user.id,
461
- f_operate_date: Util.toStandardTimeString()
462
- }
463
- const userfiles = {
464
- f_userfiles_id: res.data[0].f_userfiles_id,
465
- version: res.data[0].version
466
- }
467
- let update1 = false
468
- let update2 = false
469
- for (const item of this.msg.serviceacitivity[0].servicerepair) {
470
- if (item.details[0].f_content == '有' || item.f_type == '表具信息'){
471
- for (const detail of item.details) {
472
- if (maps[detail.f_project]) {
473
- if (['表前阀', '报警器', '表封号', '表向', '流量计品牌', '流量计型号', '流量计类型', '流量范围(m³/h)'].indexOf(detail.f_project) >= 0){
474
- userfiles[maps[detail.f_project]] = detail.f_content
475
- if (detail.f_content){
476
- update2 = true
477
- }
478
- }else {
479
- userfire[maps[detail.f_project]] = detail.f_content
480
- if (detail.f_content){
481
- update1 = true
482
- }
483
- }
484
- }
485
- }
486
- }
487
- }
488
- if (update1) {
489
- await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/entity/t_userfire`, userfire, {rejectMsg: '更新点火信息失败!'})
490
- }
491
- if (update2) {
492
- await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/entity/t_userfiles`, userfiles, {rejectMsg: '更新点火信息失败!'})
493
- }
494
- }
495
- this.$showMessage('保存提交成功!', ['confirm'])
496
- } else {
497
- this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
498
- }
499
- this.showNorepair = false
500
- this.showCannotrepair = false
501
- this.$dispatch('tijiao')
502
- }else {
503
- this.$showMessage(`保存提交失败!`, ['confirm'])
504
- }
505
- },
506
- // 检验是否必填 返回 error:{msg:'111',ismust:true}
507
- checkismust(){
508
- var error ={
509
- msg:'',
510
- ifmust:false
511
- }
512
- for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
513
- for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
514
- if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
515
- break;
516
- }
517
- 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){
518
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
519
- error.ifmust = true
520
- return error
521
- }
522
- 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' ){
523
- error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
524
- error.ifmust = true
525
- return error
526
- }
527
- }
528
- }
529
- return error
530
- },
531
- // checkzhihuanwork 检测置换作业是否正常
532
- checkzhihuanwork(){
533
- var isstatus = true
534
- if(this.zhihuan){
535
- for(var i = 0;i<this.zhihuan.details.length;i++){
536
- if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
537
- if(this.zhihuan.details[i].f_status == 'false'){
538
- isstatus = false
539
- break;
540
- }
541
- }
542
- }
543
- }
544
- return isstatus
545
- },
546
- checkzhihuanimg(){
547
- var isstatus = {
548
- check: true,
549
- title:''
550
- }
551
- if(Vue.config.telephone.Outlay.data != undefined){
552
- let checkimgs = ''
553
- console.log('获取拍照配置文件')
554
- console.log(JSON.stringify(this.msg.f_workorder_type)+'22222222222222222')
555
- if(this.service.f_user_type == '民用'){
556
- checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
557
- }else{
558
- checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
559
- }
560
- if(checkimgs.length>0){
561
- for(var i =0;i<checkimgs.length;i++){
562
- var checkimgstype = checkimgs[i].title
563
- if(checkimgs[i].checkmust){
564
- var flag = false
565
- for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
566
- if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
567
- flag = true
568
- break;
569
- }
570
- }
571
- if(!flag){
572
- isstatus.check = false
573
- isstatus.title = checkimgstype
574
- break;
575
- }
576
- }
577
- }
578
- }
579
- }
580
- return isstatus
581
- },
582
- checkservice(){
583
- // 1.先判断灶具
584
- if(this.zaoju){
585
- var iszaoju = false
586
- for(var i = 0;i<this.zaoju.details.length;i++){
587
- if(this.zaoju.details[i].f_project == '有无灶具设备'){
588
- if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
589
- iszaoju = true
590
- break;
591
- }
592
- }
593
- }
594
- if(iszaoju){
595
- for(var i = 0;i<this.zaoju.details.length;i++){
596
- if(this.zaoju.details[i].type == 'picture'){
597
- console.log('照片长度')
598
- console.log(this.zaoju.imgs.length)
599
- if(this.zaoju.imgs.length == 0){
600
- this.$showMessage('灶具设备未拍照!', ['confirm'])
601
- return false
602
- }
603
- }else{
604
- if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
605
- this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
606
- return false
607
- }
608
- }
609
- }
610
- }
611
- }
612
- // 2.判断热水器
613
- if(this.reshuiqi){
614
- var isreshuiqi = false
615
- for(var i = 0;i<this.reshuiqi.details.length;i++){
616
- if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
617
- if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
618
- isreshuiqi = true
619
- break;
620
- }
621
- }
622
- }
623
- if(isreshuiqi){
624
- for(var i = 0;i<this.reshuiqi.details.length;i++){
625
- if(this.reshuiqi.details[i].type == 'picture'){
626
- if(this.reshuiqi.imgs.length == 0){
627
- this.$showMessage('热水器设备未拍照!', ['confirm'])
628
- return false
629
- }
630
- }else{
631
- if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
632
- this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
633
- return false
634
- }
635
- }
636
- }
637
- }
638
- }
639
- // 3.判断壁挂炉
640
- if(this.bigualu){
641
- var isbigualu = false
642
- for(var i = 0;i<this.bigualu.details.length;i++){
643
- if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
644
- if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
645
- isbigualu = true
646
- break;
647
- }
648
- }
649
- }
650
- if(isbigualu){
651
- for(var i = 0;i<this.bigualu.details.length;i++){
652
- if(this.bigualu.details[i].type == 'picture'){
653
- if(this.bigualu.imgs.length == 0){
654
- this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
655
- return false
656
- }
657
- }else{
658
- if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
659
- this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
660
- return false
661
- }
662
- }
663
- }
664
- }
665
- }
666
- return true
667
- },
668
- cannotRepaer() {
669
- this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
670
- this.msg.loginid = Vue.user.id
671
- let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
672
- if (result.result === '成功') {
673
- this.$showMessage('保存提交成功!', ['confirm'])
674
- } else {
675
- this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
676
- }
677
- this.showNorepair = false
678
- this.showCannotrepair = false
679
- this.$dispatch('tijiao')
680
- },
681
- saveCompeleted() {
682
- this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
683
- this.$androidUtil.bzLogic('SaveCompeleted', {row: this.msg})
684
- },
685
- sortDetais(result, type) {
686
- let door = Object.assign({}, result)
687
- door.details = []
688
- for (let i = 0; i < result.details.length; i++) {
689
- if (typeof (result.details[i].f_contentmessage) === 'object') {
690
- for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
691
- if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
692
- let k = result.details[i].f_contentmessage[j].indexOf('-')
693
- let newObj = {}
694
- newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
695
- newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
696
- newObj.f_project = result.details[i].f_project
697
- newObj.f_type = type
698
- door.details.push(newObj)
699
- }
700
- }
701
- }
702
- if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
703
- // console.log('好了')
704
- for (let l = 0; l < result.details[i].f_content.length; l++) {
705
- let new0bj = {}
706
- new0bj.f_content = result.details[i].f_content[l]
707
- new0bj.f_project = result.details[i].f_project
708
- new0bj.f_type = 'a'
709
- door.details.push(new0bj)
710
- }
711
- }
712
- if (typeof(result.details[i].f_content) === 'string') {
713
- door.details.push(result.details[i])
714
- }
715
- }
716
- return door
717
- },
718
- close() {
719
- this.showhead = true
720
- this.showNorepair = false
721
- }
722
- ,
723
- close1() {
724
- this.showhead = true
725
- this.showCannotrepair = false
726
- }
727
- },
728
- ready () {
729
- this.wwcbutten = Vue.config2.telephone.FaultAll.wwcbutten
730
- this.wwxbutten = Vue.config2.telephone.FaultAll.wwxbutten
731
- this.savebutten = Vue.config2.telephone.FaultAll.savebutten
732
- this.jabutten = Vue.config2.telephone.FaultAll.jabutten
733
- this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
734
- // this.wwcbutten = true
735
- // this.wwxbutten = true
736
- // this.savebutten = false
737
- console.log(`未完成按钮:${this.wwcbutten} 无法维修按钮:${this.wwxbutten} 工单保存按钮:${this.savebutten} 结案按钮:${this.jabutten}` )
738
- },
739
- computed: {
740
- stateNoRepair() {
741
- return this.msg.serviceacitivity.find((row) => {
742
- return row.f_result_status === '未维修'
743
- })
744
- },
745
- hunei() {
746
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
747
- return row.f_type === '户内维修' // 换表
748
- })
749
- return this.sortDetais(result, 'a')
750
- // return door
751
- },
752
- hitchAll() {
753
- let hitchMsg = []
754
- let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
755
- return row.f_type === '户内维修' // 户内维修
756
- })
757
- this.obj.details.forEach((row) => {
758
- hitchMsg.push(row)
759
- })
760
- return hitchMsg
761
- }
762
- ,
763
- gaiGuan() {
764
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
765
- // return row.f_service_type === '改管'
766
- return row.f_type === '改管'
767
- })
768
- }
769
- ,
770
- zhihuan() {
771
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
772
- // return row.f_service_type === '改管'
773
- return row.f_type === '置换作业'
774
- })
775
- },
776
- zaoju() {
777
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
778
- // return row.f_service_type === '立管维修'
779
- return row.f_type === '灶具信息'
780
- })
781
- },
782
- reshuiqi() {
783
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
784
- // return row.f_service_type === '立管维修'
785
- return row.f_type === '热水器信息'
786
- })
787
- },
788
- bigualu() {
789
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
790
- // return row.f_service_type === '立管维修'
791
- return row.f_type === '壁挂炉信息'
792
- })
793
- },
794
- sanhuanzhuang() {
795
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
796
- // return row.f_service_type === '立管维修'
797
- return row.f_type === '散户安装'
798
- })
799
- },
800
- sheBeiRepairAll() {
801
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
802
- return row.f_type === '设备维修' // 换表
803
- })
804
- console.log('设备' + JSON.stringify(result))
805
- return this.sortDetais(result, 'b')
806
- },
807
- zaoJuRepairAll() {
808
- let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
809
- return row.f_type === '灶具维修' // 换表
810
- })
811
- return this.sortDetais(result, 'c')
812
- },
813
- troubleDeal() {
814
- return this.msg.serviceacitivity[0].servicerepair.find((row) => {
815
- return row.f_type === '事故处理'
816
- })
817
- }
818
- }
819
- ,
820
- components: {
821
- 'failure-edit':
822
- FailureEdit
823
- }
824
- }
825
- </script>
826
- <style scoped>
827
- .pd-top {
828
- padding-top: 7px;
829
- }
830
- </style>
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="#" 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-show="wwcbutten">
22
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='noRepair'>
23
+ 工单未完
24
+ </button>
25
+ </div>
26
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="jabutten">
27
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='finishRepair'>
28
+ 工单结案
29
+ </button>
30
+ </div>
31
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="wwxbutten">
32
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='cannotRepair'>
33
+ 无法完成
34
+ </button>
35
+ </div>
36
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="sfbutten">
37
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='gotoOtherCharge'>
38
+ 工单收费
39
+ </button>
40
+ </div>
41
+ <div class="col-xs-3 col-sm-3 col-md-3" v-show="savebutten">
42
+ <button type="button" name="button" class="col-sm-3 btn btn-primary"
43
+ @click='workOrderSave'>
44
+ 临时保存
45
+ </button>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div class="panel panel-default auto repair-info-content"
53
+ v-if="msg.serviceacitivity[0].f_result_status == '已完成' && !show">
54
+ <div class="panel-body ">
55
+ <div class="row auto compatible">
56
+ <div class="row auto">
57
+ <div class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;" v-show="false">
58
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click='saveCompeleted()'>
59
+ 保存
60
+ </button>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showNorepair">
67
+ <div>
68
+ <p><big><b>工单未完成</b></big></p>
69
+ </div>
70
+ <div class="row">
71
+ <div class="col-sm-12 form-group form-fix-width">
72
+ <label class="control-label">原因</label>
73
+ <textarea name="name" rows="2" class="form-control ver-textarea"
74
+ v-model="msg.serviceacitivity[0].f_reason"></textarea>
75
+ </div>
76
+ </div>
77
+ <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
78
+ </failure-edit>
79
+ <div class="form-group">
80
+ <button type="button" class="btn btn-default pull-right" @click='close'>取消</button>
81
+ <button type="button" class="btn btn-success pull-right" @click='confirm("未完成")'>确认</button>
82
+ </div>
83
+ </div>
84
+ <div class="panel panel-default auto repair-info-content form-horizontal" v-if="showCannotrepair">
85
+ <div>
86
+ <p><big><b>无法完成</b></big></p>
87
+ </div>
88
+ <div class="row">
89
+ <div class="col-sm-12 form-group form-fix-width">
90
+ <label class="control-label">原因</label>
91
+ <textarea name="name" rows="2" class="form-control ver-textarea"
92
+ v-model="msg.serviceacitivity[0].f_reason"></textarea>
93
+ </div>
94
+ </div>
95
+ <failure-edit :value='msg.serviceacitivity[0].failure' @input='newFailure' v-if="msg.f_workorder_type == '报修单'">
96
+ </failure-edit>
97
+ <div class="row">
98
+ <div class="col-sm-12">
99
+ <button type="button" class="btn btn-default pull-right" @click='close1'>取消</button>
100
+ <button type="button" class="btn btn-success pull-right" @click='cannotRepaer()'>确认</button>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </template>
106
+ <script>
107
+ import Vue from 'vue'
108
+ import * as Util from '../../../components/Util'
109
+ import {HttpResetClass} from 'vue-client'
110
+ import FailureEdit from '../../../components/pc/FailureEdit'
111
+
112
+ export default {
113
+ title: '故障汇总',
114
+ props: {
115
+ msg: {
116
+ type: Object
117
+ },
118
+ savevalid: {
119
+ type: Object
120
+ },
121
+ model: {
122
+ type: Object
123
+ },
124
+ show: {
125
+ type: Boolean,
126
+ default: false
127
+ },
128
+ system: ''
129
+ },
130
+ data() {
131
+ return {
132
+ savebutten:false, // 工单保存按钮
133
+ wwcbutten:false, // 未完成按钮
134
+ wwxbutten:false, // 未维修按钮
135
+ jabutten:false, //结案按钮
136
+ sfbutten:false, //收费按钮
137
+ fileName: '',
138
+ datajson: '',
139
+ norepair: '',
140
+ showNorepair: false,
141
+ showCannotrepair: false,
142
+ showhead: true,
143
+ repairers : this.$appdata.getParam('站点管理员'),
144
+ config:{},
145
+ othercharge_id: ''
146
+ }
147
+ },
148
+ methods: {
149
+ // 工单收费
150
+ async gotoOtherCharge() {
151
+ console.log('去工单收费界面!')
152
+ let con = {
153
+ conndition: ` f_userinfo_id = '${this.msg.f_userinfo_id}' and f_table_state = '正常' `
154
+ }
155
+ let http1 = new HttpResetClass()
156
+ let row = await http1.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/onlinequeryuser`, {data: con},{
157
+ resolveMsg: '物联网收费成功!!',
158
+ rejectMsg: '物联网收费出错!!!'
159
+ })
160
+ console.log(JSON.stringify('获取用户信息返回==='+JSON.stringify(row)))
161
+ // 去其他收费界面
162
+ let _this = this
163
+ var pardate = {
164
+ _this:_this,
165
+ title:'其他收费',
166
+ safe:false
167
+ }
168
+ _this.$dispatch('gotoson',pardate)
169
+ console.log('进入other_charge')
170
+ _this.$goto('other_charge', {row: row}, 'self',_this.payback)
171
+ // _this.$goto('create_qrcode', {row: parameter}, 'self',_this.payback)
172
+ },
173
+ payback(msg) {
174
+ if (msg) {
175
+ console.log('q其他收费记录id555555555'+JSON.stringify(msg))
176
+ this.othercharge_id = msg
177
+ }else {
178
+ console.log('支付未成功!')
179
+ this.$showMessage('支付失败!')
180
+ }
181
+ },
182
+ // 工单结案
183
+ finishRepair(){
184
+ var _this = this
185
+ this.$showMessage('请确认该工单结案!', ['confirm', 'cancel']).then((res) => {
186
+ if (res === 'confirm') {
187
+ _this.confirm("结案")
188
+ }
189
+ })
190
+ },
191
+ deleteEmptyProperty(object){
192
+ for (var i in object) {
193
+ var value = object[i];
194
+ if (typeof value === 'object') {
195
+ if (Array.isArray(value)) {
196
+ if (value.length == 0) {
197
+ delete object[i];
198
+ console.log('delete Array', i);
199
+ continue;
200
+ }
201
+ }
202
+ this.deleteEmptyProperty(value);
203
+ if (this.isEmpty(value)) {
204
+ console.log('isEmpty true', i, value);
205
+ delete object[i];
206
+ console.log('delete a empty object');
207
+ }
208
+ } else {
209
+ if (value === '' || value === null || value === undefined) {
210
+ delete object[i];
211
+ console.log('delete ', i);
212
+ } else {
213
+ console.log('check ', i, value);
214
+ }
215
+ }
216
+ }
217
+ },
218
+ isEmpty(object) {
219
+ for (var name in object) {
220
+ return false;
221
+ }
222
+ return true;
223
+ },
224
+ // 从图片中删除
225
+ remove(row) {
226
+ this.$androidUtil.delfile(row.android_file)
227
+ let pos = this.model.imgs.findIndex((value) => {
228
+ return value === row
229
+ })
230
+ this.model.imgs.splice(pos, 1)
231
+ },
232
+ // fileName: 回传文件名,传入的带安卓路径url
233
+ // prop: 传入的字段名,没做改动
234
+ cameraCallBack(prop, fileName) {
235
+ // 当前this只能通过HostApp.__tis__获取
236
+ let self = this.$androidUtil.getCallBack(this)
237
+ // 添加新图片
238
+ self.model.imgs.push({
239
+ android_file: self.fileName,
240
+ path: fileName
241
+ })
242
+ },
243
+ takePic() {
244
+ let prop = 'repair'
245
+ let idx = 'aofeng'
246
+ this.fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
247
+ this.$sandroidUtil.takePic(this, this.cameraCallBack, this.fileName)
248
+ },
249
+ newFailure(value) {
250
+ this.msg.serviceacitivity[0].failure = value
251
+ },
252
+ noRepair() {
253
+ this.showhead = false
254
+ this.showNorepair = true
255
+ HostApp.backupDatabase()
256
+ },
257
+ cannotRepair() {
258
+ this.showhead = false
259
+ this.showCannotrepair = true
260
+ // falg:0, 表示第一次上传,批量上传时,flag:1
261
+ // this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
262
+ },
263
+ // 测试环境下模拟上传失败
264
+ fail(param) {
265
+ this.msg.serviceacitivity[0].f_result_status = param
266
+ this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg, test: true})
267
+ },
268
+ async workOrderSave(){
269
+ this.norepair = false
270
+ if (this.hunei && this.hunei.details) {
271
+ for (let i = 0; i < this.hunei.details.length; i++) {
272
+ if (this.hunei.details[i].f_project === '未维修') {
273
+ this.norepair = true
274
+ }
275
+ }
276
+ }
277
+ // 用户基本信息转字符串
278
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
279
+ this.msg.serviceacitivity[0].f_result_status = '工单保存'
280
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
281
+ this.deleteEmptyProperty(this.msg)
282
+ HostApp.__this__ = this
283
+ HostApp.logicWithHint({
284
+ // logic别名,key必须为logic
285
+ 'logic': 'workOrderSave',
286
+ // 回调执行方法名,key必须为callback
287
+ 'callback': 'javascript:HostApp.__this__.localSaveCallBack()',
288
+ // logic执行需要的业务参数
289
+ 'data': {row: this.msg},
290
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
291
+ // 执行回调方法传入key为backresult
292
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
293
+ 'backresult': 1
294
+ })
295
+ },
296
+ localSaveCallBack(res){
297
+ if(res.state == 'ok'){
298
+ let result = JSON.parse(res.result)
299
+ if(result.result == '成功'){
300
+ this.$showMessage('工单保存成功!', ['confirm'])
301
+ this.$dispatch('tijiao')
302
+ }else{
303
+ this.$showMessage(`工单保存失败! ${result.errMsg}`, ['confirm'])
304
+ }
305
+ this.$dispatch('tijiao')
306
+ }else {
307
+ this.$showMessage(`保存提交失败!`, ['confirm'])
308
+ }
309
+ },
310
+ // 工单上传
311
+ async confirm(param) {
312
+ /*console.log('是否换表----'+JSON.stringify(this.model.ischange))
313
+ if(!this.model.ischange) {
314
+ this.$showMessage('您还为进行换表操作,工单为完成!,')
315
+ return
316
+ }*/
317
+
318
+ this.norepair = false
319
+ if (this.hunei && this.hunei.details) {
320
+ for (let i = 0; i < this.hunei.details.length; i++) {
321
+ if (this.hunei.details[i].f_project === '未维修') {
322
+ this.norepair = true
323
+ }
324
+ }
325
+ }
326
+ if(param != '结案'&& (this.msg.f_workorder_type == '置换通气单'||this.msg.f_workorder_type == '安装单')) {
327
+ // 检测验证是否必填
328
+ var isfinish = this.checkismust()
329
+ if(isfinish.ifmust){
330
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
331
+ return
332
+ }
333
+ // 检测签名是否完成
334
+ // if(!(this.msg.serviceacitivity[0].f_signname)) {
335
+ // this.$showMessage(`请完成客户签名!`, ['confirm'])
336
+ // return
337
+ // }
338
+ // 检测置换作业是否有异常
339
+ var yinhuanflag = this.checkzhihuanwork()
340
+ if(!yinhuanflag){
341
+ var resy = await this.$showMessage('是否确认该户置换作业异常?', ['confirm', 'cancel'])
342
+ if(resy == 'cancel'){
343
+ return
344
+ }
345
+ this.msg.f_is_abnormal = '异常'
346
+ this.msg.serviceacitivity[0].f_is_abnormal = '异常'
347
+ }
348
+ // 检测置换照片是否已拍
349
+ // var imgflag = this.checkzhihuanimg()
350
+ // if(!(imgflag.check)){
351
+ // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
352
+ // return
353
+ // }
354
+ }
355
+ else if(this.msg.f_workorder_type == '报修单' && param != '结案'){
356
+ let isfinish = this.checkismust()
357
+ if(isfinish.ifmust){
358
+ this.$showMessage(`请录入${isfinish.msg}信息!`, ['confirm'])
359
+ return
360
+ }
361
+ // if(!(this.msg.serviceacitivity[0].f_signname)) {
362
+ // this.$showMessage(`请完成客户签名!`, ['confirm'])
363
+ // return
364
+ // }
365
+ // let imgflag = this.checkzhihuanimg()
366
+ // if(!(imgflag.check)){
367
+ // this.$showMessage(`${imgflag.title}未拍照!`, ['confirm'])
368
+ // return
369
+ // }
370
+ }
371
+ // }
372
+ // 用户基本信息转字符串
373
+ // if ((this.savevalid.uservalid && this.savevalid.doorvalid) || this.norepair || this.liGuanWeiXou || this.sheBeiRepairAll) {
374
+ this.msg.serviceacitivity[0].f_date_leave = Util.toStandardTimeString()
375
+ this.msg.serviceacitivity[0].f_result_status = param
376
+ this.msg.serviceacitivity[0].f_order_man = Vue.user.name
377
+ this.msg.loginid = Vue.user.id
378
+ // if (!this.savevalid.changetable && this.model.servicerepair && this.model.servicerepair[0].f_if_change) {
379
+ // this.$showMessage('未上传收费!', ['confirm'])
380
+ // } else {
381
+ this.deleteEmptyProperty(this.msg)
382
+ console.log('上传参数11111111111')
383
+ console.log(JSON.stringify(this.msg))
384
+ HostApp.__this__ = this
385
+ HostApp.logicWithHint({
386
+ // logic别名,key必须为logic
387
+ 'logic': 'upload',
388
+ // 回调执行方法名,key必须为callback
389
+ 'callback': 'javascript:HostApp.__this__.uploadCallback()',
390
+ // logic执行需要的业务参数
391
+ 'data': {flag: 0, row: this.msg},
392
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
393
+ // 执行回调方法传入key为backresult
394
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
395
+ 'backresult': 1
396
+ })
397
+ // let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
398
+ // } else {
399
+ // this.$showMessage('有未填写项', ['confirm'])
400
+ // }
401
+ },
402
+ async uploadCallback(res){
403
+ if(res.state == 'ok'){
404
+ let result = JSON.parse(res.result)
405
+ if (result.result === '成功') {
406
+ if (this.msg.serviceacitivity.length && this.msg.serviceacitivity[0].servicerepair
407
+ && this.msg.serviceacitivity[0].servicerepair.length && this.msg.f_workorder_type == '置换通气单'){
408
+ let res = await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/saleSingleTable`, {data: {
409
+ items:"*",
410
+ tablename:"t_userfiles",
411
+ condition:`f_userinfo_id = ${this.msg.serviceacitivity[0].baseuserinfo.f_userinfo_id} and f_table_state = '正常'`,
412
+ orderitem:"f_userfiles_id"
413
+ }})
414
+ console.log('res=', JSON.stringify(res))
415
+ let res2 = await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/saleSingleTable`, {data: {
416
+ items:"*",
417
+ tablename:"t_userfire",
418
+ condition:`f_userfiles_id = '${res.data[0].f_userfiles_id}' and f_state = '有效'`,
419
+ orderitem:"f_userfiles_id"
420
+ }})
421
+ let maps = {
422
+ "镀锌管": "f_galvanize_pipe",
423
+ "三通": "f_tee",
424
+ "对丝": "f_nipple",
425
+ "弯头": "f_elbow",
426
+ "管卡": "f_pipe_strap",
427
+ "灶前阀": "f_zqf",
428
+ "胶管": "f_sebific_duct",
429
+ "自闭阀": "f_zbf",
430
+ "表前阀": "f_bqf_type",
431
+ "报警器": "f_alarm_code",
432
+ "灶具品牌": "f_gas_appliance",
433
+ "壁挂炉品牌": "f_bgl",
434
+ "热水器品牌": "f_geyser",
435
+ "表封号": "f_metertitles",
436
+ "表向": "f_aroundmeter",
437
+ }
438
+ if (this.msg.serviceacitivity[0].baseuserinfo.f_user_type != '民用'){
439
+ maps = {
440
+ "流量计品牌": "f_flowmeter_brand",
441
+ "流量计型号": "f_flowmeter_model",
442
+ "流量计类型": "f_llj_type",
443
+ "流量范围(m³/h)": "f_llj_range",
444
+
445
+ "控制器品牌": "f_control_brand",
446
+ "控制器型号": "f_control_model",
447
+ "控制器编号": "f_control_code",
448
+
449
+ "灶具品牌": "f_appliance_brand",
450
+ "灶具型号": "f_appliance_model",
451
+
452
+ "气表品牌": "f_fire_gasbrand",
453
+ "表向": "f_aroundmeter",
454
+ }
455
+ }
456
+ const userfire = {
457
+ id: res2.data[0].id,
458
+ f_lgniter: Vue.user.name,
459
+ f_operator: Vue.user.name,
460
+ f_operatorid: Vue.user.id,
461
+ f_operate_date: Util.toStandardTimeString()
462
+ }
463
+ const userfiles = {
464
+ f_userfiles_id: res.data[0].f_userfiles_id,
465
+ version: res.data[0].version
466
+ }
467
+ let update1 = false
468
+ let update2 = false
469
+ for (const item of this.msg.serviceacitivity[0].servicerepair) {
470
+ if (item.details[0].f_content == '有' || item.f_type == '表具信息'){
471
+ for (const detail of item.details) {
472
+ if (maps[detail.f_project]) {
473
+ if (['表前阀', '报警器', '表封号', '表向', '流量计品牌', '流量计型号', '流量计类型', '流量范围(m³/h)'].indexOf(detail.f_project) >= 0){
474
+ userfiles[maps[detail.f_project]] = detail.f_content
475
+ if (detail.f_content){
476
+ update2 = true
477
+ }
478
+ }else {
479
+ userfire[maps[detail.f_project]] = detail.f_content
480
+ if (detail.f_content){
481
+ update1 = true
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ }
488
+ if (update1) {
489
+ await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/entity/t_userfire`, userfire, {rejectMsg: '更新点火信息失败!'})
490
+ }
491
+ if (update2) {
492
+ await new HttpResetClass().load('POST',`${this.$androidUtil.getProxyUrl()}/rs/entity/t_userfiles`, userfiles, {rejectMsg: '更新点火信息失败!'})
493
+ }
494
+ }
495
+ this.$showMessage('保存提交成功!', ['confirm'])
496
+ } else {
497
+ this.$showMessage(`保存提交失败!${result.errMsg}`, ['confirm'])
498
+ }
499
+ this.showNorepair = false
500
+ this.showCannotrepair = false
501
+ this.$dispatch('tijiao')
502
+ }else {
503
+ this.$showMessage(`保存提交失败!`, ['confirm'])
504
+ }
505
+ },
506
+ // 检验是否必填 返回 error:{msg:'111',ismust:true}
507
+ checkismust(){
508
+ var error ={
509
+ msg:'',
510
+ ifmust:false
511
+ }
512
+ for(var i = 0;i<this.msg.serviceacitivity[0].servicerepair.length;i++) {
513
+ for (var j = 0; j < this.msg.serviceacitivity[0].servicerepair[i].details.length; j++) {
514
+ if(this.msg.serviceacitivity[0].servicerepair[i].details[j].type == 'checkbox'&&this.msg.serviceacitivity[0].servicerepair[i].details[j].f_content == '无'){
515
+ break;
516
+ }
517
+ 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){
518
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
519
+ error.ifmust = true
520
+ return error
521
+ }
522
+ 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' ){
523
+ error.msg = `${this.msg.serviceacitivity[0].servicerepair[i].f_type}中${this.msg.serviceacitivity[0].servicerepair[i].details[j].f_project}`
524
+ error.ifmust = true
525
+ return error
526
+ }
527
+ }
528
+ }
529
+ return error
530
+ },
531
+ // checkzhihuanwork 检测置换作业是否正常
532
+ checkzhihuanwork(){
533
+ var isstatus = true
534
+ if(this.zhihuan){
535
+ for(var i = 0;i<this.zhihuan.details.length;i++){
536
+ if(this.zhihuan.details[i].type == 'radio' && this.zhihuan.details[i].f_content){
537
+ if(this.zhihuan.details[i].f_status == 'false'){
538
+ isstatus = false
539
+ break;
540
+ }
541
+ }
542
+ }
543
+ }
544
+ return isstatus
545
+ },
546
+ checkzhihuanimg(){
547
+ var isstatus = {
548
+ check: true,
549
+ title:''
550
+ }
551
+ if(Vue.config.telephone.Outlay.data != undefined){
552
+ let checkimgs = ''
553
+ console.log('获取拍照配置文件')
554
+ console.log(JSON.stringify(this.msg.f_workorder_type)+'22222222222222222')
555
+ if(this.service.f_user_type == '民用'){
556
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].civil)))
557
+ }else{
558
+ checkimgs = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.msg.f_workorder_type].nocivil)))
559
+ }
560
+ if(checkimgs.length>0){
561
+ for(var i =0;i<checkimgs.length;i++){
562
+ var checkimgstype = checkimgs[i].title
563
+ if(checkimgs[i].checkmust){
564
+ var flag = false
565
+ for(var j =0;j<this.msg.serviceacitivity[0].imgs.length;j++){
566
+ if(this.msg.serviceacitivity[0].imgs[j].imgpath == checkimgstype) {
567
+ flag = true
568
+ break;
569
+ }
570
+ }
571
+ if(!flag){
572
+ isstatus.check = false
573
+ isstatus.title = checkimgstype
574
+ break;
575
+ }
576
+ }
577
+ }
578
+ }
579
+ }
580
+ return isstatus
581
+ },
582
+ checkservice(){
583
+ // 1.先判断灶具
584
+ if(this.zaoju){
585
+ var iszaoju = false
586
+ for(var i = 0;i<this.zaoju.details.length;i++){
587
+ if(this.zaoju.details[i].f_project == '有无灶具设备'){
588
+ if(this.zaoju.details[i].f_content == '有'||this.zaoju.details[i].f_content == ''){
589
+ iszaoju = true
590
+ break;
591
+ }
592
+ }
593
+ }
594
+ if(iszaoju){
595
+ for(var i = 0;i<this.zaoju.details.length;i++){
596
+ if(this.zaoju.details[i].type == 'picture'){
597
+ console.log('照片长度')
598
+ console.log(this.zaoju.imgs.length)
599
+ if(this.zaoju.imgs.length == 0){
600
+ this.$showMessage('灶具设备未拍照!', ['confirm'])
601
+ return false
602
+ }
603
+ }else{
604
+ if(this.zaoju.details[i].f_content == '' || this.zaoju.details[i].f_content == undefined){
605
+ this.$showMessage('灶具设备信息未填写完整!', ['confirm'])
606
+ return false
607
+ }
608
+ }
609
+ }
610
+ }
611
+ }
612
+ // 2.判断热水器
613
+ if(this.reshuiqi){
614
+ var isreshuiqi = false
615
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
616
+ if(this.reshuiqi.details[i].f_project == '有无热水器设备'){
617
+ if(this.reshuiqi.details[i].f_content == '有'||this.reshuiqi.details[i].f_content == ''){
618
+ isreshuiqi = true
619
+ break;
620
+ }
621
+ }
622
+ }
623
+ if(isreshuiqi){
624
+ for(var i = 0;i<this.reshuiqi.details.length;i++){
625
+ if(this.reshuiqi.details[i].type == 'picture'){
626
+ if(this.reshuiqi.imgs.length == 0){
627
+ this.$showMessage('热水器设备未拍照!', ['confirm'])
628
+ return false
629
+ }
630
+ }else{
631
+ if(this.reshuiqi.details[i].f_content == '' || this.reshuiqi.details[i].f_content == undefined){
632
+ this.$showMessage('热水器设备信息未填写完整!', ['confirm'])
633
+ return false
634
+ }
635
+ }
636
+ }
637
+ }
638
+ }
639
+ // 3.判断壁挂炉
640
+ if(this.bigualu){
641
+ var isbigualu = false
642
+ for(var i = 0;i<this.bigualu.details.length;i++){
643
+ if(this.bigualu.details[i].f_project == '有无壁挂炉设备'){
644
+ if(this.bigualu.details[i].f_content == '有'||this.bigualu.details[i].f_content == ''){
645
+ isbigualu = true
646
+ break;
647
+ }
648
+ }
649
+ }
650
+ if(isbigualu){
651
+ for(var i = 0;i<this.bigualu.details.length;i++){
652
+ if(this.bigualu.details[i].type == 'picture'){
653
+ if(this.bigualu.imgs.length == 0){
654
+ this.$showMessage('壁挂炉设备未拍照!', ['confirm'])
655
+ return false
656
+ }
657
+ }else{
658
+ if(this.bigualu.details[i].f_content == '' || this.bigualu.details[i].f_content == undefined){
659
+ this.$showMessage('壁挂炉设备信息未填写完整!', ['confirm'])
660
+ return false
661
+ }
662
+ }
663
+ }
664
+ }
665
+ }
666
+ return true
667
+ },
668
+ cannotRepaer() {
669
+ this.msg.serviceacitivity[0].f_service_acitivity_type = '未维修'
670
+ this.msg.loginid = Vue.user.id
671
+ let result = this.$androidUtil.bzLogic('upload', {flag: 0, row: this.msg})
672
+ if (result.result === '成功') {
673
+ this.$showMessage('保存提交成功!', ['confirm'])
674
+ } else {
675
+ this.$showMessage(`保存提交失败!${JSON.stringify(result)}`, ['confirm'])
676
+ }
677
+ this.showNorepair = false
678
+ this.showCannotrepair = false
679
+ this.$dispatch('tijiao')
680
+ },
681
+ saveCompeleted() {
682
+ this.msg.serviceacitivity[0].baseuserinfo.f_date_level = Util.toStandardTimeString()
683
+ this.$androidUtil.bzLogic('SaveCompeleted', {row: this.msg})
684
+ },
685
+ sortDetais(result, type) {
686
+ let door = Object.assign({}, result)
687
+ door.details = []
688
+ for (let i = 0; i < result.details.length; i++) {
689
+ if (typeof (result.details[i].f_contentmessage) === 'object') {
690
+ for (let j = 0; j < result.details[i].f_contentmessage.length; j++) {
691
+ if (result.details[i].f_contentmessage[j].indexOf('-') !== -1) {
692
+ let k = result.details[i].f_contentmessage[j].indexOf('-')
693
+ let newObj = {}
694
+ newObj.f_content = result.details[i].f_contentmessage[j].substring(k + 1, result.details[i].f_contentmessage[j].length)
695
+ newObj.f_contentmessage = result.details[i].f_contentmessage[j].substring(0, k)
696
+ newObj.f_project = result.details[i].f_project
697
+ newObj.f_type = type
698
+ door.details.push(newObj)
699
+ }
700
+ }
701
+ }
702
+ if (typeof (result.details[i].f_content) === 'object' && !result.details[i].f_contentmessage) {
703
+ // console.log('好了')
704
+ for (let l = 0; l < result.details[i].f_content.length; l++) {
705
+ let new0bj = {}
706
+ new0bj.f_content = result.details[i].f_content[l]
707
+ new0bj.f_project = result.details[i].f_project
708
+ new0bj.f_type = 'a'
709
+ door.details.push(new0bj)
710
+ }
711
+ }
712
+ if (typeof(result.details[i].f_content) === 'string') {
713
+ door.details.push(result.details[i])
714
+ }
715
+ }
716
+ return door
717
+ },
718
+ close() {
719
+ this.showhead = true
720
+ this.showNorepair = false
721
+ }
722
+ ,
723
+ close1() {
724
+ this.showhead = true
725
+ this.showCannotrepair = false
726
+ }
727
+ },
728
+ ready () {
729
+ this.wwcbutten = Vue.config2.telephone.FaultAll.wwcbutten
730
+ this.wwxbutten = Vue.config2.telephone.FaultAll.wwxbutten
731
+ this.savebutten = Vue.config2.telephone.FaultAll.savebutten
732
+ this.jabutten = Vue.config2.telephone.FaultAll.jabutten
733
+ this.sfbutten = Vue.config2.telephone.FaultAll.sfbutten?true:false
734
+ // this.wwcbutten = true
735
+ // this.wwxbutten = true
736
+ // this.savebutten = false
737
+ console.log(`未完成按钮:${this.wwcbutten} 无法维修按钮:${this.wwxbutten} 工单保存按钮:${this.savebutten} 结案按钮:${this.jabutten}` )
738
+ },
739
+ computed: {
740
+ stateNoRepair() {
741
+ return this.msg.serviceacitivity.find((row) => {
742
+ return row.f_result_status === '未维修'
743
+ })
744
+ },
745
+ hunei() {
746
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
747
+ return row.f_type === '户内维修' // 换表
748
+ })
749
+ return this.sortDetais(result, 'a')
750
+ // return door
751
+ },
752
+ hitchAll() {
753
+ let hitchMsg = []
754
+ let obj = this.msg.serviceacitivity[0].servicerepair.find((row) => {
755
+ return row.f_type === '户内维修' // 户内维修
756
+ })
757
+ this.obj.details.forEach((row) => {
758
+ hitchMsg.push(row)
759
+ })
760
+ return hitchMsg
761
+ }
762
+ ,
763
+ gaiGuan() {
764
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
765
+ // return row.f_service_type === '改管'
766
+ return row.f_type === '改管'
767
+ })
768
+ }
769
+ ,
770
+ zhihuan() {
771
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
772
+ // return row.f_service_type === '改管'
773
+ return row.f_type === '置换作业'
774
+ })
775
+ },
776
+ zaoju() {
777
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
778
+ // return row.f_service_type === '立管维修'
779
+ return row.f_type === '灶具信息'
780
+ })
781
+ },
782
+ reshuiqi() {
783
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
784
+ // return row.f_service_type === '立管维修'
785
+ return row.f_type === '热水器信息'
786
+ })
787
+ },
788
+ bigualu() {
789
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
790
+ // return row.f_service_type === '立管维修'
791
+ return row.f_type === '壁挂炉信息'
792
+ })
793
+ },
794
+ sanhuanzhuang() {
795
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
796
+ // return row.f_service_type === '立管维修'
797
+ return row.f_type === '散户安装'
798
+ })
799
+ },
800
+ sheBeiRepairAll() {
801
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
802
+ return row.f_type === '设备维修' // 换表
803
+ })
804
+ console.log('设备' + JSON.stringify(result))
805
+ return this.sortDetais(result, 'b')
806
+ },
807
+ zaoJuRepairAll() {
808
+ let result = this.msg.serviceacitivity[0].servicerepair.find((row) => {
809
+ return row.f_type === '灶具维修' // 换表
810
+ })
811
+ return this.sortDetais(result, 'c')
812
+ },
813
+ troubleDeal() {
814
+ return this.msg.serviceacitivity[0].servicerepair.find((row) => {
815
+ return row.f_type === '事故处理'
816
+ })
817
+ }
818
+ }
819
+ ,
820
+ components: {
821
+ 'failure-edit':
822
+ FailureEdit
823
+ }
824
+ }
825
+ </script>
826
+ <style scoped>
827
+ .pd-top {
828
+ padding-top: 7px;
829
+ }
830
+ </style>