Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform-ui
Commits
8fc3fa34
Commit
8fc3fa34
authored
Dec 19, 2019
by
guoyou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单统计导出
parent
e5b02974
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
vehicleStatistics.js
src/api/statistics/vehicleStatistics.js
+12
-2
orderStatistics.vue
src/views/statistics/orderStatistics.vue
+31
-2
No files found.
src/api/statistics/vehicleStatistics.js
View file @
8fc3fa34
...
...
@@ -19,7 +19,7 @@ export function vehicleInfoExcel(params) {
});
}
//
车辆统计信息列表
//
订单统计
export
function
received_statistics
(
params
)
{
return
fetch
({
url
:
'api/order/admin/order/received_statistics'
,
...
...
@@ -27,4 +27,14 @@ export function received_statistics(params) {
timeout
:
'50000'
,
data
:
params
});
}
\ No newline at end of file
}
// 订单统计导出
export
function
excelExport
(
query
)
{
return
fetch
({
url
:
'/api/order/orderStatistics/excel'
,
method
:
'post'
,
data
:
query
,
responseType
:
'blob'
});
}
\ No newline at end of file
src/views/statistics/orderStatistics.vue
View file @
8fc3fa34
...
...
@@ -58,7 +58,7 @@
</div>
<el-button
type=
"primary"
@
click=
"search"
>
搜索
</el-button>
<el-button
type=
"primary"
@
click=
"clearSearch"
>
清空搜索
</el-button>
<el-button
type=
"primary"
>
导出excel
</el-button>
<el-button
type=
"primary"
:loading=
"excelLoading"
@
click=
"downloadExcel"
>
导出报表
</el-button>
</el-row>
</el-form>
...
...
@@ -72,7 +72,7 @@
</
template
>
<
script
>
import
{
received_statistics
}
from
'api/statistics/vehicleStatistics'
import
{
received_statistics
,
excelExport
}
from
'api/statistics/vehicleStatistics'
import
{
formatDate
}
from
'utils/dateFormattor'
import
{
objDeepCopy
}
from
'../../utils'
export
default
{
...
...
@@ -94,6 +94,7 @@ export default {
}
}
return
{
excelLoading
:
false
,
loading
:
true
,
time
:
null
,
checkArr
:
[
...
...
@@ -279,6 +280,34 @@ export default {
this
.
getList
()
},
methods
:
{
//导出
downloadExcel
()
{
this
.
excelLoading
=
true
var
u
=
navigator
.
userAgent
,
app
=
navigator
.
appVersion
excelExport
(
this
.
listQuery
,
{
responseType
:
'arraybuffer'
}).
then
(
res
=>
{
const
content
=
res
const
blob
=
new
Blob
([
content
],
{
type
:
'application/vnd.ms-excel'
})
const
fileName
=
'订单统计.xlsx'
if
(
u
.
indexOf
(
'Edge'
)
>
-
1
)
{
window
.
navigator
.
msSaveBlob
(
blob
,
fileName
)
}
else
{
const
elink
=
document
.
createElement
(
'a'
)
elink
.
download
=
fileName
elink
.
style
.
display
=
'none'
elink
.
href
=
URL
.
createObjectURL
(
blob
)
document
.
body
.
appendChild
(
elink
)
elink
.
click
()
URL
.
revokeObjectURL
(
elink
.
href
)
// 释放URL 对象
document
.
body
.
removeChild
(
elink
)
}
this
.
excelLoading
=
false
}
)
},
//搜索
search
()
{
if
(
!!
this
.
time
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment