index.vue
7.75 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<template>
<div style="background-color:#F2F3F5">
<div class="history">
<div style="background-color:#Fff;padding:20px 20px 0 20px">
<div style="font-size:12px;font-weight:600">收货地统计</div>
<!-- 顶部搜索 -->
<div class="toolbar">
<el-form ref="formParams" :inline="true" :model="formParams">
<el-form-item label="日期">
<el-date-picker
v-model="formParams.dates"
type="daterange"
size="mini"
style="width:220px"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label-width="0">
<el-button plain @click="search" size="mini" style="background-color: #3F9B6A;color: #fff;">查询</el-button>
<el-button plain @click="clear" size="mini" style="background-color: #fff;color: #000;">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
<!-- <div style="display: flex;margin-bottom: 20px;background-color: #fff;">
<div style="border: #EBEEF5 1px solid; margin-right: 20px; width: 45%;" >
<div style="border-bottom: #EBEEF5 1px solid;background-color: #F7F7F7;padding: 10px 15px;">收货地地域分布图</div>
<div ref="container" style="width: 600px; height: 400px;"></div>
</div>
<div style="border: #EBEEF5 1px solid; width: 45%;">
<div style="border-bottom: #EBEEF5 1px solid;background-color: #F7F7F7;padding: 10px 15px;">收货地占比图</div>
<div ref="container1" style="width: 600px; height: 400px;"></div>
</div>
</div> -->
<!-- 表格 -->
<div class="content_table" style="padding: 15px 10px 10px 20px;background-color:#fff">
<div style="padding: 10px;margin-bottom: 20px;">
<div class="table">
<el-table
border
show-summary
:data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
:header-cell-style="{fontSize: '12px', backgroundColor: '#FAFAFA',color:'#000',fontWeight: 'normal'}"
style="width: 100%"
>
<el-table-column prop="address" label="收货地" />
<el-table-column label="下单数量" prop="num">
<template slot-scope="scope">
{{scope.row.refundOder.length + scope.row.transactionOrder.length}}
</template>
</el-table-column>
<el-table-column prop="refundOder" label="退单数">
<template slot-scope="scope">
{{scope.row.refundOder.length}}
</template>
</el-table-column>
<el-table-column prop="transactionOrder" label="成交数" >
<template slot-scope="scope">
{{scope.row.transactionOrder.length}}
</template>
</el-table-column>
<el-table-column prop="refundAmount" label="退单金额" :show-overflow-tooltip="true"/>
<el-table-column prop="transactionAmount" label="成交金额" :show-overflow-tooltip="true" />
</el-table>
</div>
<!-- 分页 -->
<div class="fenye">
<div style="line-height: 34px">显示第1到第10条记录</div>
<el-pagination class="pagination" :hide-on-single-page="flag" background small :current-page="currentPage"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" layout="total,sizes,prev, pager,next" :total="total "
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import {orderGetAll,deliveryAddressStatistics} from '@/api/psRanking'
export default {
data() {
return {
total: 1,
pageSize: 10,
currentPage: 1,
formParams: {
dates: [],
page: 1,
pageSize: 10
},
formInline: {
searchType: '1',
search: '', // 搜索字段
state: '',
// afterState: '', // 售后状态 0-无售后 1-售后中 2-售后成功 3-售后关闭
dates: [], // 下单时间数组
page: 1,
shopName: '',
pageSize: 10
},
tableData: [],
chart1:null
}
},
mounted() {
this.echar1(this.$refs.container1);
this.getAll()
},
methods: {
async getAll(){
const res = await orderGetAll(this.formInline)
const Orderlist = await deliveryAddressStatistics(res.data.list)
this.tableData = Orderlist.data
},
async search(){
this.formInline.dates = this.formParams.dates
const res = await orderGetAll(this.formInline)
const Orderlist = await deliveryAddressStatistics(res.data.list)
this.tableData = Orderlist.data
},
clear(){
this.formInline.dates = []
this.formParams.dates = []
this.getAll()
},
echar1(diameter) {
this.chart1 = echarts.init(diameter);
// 指定图表的配置项和数据
const option1 = {
series: [
{
name: 'Funnel',
type: 'funnel',
left: '10%',
top: 60,
bottom: 60,
width: '80%',
min: 0,
max: 100,
minSize: '0%',
maxSize: '100%',
sort: 'descending',
gap: 2,
label: {
show: true,
position: 'inside'
},
labelLine: {
length: 10,
lineStyle: {
width: 1,
type: 'solid'
}
},
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
emphasis: {
label: {
fontSize: 20
}
},
data: [
{ value: 60, name: 'Visit' },
{ value: 40, name: 'Inquiry' },
{ value: 20, name: 'Order' },
{ value: 80, name: 'Click' },
{ value: 100, name: 'Show' }
]
}
]
};
// 使用刚指定的配置项和数据显示图表。
this.chart1.setOption(option1)
},
}
}
</script>
<style lang='scss' scoped>
.history{
padding: 0px;
padding-left: 10px;
min-height: calc(100vh - 50px - 20px);
}
::v-deep .el-form-item__label{
font-weight: normal;
font-size: 12px;
}
::v-deep .btn .el-button:focus,
.el-button:hover {
border: 1px solid #3F9B6A;
}
::v-deep .el-button {
border: 1px solid #3F9B6A;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #3F9B6A;
}
</style>
<style scoped>
.history /deep/ .el-table .cell.el-tooltip img {
max-height: 100px;
}
.fenye {
margin-top: 20px;
display: flex;
justify-content: flex-start;
position: relative;
}
.pagination {
text-align: right;
line-height: 20px;
}
/deep/ .el-pagination__total {
margin-top: 4px;
}
/deep/ .el-pager {
position: absolute;
top: 4px;
right: 40px;
}
/deep/ .btn-next {
position: absolute;
top: 4px;
right: 10px;
}
/deep/ .btn-prev {
position: absolute;
top: 4px;
right: 69px;
}
.toolbar{
.el-form-item{
margin-bottom:0px;
}
}
</style>
<style>
.el-tooltip__popper {
max-width: 50%;
}
</style>