Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zentao-view
Project
Project
Details
Activity
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
zentao
zentao-view
Commits
06758090
Commit
06758090
authored
Mar 05, 2021
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(工时列表): 添加导出功能
parent
8d2b166b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
task.js
src/api/task/task.js
+13
-0
TaskEstimateList.vue
src/views/task/taskEstimate/TaskEstimateList.vue
+12
-1
No files found.
src/api/task/task.js
View file @
06758090
...
@@ -27,4 +27,17 @@ export function getAuxiliaryInfo(month) {
...
@@ -27,4 +27,17 @@ export function getAuxiliaryInfo(month) {
url
:
`
${
baseUrl
.
taskEstimate
}
/auxiliary-info/
${
month
}
`
,
url
:
`
${
baseUrl
.
taskEstimate
}
/auxiliary-info/
${
month
}
`
,
method
:
'get'
method
:
'get'
});
});
}
/*
* 导出工时表
*/
export
function
exportExcel
(
parameter
)
{
return
axios
({
responseType
:
'blob'
,
headers
:
{
'Accept'
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
},
url
:
`
${
baseUrl
.
taskEstimate
}
/export`
,
method
:
'post'
,
data
:
parameter
,
})
}
}
\ No newline at end of file
src/views/task/taskEstimate/TaskEstimateList.vue
View file @
06758090
...
@@ -71,6 +71,9 @@
...
@@ -71,6 +71,9 @@
</span>
</span>
<div
class=
"cust-table-operator"
>
<div
class=
"cust-table-operator"
>
<a-button-group>
<a-button-group>
<a-button
type=
"primary"
@
click=
"exportExcel"
ghost
>
导出
</a-button>
<a-button
type=
"primary"
@
click=
"search"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"search"
>
查询
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
</a-button-group>
</a-button-group>
...
@@ -98,7 +101,7 @@
...
@@ -98,7 +101,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getPage
,
getAuxiliaryInfo
}
from
"@/api/task/task"
;
import
{
getPage
,
getAuxiliaryInfo
,
exportExcel
}
from
"@/api/task/task"
;
import
{
getSelectableProjects
}
from
"@/api/project/project"
;
import
{
getSelectableProjects
}
from
"@/api/project/project"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
...
@@ -291,6 +294,14 @@ export default {
...
@@ -291,6 +294,14 @@ export default {
// 重新计算当月天数
// 重新计算当月天数
this
.
dayOfTheMonth
=
date
.
daysInMonth
();
this
.
dayOfTheMonth
=
date
.
daysInMonth
();
},
},
exportExcel
()
{
exportExcel
(
this
.
query
).
then
((
response
)
=>
{
let
fileDownload
=
require
(
"js-file-download"
);
fileDownload
(
response
.
data
,
`
${
this
.
query
.
month
}${
this
.
query
.
projectId
?
this
.
projectOptions
.
filter
(
p
=>
p
.
value
==
this
.
query
.
projectId
)[
0
].
title
:
''
}
工时明细.xlsx`
);
this
.
loading
=
false
;
});
},
},
},
mounted
()
{
mounted
()
{
getSelectableProjects
().
then
(({
data
})
=>
{
getSelectableProjects
().
then
(({
data
})
=>
{
...
...
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