Statistics.vue
6.18 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
198
199
200
201
202
203
204
205
206
207
<template>
<div class="statistics">
<div class="headline">{{ statisticsObj.title }}</div>
<div class="flex">
<template v-for="value in statisticsObj.cumulative && statisticsObj.cumulative">
<div class="text-half" :key="value.id + 'cumulative'">
<div class="small-text">{{ value.title }}</div>
<div class="num-text">
<span v-if="value.type == 0">¥</span>
{{ value.value(reportData) }}
</div>
</div>
</template>
</div>
<div class="flex-between">
<template v-if="statisticsObj.new && statisticsObj.new.length > 0">
<van-swipe :loop="false" :show-indicators="false" :width="200">
<template v-for="(add, addIndex) in statisticsObj.new">
<van-swipe-item class="container" :key="add.id + 'new'">
<div class="text-message">{{ add.title }}</div>
<div class="flex-between">
<span class="add-count">
<label v-if="tabIndex == 1"><template v-if="addIndex == 0">¥</template></label>
{{ add.value(reportData) }}
</span>
<template v-if="add.sequential(reportData)">
<div class="ratio text-message flex">
<span :class="['flex', add.up(reportData) == 0 ? 'bcolor' : 'ycolor']">
<template v-if="add.sequential(reportData) != '0%'">
<div :class="['sprite-icon', add.up(reportData) == 0 ? 'icon-iconup' : 'icon-icondown']"></div>
</template>
{{ add.sequential(reportData) }}
</span>
</div>
</template>
<template v-else>
<span class="text-message">{{ reportType == 0 ? '周环比:' : '月环比:' }}-</span>
</template>
</div>
<div class="flex">
<div :class="['sprite-icon', 'icon-' + add.icon]"></div>
<template v-if="add.list">
<div class="customer-info">
<span class="text-message mb">{{ add.list.customerTitle }}:{{ add.list.customerValue(reportData) }}</span>
<span class="text-message">{{ add.list.qyTitle }}:{{ add.list.qyValue(reportData) }}</span>
</div>
</template>
<template v-if="add.info">
<div class="customer-info">
<span class="text-message mb">{{ add.info.title }}</span>
<div class="gray-text flex">
{{ add.info.value(reportData) }}
<template v-if="add.info.sequential(reportData)">
<div class="ratio text-message flex">
{{ reportType == 0 ? '周环比:' : '月环比:' }}
<label :class="['flex', add.info.up(reportData) == 0 ? 'applybcolor' : 'applyycolor']">
<template v-if="add.info.sequential(reportData) != '0%'">
<div :class="['sprite-icon', add.info.up(reportData) == 0 ? 'icon-iconup' : 'icon-icondown']"></div>
</template>
{{ add.info.sequential(reportData)}}
</label>
</div>
</template>
<div v-else class="ratio text-message flex ">
{{ reportType == 0 ? '周环比:' : '月环比:' }}-
</div>
</div>
</div>
</template>
</div>
</van-swipe-item>
</template>
</van-swipe>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { mapState } from 'vuex'
export default {
name: 'Statistics',
data() {
return {
value: this.keyword
}
},
computed: {
...mapState({
reportType: state => state.report.reportType,
reportData: state => state.report.reportData,
statisticsObj: state => state.report.statisticsObj,
tabIndex: state => state.report.tabIndex
})
},
mounted() {},
methods: {}
}
</script>
<style scoped lang='scss'>
.statistics {
margin: 20px 0 30px 0;
.headline {
margin-bottom: 10px;
}
.headline::before {
content: '.';
width: 3px;
height: 15px;
background: #ffffff;
border-radius: 2px;
color: #ffffff;
margin-right: 5px;
box-sizing: border-box;
}
.text-half {
.small-text {
margin-bottom: 5px;
}
}
.flex-between {
width: 100%;
box-sizing: border-box;
}
.container {
width: 167px !important;
height: 106px;
background: #ffffff;
box-shadow: 0px 3px 8px 0px rgba(170, 180, 209, 0.2);
border-radius: 4px;
padding: 10px;
box-sizing: border-box;
margin-top: 10px;
margin-right: 10px;
.add-count {
height: 25px;
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 2px;
}
.ratio {
span {
padding: 0 1px;
width: auto;
border-radius: 3px;
height: 15px;
font-size: 10px;
font-weight: 500;
line-height: 15px;
margin-left: 5px;
}
& .bcolor {
background: #d0def1;
color: #3975c6;
}
& .ycolor {
background: #f5ddb5;
color: #df8500;
}
label {
font-weight: 500;
color: #3975c6;
line-height: 15px;
}
// & .up {
// transform: rotate(180deg);
// line-height: 15px;
// }
}
.customer-info {
width: 65%;
.gray-text {
.text-message {
font-size: 10px;
}
.ratio {
margin-left: 2px;
margin-bottom: 0;
& .applybcolor {
color: #3975c6;
}
& .applyycolor {
color: #df8500;
}
}
}
}
}
}
.statistics /deep/ .van-swipe {
margin-right: -15px;
.van-swipe__track {
margin-right: 10px;
height: auto;
width: 100% !important;
.van-swipe-item {
width: 167px !important;
}
}
}
</style>