Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NLT-e-cigarette
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
张伯涛
NLT-e-cigarette
Commits
37265f73
Commit
37265f73
authored
Aug 10, 2022
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产出统计,维修统计导出接口
parent
b748a906
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
2 deletions
+91
-2
apis.js
src/views/productionStatis/apis.js
+21
-0
produceStatistics.vue
src/views/productionStatis/produceStatistics.vue
+35
-1
repairStatistics.vue
src/views/productionStatis/repairStatistics.vue
+35
-1
No files found.
src/views/productionStatis/apis.js
View file @
37265f73
import
request
from
'@/utils/request'
// 维修统计查询数据
export
function
getDataDetails
(
params
)
{
return
request
({
url
:
'/datamonitor/getStatisticsForMaintain'
,
...
...
@@ -7,9 +8,29 @@ export function getDataDetails(params) {
params
})
}
// 产出统计查询统计
export
function
getProDetails
(
params
)
{
return
request
({
url
:
'/datamonitor/getStatisticsForProduce/'
+
'?beginDate='
+
params
.
beginDate
+
'&endDate='
+
params
.
endDate
+
'&type='
+
params
.
type
,
method
:
'get'
})
}
// 维修统计导出
export
function
repairStatisicsExport
(
query
)
{
return
request
({
url
:
'/datamonitor/exportMaintainStatics'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
// 产出统计导出
export
function
produceStatisicsExport
(
query
)
{
return
request
({
url
:
'/datamonitor/exportForProduce'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/views/productionStatis/produceStatistics.vue
View file @
37265f73
...
...
@@ -73,6 +73,13 @@
</el-col>
</el-row>
<div
style=
"border-top: 14px solid #f4f4f4; padding: 20px"
>
<el-button
type=
"danger"
size=
"small"
class=
"redBtn"
style=
"margin-bottom: 10px;float: right"
@
click=
"handleExport"
>
导出 Export
</el-button>
<el-table
border
:data=
"dataList"
...
...
@@ -132,7 +139,7 @@
<
script
>
import
moment
from
'moment'
import
*
as
echarts
from
'echarts'
import
{
getProDetails
}
from
'./apis'
import
{
getProDetails
,
produceStatisicsExport
}
from
'./apis'
export
default
{
name
:
'ProduceStatistics'
,
...
...
@@ -246,6 +253,33 @@ export default {
})
},
methods
:
{
/** 导出按钮操作*/
handleExport
()
{
const
params
=
{
beginDate
:
this
.
queryParams
.
startDate
,
endDate
:
this
.
queryParams
.
endDate
,
type
:
this
.
choseType
}
this
.
$confirm
(
'是否确认导出当前数据?'
,
'提示'
,
{
confirmButtonText
:
'确定 Confirm'
,
cancelButtonText
:
'取消 Cancel'
,
cancelButtonClass
:
'btn-custom-cancel'
,
type
:
'warning'
}).
then
(
function
()
{
return
produceStatisicsExport
(
params
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'维修统计'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg);
})
})
},
/** 获取页面数据*/
getRepairStats
()
{
const
params
=
{
...
...
src/views/productionStatis/repairStatistics.vue
View file @
37265f73
...
...
@@ -61,6 +61,13 @@
</div>
</el-card>
<div
style=
"border-top: 14px solid #f4f4f4; padding: 20px"
>
<el-button
type=
"danger"
size=
"small"
class=
"redBtn"
style=
"margin-bottom: 10px;float: right"
@
click=
"handleExport"
>
导出 Export
</el-button>
<el-table
border
:data=
"dataList"
...
...
@@ -169,7 +176,7 @@
<
script
>
import
moment
from
'moment'
import
*
as
echarts
from
'echarts'
import
{
getDataDetails
}
from
'./apis'
import
{
getDataDetails
,
repairStatisicsExport
}
from
'./apis'
export
default
{
name
:
'RepairStatistics'
,
...
...
@@ -274,6 +281,33 @@ export default {
})
},
methods
:
{
/** 导出按钮操作*/
handleExport
()
{
const
params
=
{
beginDate
:
this
.
queryParams
.
startDate
,
endDate
:
this
.
queryParams
.
endDate
,
type
:
this
.
choseType
}
this
.
$confirm
(
'是否确认导出当前数据?'
,
'提示'
,
{
confirmButtonText
:
'确定 Confirm'
,
cancelButtonText
:
'取消 Cancel'
,
cancelButtonClass
:
'btn-custom-cancel'
,
type
:
'warning'
}).
then
(
function
()
{
return
repairStatisicsExport
(
params
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'维修统计'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg);
})
})
},
/** 获取页面数据*/
getRepairStats
()
{
const
params
=
{
...
...
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