claimsNote.js
2.24 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
import {equityApi} from "../../../api/api"
Page({
data: {
showPage:false,
noteList:[],
isCanFresh:false,
status:['待受理','待定损','待服务','待确认','已确认','已失效','已删除','已结束']
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options&&options.formPage=='apply'){
wx.navigateTo({
url: '/packageEquity/pages/claimsNoteDetail/claimsNoteDetail?hxcode='+options.hxcode,
});
this.setData({isCanFresh:true,contractNo:options.contractNo})
return
}
wx.$util.showLoading('加载中...')
this.getList(options.contractNo)
},
onShow(){
let {isCanFresh,contractNo} = this.data
if(isCanFresh){
this.getList(contractNo)
}
},
toDetail(e){
const {item} = e.currentTarget.dataset
this.data.isCanFresh = true
if([5,6,7].includes(Number(item.customerStatus)))return
wx.navigateTo({
url: '/packageEquity/pages/claimsNoteDetail/claimsNoteDetail?hxcode='+item.writeOffCode,
});
},
// 获取列表
getList(contractNo){
equityApi.claimsList({contractNo}).then(res=>{
wx.hideLoading();
if(res&&res.length){
let tempArr = []
res.forEach(el=>{
el.customerStatus = Number(el.customerStatus) || 0
el.attachmentList.forEach(ele=>{
if(ele.firstClassifyName=='现场照片'){
tempArr = ele.attachments
el.images = tempArr
}
})
let strlist = []
el.serviceItemsList.forEach(k=>{
strlist.push(k.serviceItemName)
})
el.serviceItemsListStr = strlist.join(' ')
})
}
this.setData({
noteList:res || [],
showPage:res.length?false:true,
contractNo
})
})
},
toPreview(e) {
const { item } = e.currentTarget.dataset
wx.previewImage({
current: item, // 当前显示图片的 http 链接
urls: [item] // 需要预览的图片 http 链接列表
})
},
// 打开地图
openMap(e) {
const target = e.currentTarget.dataset.item
wx.openLocation({
latitude: parseFloat(target.merchantLat),
longitude: parseFloat(target.merchantLng),
address: target.merchantAddress
})
},
})