Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psa-web
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
高滢
psa-web
Commits
8f209df0
Commit
8f209df0
authored
Feb 28, 2025
by
ZhangRunSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:考勤首页
parent
58ce8a0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
414 additions
and
0 deletions
+414
-0
index.vue
src/views/attendance/timecard/index.vue
+414
-0
No files found.
src/views/attendance/timecard/index.vue
0 → 100644
View file @
8f209df0
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"申请日期"
>
<el-date-picker
v-model=
"daterangeApplicationDate"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
<el-form-item
label=
"归属周期"
prop=
"attributionPeriod"
>
<el-date-picker
clearable
v-model=
"queryParams.attributionPeriod"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择归属周期"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"补签/打卡日期"
prop=
"candidateDate"
>
<el-date-picker
clearable
v-model=
"queryParams.candidateDate"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择补签/打卡日期"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"打卡状态"
prop=
"checkInStatus"
>
<el-select
v-model=
"queryParams.checkInStatus"
placeholder=
"请选择打卡状态 0:正常签到 1:早退 2:迟到 3: 正常签退"
clearable
>
<el-option
v-for=
"dict in dict.type.clock_status"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:clock:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:clock:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:clock:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['system:clock:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"clockList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"主键"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"申请日期"
align=
"center"
prop=
"applicationDate"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
applicationDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"归属周期"
align
=
"center"
prop
=
"attributionPeriod"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
attributionPeriod
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"关联用户表主键user_id"
align
=
"center"
prop
=
"userId"
/>
<
el
-
table
-
column
label
=
"关联部门表主键dept_id"
align
=
"center"
prop
=
"deptId"
/>
<
el
-
table
-
column
label
=
"关联项目表主键"
align
=
"center"
prop
=
"projectId"
/>
<
el
-
table
-
column
label
=
"补签/打卡日期"
align
=
"center"
prop
=
"candidateDate"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
candidateDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"星期几"
align
=
"center"
prop
=
"week"
/>
<
el
-
table
-
column
label
=
"0:导入 1:外勤 2:补卡"
align
=
"center"
prop
=
"flag"
/>
<
el
-
table
-
column
label
=
"上班打卡 0:否 1:是"
align
=
"center"
prop
=
"isClockIn"
/>
<
el
-
table
-
column
label
=
"下班打卡 0:否 1:是"
align
=
"center"
prop
=
"isClockOut"
/>
<
el
-
table
-
column
label
=
"补签事由说明"
align
=
"center"
prop
=
"reason"
/>
<
el
-
table
-
column
label
=
"上班打卡时间"
align
=
"center"
prop
=
"checkInTime"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
checkInTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"下班签退时间"
align
=
"center"
prop
=
"signOutTime"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
signOutTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"打卡状态 0:正常签到 1:早退 2:迟到 3: 正常签退"
align
=
"center"
prop
=
"checkInStatus"
>
<
template
slot
-
scope
=
"scope"
>
<
dict
-
tag
:
options
=
"dict.type.clock_status"
:
value
=
"scope.row.checkInStatus"
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"迟到分钟数"
align
=
"center"
prop
=
"lateByMinutes"
/>
<
el
-
table
-
column
label
=
"早退分钟数"
align
=
"center"
prop
=
"leaveEarlyMinutes"
/>
<
el
-
table
-
column
label
=
"提交人"
align
=
"center"
prop
=
"creatBy"
/>
<
el
-
table
-
column
label
=
"创建时间"
align
=
"center"
prop
=
"creatTime"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
parseTime
(
scope
.
row
.
creatTime
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['system:clock:edit']"
>
修改
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
v
-
hasPermi
=
"['system:clock:remove']"
>
删除
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"queryParams.pageNum"
:
limit
.
sync
=
"queryParams.pageSize"
@
pagination
=
"getList"
/>
<!--
添加或修改考勤打卡对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"500px"
append
-
to
-
body
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"80px"
>
<
el
-
form
-
item
label
=
"申请日期"
prop
=
"applicationDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.applicationDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择申请日期"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"归属周期"
prop
=
"attributionPeriod"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.attributionPeriod"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择归属周期"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"关联用户表主键user_id"
prop
=
"userId"
>
<
el
-
input
v
-
model
=
"form.userId"
placeholder
=
"请输入关联用户表主键user_id"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"关联项目表主键"
prop
=
"projectId"
>
<
el
-
input
v
-
model
=
"form.projectId"
placeholder
=
"请输入关联项目表主键"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"补签/打卡日期"
prop
=
"candidateDate"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.candidateDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择补签/打卡日期"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"星期几"
prop
=
"week"
>
<
el
-
input
v
-
model
=
"form.week"
placeholder
=
"请输入星期几"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"0:导入 1:外勤 2:补卡"
prop
=
"flag"
>
<
el
-
input
v
-
model
=
"form.flag"
placeholder
=
"请输入0:导入 1:外勤 2:补卡"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"上班打卡 0:否 1:是"
prop
=
"isClockIn"
>
<
el
-
input
v
-
model
=
"form.isClockIn"
placeholder
=
"请输入上班打卡 0:否 1:是"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"下班打卡 0:否 1:是"
prop
=
"isClockOut"
>
<
el
-
input
v
-
model
=
"form.isClockOut"
placeholder
=
"请输入下班打卡 0:否 1:是"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"补签事由说明"
prop
=
"reason"
>
<
el
-
input
v
-
model
=
"form.reason"
placeholder
=
"请输入补签事由说明"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"上班打卡时间"
prop
=
"checkInTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.checkInTime"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择上班打卡时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"下班签退时间"
prop
=
"signOutTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.signOutTime"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择下班签退时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"打卡状态 0:正常签到 1:早退 2:迟到 3: 正常签退"
prop
=
"checkInStatus"
>
<
el
-
select
v
-
model
=
"form.checkInStatus"
placeholder
=
"请选择打卡状态 0:正常签到 1:早退 2:迟到 3: 正常签退"
>
<
el
-
option
v
-
for
=
"dict in dict.type.clock_status"
:
key
=
"dict.value"
:
label
=
"dict.label"
:
value
=
"dict.value"
><
/el-option
>
<
/el-select
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"迟到分钟数"
prop
=
"lateByMinutes"
>
<
el
-
input
v
-
model
=
"form.lateByMinutes"
placeholder
=
"请输入迟到分钟数"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"早退分钟数"
prop
=
"leaveEarlyMinutes"
>
<
el
-
input
v
-
model
=
"form.leaveEarlyMinutes"
placeholder
=
"请输入早退分钟数"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"提交人"
prop
=
"creatBy"
>
<
el
-
input
v
-
model
=
"form.creatBy"
placeholder
=
"请输入提交人"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"创建时间"
prop
=
"creatTime"
>
<
el
-
date
-
picker
clearable
v
-
model
=
"form.creatTime"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择创建时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"submitForm"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/el-dialog
>
<
/div
>
<
/template
>
<
script
>
import
{
listClock
,
getClock
,
delClock
,
addClock
,
updateClock
}
from
"@/api/system/clock"
;
export
default
{
name
:
"Clock"
,
dicts
:
[
'clock_status'
],
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 考勤打卡表格数据
clockList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 创建时间时间范围
daterangeApplicationDate
:
[],
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
applicationDate
:
null
,
attributionPeriod
:
null
,
deptId
:
null
,
candidateDate
:
null
,
checkInStatus
:
null
,
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
}
}
;
}
,
created
()
{
this
.
getList
();
}
,
methods
:
{
/** 查询考勤打卡列表 */
getList
()
{
this
.
loading
=
true
;
this
.
queryParams
.
params
=
{
}
;
if
(
null
!=
this
.
daterangeApplicationDate
&&
''
!=
this
.
daterangeApplicationDate
)
{
this
.
queryParams
.
params
[
"beginApplicationDate"
]
=
this
.
daterangeApplicationDate
[
0
];
this
.
queryParams
.
params
[
"endApplicationDate"
]
=
this
.
daterangeApplicationDate
[
1
];
}
listClock
(
this
.
queryParams
).
then
(
response
=>
{
this
.
clockList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
}
,
// 表单重置
reset
()
{
this
.
form
=
{
}
;
this
.
resetForm
(
"form"
);
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
daterangeApplicationDate
=
[];
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加考勤打卡"
;
}
,
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getClock
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改考勤打卡"
;
}
);
}
,
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateClock
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
else
{
addClock
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
}
);
}
}
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
ids
=
row
.
id
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除考勤打卡编号为"'
+
ids
+
'"的数据项?'
).
then
(
function
()
{
return
delClock
(
ids
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
).
catch
(()
=>
{
}
);
}
,
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'system/clock/export'
,
{
...
this
.
queryParams
}
,
`clock_${new Date().getTime()
}
.xlsx`
)
}
}
}
;
<
/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