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
a38b049f
Commit
a38b049f
authored
Nov 18, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增车辆统计导出
parent
999cdedd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
index.js
src/api/vehicle/vehicleInfo/index.js
+8
-0
index.vue
src/views/vehicle/vehicleInfo/index.vue
+32
-2
No files found.
src/api/vehicle/vehicleInfo/index.js
View file @
a38b049f
...
...
@@ -123,3 +123,11 @@ export function downloadExcel(query) {
responseType
:
'blob'
});
}
export
function
exportExcel
(
query
)
{
return
fetch
({
url
:
'/vehicle/VehicleInformationDownload/app/unauth/export'
,
method
:
'get'
,
responseType
:
'blob'
});
}
src/views/vehicle/vehicleInfo/index.vue
View file @
a38b049f
...
...
@@ -219,6 +219,12 @@
v-waves
@
click=
"handleFilter('download')"
>
下载车辆信息Excel表
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
@
click=
"handleFilter('export')"
>
导出分公司车辆信息
</el-button>
</div>
<el-table
:key=
"tableKey"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
>
...
...
@@ -976,7 +982,8 @@ import {
downloadExcel
,
checkVin
,
checkEngineNum
,
getArea
getArea
,
exportExcel
}
from
'../../../api/vehicle/vehicleInfo/'
import
{
...
...
@@ -1992,7 +1999,27 @@ export default {
}
this
.
getList
()
},
exportExcelInfo
()
{
exportExcel
().
then
(
res
=>
{
const
content
=
res
const
blob
=
new
Blob
([
content
])
const
fileName
=
'vehicle.xlsx'
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
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
)
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
)
}
})
},
/**
* 下载车辆信息excel表
* */
...
...
@@ -2732,6 +2759,9 @@ export default {
if
(
p
==
'download'
)
{
this
.
download
()
}
if
(
p
==
'export'
)
{
this
.
exportExcelInfo
();
}
}
else
{
return
false
}
...
...
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