3f535f30
杨鑫
'初始'
|
1
2
|
<template>
<div style="background-color:#F2F3F5">
|
8dca79c8
杨鑫
1
|
3
|
<div class="history" v-loading="loading">
|
3f535f30
杨鑫
'初始'
|
4
|
<div style="background-color:#Fff;padding:20px 20px 0 20px">
|
3f535f30
杨鑫
'初始'
|
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<!-- 顶部搜索 -->
<div class="toolbar">
<el-form ref="formParams" :inline="true" :model="formParams">
<el-form-item label="日期">
<el-date-picker
v-model="formParams.dates"
type="daterange"
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 @click="search" style="background-color: #3F9B6A;color: #fff;">查询</el-button>
<el-button @click="clear" class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
|
9683c4af
杨鑫
'最新'
|
29
30
31
32
|
<div style="margin-bottom: 20px;background-color: #fff;">
<div style="border: #EBEEF5 1px solid;width: 100%;">
<div style="border-bottom: #EBEEF5 1px solid;background-color: #F7F7F7;padding: 10px 15px;">收货地成交图</div>
|
8dca79c8
杨鑫
1
|
33
|
<div ref="container1" style="width: 100%; height: 500px;"></div>
|
3f535f30
杨鑫
'初始'
|
34
|
</div>
|
137c0ee8
杨鑫
'yanshou'
|
35
|
</div>
|
3f535f30
杨鑫
'初始'
|
36
|
<!-- 表格 -->
|
8dca79c8
杨鑫
1
|
37
|
<div class="content_table" style="padding: 15px 0px 10px 0px;background-color:#fff">
|
3f535f30
杨鑫
'初始'
|
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
|
<div style="padding: 10px;margin-bottom: 20px;">
<div class="table">
<el-table
show-summary
:data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
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>
|
8dca79c8
杨鑫
1
|
63
64
|
<el-table-column prop="refundAmount" label="退单金额(元)" :show-overflow-tooltip="true"/>
<el-table-column prop="transactionAmount" label="成交金额(元)" :show-overflow-tooltip="true" />
|
3f535f30
杨鑫
'初始'
|
65
66
67
68
|
</el-table>
</div>
<!-- 分页 -->
<div class="fenye">
|
8dca79c8
杨鑫
1
|
69
|
<div style="line-height: 200%;">共{{total}}条</div>
|
137c0ee8
杨鑫
'yanshou'
|
70
|
<el-pagination class="pagination" :hide-on-single-page="flag" background :current-page="currentPage"
|
8dca79c8
杨鑫
1
|
71
|
:page-size="pageSize" layout="prev, pager,next" :total="total"
|
137c0ee8
杨鑫
'yanshou'
|
72
|
@current-change="handleCurrentChange" />
|
3f535f30
杨鑫
'初始'
|
73
74
75
76
77
78
79
80
81
82
|
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
|
8dca79c8
杨鑫
1
|
83
|
import {getAllNotPage,deliveryAddressStatistics} from '@/api/psRanking'
|
3f535f30
杨鑫
'初始'
|
84
85
86
|
export default {
data() {
return {
|
9683c4af
杨鑫
'最新'
|
87
|
total: 0,
|
137c0ee8
杨鑫
'yanshou'
|
88
|
flag:false,
|
3f535f30
杨鑫
'初始'
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
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: [],
|
8dca79c8
杨鑫
1
|
107
|
loading:true
|
3f535f30
杨鑫
'初始'
|
108
109
110
111
112
113
114
115
|
}
},
mounted() {
this.getAll()
},
methods: {
async getAll(){
|
60d9bf40
杨鑫
'1'
|
116
|
|
8dca79c8
杨鑫
1
|
117
118
119
120
121
|
const res = await getAllNotPage(this.formInline)
if(res.code ==''){
this.loading = false
}
const Orderlist = await deliveryAddressStatistics(res.data)
|
3f535f30
杨鑫
'初始'
|
122
|
this.tableData = Orderlist.data
|
9683c4af
杨鑫
'最新'
|
123
124
|
this.total = Orderlist.data.length
this.echar1(Orderlist.data)
|
b12ba7ef
杨鑫
'最新'
|
125
|
|
3f535f30
杨鑫
'初始'
|
126
127
128
|
},
async search(){
this.formInline.dates = this.formParams.dates
|
8dca79c8
杨鑫
1
|
129
130
131
132
133
134
|
const res = await getAllNotPage(this.formInline)
if(res.code ==''){
this.loading = false
}
this.currentPage = 1
const Orderlist = await deliveryAddressStatistics(res.data)
|
3f535f30
杨鑫
'初始'
|
135
|
this.tableData = Orderlist.data
|
9683c4af
杨鑫
'最新'
|
136
137
|
this.total = Orderlist.data.length
this.echar1(Orderlist.data)
|
3f535f30
杨鑫
'初始'
|
138
139
140
141
|
},
clear(){
this.formInline.dates = []
this.formParams.dates = []
|
8dca79c8
杨鑫
1
|
142
|
this.currentPage = 1
|
3f535f30
杨鑫
'初始'
|
143
144
|
this.getAll()
},
|
137c0ee8
杨鑫
'yanshou'
|
145
|
handleCurrentChange(val){
|
8dca79c8
杨鑫
1
|
146
|
this.currentPage = val
|
137c0ee8
杨鑫
'yanshou'
|
147
|
},
|
3f535f30
杨鑫
'初始'
|
148
|
echar1(diameter) {
|
8dca79c8
杨鑫
1
|
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
|
let Dom = this.$refs.container1;
let myChart = echarts.init(Dom);
let processedData = diameter.map(item => ({
name: item.address,
value: item.refundAmount
}));
console.log(processedData)
// 指定图表的配置项和数据
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
return params[0].name + ': ' + params[0].value+'元';
}
},
color: ['#3F9B6A'],
xAxis: {
type: 'category',
data: processedData.map(item => item.name),
axisLabel: {
interval: 0, // 强制显示所有标签
formatter: function (value) {
if (value.length > 4) {
return value.slice(0, 4) + '...';
}
return value;
}
}
},
yAxis: {
type: 'value'
},
series: [
|
3f535f30
杨鑫
'初始'
|
185
|
{
|
8dca79c8
杨鑫
1
|
186
187
188
|
name: '退款金额',
type: 'bar',
data: processedData.map(item => item.value),
|
3f535f30
杨鑫
'初始'
|
189
|
label: {
|
8dca79c8
杨鑫
1
|
190
191
192
193
194
195
196
197
198
199
|
show: true,
position: 'top'
},
itemStyle: {
borderRadius: [5, 5, 0, 0]
},
emphasis: {
label: {
fontSize: 20
}
|
3f535f30
杨鑫
'初始'
|
200
|
}
|
3f535f30
杨鑫
'初始'
|
201
|
}
|
8dca79c8
杨鑫
1
|
202
203
204
|
]
};
|
3f535f30
杨鑫
'初始'
|
205
206
|
// 使用刚指定的配置项和数据显示图表。
|
137c0ee8
杨鑫
'yanshou'
|
207
|
option && myChart.setOption(option);
|
3f535f30
杨鑫
'初始'
|
208
209
210
211
212
213
214
215
216
217
218
219
220
|
},
}
}
</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;
|
8dca79c8
杨鑫
1
|
221
|
font-size: 14px;
|
3f535f30
杨鑫
'初始'
|
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
}
::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;
}
|
8dca79c8
杨鑫
1
|
239
240
241
242
|
.history{
margin-left:10px;
background-color: #fff;
}
|
3f535f30
杨鑫
'初始'
|
243
244
245
|
.fenye {
margin-top: 20px;
display: flex;
|
8dca79c8
杨鑫
1
|
246
|
justify-content: space-between;
|
3f535f30
杨鑫
'初始'
|
247
248
249
250
251
252
253
|
position: relative;
}
.pagination {
text-align: right;
line-height: 20px;
}
|
8dca79c8
杨鑫
1
|
254
|
|
3f535f30
杨鑫
'初始'
|
255
256
257
258
259
260
261
262
263
264
265
|
.toolbar{
.el-form-item{
margin-bottom:0px;
}
}
</style>
<style>
.el-tooltip__popper {
max-width: 50%;
}
</style>
|