properties.js
3.88 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import util from '../../../utils/util.js'
const toolList = ['新车精品升级']
const rankingText = ['金额', '人数']
const toolText = ['累计', '日期']
const topCondition = 0
const trapezoidColor = ['#5B84FE', '#57BDFF', '#58E39F']
const resultList = [{
key: 'totalPriceCount',
title: '销售额(元)'
},
// {
// key: 'shopProfitMoneyCount',
// title: '店面分润(元)'
// },
{
key: 'customerUnitCost',
title: '客单价(元)'
}
]
const trapezoid = [{
name: '发券量',
key: 'getTotal'
},
{
name: '核券量',
key: 'usedTotal'
},
{
name: '转化量',
key: 'upgradeTotal'
}
]
const orderObj = [{
label: '客户姓名:',
key: 'customerName'
},
{
label: '车架号:',
key: 'standNo'
},
{
label: '转化产品:',
key: 'goodsListName'
},
{
label: '转化金额:',
key: 'totalPrice'
},
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
{
label: {
3: '工单时间:',
4: '工单时间:',
5: '工单时间:',
6: '工单时间:',
},
enum: true,
key: 'time'
}
]
const canvasObj = {
usedRatio: {
color: '#58E39F',
title: '核券率',
val: 0
},
upgradeRatio: {
color: '#FFAB00',
title: '转化率',
val: 0
}
}
const maxDate = new Date().format('yyyy-MM-dd')
const rankingTime = {
startDate: new Date().format('yyyy-MM'),
endDate: new Date().format('yyyy-MM')
}
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 , 9 已撤销
const orderStatus = {
1: {
text: '待跟进',
color: '#A3A5AD'
},
2: {
text: '不升级',
color: '#EF4342'
},
3: {
text: '待支付',
color: '#FF9834'
},
4: {
text: '已支付',
color: '#07C160'
},
6: {
text: '已评价',
color: '#05BAA0'
},
9:{
text:'已撤销',
color: '#999'
}
}
module.exports = {
pageData: {
maxDate,
toolList,
orderObj,
trapezoid,
canvasObj,
resultList,
rankingText,
rankingTime,
topCondition,
trapezoidColor,
usedRatio: () => {},
upgradeRatio: () => {},
rankingList: [],
orderList: [],
orderStatus,
chartShow: false,
toolText,
toolIndex: 0,
couponIndex:0,
couponList:[]
},
methods: {
initChart(F2, config, options) {
let {
val,
title,
color
} = options
if(!val) val = 0
config.padding = [10, 0, 20, 0]
const chart = new F2.Chart(config)
const data = [{
x: '0',
y: util.decimal(val * 100, 2)
}]
chart.source(data, {
y: {
max: 100,
min: 0
}
})
chart.legend(false)
chart.coord('polar', {
transposed: true,
innerRadius: 0.8,
radius: 0.85
})
chart.axis(false)
chart.tooltip(false)
chart.guide().text({
position: ['50%', '50%'],
content: `${util.decimal(val,2)}%`,
style: {
fill: '#333',
fontSize: 12
}
})
chart.guide().text({
position: ['50%', '105%'],
content: title,
style: {
fill: '#666',
fontSize: 8
}
})
chart.guide().arc({
start: [0, 0],
end: [1, 99.99],
top: false,
style: {
lineWidth: 6.5,
stroke: '#eaeaea'
}
})
chart.interval()
.position('x*y')
.size(9)
.color(color)
.animate({
appear: {
duration: 1200,
easing: 'cubicIn'
}
})
chart.render()
return chart
}
}
}