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
0df0da92
Commit
0df0da92
authored
Mar 11, 2021
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加工作日日报报表
parent
dd628253
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
171 deletions
+35
-171
report.js
src/api/report/report.js
+14
-0
StaffDailyReportList.vue
src/views/staffDailyReport/StaffDailyReportList.vue
+21
-171
No files found.
src/api/report/report.js
0 → 100644
View file @
0df0da92
import
{
axios
}
from
'@/util/axios/request'
;
const
api
=
{
staffDailyReport
:
'/report/staff/daily'
,
};
export
function
getStaffDailyReport
(
parameter
)
{
return
axios
({
url
:
api
.
staffDailyReport
,
method
:
'post'
,
data
:
parameter
,
useFullLoading
:
true
})
}
src/views/staffDailyReport/StaffDailyReportList.vue
View file @
0df0da92
...
...
@@ -5,8 +5,8 @@
<div>
<a-row>
<a-col
:span=
"6"
>
<a-form-item
label=
"
用户名
"
:labelCol=
"
{span: 8}" :wrapperCol="{span: 16}">
<a-
input
@
pressEnter=
"search"
style=
"width: 100%"
v-model=
"query.realname"
placeholder=
"请输入
"
/>
<a-form-item
label=
"
日期
"
:labelCol=
"
{span: 8}" :wrapperCol="{span: 16}">
<a-
date-picker
v-model=
"query.date"
:allowClear=
"false
"
/>
</a-form-item>
</a-col>
</a-row>
...
...
@@ -16,13 +16,12 @@
<div>
<a-table
size=
"middle"
@
change=
"sortChange"
:columns=
"columns"
:dataSource=
"dataSource"
:pagination=
"false"
:rowKey=
"rowKey"
:loading=
"loading"
:
rowSelection=
"
{selectedRowKeys: selectedRowKeys, onChange: updateSelect
}"
:
scroll=
"
{ y: tableHeight
}"
bordered
>
<div
slot=
"title"
slot-scope=
"data"
>
...
...
@@ -36,49 +35,7 @@
</a-button-group>
</div>
</div>
<div
v-if=
"total > 0"
id=
"components-pagination-demo-mini"
slot=
"footer"
slot-scope=
"data"
>
{{
data
.
none
}}
<a-pagination
@
change=
"pageChange"
v-model=
"query.page"
show-less-items
:defaultPageSize=
"defaultPageSize"
:pageSizeOptions=
"$pageSizeOptions"
@
showSizeChange=
"sizeChange"
class=
"cust-pagination"
size=
"small"
:total=
"total"
showSizeChanger
showQuickJumper
:showTotal=
"$showTotal"
/>
</div>
<span
slot=
"action"
slot-scope=
"text,record,index"
>
<!--
<a-button
type=
"primary"
v-if=
"record.changed"
@
click=
"saveOne(index)"
size=
"small"
><span
style=
"font-size: 8px"
>
保存
</span></a-button>
-->
<a-icon
type=
"edit"
v-if=
"record.changed"
@
click=
"saveOne(index)"
/>
<a-icon
v-else
type=
"check-circle"
theme=
"twoTone"
two-tone-color=
"#52c41a"
/>
</span>
<span
slot=
"statisticsStatus"
slot-scope=
"text,record,index"
>
<a-switch
checked-children=
"是"
un-checked-children=
"否"
:checked=
"text ===1"
@
click=
"changeStatisticsStatus(record,index)"
default-checked
/>
</span>
<span
slot=
"status"
slot-scope=
"text,record"
>
<a-tag
v-if=
"record.end>new Date()"
:color=
"text=='wait'?'green':'blue'"
>
{{
text
==
'wait'
?
'未开始'
:
'进行中'
}}
</a-tag>
<a-tag
color=
"red"
v-else
>
已过期
</a-tag>
</span>
<span
slot=
"wages"
slot-scope=
"text, record,index"
:key=
"record.id"
>
<a-input-number
style=
"width: 200px"
:precision=
'2'
:formatter=
"value => `$ $
{value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"
@change="e=>handleChange(e, index)"
v-model ='record.charge'
>
</a-input-number>
</span>
<div
slot=
"detail"
slot-scope=
"text"
v-html=
"text"
style=
"color:blue"
>
{{
text
}}
</div>
</a-table>
</div>
...
...
@@ -86,24 +43,15 @@
</
template
>
<
script
>
import
{
get
Page
,
updateStatus
,
saveProjectCharge
}
from
"@/api/project/projectCharge
"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
{
get
StaffDailyReport
}
from
"@/api/report/report
"
;
import
moment
from
'moment'
;
const
dataSource
=
[]
const
columns
=
[
{
title
:
'项目名'
,
width
:
300
,
dataIndex
:
'name'
,
align
:
'left'
},
{
title
:
'代码'
,
width
:
180
,
dataIndex
:
'code'
,
align
:
'left'
},
// {title: '描述', dataIndex: 'desc', align: 'center'},
{
title
:
'状态'
,
width
:
120
,
dataIndex
:
'status'
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'status'
}},
{
title
:
'是否统计'
,
width
:
120
,
dataIndex
:
'statisticsStatus'
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'statisticsStatus'
}
},
{
title
:
'项目款项(RMB)'
,
dataIndex
:
'charge'
,
align
:
'right'
,
scopedSlots
:
{
customRender
:
'wages'
}},
{
title
:
'操作'
,
key
:
'operation'
,
width
:
150
,
scopedSlots
:
{
customRender
:
'action'
},
align
:
'center'
}
{
title
:
'日期'
,
width
:
100
,
dataIndex
:
'date'
,
align
:
'center'
},
{
title
:
'姓名'
,
width
:
180
,
dataIndex
:
'name'
,
align
:
'left'
},
{
title
:
'登记工时'
,
width
:
100
,
dataIndex
:
'hours'
,
align
:
'right'
},
{
title
:
'工作详情'
,
dataIndex
:
'detail'
,
align
:
'left'
,
scopedSlots
:
{
customRender
:
'detail'
},},
{
title
:
'剩余工时'
,
width
:
100
,
dataIndex
:
'leftHours'
,
align
:
'right'
}
]
export
default
{
...
...
@@ -111,139 +59,41 @@ export default {
data
()
{
return
{
isFirstLoad
:
true
,
page
:
1
,
query
:
{
name
:
""
,
status
:
""
,
order
:
""
,
sort
:
""
,
page
:
1
,
size
:
10
,
date
:
moment
()
},
total
:
0
,
rowKey
:
"id"
,
index
:
-
1
,
loading
:
false
,
columns
:
columns
,
dataSource
:
dataSource
,
tableHeight
:
document
.
documentElement
.
clientHeight
-
210
,
dataSource
:
[],
selectedRowKeys
:
[],
selectedRows
:
[],
}
},
computed
:
{
defaultPageSize
:
function
()
{
return
this
.
$defaultPageSize
()
}
},
methods
:
{
search
()
{
this
.
query
.
page
=
1
this
.
loadData
();
},
reset
()
{
this
.
query
.
page
=
1
this
.
query
.
name
=
""
;
this
.
query
.
status
=
""
;
this
.
query
.
date
=
""
;
this
.
loadData
();
},
pageChange
(
page
)
{
this
.
query
.
page
=
page
;
this
.
loadData
();
},
sizeChange
(
current
,
size
)
{
this
.
query
.
size
=
size
;
this
.
loadData
();
},
loadData
(
pageSize
)
{
if
(
pageSize
&&
!
isNaN
(
pageSize
))
{
this
.
query
.
size
=
pageSize
}
getPage
(
this
.
query
).
then
(
res
=>
{
console
.
log
(
11111
)
if
(
res
&&
res
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
respData
=
res
.
data
let
list
=
respData
.
list
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
!
list
[
i
].
charge
)
{
list
[
i
].
charge
=
0
}
list
[
i
].
orgCharge
=
respData
.
list
[
i
].
charge
}
this
.
dataSource
=
list
;
this
.
total
=
respData
.
total
}
this
.
loading
=
false
;
})
},
handleChange
(
value
,
index
)
{
const
newData
=
[...
this
.
dataSource
];
const
target
=
newData
[
index
];
if
(
target
)
{
target
.
charge
=
value
;
newData
[
index
].
changed
=
target
.
orgCharge
!=
target
.
charge
this
.
dataSource
=
newData
;
}
},
changeStatisticsStatus
(
record
,
index
)
{
updateStatus
(
record
.
id
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
a
=
[...
this
.
dataSource
]
a
[
index
].
statisticsStatus
=
response
.
data
this
.
dataSource
=
a
;
}
})
},
saveOne
(
index
)
{
let
a
=
[...
this
.
dataSource
]
let
saveData
=
{
id
:
a
[
index
].
id
,
charge
:
a
[
index
].
charge
,
}
saveProjectCharge
(
saveData
).
then
(
resp
=>
{
loadData
()
{
getStaffDailyReport
({
date
:
this
.
query
.
date
.
format
(
"YYYY-MM-DD"
)}).
then
(
resp
=>
{
if
(
resp
&&
resp
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
"保存成功"
,
duration
:
4
,});
this
.
loadData
()
console
.
log
(
resp
.
data
)
this
.
dataSource
=
resp
.
data
;
}
})
this
.
dataSource
=
a
;
},
sortChange
(
pagination
,
filters
,
sorter
)
{
this
.
query
.
sort
=
humpToLine
(
sorter
.
field
);
this
.
query
.
order
=
setOrder
(
sorter
.
order
);
this
.
loadData
();
},
updateSelect
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
onCtDateChange
(
date
,
dateString
)
{
this
.
ctDatePicker
=
date
;
this
.
query
.
ctDateBegin
=
dateString
[
0
]
this
.
query
.
ctDateEnd
=
dateString
[
1
]
this
.
loadData
()
},
}
},
mounted
()
{
},
activated
()
{
if
(
this
.
isFirstLoad
==
true
)
{
this
.
loadData
(
this
.
defaultPageSize
)
this
.
isFirstLoad
=
false
}
else
{
let
isModify
=
this
.
$route
.
query
.
isModify
if
(
isModify
==
true
)
{
this
.
loadData
()
}
else
if
(
isModify
!=
undefined
)
{
this
.
loadData
()
}
}
}
}
</
script
>
...
...
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