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
e7f430aa
Commit
e7f430aa
authored
Mar 04, 2021
by
menglingjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加统计字段操作
parent
7086b316
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
wages.js
src/api/personnel/wages.js
+7
-0
ZtUserWagesList.vue
src/views/personnel/wages/ZtUserWagesList.vue
+17
-5
No files found.
src/api/personnel/wages.js
View file @
e7f430aa
...
@@ -24,4 +24,11 @@ export function saveUserWages(parameter) {
...
@@ -24,4 +24,11 @@ export function saveUserWages(parameter) {
useFullLoading
:
true
useFullLoading
:
true
})
})
}
}
export
function
updateStatus
(
id
)
{
return
axios
({
url
:
api
.
ztUserUrl
+
"statistics/status/"
+
id
,
method
:
'get'
,
useFullLoading
:
true
})
}
src/views/personnel/wages/ZtUserWagesList.vue
View file @
e7f430aa
...
@@ -59,7 +59,10 @@
...
@@ -59,7 +59,10 @@
<a-button
size=
"small"
style=
"margin-right: 20px"
@
click=
"changeStatus(record,index)"
v-if=
"!record.disabled"
><span
style=
"font-size: 8px"
>
编辑
</span></a-button>
<a-button
size=
"small"
style=
"margin-right: 20px"
@
click=
"changeStatus(record,index)"
v-if=
"!record.disabled"
><span
style=
"font-size: 8px"
>
编辑
</span></a-button>
<a-button
size=
"small"
style=
"margin-right: 20px"
@
click=
"changeStatus(record,index)"
v-if=
"record.disabled"
><span
style=
"font-size: 8px"
>
取消
</span></a-button>
<a-button
size=
"small"
style=
"margin-right: 20px"
@
click=
"changeStatus(record,index)"
v-if=
"record.disabled"
><span
style=
"font-size: 8px"
>
取消
</span></a-button>
<a-button
type=
"primary"
v-if=
"record.disabled"
@
click=
"saveOne(index)"
size=
"small"
><span
style=
"font-size: 8px"
>
保存
</span></a-button>
<a-button
type=
"primary"
v-if=
"record.disabled"
@
click=
"saveOne(index)"
size=
"small"
><span
style=
"font-size: 8px"
>
保存
</span></a-button>
</span>
<span
slot=
"statisticsStatus"
slot-scope=
"text,record,index"
>
<!-- <a-button size="small" style="margin-right: 20px" @click="changeStatisticsStatus(record)"><span style="font-size: 8px">{{text==0?"否":"是"}}</span></a-button>-->
<a-switch
checked-children=
"是"
un-checked-children=
"否"
:checked=
"text ===1"
@
click=
"changeStatisticsStatus(record,index)"
default-checked
/>
</span>
</span>
<span
slot=
"wages"
slot-scope=
"text, record,index"
:key=
"record.id"
>
<span
slot=
"wages"
slot-scope=
"text, record,index"
:key=
"record.id"
>
<a-input-number
<a-input-number
...
@@ -80,7 +83,7 @@
...
@@ -80,7 +83,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
getWagesPage
,
saveUserWages
}
from
"@/api/personnel/wages"
;
import
{
getWagesPage
,
saveUserWages
,
updateStatus
}
from
"@/api/personnel/wages"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
const
dataSource
=
[]
const
dataSource
=
[]
...
@@ -88,6 +91,7 @@ const columns = [
...
@@ -88,6 +91,7 @@ const columns = [
{
title
:
'账号'
,
width
:
160
,
dataIndex
:
'account'
,
align
:
'center'
},
{
title
:
'账号'
,
width
:
160
,
dataIndex
:
'account'
,
align
:
'center'
},
{
title
:
'邮箱'
,
width
:
200
,
dataIndex
:
'email'
,
align
:
'center'
},
{
title
:
'邮箱'
,
width
:
200
,
dataIndex
:
'email'
,
align
:
'center'
},
{
title
:
'真实姓名'
,
width
:
120
,
dataIndex
:
'realname'
,
align
:
'center'
},
{
title
:
'真实姓名'
,
width
:
120
,
dataIndex
:
'realname'
,
align
:
'center'
},
{
title
:
'是否统计'
,
width
:
120
,
dataIndex
:
'statisticsStatus'
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'statisticsStatus'
}},
{
title
:
'工资'
,
dataIndex
:
'wages'
,
align
:
'right'
,
scopedSlots
:
{
customRender
:
'wages'
}},
{
title
:
'工资'
,
dataIndex
:
'wages'
,
align
:
'right'
,
scopedSlots
:
{
customRender
:
'wages'
}},
{
title
:
'操作'
,
key
:
'operation'
,
width
:
150
,
scopedSlots
:
{
customRender
:
'action'
},
align
:
'center'
}
{
title
:
'操作'
,
key
:
'operation'
,
width
:
150
,
scopedSlots
:
{
customRender
:
'action'
},
align
:
'center'
}
]
]
...
@@ -143,13 +147,11 @@ export default {
...
@@ -143,13 +147,11 @@ export default {
if
(
pageSize
&&
!
isNaN
(
pageSize
))
{
if
(
pageSize
&&
!
isNaN
(
pageSize
))
{
this
.
query
.
size
=
pageSize
this
.
query
.
size
=
pageSize
}
}
this
.
loading
=
true
;
getWagesPage
(
this
.
query
).
then
(
res
=>
{
getWagesPage
(
this
.
query
).
then
(
res
=>
{
if
(
res
&&
res
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
if
(
res
&&
res
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
respData
=
res
.
data
let
respData
=
res
.
data
this
.
dataSource
=
respData
.
list
;
this
.
dataSource
=
respData
.
list
;
this
.
total
=
respData
.
total
;
this
.
total
=
respData
.
total
console
.
log
(
this
.
total
)
}
}
this
.
loading
=
false
;
this
.
loading
=
false
;
...
@@ -175,6 +177,16 @@ export default {
...
@@ -175,6 +177,16 @@ export default {
this
.
dataSource
=
a
;
this
.
dataSource
=
a
;
}
}
},
},
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
)
{
saveOne
(
index
)
{
let
a
=
[...
this
.
dataSource
]
let
a
=
[...
this
.
dataSource
]
let
saveData
=
{
let
saveData
=
{
...
...
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