claimsNoteDetail.js
3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import { equityApi } from '~/api/api'
Page({
data: {
statusList: [
{
name: '待受理',
activeName: '已受理',
invalidName: '已失效',
invalid: false,
active: false,
left: false,
right: false
},
{
name: '待定损',
activeName: '已定损',
active: false,
left: false,
right: false
},
{
name: '待服务',
activeName: '已服务',
active: false,
left: false,
right: false
}
],
currentStatus: 0,
detailInfo: {}
},
onLoad(options) {
if (options && options?.writeOffCode) {
this.getDetail(options.writeOffCode)
}
},
getDetail(writeOffCode) {
equityApi.getClaimsDetail({writeOffCode}).then(res => {
// 32:待受理,40:已失效,33:待定损 34:定损通过 35:定损不通过 23:待核赔" 状态是其余值时,统一展示为已服务
if (![32, 40, 33, 34, 35, 23].includes(res.status)) res.status = 23
let tempArr = []
res?.attachmentList?.forEach(ele=>{
if(ele.firstClassifyName=='现场照片'){
tempArr = ele.attachments
res.images = tempArr
}
})
let strlist = []
res?.serviceItemsList?.forEach(k=>{
strlist.push(k.serviceItemName)
})
res.serviceItemsListStr = strlist.join('、')
this.setData({
detailInfo: res
}, () => {
this.handlerStatus(this.data.detailInfo)
})
})
},
// 处理状态展示 案件状态,32:待受理,40:已失效,33:待定损 34:定损通过 35:定损不通过 23:待核赔"
handlerStatus(detailInfo) {
let { statusList } = this.data
const status = detailInfo?.status
if (status == 40) { // 已失效
statusList[0].invalid = true
} else if (status == 33 || status == 35) { // 待定损 定损不通过
statusList[0].active = true
statusList[0].right = true
statusList[1].left = true
} else if (status == 34) { // 定损通过
statusList[0].active = true
statusList[0].right = true
statusList[1].active = true
statusList[1].left = true
statusList[1].right = true
statusList[2].left = true
} else if (status == 23) { // 待核赔或其他状态
statusList[0].active = true
statusList[0].right = true
statusList[1].active = true
statusList[1].left = true
statusList[1].right = true
statusList[2].active = true
statusList[2].left = true
statusList[2].right = true
}
this.setData({
statusList,
currentStatus: [32, 40]?.includes(status) ? 0 : [33, 35]?.includes(status) ? 1 : [34] ? 2 : ''
})
},
// 复制核销码
setCopyData() {
wx.$api.setCopyData(`${this.data.detailInfo.writeOffCode}`, () => {
wx.$api.showToast('复制成功')
})
},
callPhone(e) {
const { phone } = e.currentTarget.dataset
if (!phone) return
wx.$api.phoneCall(phone)
},
toPreview(e) {
const { item } = e.currentTarget.dataset
wx.previewImage({
current: item, // 当前显示图片的 http 链接
urls: [item] // 需要预览的图片 http 链接列表
})
}
})