Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-manager-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-manager-ui
Commits
8cd12952
Commit
8cd12952
authored
Nov 18, 2024
by
姬鋆屾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref:代码优化
parent
07298ac7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1287 additions
and
1443 deletions
+1287
-1443
src/views/attendance/class/list.vue
src/views/attendance/class/list.vue
+75
-71
src/views/attendance/group/list.vue
src/views/attendance/group/list.vue
+87
-87
src/views/attendance/leave/record/list.vue
src/views/attendance/leave/record/list.vue
+119
-110
src/views/attendance/record/error/list.vue
src/views/attendance/record/error/list.vue
+186
-181
src/views/attendance/record/hik/list.vue
src/views/attendance/record/hik/list.vue
+178
-193
src/views/attendance/record/list.vue
src/views/attendance/record/list.vue
+294
-349
src/views/attendance/stat/list.vue
src/views/attendance/stat/list.vue
+175
-237
src/views/staff/list.vue
src/views/staff/list.vue
+173
-215
No files found.
src/views/attendance/class/list.vue
View file @
8cd12952
<
template
>
<div
class=
"page"
>
<!-- S 班次表格主体 -->
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
></LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<!-- E 班次表格主体 -->
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialogshow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
dialogShow
from
'
./dialogshow
'
;
import
table
from
'
@/assets/mixins/table
'
;
export
default
{
name
:
"
AttendanceClassList
"
,
name
:
'
AttendanceClassList
'
,
components
:
{
dialogShow
,
dialogShow
},
mixins
:
[
table
],
created
()
{},
methods
:
{
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
align
=
"
center
"
><
/el-table-column
>
);
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
dialogform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
dialogform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
dialogform
.
view
(
row
);
},
},
data
()
{
return
{
/** 子表列元素 */
columnSet
:
[
{
prop
:
"
goWorkDate
"
,
label
:
"
上班打卡时间
"
,
prop
:
'
goWorkDate
'
,
label
:
'
上班打卡时间
'
,
width
:
150
,
align
:
"
center
"
,
align
:
'
center
'
},
{
prop
:
"
goWorkDateBefore
"
,
label
:
"
上班前打卡(分钟)
"
,
prop
:
'
goWorkDateBefore
'
,
label
:
'
上班前打卡(分钟)
'
,
width
:
150
,
align
:
"
center
"
,
align
:
'
center
'
},
{
prop
:
"
goWorkDateAfter
"
,
label
:
"
上班后打卡(分钟)
"
,
prop
:
'
goWorkDateAfter
'
,
label
:
'
上班后打卡(分钟)
'
,
width
:
150
,
align
:
"
center
"
,
align
:
'
center
'
},
{
prop
:
"
offWorkDate
"
,
label
:
"
下班打卡时间
"
,
prop
:
'
offWorkDate
'
,
label
:
'
下班打卡时间
'
,
width
:
150
,
align
:
"
center
"
,
align
:
'
center
'
},
{
prop
:
"
offWorkDateBefore
"
,
label
:
"
下班前打卡(分钟)
"
,
prop
:
'
offWorkDateBefore
'
,
label
:
'
下班前打卡(分钟)
'
,
width
:
150
,
align
:
"
center
"
,
align
:
'
center
'
},
{
prop
:
"
offWorkDateAfter
"
,
label
:
"
下班后打卡(分钟)
"
,
prop
:
'
offWorkDateAfter
'
,
label
:
'
下班后打卡(分钟)
'
,
width
:
150
,
align
:
"
center
"
,
}
,
align
:
'
center
'
}
// {prop:"remark",label:"备注",width:150},
// {prop:"classId",label:"班次ID",width:150},
],
config
:
{
search
:
[
{
name
:
"
className
"
,
type
:
"
text
"
,
label
:
"
班次名称
"
,
fuzzy
:
true
,
}
,
name
:
'
className
'
,
type
:
'
text
'
,
label
:
'
班次名称
'
,
fuzzy
:
true
}
],
isshowTabPane
:
true
,
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
班次名称
"
,
prop
:
"
className
"
},
{
type
:
'
selection
'
,
width
:
60
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
},
{
label
:
'
班次名称
'
,
prop
:
'
className
'
},
// {label: "考勤时间", prop: "className"},
{
label
:
"
考勤班次详细信息
"
,
label
:
'
考勤班次详细信息
'
,
width
:
200
,
prop
:
"
subColumns
"
,
prop
:
'
subColumns
'
,
formatter
:
(
row
)
=>
{
let
widthsize
=
this
.
columnSet
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
Number
(
cur
.
width
);
...
...
@@ -121,10 +91,10 @@ export default {
<
/el-button
>
<
/el-popover
>
);
}
,
}
},
{
label
:
"
操作
"
,
label
:
'
操作
'
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
...
...
@@ -137,11 +107,45 @@ export default {
onDel
=
{
this
.
toDel
}
/
>
);
}
,
}
,
]
,
}
,
}
}
]
}
};
},
created
()
{},
methods
:
{
// 表格渲染数据
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
// 表格渲染表头
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
align
=
"
center
"
><
/el-table-column
>
);
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
dialogform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
dialogform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
dialogform
.
view
(
row
);
}
}
};
</
script
>
src/views/attendance/group/list.vue
View file @
8cd12952
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notDel
:config=
"tableConfig"
v-if=
"isshow"
></LayoutTable>
<!-- S 考勤组表格主体 -->
<LayoutTable
:data=
"tableData"
notDel
:config=
"tableConfig"
v-if=
"isshow"
></LayoutTable>
<group-template
ref=
"groupTemplate"
@
ok=
"okFn"
/>
<!-- E 考勤组表格主体 -->
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
groupTemplate
from
"
./groupTemplate
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
groupTemplate
from
'
./groupTemplate
'
;
import
table
from
'
@/assets/mixins/table
'
;
export
default
{
name
:
"
AttendanceGroupList
"
,
name
:
'
AttendanceGroupList
'
,
components
:
{
groupTemplate
,
groupTemplate
},
mixins
:
[
table
],
created
()
{},
methods
:
{
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
><
/el-table-column
>
);
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
add
(
row
);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
edit
(
row
);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
view
(
row
);
},
okFn
(
val
)
{
this
.
getData
();
this
.
isshow
=
val
;
},
},
data
()
{
return
{
isshow
:
true
,
/** 子表列元素 */
columnSet
:
[
{
prop
:
"
groupId
"
,
label
:
"
考勤组
"
,
width
:
100
},
{
prop
:
"
groupName
"
,
label
:
"
考勤组名称
"
,
width
:
100
},
{
prop
:
"
staffId
"
,
label
:
"
员工ID
"
,
width
:
100
},
{
prop
:
"
staffName
"
,
label
:
"
员工姓名
"
,
width
:
100
},
{
prop
:
"
partAttendance
"
,
label
:
"
是否参与考勤,
"
,
width
:
100
},
{
prop
:
"
remark
"
,
label
:
"
备注
"
,
width
:
100
},
{
prop
:
'
groupId
'
,
label
:
'
考勤组
'
,
width
:
100
},
{
prop
:
'
groupName
'
,
label
:
'
考勤组名称
'
,
width
:
100
},
{
prop
:
'
staffId
'
,
label
:
'
员工ID
'
,
width
:
100
},
{
prop
:
'
staffName
'
,
label
:
'
员工姓名
'
,
width
:
100
},
{
prop
:
'
partAttendance
'
,
label
:
'
是否参与考勤,
'
,
width
:
100
},
{
prop
:
'
remark
'
,
label
:
'
备注
'
,
width
:
100
}
],
config
:
{
isshowTabPane
:
true
,
search
:
[
{
name
:
"
groupName
"
,
type
:
"
text
"
,
label
:
"
考勤组名称
"
,
fuzzy
:
true
,
}
,
name
:
'
groupName
'
,
type
:
'
text
'
,
label
:
'
考勤组名称
'
,
fuzzy
:
true
}
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
,
fixed
:
"
left
"
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
,
fixed
:
"
left
"
},
{
type
:
'
selection
'
,
width
:
60
,
fixed
:
'
left
'
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
,
fixed
:
'
left
'
},
{
label
:
"
考勤组名称
"
,
prop
:
"
groupName
"
,
width
:
200
,
fixed
:
"
left
"
},
{
label
:
'
考勤组名称
'
,
prop
:
'
groupName
'
,
width
:
200
,
fixed
:
'
left
'
},
{
label
:
"
人数
"
,
prop
:
"
personNum
"
,
width
:
80
,
fixed
:
"
left
"
},
{
label
:
'
人数
'
,
prop
:
'
personNum
'
,
width
:
80
,
fixed
:
'
left
'
},
{
label
:
"
负责人
"
,
prop
:
"
responsibleName
"
,
label
:
'
负责人
'
,
prop
:
'
responsibleName
'
,
width
:
80
,
fixed
:
"
left
"
,
fixed
:
'
left
'
},
//未
{
label
:
"
类型
"
,
prop
:
"
type
"
,
label
:
'
类型
'
,
prop
:
'
type
'
,
formatter
:
this
.
formatterattendType
,
width
:
100
,
fixed
:
"
left
"
,
fixed
:
'
left
'
},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter},
...
...
@@ -120,9 +69,9 @@ export default {
// {label: "考勤方式", prop: "attendanceType"},
{
label
:
"
考勤时间
"
,
prop
:
"
attendanceTime
"
,
formatter
:
this
.
formatterBanci
,
label
:
'
考勤时间
'
,
prop
:
'
attendanceTime
'
,
formatter
:
this
.
formatterBanci
},
//未
// {label: "考勤组人员信息",
...
...
@@ -141,7 +90,7 @@ export default {
// },
// },
{
label
:
"
操作
"
,
label
:
'
操作
'
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
...
...
@@ -154,12 +103,63 @@ export default {
onDel
=
{
this
.
toDel
}
/
>
);
}
,
}
,
]
,
}
,
}
}
]
}
};
},
created
()
{},
methods
:
{
// 渲染表格数据
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
// 处理表格头部
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
><
/el-table-column
>
);
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
add
(
row
);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
edit
(
row
);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
isshow
=
false
;
this
.
$refs
.
groupTemplate
.
view
(
row
);
},
// 确认操作
okFn
(
val
)
{
this
.
getData
();
this
.
isshow
=
val
;
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
...
...
src/views/attendance/leave/record/list.vue
View file @
8cd12952
<
template
>
<div
class=
"page"
>
<!-- S 表格主体 -->
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notDel
>
<el-button
type=
"primary"
...
...
@@ -10,165 +11,134 @@
>
导出
</el-button>
</LayoutTable>
<!-- E 表格主体 -->
<!-- S 弹窗部分 -->
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
<drawer-audit
ref=
"draweraudit"
@
ok=
"getData"
/>
<!-- E 弹窗部分 -->
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
drawerAudit
from
"
./draweraudit
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
drawerShow
from
'
./drawershow
'
;
import
drawerAudit
from
'
./draweraudit
'
;
import
table
from
'
@/assets/mixins/table
'
;
export
default
{
name
:
"
AttendanceLeaveRecordList
"
,
name
:
'
AttendanceLeaveRecordList
'
,
components
:
{
drawerShow
,
drawerAudit
,
drawerAudit
},
mixins
:
[
table
],
created
()
{},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
audit
(
row
)
{
//todo 审核页面进行审核
this
.
$refs
.
drawerform
.
edit
(
row
);
// this.$refs.draweraudit.view(row);
},
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/attendance/leave/record/exportExcel
"
,
{
idList
:
this
.
selection
,
name
:
this
.
$route
.
query
[
"
name
"
],
startTimeEnd
:
this
.
query
.
startTimeEnd
,
startTimeStart
:
this
.
query
.
startTimeStart
,
},
{
type
:
"
excel
"
,
name
:
"
请假记录
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
},
data
()
{
return
{
// 导出加载状态
isExport
:
false
,
// 表格配置项
config
:
{
isshowTabPane
:
true
,
search
:
[
{
name
:
"
leavePerson
"
,
type
:
"
text
"
,
label
:
"
请假人
"
,
fuzzy
:
true
,
name
:
'
leavePerson
'
,
type
:
'
text
'
,
label
:
'
请假人
'
,
fuzzy
:
true
},
{
name
:
"
phoneNumber
"
,
type
:
"
text
"
,
label
:
"
电话号码
"
,
fuzzy
:
true
,
name
:
'
phoneNumber
'
,
type
:
'
text
'
,
label
:
'
电话号码
'
,
fuzzy
:
true
},
{
name
:
"
salaId
"
,
type
:
"
selectSalaId
"
,
label
:
"
大厅
"
,
fuzzy
:
false
,
name
:
'
salaId
'
,
type
:
'
selectSalaId
'
,
label
:
'
大厅
'
,
fuzzy
:
false
},
{
name
:
"
deptId
"
,
type
:
"
selectDeptId
"
,
label
:
"
部门
"
,
fuzzy
:
false
,
name
:
'
deptId
'
,
type
:
'
selectDeptId
'
,
label
:
'
部门
'
,
fuzzy
:
false
},
{
name
:
"
leaveType
"
,
type
:
"
select
"
,
label
:
"
请假类型
"
,
name
:
'
leaveType
'
,
type
:
'
select
'
,
label
:
'
请假类型
'
},
{
name
:
"
startTimeStart
"
,
type
:
"
date
"
,
label
:
"
开始时间
"
,
fuzzy
:
false
,
name
:
'
startTimeStart
'
,
type
:
'
date
'
,
label
:
'
开始时间
'
,
fuzzy
:
false
},
{
name
:
"
startTimeEnd
"
,
type
:
"
date
"
,
label
:
"
结束时间
"
,
fuzzy
:
false
,
}
,
name
:
'
startTimeEnd
'
,
type
:
'
date
'
,
label
:
'
结束时间
'
,
fuzzy
:
false
}
],
columns
:
[
{
type
:
"
selection
"
,
width
:
40
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
type
:
'
selection
'
,
width
:
40
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
},
// {label: "请假人id", prop: "leavePersonId", formatter: this.formatter},
{
label
:
"
请假人
"
,
prop
:
"
leavePerson
"
},
{
label
:
'
请假人
'
,
prop
:
'
leavePerson
'
},
// {label: "所属部门id", prop: "deptId", formatter: this.formatter},
{
label
:
"
大厅
"
,
prop
:
"
salaName
"
,
label
:
'
大厅
'
,
prop
:
'
salaName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
label
:
'
部门
'
,
prop
:
'
deptName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
电话号码
"
,
prop
:
"
phoneNumber
"
},
{
label
:
'
电话号码
'
,
prop
:
'
phoneNumber
'
},
{
label
:
"
请假类型
"
,
prop
:
"
leaveType
"
,
formatter
:
this
.
formatterLeaveType
,
label
:
'
请假类型
'
,
prop
:
'
leaveType
'
,
formatter
:
this
.
formatterLeaveType
},
{
label
:
"
开始时间
"
,
prop
:
"
startTime
"
,
label
:
'
开始时间
'
,
prop
:
'
startTime
'
,
width
:
150
,
formatter
:
this
.
formatterDate
,
formatter
:
this
.
formatterDate
},
{
label
:
"
结束时间
"
,
prop
:
"
endTime
"
,
label
:
'
结束时间
'
,
prop
:
'
endTime
'
,
width
:
150
,
formatter
:
this
.
formatterDate
,
formatter
:
this
.
formatterDate
},
{
label
:
"
钉钉原始时间(换算时长)
"
,
label
:
'
钉钉原始时间(换算时长)
'
,
width
:
190
,
formatter
:
(
row
)
=>
{
return
(
(
row
.
sourceDingTime
?
row
.
sourceDingTime
:
"
--
"
)
+
(
row
.
sourceDingTime
?
row
.
sourceDingTime
:
'
--
'
)
+
(
row
.
duration
?
"
(
"
+
(
row
.
duration
/
60
/
60
/
8
).
toFixed
(
2
)
+
"
天
"
+
"
)
"
:
"
(--)
"
)
?
'
(
'
+
(
row
.
duration
/
60
/
60
/
8
).
toFixed
(
2
)
+
'
天
'
+
'
)
'
:
'
(--)
'
)
);
}
,
}
},
// {label: "审批负责人Id", prop: "approverId", formatter: this.formatter},
...
...
@@ -176,27 +146,27 @@ export default {
/* {label: "处理状态", prop: "processStatus", formatter: this.formatter},*/
{
label
:
"
状态
"
,
prop
:
"
auditResult
"
,
formatter
:
this
.
formatter
,
label
:
'
状态
'
,
prop
:
'
auditResult
'
,
formatter
:
this
.
formatter
},
// { label: "审批负责人", prop: "approver" },
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
,
label
:
'
创建用户
'
,
prop
:
'
createUserId
'
,
formatter
:
this
.
formatter
},
{
label
:
"
创建时间
"
,
prop
:
"
createTime
"
,
label
:
'
创建时间
'
,
prop
:
'
createTime
'
,
width
:
150
,
formatter
:
this
.
formatterDate
,
formatter
:
this
.
formatterDate
},
{
label
:
"
操作
"
,
label
:
'
操作
'
,
width
:
220
,
formatter
:
(
row
)
=>
{
return
(
...
...
@@ -221,15 +191,54 @@ export default {
审核
<
/el-button
>
)
:
(
""
''
)}
<
/div
>
);
}
,
}
,
]
,
}
,
}
}
]
}
};
},
created
()
{},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
audit
(
row
)
{
//todo 审核页面进行审核
this
.
$refs
.
drawerform
.
edit
(
row
);
// this.$refs.draweraudit.view(row);
},
// 导出操作
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
'
/attendance/leave/record/exportExcel
'
,
{
idList
:
this
.
selection
,
name
:
this
.
$route
.
query
[
'
name
'
],
startTimeEnd
:
this
.
query
.
startTimeEnd
,
startTimeStart
:
this
.
query
.
startTimeStart
},
{
type
:
'
excel
'
,
name
:
'
请假记录
'
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
}
}
};
</
script
>
src/views/attendance/record/error/list.vue
View file @
8cd12952
...
...
@@ -23,9 +23,7 @@
<drawer-show
ref=
"drawerShow"
@
ok=
"getData"
/>
<!-- 撤销提示 -->
<el-dialog
:visible.sync=
"dialogVisible"
title=
"提示"
width=
"40%"
>
<div>
撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。
</div>
<div>
撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。
</div>
<div
class=
"flex flex_end"
>
<el-button
@
click=
"dialogVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"resetError"
>
确定
</el-button>
...
...
@@ -39,147 +37,44 @@
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
drawerShow
from
'
./drawershow
'
;
import
table
from
'
@/assets/mixins/table
'
;
import
{
getFirstDay
,
getLastDay
,
getdiffdate
,
timestampToTime
,
getMyDay
,
}
from
"
@/assets/utils/dateFormat.js
"
;
getMyDay
}
from
'
@/assets/utils/dateFormat.js
'
;
export
default
{
name
:
"
AttendanceRecordErrorList
"
,
name
:
'
AttendanceRecordErrorList
'
,
components
:
{
drawerShow
,
drawerShow
},
mixins
:
[
table
],
created
()
{
this
.
query
.
errorDateTimeStart
=
getFirstDay
();
this
.
query
.
errorDateTimeEnd
=
getLastDay
();
},
methods
:
{
countDown
()
{
if
(
this
.
percent
==
95
)
{
let
params
=
{};
for
(
let
value
of
this
.
config
.
search
)
{
if
(
this
.
query
[
value
.
name
])
{
params
[
value
.
name
]
=
this
.
query
[
value
.
name
];
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
}
let
that
=
this
;
this
.
$download
(
"
/attendance/record/error/exportExcel
"
,
{
...
params
,
},
{
type
:
"
excel
"
,
name
:
"
异常处理
"
}
)
.
then
(()
=>
{
this
.
percent
=
100
;
this
.
progress
=
false
;
that
.
isExport
=
false
;
})
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
progress
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
return
;
}
else
{
this
.
percent
=
this
.
percent
+
1
;
let
that
=
this
;
setTimeout
(
function
()
{
that
.
countDown
();
},
100
);
}
},
/** 导出Excel */
doExport
()
{
if
(
this
.
isExport
==
true
)
{
this
.
$message
.
info
(
"
数据正在导出中,请勿重复点击!
"
);
return
false
;
}
this
.
isExport
=
true
;
this
.
progress
=
true
;
this
.
percent
=
0
;
this
.
countDown
();
},
/** 重写新增方法 */
// toAdd(row) {
// this.$refs.dialogform.add(row);
// },
// /** 重写编辑方法 */
// toEdit(row) {
// this.$refs.dialogform.edit(row);
// },
// /** 重写查看方法 */
// toView(row) {
// this.$refs.dialogform.view(row);
// },
morehandle
()
{
let
arr
=
this
.
tableData
.
data
.
filter
((
item
)
=>
{
if
(
this
.
selection
.
includes
(
item
.
id
)
&&
item
.
processStatus
==
0
)
{
return
item
;
}
});
this
.
$nextTick
(()
=>
{
this
.
selection
=
arr
.
map
((
item
)
=>
item
.
id
);
});
if
(
arr
.
length
<
1
)
{
this
.
$message
.
error
(
"
请至少选择一条处理
"
);
return
;
}
this
.
$refs
.
drawerShow
.
edit
(
arr
[
0
],
arr
);
},
// 处理
handle
(
err
)
{
console
.
log
(
err
);
this
.
$refs
.
drawerShow
.
edit
(
err
,
[]);
},
// 撤销
reCancle
(
err
)
{
console
.
log
(
err
);
this
.
currentParams
=
err
;
this
.
dialogVisible
=
true
;
},
resetError
()
{
this
.
$post
(
"
attendance/record/error/revokeError
"
,
{
id
:
this
.
currentParams
.
id
,
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
dialogVisible
=
false
;
this
.
getData
();
}
});
},
},
data
()
{
return
{
// 进度
percent
:
0
,
// 导出加载状态
isExport
:
false
,
// 是否显示进度
progress
:
false
,
// 表格配置项
config
:
{
isshowTabPane
:
true
,
search
:
[
{
name
:
"
salaId
"
,
type
:
"
selectSalaId
"
,
label
:
"
大厅
"
,
fuzzy
:
false
,
name
:
'
salaId
'
,
type
:
'
selectSalaId
'
,
label
:
'
大厅
'
,
fuzzy
:
false
},
{
name
:
"
deptId
"
,
type
:
"
selectDeptId
"
,
label
:
"
部门
"
,
fuzzy
:
false
,
name
:
'
deptId
'
,
type
:
'
selectDeptId
'
,
label
:
'
部门
'
,
fuzzy
:
false
},
// {
// name: "groupId",
...
...
@@ -193,31 +88,31 @@ export default {
fuzzy: false
},*/
{
name
:
"
errorStatus
"
,
type
:
"
select
"
,
label
:
"
异常状态
"
,
name
:
'
errorStatus
'
,
type
:
'
select
'
,
label
:
'
异常状态
'
},
{
name
:
"
processStatus
"
,
type
:
"
select
"
,
label
:
"
处理状态
"
,
name
:
'
processStatus
'
,
type
:
'
select
'
,
label
:
'
处理状态
'
},
{
name
:
"
errorDateTimeStart
"
,
type
:
"
date
"
,
label
:
"
异常开始时间
"
,
name
:
'
errorDateTimeStart
'
,
type
:
'
date
'
,
label
:
'
异常开始时间
'
},
{
name
:
"
errorDateTimeEnd
"
,
type
:
"
date
"
,
label
:
"
异常结束时间
"
,
name
:
'
errorDateTimeEnd
'
,
type
:
'
date
'
,
label
:
'
异常结束时间
'
},
{
name
:
"
staffName
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
,
}
,
name
:
'
staffName
'
,
type
:
'
text
'
,
label
:
'
员工姓名
'
,
fuzzy
:
true
}
// {
// name: "phoneNumber",
// type: "text",
...
...
@@ -226,68 +121,68 @@ export default {
// },
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
,
fixed
:
"
left
"
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
,
fixed
:
"
left
"
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
,
fixed
:
"
left
"
,
width
:
100
},
{
label
:
"
工号
"
,
prop
:
"
workNum
"
},
{
type
:
'
selection
'
,
width
:
60
,
fixed
:
'
left
'
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
,
fixed
:
'
left
'
},
{
label
:
'
员工姓名
'
,
prop
:
'
staffName
'
,
fixed
:
'
left
'
,
width
:
100
},
{
label
:
'
工号
'
,
prop
:
'
workNum
'
},
{
label
:
"
大厅
"
,
prop
:
"
salaName
"
,
label
:
'
大厅
'
,
prop
:
'
salaName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
label
:
'
部门
'
,
prop
:
'
deptName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
考勤组
"
,
prop
:
"
attendanceGroupName
"
},
{
label
:
'
考勤组
'
,
prop
:
'
attendanceGroupName
'
},
/* {label: "班次", prop: "shiftsName"},*/
{
label
:
"
异常状态
"
,
prop
:
"
errorStatus
"
,
formatter
:
this
.
formattereErrorStatus
,
label
:
'
异常状态
'
,
prop
:
'
errorStatus
'
,
formatter
:
this
.
formattereErrorStatus
},
{
label
:
"
异常时间
"
,
prop
:
"
errorDateTime
"
,
label
:
'
异常时间
'
,
prop
:
'
errorDateTime
'
,
width
:
160
,
formatter
:
this
.
formatterDate
,
formatter
:
this
.
formatterDate
},
{
label
:
"
处理结果
"
,
prop
:
"
processResult
"
,
formatter
:
this
.
formatters
,
label
:
'
处理结果
'
,
prop
:
'
processResult
'
,
formatter
:
this
.
formatters
},
{
label
:
"
上下班时间
"
,
prop
:
"
goOffDateTime
"
,
label
:
'
上下班时间
'
,
prop
:
'
goOffDateTime
'
,
formatter
:
(
row
)
=>
{
return
row
.
goOrOff
+
"
"
+
row
.
goOffDateTime
;
}
,
return
row
.
goOrOff
+
'
'
+
row
.
goOffDateTime
;
}
},
{
label
:
"
实际打卡时间
"
,
prop
:
"
actualAttendanceDateTime
"
,
label
:
'
实际打卡时间
'
,
prop
:
'
actualAttendanceDateTime
'
,
formatter
:
this
.
formatterDate
,
width
:
160
,
width
:
160
},
{
label
:
"
处理时间
"
,
prop
:
"
operDateTime
"
,
label
:
'
处理时间
'
,
prop
:
'
operDateTime
'
,
formatter
:
this
.
formatterDate
,
width
:
160
,
width
:
160
},
{
label
:
"
处理状态
"
,
prop
:
"
processStatus
"
,
formatter
:
this
.
formattereDealStatus
,
label
:
'
处理状态
'
,
prop
:
'
processStatus
'
,
formatter
:
this
.
formattereDealStatus
},
{
label
:
"
处理人
"
,
prop
:
"
opertor
"
,
formatter
:
this
.
formatters
},
{
label
:
"
备注
"
,
prop
:
"
remark
"
,
formatter
:
this
.
formatters
},
{
label
:
'
处理人
'
,
prop
:
'
opertor
'
,
formatter
:
this
.
formatters
},
{
label
:
'
备注
'
,
prop
:
'
remark
'
,
formatter
:
this
.
formatters
},
{
label
:
"
操作
"
,
label
:
'
操作
'
,
width
:
100
,
formatter
:
(
row
)
=>
{
if
(
row
.
processStatus
==
0
||
!
row
.
processStatus
)
{
...
...
@@ -317,14 +212,124 @@ export default {
<
/span
>
);
}
}
,
}
,
]
,
}
}
]
},
// 是否展示弹窗
dialogVisible
:
false
,
currentParams
:
{}
,
currentParams
:
{}
};
},
created
()
{
this
.
query
.
errorDateTimeStart
=
getFirstDay
();
this
.
query
.
errorDateTimeEnd
=
getLastDay
();
},
methods
:
{
// 进度条倒计时
countDown
()
{
if
(
this
.
percent
==
95
)
{
let
params
=
{};
for
(
let
value
of
this
.
config
.
search
)
{
if
(
this
.
query
[
value
.
name
])
{
params
[
value
.
name
]
=
this
.
query
[
value
.
name
];
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
'
idList
'
]
=
this
.
selection
;
}
let
that
=
this
;
this
.
$download
(
'
/attendance/record/error/exportExcel
'
,
{
...
params
},
{
type
:
'
excel
'
,
name
:
'
异常处理
'
}
)
.
then
(()
=>
{
this
.
percent
=
100
;
this
.
progress
=
false
;
that
.
isExport
=
false
;
})
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
progress
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
return
;
}
else
{
this
.
percent
=
this
.
percent
+
1
;
let
that
=
this
;
setTimeout
(
function
()
{
that
.
countDown
();
},
100
);
}
},
/** 导出Excel */
doExport
()
{
if
(
this
.
isExport
==
true
)
{
this
.
$message
.
info
(
'
数据正在导出中,请勿重复点击!
'
);
return
false
;
}
this
.
isExport
=
true
;
this
.
progress
=
true
;
this
.
percent
=
0
;
this
.
countDown
();
},
/** 重写新增方法 */
// toAdd(row) {
// this.$refs.dialogform.add(row);
// },
// /** 重写编辑方法 */
// toEdit(row) {
// this.$refs.dialogform.edit(row);
// },
// /** 重写查看方法 */
// toView(row) {
// this.$refs.dialogform.view(row);
// },
//选择处理
morehandle
()
{
let
arr
=
this
.
tableData
.
data
.
filter
((
item
)
=>
{
if
(
this
.
selection
.
includes
(
item
.
id
)
&&
item
.
processStatus
==
0
)
{
return
item
;
}
});
this
.
$nextTick
(()
=>
{
this
.
selection
=
arr
.
map
((
item
)
=>
item
.
id
);
});
if
(
arr
.
length
<
1
)
{
this
.
$message
.
error
(
'
请至少选择一条处理
'
);
return
;
}
this
.
$refs
.
drawerShow
.
edit
(
arr
[
0
],
arr
);
},
// 处理
handle
(
err
)
{
console
.
log
(
err
);
this
.
$refs
.
drawerShow
.
edit
(
err
,
[]);
},
// 撤销
reCancle
(
err
)
{
console
.
log
(
err
);
this
.
currentParams
=
err
;
this
.
dialogVisible
=
true
;
},
// 重置
resetError
()
{
this
.
$post
(
'
attendance/record/error/revokeError
'
,
{
id
:
this
.
currentParams
.
id
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
dialogVisible
=
false
;
this
.
getData
();
}
});
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
...
...
src/views/attendance/record/hik/list.vue
View file @
8cd12952
...
...
@@ -61,7 +61,7 @@
:show-close=
"false"
>
<div
class=
"fresh_box"
>
<div
class=
"title_box"
style=
"margin-bottom: 20px
;
"
>
<div
class=
"title_box"
style=
"margin-bottom: 20px"
>
仅支持手动更新近90天的打卡数据,请选择需要更新的时间段:
</div>
<el-date-picker
...
...
@@ -76,18 +76,11 @@
</el-date-picker>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFresh"
:loading=
"submitLoad"
>
确 定
</el-button
>
<el-button
type=
"primary"
@
click=
"submitFresh"
:loading=
"submitLoad"
>
确 定
</el-button>
<el-button
@
click=
"cancleFresh"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
...
...
@@ -107,10 +100,7 @@
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
...
...
@@ -124,11 +114,7 @@
</div>
</el-dialog>
<!-- 导出记录查看 -->
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<div
class=
"hisList"
>
<div
class=
"list mt10"
...
...
@@ -141,23 +127,13 @@
<el-button
type=
"text"
>
导出成功
</el-button>
</div>
<div
class=
"details"
v-if=
"item.islook"
>
<div
class=
"mt10"
v-if=
"item.recordIdList"
>
选择列表id:
{{
item
.
recordIdList
}}
</div>
<div
class=
"mt10"
v-if=
"item.deptName"
>
选择部门:
{{
item
.
deptName
}}
</div>
<div
class=
"mt10"
v-if=
"item.groupName"
>
选择考勤组:
{{
item
.
groupName
}}
</div>
<div
class=
"mt10"
v-if=
"item.className"
>
选择班次:
{{
item
.
className
}}
</div>
<div
class=
"mt10"
v-if=
"item.recordIdList"
>
选择列表id:
{{
item
.
recordIdList
}}
</div>
<div
class=
"mt10"
v-if=
"item.deptName"
>
选择部门:
{{
item
.
deptName
}}
</div>
<div
class=
"mt10"
v-if=
"item.groupName"
>
选择考勤组:
{{
item
.
groupName
}}
</div>
<div
class=
"mt10"
v-if=
"item.className"
>
选择班次:
{{
item
.
className
}}
</div>
<div
class=
"mt10"
>
<el-link
:href=
"item.filePath"
target=
"_blank"
type=
"primary"
>
重新下载
</el-link
>
<el-link
:href=
"item.filePath"
target=
"_blank"
type=
"primary"
>
重新下载
</el-link>
</div>
</div>
<div
class=
"times mt10"
>
导出时间:
{{
item
.
createTime
}}
</div>
...
...
@@ -172,33 +148,167 @@
<
script
>
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialogshow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
{
timestampToTime
,
getFirstDay
,
getLastDay
,
}
from
"
@/assets/utils/dateFormat
"
;
import
dialogShow
from
'
./dialogshow
'
;
import
table
from
'
@/assets/mixins/table
'
;
import
{
timestampToTime
,
getFirstDay
,
getLastDay
}
from
'
@/assets/utils/dateFormat
'
;
export
default
{
name
:
"
AttendanceRecordHikList
"
,
name
:
'
AttendanceRecordHikList
'
,
components
:
{
dialogShow
,
dialogShow
},
mixins
:
[
table
],
data
()
{
return
{
// 时间组件限制
pickerOptions0
:
{
disabledDate
(
time
)
{
let
curDate
=
new
Date
().
getTime
();
let
three
=
90
*
24
*
3600
*
1000
;
let
threeMonths
=
curDate
-
three
;
return
time
.
getTime
()
>
Date
.
now
()
||
time
.
getTime
()
<
threeMonths
;
}
},
// 时间绑定
freshDate
:
''
,
// 提交加载状态
submitLoad
:
false
,
// 按钮加载状态
btnLoading
:
false
,
// 更新按钮加载状态
btnFreshLoading
:
false
,
// 弹窗展示
dialogOpen
:
false
,
// 是否展示按钮
showBtn
:
false
,
// 展示进度
progress
:
false
,
// 导出加载状态
isExport
:
false
,
// 进度
percent
:
0
,
upload
:
{
headers
:
{
Authorization
:
window
.
sessionStorage
.
getItem
(
'
token
'
)
||
''
},
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
'
导入员工关怀信息数据
'
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_API_BASE_URL
+
'
/attendance/attendance/record/hik/importData
'
},
// 表格配置
config
:
{
isshowTabPane
:
true
,
search
:
[
{
name
:
'
staffName
'
,
type
:
'
text
'
,
label
:
'
员工姓名
'
,
fuzzy
:
true
},
{
name
:
'
workNum
'
,
type
:
'
text
'
,
label
:
'
工号
'
,
fuzzy
:
false
},
// {
// name: "deptId",
// type: "select",
// label: "所属部门",
// fuzzy: false
// },
// {
// name: "attendanceGroupId",
// type: "select",
// label: "所属考勤组",
// fuzzy: false
// },
// {
// name: "shiftsId",
// type: "select",
// label: "班次",
// fuzzy: false
// },
{
name
:
'
attendanceDateStart
'
,
type
:
'
date
'
,
label
:
'
考勤开始时间
'
,
fuzzy
:
false
},
{
name
:
'
attendanceDateEnd
'
,
type
:
'
date
'
,
label
:
'
考勤结束时间
'
,
fuzzy
:
false
}
],
columns
:
[
{
type
:
'
selection
'
,
width
:
60
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
},
{
label
:
'
员工姓名
'
,
prop
:
'
staffName
'
},
{
label
:
'
工号
'
,
prop
:
'
workNum
'
},
{
label
:
'
大厅
'
,
prop
:
'
salaName
'
,
formatter
:
this
.
formatter
,
show
:
true
},
{
label
:
'
部门
'
,
prop
:
'
deptName
'
,
formatter
:
this
.
formatter
,
show
:
true
},
// {label: "考勤组", prop: "attendanceGroupName"},
// {label: "职位", prop: "positionName"},
// {label: "班次", prop: "shiftsName"},
{
label
:
'
考勤时间
'
,
prop
:
'
attendanceDate
'
,
formatter
:
this
.
formatterDate
},
{
label
:
'
考勤点名称
'
,
prop
:
'
attendanceAddress
'
},
{
label
:
'
事件源
'
,
prop
:
'
eventSource
'
}
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
//
<
table
-
buttons
noAdd
noDel
noEdit
noView
row
=
{
row
}
// onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// )
// }
// }
]
},
// 历史记录
drawerhistory
:
false
,
// 导出列表
exportList
:
[],
baseUrl
:
process
.
env
.
VUE_APP_API_BASE_URL
+
'
/
'
};
},
created
()
{
this
.
query
.
attendanceDateStart
=
timestampToTime
(
new
Date
(),
3
);
this
.
query
.
attendanceDateEnd
=
timestampToTime
(
new
Date
(),
3
);
JSON
.
parse
(
sessionStorage
.
getItem
(
"
userData
"
)).
id
==
1
JSON
.
parse
(
sessionStorage
.
getItem
(
'
userData
'
)).
id
==
1
?
(
this
.
showBtn
=
true
)
:
(
this
.
showBtn
=
false
);
},
methods
:
{
// 确认操作
submitFresh
()
{
if
(
this
.
freshDate
)
{
this
.
submitLoad
=
true
;
this
.
$post
(
"
/attendance/record/hik/addAttendanceHikRecordCustom
"
,
{
this
.
$post
(
'
/attendance/record/hik/addAttendanceHikRecordCustom
'
,
{
attendanceDateStart
:
this
.
freshDate
[
0
],
attendanceDateEnd
:
this
.
freshDate
[
1
]
,
attendanceDateEnd
:
this
.
freshDate
[
1
]
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
...
...
@@ -216,13 +326,14 @@ export default {
this
.
btnFreshLoading
=
false
;
});
}
else
{
this
.
$message
.
error
(
"
请选择时间范围!
"
);
this
.
$message
.
error
(
'
请选择时间范围!
'
);
}
},
// 取消更新
cancleFresh
()
{
this
.
dialogOpen
=
false
;
this
.
btnFreshLoading
=
false
;
this
.
freshDate
=
""
;
this
.
freshDate
=
''
;
},
// 手动更新
handleRefresh
()
{
...
...
@@ -239,27 +350,27 @@ export default {
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
this
.
$post
(
"
/attendance/record/hik/addAttendanceRecord
"
,
{
...
params
,
this
.
$post
(
'
/attendance/record/hik/addAttendanceRecord
'
,
{
...
params
}).
then
((
res
)
=>
{
this
.
btnLoading
=
false
;
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
生成打卡记录成功!
"
);
this
.
$message
.
success
(
'
生成打卡记录成功!
'
);
}
});
},
// 更改状态
changeStatus
(
item
)
{
this
.
$set
(
item
,
"
islook
"
,
!
item
.
islook
);
this
.
$set
(
item
,
'
islook
'
,
!
item
.
islook
);
},
// 导出记录
lookexportHis
()
{
this
.
$post
(
"
/attendance/export/record/list
"
,
{
this
.
$post
(
'
/attendance/export/record/list
'
,
{
type
:
1
,
page
:
1
,
size
:
-
1
,
size
:
-
1
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
let
arr
=
res
.
data
.
data
;
...
...
@@ -275,16 +386,16 @@ export default {
},
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
打卡记录导入
"
;
this
.
upload
.
title
=
'
打卡记录导入
'
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/attendance/record/hik/downloadTemplate
"
,
'
/attendance/record/hik/downloadTemplate
'
,
{},
{
type
:
"
excel
"
,
name
:
"
打卡记录统计
"
}
{
type
:
'
excel
'
,
name
:
'
打卡记录统计
'
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
...
...
@@ -301,7 +412,7 @@ export default {
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
$alert
(
response
.
msg
,
'
导入结果
'
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
...
...
@@ -318,15 +429,15 @@ export default {
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
this
.
$download
(
"
/attendance/record/hik/exportExcel
"
,
'
/attendance/record/hik/exportExcel
'
,
{
...
params
,
...
params
},
{
type
:
"
excel
"
,
name
:
"
打卡记录统计
"
}
{
type
:
'
excel
'
,
name
:
'
打卡记录统计
'
}
)
.
then
(()
=>
{
this
.
percent
=
100
;
...
...
@@ -343,7 +454,7 @@ export default {
}
else
{
this
.
percent
=
this
.
percent
+
1
;
let
that
=
this
;
setTimeout
(
function
()
{
setTimeout
(
function
()
{
that
.
countDown
();
},
100
);
}
...
...
@@ -351,7 +462,7 @@ export default {
/** 导出Excel */
doExport
()
{
if
(
this
.
isExport
==
true
)
{
this
.
$message
.
info
(
"
考勤数据正在导出中,请勿重复点击!
"
);
this
.
$message
.
info
(
'
考勤数据正在导出中,请勿重复点击!
'
);
return
false
;
}
...
...
@@ -372,134 +483,8 @@ export default {
toView
(
row
)
{
this
.
$refs
.
dialogform
.
view
(
row
);
},
afterRender
(
data
)
{},
},
data
()
{
return
{
pickerOptions0
:
{
disabledDate
(
time
)
{
let
curDate
=
new
Date
().
getTime
();
let
three
=
90
*
24
*
3600
*
1000
;
let
threeMonths
=
curDate
-
three
;
return
time
.
getTime
()
>
Date
.
now
()
||
time
.
getTime
()
<
threeMonths
;
},
},
freshDate
:
""
,
submitLoad
:
false
,
btnLoading
:
false
,
btnFreshLoading
:
false
,
dialogOpen
:
false
,
showBtn
:
false
,
progress
:
false
,
isExport
:
false
,
percent
:
0
,
upload
:
{
headers
:
{
Authorization
:
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
,
},
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
"
导入员工关怀信息数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/attendance/attendance/record/hik/importData
"
,
},
config
:
{
isshowTabPane
:
true
,
search
:
[
{
name
:
"
staffName
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
,
},
{
name
:
"
workNum
"
,
type
:
"
text
"
,
label
:
"
工号
"
,
fuzzy
:
false
,
},
// {
// name: "deptId",
// type: "select",
// label: "所属部门",
// fuzzy: false
// },
// {
// name: "attendanceGroupId",
// type: "select",
// label: "所属考勤组",
// fuzzy: false
// },
// {
// name: "shiftsId",
// type: "select",
// label: "班次",
// fuzzy: false
// },
{
name
:
"
attendanceDateStart
"
,
type
:
"
date
"
,
label
:
"
考勤开始时间
"
,
fuzzy
:
false
,
},
{
name
:
"
attendanceDateEnd
"
,
type
:
"
date
"
,
label
:
"
考勤结束时间
"
,
fuzzy
:
false
,
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
},
{
label
:
"
工号
"
,
prop
:
"
workNum
"
},
{
label
:
"
大厅
"
,
prop
:
"
salaName
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
// {label: "考勤组", prop: "attendanceGroupName"},
// {label: "职位", prop: "positionName"},
// {label: "班次", prop: "shiftsName"},
{
label
:
"
考勤时间
"
,
prop
:
"
attendanceDate
"
,
formatter
:
this
.
formatterDate
,
},
{
label
:
"
考勤点名称
"
,
prop
:
"
attendanceAddress
"
},
{
label
:
"
事件源
"
,
prop
:
"
eventSource
"
},
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
//
<
table
-
buttons
noAdd
noDel
noEdit
noView
row
=
{
row
}
// onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// )
// }
// }
],
},
drawerhistory
:
false
,
exportList
:
[],
baseUrl
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/
"
,
};
},
afterRender
(
data
)
{}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
src/views/attendance/record/list.vue
View file @
8cd12952
...
...
@@ -36,13 +36,7 @@
</div>
</div>
</div>
-->
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notDel
notAdd
ref=
"layoutTable"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notDel
notAdd
ref=
"layoutTable"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
...
...
@@ -89,11 +83,7 @@
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
<!-- 导出记录查看 -->
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<div
class=
"hisList"
>
<div
class=
"list mt10"
...
...
@@ -106,24 +96,13 @@
<el-button
type=
"text"
>
导出成功
</el-button>
</div>
<div
class=
"details"
v-if=
"item.islook"
>
<div
class=
"mt10"
v-if=
"item.recordIdList"
>
选择列表id:
{{
item
.
recordIdList
}}
</div>
<div
class=
"mt10"
v-if=
"item.deptName"
>
选择部门:
{{
item
.
deptName
}}
</div>
<div
class=
"mt10"
v-if=
"item.groupName"
>
选择考勤组:
{{
item
.
groupName
}}
</div>
<div
class=
"mt10"
v-if=
"item.className"
>
选择班次:
{{
item
.
className
}}
</div>
<div
class=
"mt10"
v-if=
"item.recordIdList"
>
选择列表id:
{{
item
.
recordIdList
}}
</div>
<div
class=
"mt10"
v-if=
"item.deptName"
>
选择部门:
{{
item
.
deptName
}}
</div>
<div
class=
"mt10"
v-if=
"item.groupName"
>
选择考勤组:
{{
item
.
groupName
}}
</div>
<div
class=
"mt10"
v-if=
"item.className"
>
选择班次:
{{
item
.
className
}}
</div>
<div
class=
"mt10"
>
<el-link
:href=
"baseUrl + item.filePath"
target=
"_blank"
type=
"primary"
<el-link
:href=
"baseUrl + item.filePath"
target=
"_blank"
type=
"primary"
>
重新下载
</el-link
>
</div>
...
...
@@ -134,49 +113,32 @@
</el-drawer>
<!-- 导出表格设置 -->
<el-dialog
:visible.sync=
"isdialog"
title=
"导出表格设置"
>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group
v-model=
"checkList"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
<div
class=
"mt20"
style=
"text-align:right"
>
<div
class=
"mt20"
style=
"text-align:
right"
>
<el-button
@
click=
"handleCancel(1)"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit(1)"
>
确定
</el-button>
</div>
</el-dialog>
<!-- 显示表格设置 -->
<el-dialog
:visible.sync=
"setDialog"
title=
"表格显示设置"
>
<div
class=
"tipsword"
>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<div
class=
"tipsword"
>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<el-checkbox-group
v-model=
"checkTableList"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
<div
class=
"mt20"
style=
"text-align:right"
>
<div
class=
"mt20"
style=
"text-align:
right"
>
<el-button
@
click=
"handleCancel(2)"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit(2)"
>
确定
</el-button>
</div>
</el-dialog>
<!-- 上传 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
...
...
@@ -196,10 +158,7 @@
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
...
...
@@ -220,16 +179,16 @@
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
TabPane
from
"
@/components/tabPane.vue
"
;
import
{
timestampToTime
}
from
"
@/assets/utils/dateFormat
"
;
import
{
formatterDateOnly
}
from
"
@/assets/utils/table
"
;
import
drawerShow
from
'
./drawershow
'
;
import
table
from
'
@/assets/mixins/table
'
;
import
TabPane
from
'
@/components/tabPane.vue
'
;
import
{
timestampToTime
}
from
'
@/assets/utils/dateFormat
'
;
import
{
formatterDateOnly
}
from
'
@/assets/utils/table
'
;
export
default
{
name
:
"
AttendanceRecordList
"
,
name
:
'
AttendanceRecordList
'
,
components
:
{
drawerShow
,
TabPane
,
TabPane
},
mixins
:
[
table
],
computed
:
{
...
...
@@ -239,10 +198,230 @@ export default {
},
activeName
()
{
return
this
.
$store
.
state
.
ThirdPath
;
},
}
},
data
()
{
return
{
isExport
:
false
,
// 动态新增列表
addColumn
:
[],
progress
:
false
,
percent
:
0
,
upload
:
{
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
'
每日打卡记录
'
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
'
/attendance/record/importData
'
},
/** 子表列元素 */
columnSet
:
[
{
prop
:
'
shiftsName
'
,
label
:
'
班次名称
'
,
width
:
150
,
show
:
true
},
{
prop
:
'
goWorkDate
'
,
label
:
'
上班打卡时间
'
,
width
:
100
,
formatter
:
this
.
formatterDate
,
show
:
true
},
{
prop
:
'
goWorkResult
'
,
label
:
'
上班打卡结果
'
,
width
:
100
,
formatter
:
this
.
formatterString
,
show
:
true
},
{
prop
:
'
offWorkDate
'
,
label
:
'
下班打卡时间
'
,
width
:
100
,
formatter
:
this
.
formatterDate
,
show
:
true
},
{
prop
:
'
offWorkResult
'
,
label
:
'
下班打卡结果
'
,
width
:
100
,
formatter
:
this
.
formatterString
,
show
:
true
}
],
config
:
{
showType
:
'
tableSelect
'
,
search
:
[
{
name
:
'
staffName
'
,
type
:
'
text
'
,
label
:
'
员工姓名
'
,
fuzzy
:
true
},
// {
// name: "workNum",
// type: "text",
// label: "员工工号",
// fuzzy: true,
// },
// {
// name: "phone",
// type: "text",
// label: "手机号",
// fuzzy: true,
// },
{
name
:
'
salaId
'
,
type
:
'
selectSalaId
'
,
label
:
'
大厅
'
,
fuzzy
:
false
},
{
name
:
'
deptId
'
,
type
:
'
selectDeptId
'
,
label
:
'
部门
'
,
fuzzy
:
false
},
{
name
:
'
groupId
'
,
type
:
'
select
'
,
label
:
'
所属考勤组
'
,
fuzzy
:
false
},
{
name
:
'
classId
'
,
type
:
'
select
'
,
label
:
'
班次
'
,
fuzzy
:
false
},
// {
// name: "punchResult",
// type: "select",
// label: "打卡结果",
// fuzzy: false,
// },
{
name
:
'
attendanceDateStart
'
,
type
:
'
date
'
,
label
:
'
考勤开始时间
'
,
fuzzy
:
false
},
{
name
:
'
attendanceDateEnd
'
,
type
:
'
date
'
,
label
:
'
考勤结束时间
'
,
fuzzy
:
false
}
],
columns
:
[
{
type
:
'
selection
'
,
width
:
60
,
show
:
true
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
,
show
:
true
},
{
label
:
'
打卡日期
'
,
prop
:
'
attendanceDate
'
,
formatter
:
this
.
formatterDateOnly
,
show
:
true
},
{
label
:
'
员工姓名
'
,
prop
:
'
staffName
'
,
show
:
true
},
{
label
:
'
员工工号
'
,
prop
:
'
workNum
'
,
show
:
true
},
{
label
:
'
考勤组
'
,
prop
:
'
attendanceGroupName
'
,
show
:
true
},
{
label
:
'
大厅
'
,
prop
:
'
salaName
'
,
formatter
:
this
.
formatter
,
show
:
true
},
{
label
:
'
部门
'
,
prop
:
'
deptName
'
,
formatter
:
this
.
formatter
,
show
:
true
},
{
label
:
'
职位
'
,
prop
:
'
positionName
'
,
show
:
true
},
{
label
:
'
班次
'
,
prop
:
'
classId
'
,
formatter
:
this
.
formatter
,
show
:
true
}
// {
// label: "签到结果",
// prop: "signInResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "签退结果",
// prop: "signOutResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "打卡结果",
// prop: "punchResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤类型",
// prop: "attendType",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤打卡记录详细信息",
// width: 120,
// prop: "subColumns",
// show: true,
// formatter: (row) => {
// let widthsize = this.columnSet.reduce((pre, cur) => {
// return pre + Number(cur.width);
// }, 50);
// return (
//
<
el
-
popover
placement
=
"
right
"
width
=
{
widthsize
}
trigger
=
"
click
"
>
// {this.renderTable(row.attendanceRecordDetailList)}
//
<
el
-
button
type
=
"
text
"
slot
=
"
reference
"
>
// 详细
//
<
/el-button
>
//
<
/el-popover
>
// );
// },
// },
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
//
<
table
-
buttons
noAdd
noEdit
noView
noDel
// row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// );
// }
// }
]
},
drawerhistory
:
false
,
isdialog
:
false
,
setcolum
:
[],
checkList
:
[],
setDialog
:
false
,
checkTableList
:
[],
exportList
:
[],
//导出记录
baseUrl
:
process
.
env
.
VUE_APP_API_BASE_URL
+
'
/
'
,
initalArr
:
[],
attendStatInfo
:
{}
};
},
created
()
{
this
.
$post
(
"
/attendance/record/stat
"
,
{}).
then
((
res
)
=>
{
this
.
$post
(
'
/attendance/record/stat
'
,
{}).
then
((
res
)
=>
{
if
(
res
.
code
===
1
)
{
this
.
attendStatInfo
=
res
.
data
;
}
...
...
@@ -267,9 +446,7 @@ export default {
this
.
isdialog
=
false
;
}
else
{
this
.
config
.
columns
.
forEach
((
v
)
=>
{
v
.
prop
&&
v
.
prop
!=
"
attendanceStaffStatEntities
"
?
(
v
.
show
=
false
)
:
(
v
.
show
=
true
);
v
.
prop
&&
v
.
prop
!=
'
attendanceStaffStatEntities
'
?
(
v
.
show
=
false
)
:
(
v
.
show
=
true
);
this
.
checkTableList
.
forEach
((
val
)
=>
{
if
(
v
.
prop
==
val
)
{
v
.
show
=
true
;
...
...
@@ -288,23 +465,19 @@ export default {
let
obj
=
{
show
:
true
,
label
:
item
.
name
,
prop
:
""
,
prop
:
''
,
formatter
:
(
row
)
=>
{
if
(
row
.
attendanceRecordDetailList
.
length
<
1
)
{
return
"
-
"
;
return
'
-
'
;
}
else
{
return
this
.
handleArr
(
row
.
attendanceRecordDetailList
,
item
.
orderNum
,
item
.
property
);
return
this
.
handleArr
(
row
.
attendanceRecordDetailList
,
item
.
orderNum
,
item
.
property
);
}
}
,
}
};
addobjArr
.
push
(
obj
);
});
this
.
config
.
columns
=
[...
this
.
initalArr
,
...
addobjArr
];
this
.
$refs
.
layoutTable
.
showType
=
"
tableSelect
"
;
this
.
$refs
.
layoutTable
.
showType
=
'
tableSelect
'
;
this
.
$forceUpdate
();
},
// 表格接收数据前
...
...
@@ -316,41 +489,34 @@ export default {
let
index
=
arr
.
findIndex
((
item
)
=>
item
.
orderNum
===
currentorderNum
);
if
(
index
>
-
1
)
{
if
(
!
arr
[
index
][
property
])
{
return
"
-
"
;
}
else
if
(
property
===
"
goWorkDate
"
||
property
===
"
offWorkDate
"
)
{
return
'
-
'
;
}
else
if
(
property
===
'
goWorkDate
'
||
property
===
'
offWorkDate
'
)
{
// 打卡时间
return
timestampToTime
(
arr
[
index
][
property
],
6
);
}
else
if
(
property
===
"
goWorkResult
"
||
property
===
"
offWorkResult
"
)
{
}
else
if
(
property
===
'
goWorkResult
'
||
property
===
'
offWorkResult
'
)
{
let
val
=
arr
[
index
][
property
];
return
this
.
tableData
.
dict
.
goWorkResult
[
val
]
==
"
正常
"
?
(
return
this
.
tableData
.
dict
.
goWorkResult
[
val
]
==
'
正常
'
?
(
<
span
>
{
this
.
tableData
.
dict
.
goWorkResult
[
val
]}
<
/span
>
)
:
this
.
tableData
.
dict
.
goWorkResult
[
val
]
==
"
请假
"
?
(
<
span
style
=
"
color:#1a7af8
"
>
{
this
.
tableData
.
dict
.
goWorkResult
[
val
]}
<
/span
>
)
:
this
.
tableData
.
dict
.
goWorkResult
[
val
]
==
'
请假
'
?
(
<
span
style
=
"
color:#1a7af8
"
>
{
this
.
tableData
.
dict
.
goWorkResult
[
val
]}
<
/span
>
)
:
(
<
span
style
=
"
color:red
"
>
{
this
.
tableData
.
dict
.
goWorkResult
[
val
]}
<
/span
>
<
span
style
=
"
color:red
"
>
{
this
.
tableData
.
dict
.
goWorkResult
[
val
]}
<
/span
>
);
}
}
else
{
return
"
-
"
;
return
'
-
'
;
}
},
//改变状态
changeStatus
(
item
)
{
this
.
$set
(
item
,
"
islook
"
,
!
item
.
islook
);
this
.
$set
(
item
,
'
islook
'
,
!
item
.
islook
);
},
// 导出记录
lookexportHis
()
{
this
.
$post
(
"
/attendance/export/record/list
"
,
{
this
.
$post
(
'
/attendance/export/record/list
'
,
{
type
:
2
,
page
:
1
,
size
:
-
1
,
size
:
-
1
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
let
arr
=
res
.
data
.
data
;
...
...
@@ -366,16 +532,16 @@ export default {
},
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
打卡记录导入
"
;
this
.
upload
.
title
=
'
打卡记录导入
'
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/attendance/record/downloadTemplate
"
,
'
/attendance/record/downloadTemplate
'
,
{},
{
type
:
"
excel
"
,
name
:
"
每日打卡记录
"
}
{
type
:
'
excel
'
,
name
:
'
每日打卡记录
'
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
...
...
@@ -392,13 +558,14 @@ export default {
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
$alert
(
response
.
msg
,
'
导入结果
'
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
// 倒计时操作
countDown
()
{
if
(
this
.
percent
==
95
)
{
let
params
=
{};
...
...
@@ -408,17 +575,17 @@ export default {
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
if
(
this
.
checkList
.
length
>
0
)
{
params
[
"
properties
"
]
=
this
.
checkList
;
params
[
'
properties
'
]
=
this
.
checkList
;
}
this
.
$download
(
"
/attendance/record/exportExcel
"
,
'
/attendance/record/exportExcel
'
,
{
...
params
,
...
params
},
{
type
:
"
excel
"
,
name
:
"
每日打卡记录
"
}
{
type
:
'
excel
'
,
name
:
'
每日打卡记录
'
}
)
.
then
((
res
)
=>
{
this
.
percent
=
100
;
...
...
@@ -437,7 +604,7 @@ export default {
}
else
{
this
.
percent
=
this
.
percent
+
1
;
let
that
=
this
;
setTimeout
(
function
()
{
setTimeout
(
function
()
{
that
.
countDown
();
},
100
);
}
...
...
@@ -451,16 +618,12 @@ export default {
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
if
(
this
.
checkList
.
length
>
0
)
{
params
[
"
properties
"
]
=
this
.
checkList
;
params
[
'
properties
'
]
=
this
.
checkList
;
}
let
flag
=
this
.
checkDate
(
params
.
attendanceDateStart
,
params
.
attendanceDateEnd
,
1
);
let
flag
=
this
.
checkDate
(
params
.
attendanceDateStart
,
params
.
attendanceDateEnd
,
1
);
if
(
!
flag
)
{
this
.
isExport
=
true
;
...
...
@@ -469,21 +632,22 @@ export default {
this
.
countDown
();
}
},
// 设置时间并检查
checkDate
(
startTime
,
endTime
,
compDay
)
{
if
(
startTime
==
""
||
startTime
==
null
||
startTime
==
undefined
)
{
this
.
$message
.
error
(
"
开始时间为空,请检查!
"
);
if
(
startTime
==
''
||
startTime
==
null
||
startTime
==
undefined
)
{
this
.
$message
.
error
(
'
开始时间为空,请检查!
'
);
return
true
;
}
if
(
endTime
==
""
||
endTime
==
null
||
endTime
==
undefined
)
{
this
.
$message
.
error
(
"
结束时间为空,请检查!
"
);
if
(
endTime
==
''
||
endTime
==
null
||
endTime
==
undefined
)
{
this
.
$message
.
error
(
'
结束时间为空,请检查!
'
);
return
true
;
}
var
data1
=
Date
.
parse
(
startTime
.
replace
(
/-/g
,
"
/
"
));
var
data2
=
Date
.
parse
(
endTime
.
replace
(
/-/g
,
"
/
"
));
var
data1
=
Date
.
parse
(
startTime
.
replace
(
/-/g
,
'
/
'
));
var
data2
=
Date
.
parse
(
endTime
.
replace
(
/-/g
,
'
/
'
));
var
datadiff
=
data2
-
data1
;
var
time
=
parseInt
(
compDay
)
*
(
60
*
60
*
24
*
1000
);
if
(
datadiff
<
0
)
{
this
.
$message
.
error
(
"
开始时间应小于结束时间
"
);
this
.
$message
.
error
(
'
开始时间应小于结束时间
'
);
return
true
;
}
// if (datadiff > time) {
...
...
@@ -492,17 +656,14 @@ export default {
// }
return
false
;
},
// 设置弹窗内的展示内容
setdialog
(
i
)
{
if
(
i
==
1
)
{
this
.
isdialog
=
true
;
this
.
setcolum
=
this
.
config
.
columns
.
filter
(
(
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
config
.
columns
.
filter
((
item
)
=>
item
.
label
&&
item
.
prop
);
}
else
{
this
.
setDialog
=
true
;
this
.
setcolum
=
this
.
config
.
columns
.
filter
(
(
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
config
.
columns
.
filter
((
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
checkTableList
=
this
.
config
.
columns
.
map
((
item
)
=>
{
if
(
item
.
show
)
{
...
...
@@ -511,6 +672,7 @@ export default {
});
}
},
// 表格数据渲染处理
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
...
...
@@ -518,6 +680,7 @@ export default {
<
/el-table
>
);
},
// 表格表头渲染处理
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
...
...
@@ -540,233 +703,15 @@ export default {
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
// 点击操作
handleClick
(
key
)
{
console
.
log
(
key
);
this
.
$store
.
commit
(
"
setThirdPath
"
,
key
);
this
.
$store
.
commit
(
'
setThirdPath
'
,
key
);
this
.
$router
.
push
({
path
:
key
,
path
:
key
});
},
},
data
()
{
return
{
isExport
:
false
,
// 动态新增列表
addColumn
:
[],
progress
:
false
,
percent
:
0
,
upload
:
{
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
"
每日打卡记录
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/attendance/record/importData
"
,
},
/** 子表列元素 */
columnSet
:
[
{
prop
:
"
shiftsName
"
,
label
:
"
班次名称
"
,
width
:
150
,
show
:
true
},
{
prop
:
"
goWorkDate
"
,
label
:
"
上班打卡时间
"
,
width
:
100
,
formatter
:
this
.
formatterDate
,
show
:
true
,
},
{
prop
:
"
goWorkResult
"
,
label
:
"
上班打卡结果
"
,
width
:
100
,
formatter
:
this
.
formatterString
,
show
:
true
,
},
{
prop
:
"
offWorkDate
"
,
label
:
"
下班打卡时间
"
,
width
:
100
,
formatter
:
this
.
formatterDate
,
show
:
true
,
},
{
prop
:
"
offWorkResult
"
,
label
:
"
下班打卡结果
"
,
width
:
100
,
formatter
:
this
.
formatterString
,
show
:
true
,
},
],
config
:
{
showType
:
"
tableSelect
"
,
search
:
[
{
name
:
"
staffName
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
,
},
// {
// name: "workNum",
// type: "text",
// label: "员工工号",
// fuzzy: true,
// },
// {
// name: "phone",
// type: "text",
// label: "手机号",
// fuzzy: true,
// },
{
name
:
"
salaId
"
,
type
:
"
selectSalaId
"
,
label
:
"
大厅
"
,
fuzzy
:
false
,
},
{
name
:
"
deptId
"
,
type
:
"
selectDeptId
"
,
label
:
"
部门
"
,
fuzzy
:
false
,
},
{
name
:
"
groupId
"
,
type
:
"
select
"
,
label
:
"
所属考勤组
"
,
fuzzy
:
false
,
},
{
name
:
"
classId
"
,
type
:
"
select
"
,
label
:
"
班次
"
,
fuzzy
:
false
,
},
// {
// name: "punchResult",
// type: "select",
// label: "打卡结果",
// fuzzy: false,
// },
{
name
:
"
attendanceDateStart
"
,
type
:
"
date
"
,
label
:
"
考勤开始时间
"
,
fuzzy
:
false
,
},
{
name
:
"
attendanceDateEnd
"
,
type
:
"
date
"
,
label
:
"
考勤结束时间
"
,
fuzzy
:
false
,
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
,
show
:
true
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
,
show
:
true
},
{
label
:
"
打卡日期
"
,
prop
:
"
attendanceDate
"
,
formatter
:
this
.
formatterDateOnly
,
show
:
true
,
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
,
show
:
true
},
{
label
:
"
员工工号
"
,
prop
:
"
workNum
"
,
show
:
true
},
{
label
:
"
考勤组
"
,
prop
:
"
attendanceGroupName
"
,
show
:
true
,
},
{
label
:
"
大厅
"
,
prop
:
"
salaName
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
{
label
:
"
职位
"
,
prop
:
"
positionName
"
,
show
:
true
},
{
label
:
"
班次
"
,
prop
:
"
classId
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
// {
// label: "签到结果",
// prop: "signInResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "签退结果",
// prop: "signOutResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "打卡结果",
// prop: "punchResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤类型",
// prop: "attendType",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤打卡记录详细信息",
// width: 120,
// prop: "subColumns",
// show: true,
// formatter: (row) => {
// let widthsize = this.columnSet.reduce((pre, cur) => {
// return pre + Number(cur.width);
// }, 50);
// return (
//
<
el
-
popover
placement
=
"
right
"
width
=
{
widthsize
}
trigger
=
"
click
"
>
// {this.renderTable(row.attendanceRecordDetailList)}
//
<
el
-
button
type
=
"
text
"
slot
=
"
reference
"
>
// 详细
//
<
/el-button
>
//
<
/el-popover
>
// );
// },
// },
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
//
<
table
-
buttons
noAdd
noEdit
noView
noDel
// row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// );
// }
// }
],
},
drawerhistory
:
false
,
isdialog
:
false
,
setcolum
:
[],
checkList
:
[],
setDialog
:
false
,
checkTableList
:
[],
exportList
:
[],
//导出记录
baseUrl
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/
"
,
initalArr
:
[],
attendStatInfo
:
{},
};
},
}
}
};
</
script
>
<
style
scoped
lang=
"less"
>
...
...
src/views/attendance/stat/list.vue
View file @
8cd12952
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notAdd
notDel
ref=
"layoutTable"
>
<!-- S 表格主体部分 -->
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notAdd
notDel
ref=
"layoutTable"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
...
...
@@ -64,23 +59,22 @@
<i
class=
"el-icon-refresh"
></i>
<span
>
上次考勤汇总时间:
{{
tableData
.
dict
.
summaryTime
?
tableData
.
dict
.
summaryTime
:
"
--
"
tableData
.
dict
.
summaryTime
?
tableData
.
dict
.
summaryTime
:
'
--
'
}}
</span
>
</span>
</LayoutTable>
<!-- E 表格主体部分 -->
<!-- S 弹窗部分 -->
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<!-- E 弹窗部分 -->
<!-- 导出表格设置 -->
<el-dialog
:visible.sync=
"isdialog"
title=
"导出表格设置"
>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group
v-model=
"checkList"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
...
...
@@ -91,15 +85,9 @@
</el-dialog>
<!-- 显示表格设置 -->
<el-dialog
:visible.sync=
"setDialog"
title=
"表格显示设置"
>
<div
class=
"tipsword"
>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<div
class=
"tipsword"
>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<el-checkbox-group
v-model=
"checkTableList"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
...
...
@@ -109,11 +97,7 @@
</div>
</el-dialog>
<!-- 导出记录查看 -->
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<el-drawer
title=
"导出记录"
:visible.sync=
"drawerhistory"
:direction=
"direction"
>
<div
class=
"hisList"
>
<div
class=
"list mt10"
v-for=
"item in 10"
:key=
"item"
>
<div
class=
"flex flex-align-center flex-pack-justify"
>
...
...
@@ -157,38 +141,21 @@
</el-date-picker>
-->
</div>
<div
class=
"fresh_box"
v-else
>
<div
class=
"title_box"
style=
"margin-bottom: 20px; line-height: 30px"
v-if=
"showTip"
>
请确认是否开始进行
{{
freshDate
+
"
月
"
}}
的考勤数据重新汇总;此过程预计需要
<div
class=
"title_box"
style=
"margin-bottom: 20px; line-height: 30px"
v-if=
"showTip"
>
请确认是否开始进行
{{
freshDate
+
'
月
'
}}
的考勤数据重新汇总;此过程预计需要
<span
style=
"color: #ff0000"
>
10
</span>
分钟左右,请勿关闭或刷新页面
</div>
<div
class=
"title_box"
style=
"margin-bottom: 20px; line-height: 30px"
v-else
>
正在进行
{{
freshDate
+
"
月
"
}}
的考勤数据重新汇总;此过程预计还需要
<div
class=
"title_box"
style=
"margin-bottom: 20px; line-height: 30px"
v-else
>
正在进行
{{
freshDate
+
'
月
'
}}
的考勤数据重新汇总;此过程预计还需要
<span
style=
"color: #ff0000"
>
{{
restTime
}}
</span>
分钟左右,请勿关闭或刷新页面
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
v-if=
"showTip"
>
<el-button
type=
"primary"
@
click=
"() => (showContent = false)"
v-if=
"showContent"
<el-button
type=
"primary"
@
click=
"() => (showContent = false)"
v-if=
"showContent"
>
确 定
</el-button
>
<el-button
type=
"primary"
@
click=
"submitFresh"
v-else
:loading=
"submitLoad"
<el-button
type=
"primary"
@
click=
"submitFresh"
v-else
:loading=
"submitLoad"
>
确 定
</el-button
>
<el-button
@
click=
"cancleFresh"
>
取 消
</el-button>
...
...
@@ -199,19 +166,19 @@
<
script
>
/** 表单弹出框模式需引入 */
import
DialogShow
from
"
./dialogshow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
DialogShow
from
'
./dialogshow
'
;
import
table
from
'
@/assets/mixins/table
'
;
import
{
getFirstDay
,
getLastDay
,
getdiffdate
,
timestampToTime
,
getMyDay
,
}
from
"
@/assets/utils/dateFormat.js
"
;
getMyDay
}
from
'
@/assets/utils/dateFormat.js
'
;
export
default
{
name
:
"
AttendanceStatList
"
,
name
:
'
AttendanceStatList
'
,
components
:
{
DialogShow
,
DialogShow
},
mixins
:
[
table
],
data
()
{
...
...
@@ -223,16 +190,15 @@ export default {
// 倒计时结束时间
endTime
:
null
,
// 倒计时结束限时
restTime
:
"
10
"
,
restTime
:
'
10
'
,
// 规定日期组件的选取范围
pickerOptions0
:
{
disabledDate
(
v
)
{
let
limitDate
=
v
.
getTime
()
<
new
Date
().
getTime
()
-
31
*
86400000
||
v
.
getTime
()
>
Date
.
now
();
v
.
getTime
()
<
new
Date
().
getTime
()
-
31
*
86400000
||
v
.
getTime
()
>
Date
.
now
();
return
limitDate
;
7
;
}
,
}
},
// 更新日期
freshDate
:
null
,
...
...
@@ -247,21 +213,21 @@ export default {
isExport
:
false
,
// 表格配置项
config
:
{
showType
:
"
tableSelect
"
,
showType
:
'
tableSelect
'
,
isshowTabPane
:
true
,
height
:
"
680px
"
,
height
:
'
680px
'
,
search
:
[
{
name
:
"
salaId
"
,
type
:
"
selectSalaId
"
,
label
:
"
大厅
"
,
fuzzy
:
false
,
name
:
'
salaId
'
,
type
:
'
selectSalaId
'
,
label
:
'
大厅
'
,
fuzzy
:
false
},
{
name
:
"
deptId
"
,
type
:
"
selectDeptId
"
,
label
:
"
部门
"
,
fuzzy
:
false
,
name
:
'
deptId
'
,
type
:
'
selectDeptId
'
,
label
:
'
部门
'
,
fuzzy
:
false
},
// {
// name: "groupId",
...
...
@@ -276,91 +242,91 @@ export default {
// fuzzy: false,
// },
{
name
:
"
summaryTimeStart
"
,
type
:
"
date
"
,
label
:
"
考勤开始时间
"
,
fuzzy
:
false
,
name
:
'
summaryTimeStart
'
,
type
:
'
date
'
,
label
:
'
考勤开始时间
'
,
fuzzy
:
false
},
{
name
:
"
summaryTimeEnd
"
,
type
:
"
date
"
,
label
:
"
考勤结束时间
"
,
fuzzy
:
false
,
name
:
'
summaryTimeEnd
'
,
type
:
'
date
'
,
label
:
'
考勤结束时间
'
,
fuzzy
:
false
},
{
name
:
"
staffName
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
,
}
,
name
:
'
staffName
'
,
type
:
'
text
'
,
label
:
'
员工姓名
'
,
fuzzy
:
true
}
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
,
fixed
:
"
left
"
,
show
:
true
},
{
type
:
'
selection
'
,
width
:
60
,
fixed
:
'
left
'
,
show
:
true
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
,
fixed
:
"
left
"
,
show
:
true
,
fixed
:
'
left
'
,
show
:
true
},
{
label
:
"
窗口类别
"
,
prop
:
"
windowCategory
"
,
fixed
:
"
left
"
,
label
:
'
窗口类别
'
,
prop
:
'
windowCategory
'
,
fixed
:
'
left
'
,
width
:
100
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
员工姓名
"
,
prop
:
"
staffName
"
,
fixed
:
"
left
"
,
label
:
'
员工姓名
'
,
prop
:
'
staffName
'
,
fixed
:
'
left
'
,
width
:
100
,
show
:
true
,
show
:
true
},
{
label
:
"
大厅
"
,
prop
:
"
salaName
"
,
label
:
'
大厅
'
,
prop
:
'
salaName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
label
:
'
部门
'
,
prop
:
'
deptName
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
应到
"
,
prop
:
"
workDays
"
,
label
:
'
应到
'
,
prop
:
'
workDays
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
{
label
:
"
实到
"
,
prop
:
"
goWorks
"
,
label
:
'
实到
'
,
prop
:
'
goWorks
'
,
formatter
:
(
row
)
=>
{
return
row
.
goWorks
==
0
?
0
:
row
.
goWorks
?
row
.
goWorks
:
"
--
"
;
return
row
.
goWorks
==
0
?
0
:
row
.
goWorks
?
row
.
goWorks
:
'
--
'
;
},
show
:
true
,
show
:
true
},
{
label
:
"
出勤率%
"
,
prop
:
"
attendanceRate
"
,
label
:
'
出勤率%
'
,
prop
:
'
attendanceRate
'
,
formatter
:
(
row
)
=>
{
return
row
.
attendanceRate
?
(
Number
(
row
.
attendanceRate
)
*
100
).
toFixed
(
2
)
+
"
%
"
:
"
--
"
;
?
(
Number
(
row
.
attendanceRate
)
*
100
).
toFixed
(
2
)
+
'
%
'
:
'
--
'
;
},
show
:
true
,
show
:
true
},
{
label
:
"
缺卡次数
"
,
prop
:
"
morningTimes
"
,
label
:
'
缺卡次数
'
,
prop
:
'
morningTimes
'
,
formatter
:
this
.
formatter
,
show
:
true
,
show
:
true
},
// {
// label: "上午缺卡次数",
...
...
@@ -373,65 +339,65 @@ export default {
// prop: "afternoonTimes",
// formatter: this.formatter,
// },
{
label
:
"
回单位(天)
"
,
prop
:
"
backToUnit
"
,
show
:
true
},
{
label
:
'
回单位(天)
'
,
prop
:
'
backToUnit
'
,
show
:
true
},
{
label
:
"
因公请假(天)
"
,
prop
:
"
onDutyLeave
"
,
show
:
true
},
{
label
:
'
因公请假(天)
'
,
prop
:
'
onDutyLeave
'
,
show
:
true
},
{
label
:
"
外出勘验(天)
"
,
prop
:
"
outOfOffice
"
,
show
:
true
},
{
label
:
'
外出勘验(天)
'
,
prop
:
'
outOfOffice
'
,
show
:
true
},
{
label
:
"
值班补班(天)
"
,
prop
:
"
shiftCompensation
"
,
show
:
true
},
{
label
:
'
值班补班(天)
'
,
prop
:
'
shiftCompensation
'
,
show
:
true
},
{
label
:
"
体检(天)
"
,
prop
:
"
physicalExamination
"
,
show
:
true
},
{
label
:
'
体检(天)
'
,
prop
:
'
physicalExamination
'
,
show
:
true
},
{
label
:
"
隔离(天)
"
,
prop
:
"
quarantine
"
,
show
:
true
},
{
label
:
'
隔离(天)
'
,
prop
:
'
quarantine
'
,
show
:
true
},
{
label
:
"
因公外出(与窗口工作无关/天)
"
,
prop
:
"
businessTrip
"
,
label
:
'
因公外出(与窗口工作无关/天)
'
,
prop
:
'
businessTrip
'
,
show
:
true
,
width
:
140
,
width
:
140
},
{
label
:
"
公休(天)
"
,
prop
:
"
publicHoliday
"
,
show
:
true
},
{
label
:
'
公休(天)
'
,
prop
:
'
publicHoliday
'
,
show
:
true
},
{
label
:
"
病假(天)
"
,
prop
:
"
sickLeave
"
,
show
:
true
},
{
label
:
'
病假(天)
'
,
prop
:
'
sickLeave
'
,
show
:
true
},
{
label
:
"
丧假(天)
"
,
prop
:
"
funeralLeave
"
,
show
:
true
},
{
label
:
'
丧假(天)
'
,
prop
:
'
funeralLeave
'
,
show
:
true
},
{
label
:
"
婚假(天)
"
,
prop
:
"
marriageLeave
"
,
show
:
true
},
{
label
:
'
婚假(天)
'
,
prop
:
'
marriageLeave
'
,
show
:
true
},
{
label
:
"
育儿假(天)
"
,
prop
:
"
childRearingLeave
"
,
show
:
true
},
{
label
:
'
育儿假(天)
'
,
prop
:
'
childRearingLeave
'
,
show
:
true
},
{
label
:
"
产假(陪护假/天)
"
,
prop
:
"
maternityLeave
"
,
label
:
'
产假(陪护假/天)
'
,
prop
:
'
maternityLeave
'
,
show
:
true
,
width
:
140
,
width
:
140
},
{
label
:
"
调回单位(或离职/天)
"
,
prop
:
"
transferBack
"
,
label
:
'
调回单位(或离职/天)
'
,
prop
:
'
transferBack
'
,
show
:
true
,
width
:
140
,
width
:
140
},
{
label
:
"
探亲假(天)
"
,
prop
:
"
homeLeave
"
,
show
:
true
},
{
label
:
'
探亲假(天)
'
,
prop
:
'
homeLeave
'
,
show
:
true
},
{
label
:
"
事假(天)
"
,
prop
:
"
personalLeave
"
,
show
:
true
},
{
label
:
'
事假(天)
'
,
prop
:
'
personalLeave
'
,
show
:
true
},
{
label
:
"
旷工(天)
"
,
prop
:
"
absenteeismDays
"
,
show
:
true
},
{
label
:
'
旷工(天)
'
,
prop
:
'
absenteeismDays
'
,
show
:
true
},
{
label
:
"
其他(天)
"
,
prop
:
"
otherDays
"
,
show
:
true
},
{
label
:
'
其他(天)
'
,
prop
:
'
otherDays
'
,
show
:
true
},
{
label
:
"
未按规定打卡(含忘记打卡)
"
,
prop
:
"
nonCompliancePunch
"
,
label
:
'
未按规定打卡(含忘记打卡)
'
,
prop
:
'
nonCompliancePunch
'
,
show
:
true
,
width
:
140
,
width
:
140
},
{
label
:
"
迟到(次)
"
,
prop
:
"
lateTimes
"
,
show
:
true
},
{
label
:
'
迟到(次)
'
,
prop
:
'
lateTimes
'
,
show
:
true
}
// { label: "上网耍手机(次)", prop: "surfingMobileTimes", show: true },
...
...
@@ -453,7 +419,7 @@ export default {
//},
//{ label: "会议早退", prop: "earlyLeaveMeeting", show: true },
]
,
]
},
// 设置表格展示项
setcolum
:
[],
...
...
@@ -469,7 +435,7 @@ export default {
// 动态新增列表
addColumn
:
[],
// 获取表格表头列表
initalArr
:
[]
,
initalArr
:
[]
};
},
created
()
{
...
...
@@ -489,9 +455,9 @@ export default {
let
hr
=
parseInt
((
msec
/
1000
/
60
/
60
)
%
24
);
let
min
=
parseInt
((
msec
/
1000
/
60
)
%
60
);
let
sec
=
parseInt
((
msec
/
1000
)
%
60
);
min
=
min
>
9
?
min
:
"
0
"
+
min
;
sec
=
sec
>
9
?
sec
:
"
0
"
+
sec
;
this
.
restTime
=
min
+
"
分
"
+
sec
+
"
秒
"
;
min
=
min
>
9
?
min
:
'
0
'
+
min
;
sec
=
sec
>
9
?
sec
:
'
0
'
+
sec
;
this
.
restTime
=
min
+
'
分
'
+
sec
+
'
秒
'
;
const
that
=
this
;
if
(
min
>=
0
&&
sec
>=
0
)
{
if
(
min
==
0
&&
sec
==
0
)
{
...
...
@@ -500,7 +466,7 @@ export default {
this
.
btnFreshLoading
=
false
;
this
.
showContent
=
true
;
this
.
showTip
=
true
;
this
.
freshDate
=
""
;
this
.
freshDate
=
''
;
this
.
getData
();
return
;
}
...
...
@@ -513,9 +479,9 @@ export default {
submitFresh
()
{
if
(
this
.
freshDate
)
{
this
.
submitLoad
=
true
;
this
.
$post
(
"
/attendance/stat/summary
"
,
{
attendanceDateStart
:
this
.
freshDate
+
"
-01
"
,
attendanceDateEnd
:
this
.
freshDate
+
"
-31
"
,
this
.
$post
(
'
/attendance/stat/summary
'
,
{
attendanceDateStart
:
this
.
freshDate
+
'
-01
'
,
attendanceDateEnd
:
this
.
freshDate
+
'
-31
'
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
...
...
@@ -533,10 +499,10 @@ export default {
this
.
btnFreshLoading
=
false
;
this
.
showContent
=
true
;
this
.
showTip
=
true
;
this
.
freshDate
=
""
;
this
.
freshDate
=
''
;
});
}
else
{
this
.
$message
.
error
(
"
请选择时间!
"
);
this
.
$message
.
error
(
'
请选择时间!
'
);
}
},
// 取消操作
...
...
@@ -544,7 +510,7 @@ export default {
this
.
dialogOpen
=
false
;
this
.
btnFreshLoading
=
false
;
this
.
showContent
=
true
;
this
.
freshDate
=
""
;
this
.
freshDate
=
''
;
},
// 手动更新
handleRefresh
()
{
...
...
@@ -567,9 +533,7 @@ export default {
this
.
isdialog
=
false
;
}
else
{
this
.
config
.
columns
.
forEach
((
v
)
=>
{
v
.
prop
&&
v
.
prop
!=
"
attendanceStaffStatEntities
"
?
(
v
.
show
=
false
)
:
(
v
.
show
=
true
);
v
.
prop
&&
v
.
prop
!=
'
attendanceStaffStatEntities
'
?
(
v
.
show
=
false
)
:
(
v
.
show
=
true
);
this
.
checkTableList
.
forEach
((
val
)
=>
{
if
(
v
.
prop
==
val
)
{
v
.
show
=
true
;
...
...
@@ -585,10 +549,10 @@ export default {
// 处理createTime相同的数据
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
j
=
i
+
1
;
j
<
arr
.
length
;
j
++
)
{
if
(
arr
[
i
][
"
createTime
"
]
==
arr
[
j
][
"
createTime
"
])
{
if
(
arr
[
i
][
"
attendanceSummary
"
].
indexOf
(
"
;
"
)
==
-
1
)
{
arr
[
i
][
"
attendanceSummary
"
]
=
arr
[
i
][
"
attendanceSummary
"
]
+
"
;
"
+
arr
[
j
].
attendanceSummary
;
if
(
arr
[
i
][
'
createTime
'
]
==
arr
[
j
][
'
createTime
'
])
{
if
(
arr
[
i
][
'
attendanceSummary
'
].
indexOf
(
'
;
'
)
==
-
1
)
{
arr
[
i
][
'
attendanceSummary
'
]
=
arr
[
i
][
'
attendanceSummary
'
]
+
'
;
'
+
arr
[
j
].
attendanceSummary
;
}
}
}
...
...
@@ -597,7 +561,7 @@ export default {
let
index
=
arr
.
findIndex
((
item
)
=>
item
.
createTime
==
currentTime
);
if
(
index
>
-
1
)
{
return
arr
[
index
].
attendanceSummary
?
(
arr
[
index
].
remark
&&
arr
[
index
].
remark
!=
""
?
(
arr
[
index
].
remark
&&
arr
[
index
].
remark
!=
''
?
(
<
el
-
tooltip
class
=
"
item
"
effect
=
"
light
"
...
...
@@ -606,30 +570,30 @@ export default {
>
<
el
-
tag
type
=
{
arr
[
index
].
attendanceSummary
.
includes
(
"
缺卡
"
)
||
arr
[
index
].
attendanceSummary
.
includes
(
"
迟到
"
)
||
arr
[
index
].
attendanceSummary
.
includes
(
"
早退
"
)
?
"
danger
"
:
"
success
"
arr
[
index
].
attendanceSummary
.
includes
(
'
缺卡
'
)
||
arr
[
index
].
attendanceSummary
.
includes
(
'
迟到
'
)
||
arr
[
index
].
attendanceSummary
.
includes
(
'
早退
'
)
?
'
danger
'
:
'
success
'
}
size
=
"
mini
"
>
{
arr
[
index
].
attendanceSummary
}
<
/el-tag
>
<
/el-tooltip
>
)
:
arr
[
index
].
attendanceSummary
.
includes
(
"
缺卡
"
)
||
arr
[
index
].
attendanceSummary
.
includes
(
"
迟到
"
)
||
arr
[
index
].
attendanceSummary
.
includes
(
"
早退
"
)
?
(
<
el
-
tag
type
=
{
"
danger
"
}
size
=
"
mini
"
>
)
:
arr
[
index
].
attendanceSummary
.
includes
(
'
缺卡
'
)
||
arr
[
index
].
attendanceSummary
.
includes
(
'
迟到
'
)
||
arr
[
index
].
attendanceSummary
.
includes
(
'
早退
'
)
?
(
<
el
-
tag
type
=
{
'
danger
'
}
size
=
"
mini
"
>
{
arr
[
index
].
attendanceSummary
}
<
/el-tag
>
)
:
(
<
el
-
tag
type
=
{
"
success
"
}
size
=
"
mini
"
>
<
el
-
tag
type
=
{
'
success
'
}
size
=
"
mini
"
>
{
arr
[
index
].
attendanceSummary
}
<
/el-tag
>
)
)
:
(
"
--
"
'
--
'
);
}
else
{
// if (currentTime
<
timestampToTime
(
new
Date
(),
3
))
{
...
...
@@ -637,7 +601,7 @@ export default {
// } else {
// return "--";
// }
return
"
--
"
;
return
'
--
'
;
}
},
// 重置表格
...
...
@@ -646,55 +610,44 @@ export default {
},
// 重写获取数据后渲染
afterRender
(
data
)
{
this
.
addColumn
=
getdiffdate
(
this
.
query
.
summaryTimeStart
,
this
.
query
.
summaryTimeEnd
);
this
.
addColumn
=
getdiffdate
(
this
.
query
.
summaryTimeStart
,
this
.
query
.
summaryTimeEnd
);
// 动态处理
let
addobjArr
=
[];
this
.
addColumn
.
map
((
item
,
index
)
=>
{
let
obj
=
{
show
:
true
,
label
:
item
+
"
(
"
+
getMyDay
(
new
Date
(
item
))
+
"
)
"
,
label
:
item
+
'
(
'
+
getMyDay
(
new
Date
(
item
))
+
'
)
'
,
width
:
100
,
formatter
:
(
row
)
=>
{
if
(
row
.
attendanceStaffStatEntities
&&
row
.
attendanceStaffStatEntities
.
length
>
0
)
{
if
(
row
.
attendanceStaffStatEntities
&&
row
.
attendanceStaffStatEntities
.
length
>
0
)
{
return
this
.
handleArr
(
row
.
attendanceStaffStatEntities
,
item
);
}
else
{
return
"
--
"
;
return
'
--
'
;
if
(
item
<
timestampToTime
(
new
Date
(),
3
))
{
return
"
正常
"
;
return
'
正常
'
;
}
else
{
return
"
--
"
;
return
'
--
'
;
}
}
}
,
}
};
addobjArr
.
push
(
obj
);
});
let
arr1
=
this
.
initalArr
.
slice
(
0
,
8
);
let
arr2
=
this
.
initalArr
.
slice
(
8
);
this
.
config
.
columns
=
[...
arr1
,
...
addobjArr
,
...
arr2
];
this
.
$refs
.
layoutTable
.
showType
=
"
tableSelect
"
;
this
.
$refs
.
layoutTable
.
showType
=
'
tableSelect
'
;
this
.
$forceUpdate
();
},
// 重写获取数据前渲染
beforeRender
(
row
)
{
this
.
tableData
.
dict
=
row
.
dict
;
row
.
data
.
forEach
((
element
)
=>
{
if
(
element
.
attendanceStaffStatEntities
&&
element
.
attendanceStaffStatEntities
.
length
>
0
)
{
if
(
element
.
attendanceStaffStatEntities
&&
element
.
attendanceStaffStatEntities
.
length
>
0
)
{
element
.
attendanceStaffStatEntities
.
forEach
((
item1
)
=>
{
item1
.
createTime
=
timestampToTime
(
item1
.
createTime
,
3
);
let
Arr
=
[];
item1
.
remark
&&
item1
.
remark
.
length
>
0
?
(
Arr
=
JSON
.
parse
(
item1
.
remark
))
:
""
;
item1
.
remark
&&
item1
.
remark
.
length
>
0
?
(
Arr
=
JSON
.
parse
(
item1
.
remark
))
:
''
;
Arr
&&
Arr
.
length
>
0
?
(
item1
.
content
=
Arr
.
map
((
v
)
=>
{
return
(
...
...
@@ -704,8 +657,8 @@ export default {
打卡时间:
{
v
.
goWorkDate
?
(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))
:
(
v
.
goWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
:
(
v
.
goWorkDate
=
'
--
'
)}
{
'
'
}
打卡结果:
{
this
.
tableData
.
dict
.
goWorkResult
[
v
.
goWorkResult
]}
<
/span
>
)
:
(
...
...
@@ -713,8 +666,8 @@ export default {
打卡时间:
{
v
.
goWorkDate
?
(
v
.
goWorkDate
=
timestampToTime
(
v
.
goWorkDate
,
6
))
:
(
v
.
goWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
:
(
v
.
goWorkDate
=
'
--
'
)}
{
'
'
}
打卡结果:
{
this
.
tableData
.
dict
.
goWorkResult
[
v
.
goWorkResult
]}
<
/span
>
)}
...
...
@@ -722,31 +675,25 @@ export default {
<
span
>
打卡时间:
{
v
.
offWorkDate
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
'
--
'
)}
{
'
'
}
打卡结果:
{
this
.
tableData
.
dict
.
offWorkResult
[
v
.
offWorkResult
]}
<
/span
>
)
:
(
<
span
style
=
"
color:red
"
>
打卡时间:
{
v
.
offWorkDate
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
"
--
"
)}
{
"
"
}
打卡结果:
?
(
v
.
offWorkDate
=
timestampToTime
(
v
.
offWorkDate
,
6
))
:
(
v
.
offWorkDate
=
'
--
'
)}
{
'
'
}
打卡结果:
{
this
.
tableData
.
dict
.
offWorkResult
[
v
.
offWorkResult
]}
<
/span
>
)}
<
/p
>
);
}))
:
""
;
:
''
;
});
}
});
...
...
@@ -769,20 +716,12 @@ export default {
setdialog
(
i
)
{
if
(
i
==
1
)
{
this
.
isdialog
=
true
;
this
.
setcolum
=
this
.
config
.
columns
.
filter
(
(
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
setcolum
.
filter
(
(
val
)
=>
val
.
prop
!==
"
attendanceStaffStatEntities
"
);
this
.
setcolum
=
this
.
config
.
columns
.
filter
((
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
setcolum
.
filter
((
val
)
=>
val
.
prop
!==
'
attendanceStaffStatEntities
'
);
}
else
{
this
.
setDialog
=
true
;
this
.
setcolum
=
this
.
config
.
columns
.
filter
(
(
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
setcolum
.
filter
(
(
val
)
=>
val
.
prop
!==
"
attendanceStaffStatEntities
"
);
this
.
setcolum
=
this
.
config
.
columns
.
filter
((
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
setcolum
.
filter
((
val
)
=>
val
.
prop
!==
'
attendanceStaffStatEntities
'
);
this
.
checkTableList
=
this
.
config
.
columns
.
map
((
item
)
=>
{
if
(
item
.
show
)
{
return
item
.
prop
;
...
...
@@ -805,17 +744,17 @@ export default {
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
if
(
this
.
checkList
.
length
>
0
)
{
params
[
"
properties
"
]
=
this
.
checkList
;
params
[
'
properties
'
]
=
this
.
checkList
;
}
this
.
$download
(
"
/attendance/stat/exportExcelExt
"
,
'
/attendance/stat/exportExcelExt
'
,
{
...
params
,
...
params
},
{
type
:
"
excel
"
,
name
:
"
考勤汇总
"
}
{
type
:
'
excel
'
,
name
:
'
考勤汇总
'
}
)
.
then
(()
=>
{
this
.
isExport
=
false
;
...
...
@@ -825,13 +764,12 @@ export default {
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
}
,
}
,
}
}
};
</
script
>
<
style
scoped
lang=
"less"
>
.hisList {
padding: 15px;
.list {
...
...
src/views/staff/list.vue
View file @
8cd12952
...
...
@@ -59,13 +59,7 @@
</el-col>
<el-col
:span=
"18"
:xs=
"12"
>
<el-row>
<LayoutTable
notDel
notAdd
:data=
"tableData"
:config=
"tableConfig"
ref=
"layoutTable"
>
<LayoutTable
notDel
notAdd
:data=
"tableData"
:config=
"tableConfig"
ref=
"layoutTable"
>
<el-button
type=
"primary"
@
click=
"doExport"
...
...
@@ -74,57 +68,36 @@
slot=
"table-head-left2"
>
导出
</el-button
>
<el-dropdown
class=
"moreControll"
slot=
"table-head-left2"
style=
"margin-left: 20px"
>
<el-dropdown
class=
"moreControll"
slot=
"table-head-left2"
style=
"margin-left: 20px"
>
<el-button
type=
"primary"
size=
"mini"
>
更多操作
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item>
<el-button
type=
"text"
@
click=
"syncPerson"
>
同步数据
</el-button
>
<el-button
type=
"text"
@
click=
"syncPerson"
>
同步数据
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type=
"text"
@
click=
"handleImport"
>
导入花名册
</el-button
>
<el-button
type=
"text"
@
click=
"handleImport"
>
导入花名册
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type=
"text"
@
click=
"lookDetailHis"
>
历史花名册
</el-button
>
<el-button
type=
"text"
@
click=
"lookDetailHis"
>
历史花名册
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type=
"text"
@
click=
"SelectEXport"
>
自定义列表字段
</el-button
>
<el-button
type=
"text"
@
click=
"SelectEXport"
>
自定义列表字段
</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<span
class=
"freshTime"
slot=
"table-head-left2"
>
<i
class=
"el-icon-refresh"
></i>
<span
>
上次同步时间:
{{
tableData
.
staff
?
tableData
.
staff
.
refreshDate
:
"
--
"
}}
</span
>
<span>
上次同步时间:
{{
tableData
.
staff
?
tableData
.
staff
.
refreshDate
:
'
--
'
}}
</span>
</span>
</LayoutTable>
</el-row>
</el-col>
</el-row>
<!-- 导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
...
...
@@ -144,10 +117,7 @@
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
...
...
@@ -176,15 +146,9 @@
<!-- 表格设置 -->
<el-dialog
:visible.sync=
"isdialog"
title=
"自定义列表字段设置"
>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<div
class=
"tipsword"
>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group
v-model=
"checkList"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.label"
>
<el-checkbox
v-for=
"(item, index) in setcolum"
:key=
"index"
:label=
"item.label"
>
</el-checkbox>
</el-checkbox-group>
<div
class=
"mt20"
style=
"text-align: right"
>
...
...
@@ -193,35 +157,156 @@
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
:bumentree=
"areaData"
:currentNode=
"currentNode"
/>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
:bumentree=
"areaData"
:currentNode=
"currentNode"
/>
</div>
</
template
>
<
script
>
import
{
timestampToTime
}
from
"
@/assets/utils/dateFormat.js
"
;
import
{
timestampToTime
}
from
'
@/assets/utils/dateFormat.js
'
;
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
import
tree
from
"
@/assets/mixins/tree
"
;
import
TabPane
from
"
@/components/tabPane.vue
"
;
import
drawerShow
from
'
./drawershow
'
;
import
table
from
'
@/assets/mixins/table
'
;
import
tree
from
'
@/assets/mixins/tree
'
;
import
TabPane
from
'
@/components/tabPane.vue
'
;
export
default
{
name
:
"
StaffList
"
,
name
:
'
StaffList
'
,
components
:
{
drawerShow
,
TabPane
,
TabPane
},
mixins
:
[
table
,
tree
],
data
()
{
return
{
// 用户导入参数
upload
:
{
headers
:
{
Authorization
:
window
.
sessionStorage
.
getItem
(
'
token
'
)
||
''
},
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
'
导入花名册数据
'
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_API_BASE_URL
+
'
/staff/importData
'
},
config
:
{
showType
:
'
tableSelect
'
,
search
:
[
{
name
:
'
name
'
,
type
:
'
text
'
,
label
:
'
员工姓名
'
,
fuzzy
:
true
},
{
name
:
'
phoneNumber
'
,
type
:
'
text
'
,
label
:
'
手机号
'
,
fuzzy
:
true
}
],
columns
:
[
{
type
:
'
selection
'
,
width
:
60
,
show
:
true
},
{
type
:
'
index
'
,
label
:
'
序号
'
,
width
:
50
,
show
:
true
},
{
label
:
'
员工姓名
'
,
prop
:
'
name
'
,
show
:
true
},
{
label
:
'
工号
'
,
prop
:
'
workNum
'
,
show
:
true
},
{
label
:
'
部门
'
,
prop
:
'
deptName
'
,
show
:
true
},
{
label
:
'
职位
'
,
prop
:
'
positionName
'
,
formatter
:
this
.
formatters
,
show
:
true
},
{
label
:
'
员工类型
'
,
prop
:
'
staffType
'
,
formatter
:
this
.
formatterType
,
show
:
true
},
{
label
:
'
员工状态
'
,
prop
:
'
status
'
,
formatter
:
this
.
formatter
,
show
:
true
},
{
label
:
'
是否在政务中心
'
,
prop
:
'
source
'
,
formatter
:
this
.
formatterSource
,
show
:
true
},
//未对
{
label
:
'
手机号
'
,
prop
:
'
phoneNumber
'
,
formatter
:
this
.
formatters
,
show
:
true
},
{
label
:
'
操作
'
,
width
:
240
,
show
:
true
,
formatter
:
(
row
)
=>
{
return
(
//
<
table
-
buttons
// noAdd
// noDel
// noEdit
// row={row}
// onView={this.toView}
// onEdit={this.toEdit}
// />
<
table
-
buttons
noAdd
noAuth
noDel
noEdit
row
=
{
row
}
onView
=
{
this
.
toView
}
onEdit
=
{
this
.
toEdit
}
/
>
);
}
}
],
isshowTabPane
:
false
},
isshowHome
:
false
,
personData
:
[],
// 导出加载状态
isExport
:
false
,
// 人员信息
staffInfo
:
{},
// 历史记录
drawerhistory
:
false
,
// 选中列表
checkList
:
[],
// 初始数组
setcolum
:
[],
// 弹窗是否显示
isdialog
:
false
};
},
computed
:
{
thirdList
()
{
if
(
!
this
.
$store
.
state
.
CurrentThirdArr
)
return
[];
return
this
.
$store
.
state
.
CurrentThirdArr
;
},
activeName
()
{
return
this
.
$store
.
state
.
ThirdPath
;
}
},
created
()
{
this
.
$post
(
"
/dept/treeselect
"
,
{}).
then
(({
data
})
=>
{
this
.
$post
(
'
/dept/treeselect
'
,
{}).
then
(({
data
})
=>
{
this
.
areaData
=
data
.
result
;
});
},
methods
:
{
// 弹窗内确认事件
handleOk
()
{
this
.
config
.
columns
.
forEach
((
v
)
=>
{
v
.
prop
?
(
v
.
show
=
false
)
:
(
v
.
show
=
true
);
...
...
@@ -237,9 +322,7 @@ export default {
},
// 自定义字段
SelectEXport
()
{
this
.
setcolum
=
this
.
config
.
columns
.
filter
(
(
item
)
=>
item
.
label
&&
item
.
prop
);
this
.
setcolum
=
this
.
config
.
columns
.
filter
((
item
)
=>
item
.
label
&&
item
.
prop
);
console
.
log
(
this
.
config
.
columns
);
this
.
checkList
=
this
.
setcolum
.
map
((
v
)
=>
{
if
(
v
.
show
)
{
...
...
@@ -250,7 +333,7 @@ export default {
},
/** 同步 */
syncPerson
()
{
this
.
$post
(
"
/staff/syncPersons
"
,
{}).
then
((
res
)
=>
{
this
.
$post
(
'
/staff/syncPersons
'
,
{}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
res
.
msg
);
}
...
...
@@ -258,14 +341,14 @@ export default {
},
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
员工导入
"
;
this
.
upload
.
title
=
'
员工导入
'
;
this
.
upload
.
open
=
true
;
},
handleClick
(
key
)
{
console
.
log
(
key
);
this
.
$store
.
commit
(
"
setThirdPath
"
,
key
);
this
.
$store
.
commit
(
'
setThirdPath
'
,
key
);
this
.
$router
.
push
({
path
:
key
,
path
:
key
});
},
/** 重写新增方法 */
...
...
@@ -283,13 +366,13 @@ export default {
// this.personData = row
// this.isshowHome = true
this
.
$router
.
push
({
path
:
"
/staff/view
"
,
path
:
'
/staff/view
'
,
query
:
{
id
:
row
.
id
,
}
,
id
:
row
.
id
}
});
},
// 节点点击事件
handleNodeClick
(
node
)
{
this
.
currentNode
=
node
;
this
.
query
=
Object
.
assign
({},
this
.
query
,
{
deptId
:
node
.
id
});
...
...
@@ -297,11 +380,12 @@ export default {
this
.
$router
.
push
({
path
:
this
.
$route
.
path
,
query
:
{
page
:
1
,
}
,
page
:
1
}
});
this
.
getData
();
},
// 导出操作
doExport
()
{
this
.
isExport
=
true
;
let
params
=
{};
...
...
@@ -311,14 +395,14 @@ export default {
}
}
if
(
this
.
selection
.
length
>
0
)
{
params
[
"
idList
"
]
=
this
.
selection
;
params
[
'
idList
'
]
=
this
.
selection
;
}
this
.
$download
(
"
/staff/exportExcel
"
,
'
/staff/exportExcel
'
,
{
...
params
,
...
params
},
{
type
:
"
excel
"
}
{
type
:
'
excel
'
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
...
...
@@ -329,7 +413,7 @@ export default {
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/staff/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
this
.
$download
(
'
/staff/downloadTemplate
'
,
{},
{
type
:
'
excel
'
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
...
...
@@ -344,132 +428,12 @@ export default {
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
// 获取数据后处理数据
afterRender
(
data
)
{
this
.
tableData
.
staff
.
refreshDate
=
timestampToTime
(
this
.
tableData
.
staff
.
refreshDate
,
6
);
this
.
$refs
.
layoutTable
.
showType
=
"
tableSelect
"
;
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
headers
:
{
Authorization
:
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
,
},
// 是否显示弹出层(员工关怀信息导入)
open
:
false
,
// 弹出层标题(员工关怀信息导入)
title
:
"
导入花名册数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/staff/importData
"
,
},
config
:
{
showType
:
"
tableSelect
"
,
search
:
[
{
name
:
"
name
"
,
type
:
"
text
"
,
label
:
"
员工姓名
"
,
fuzzy
:
true
,
},
{
name
:
"
phoneNumber
"
,
type
:
"
text
"
,
label
:
"
手机号
"
,
fuzzy
:
true
,
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
,
show
:
true
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
,
show
:
true
},
{
label
:
"
员工姓名
"
,
prop
:
"
name
"
,
show
:
true
},
{
label
:
"
工号
"
,
prop
:
"
workNum
"
,
show
:
true
},
{
label
:
"
部门
"
,
prop
:
"
deptName
"
,
show
:
true
},
{
label
:
"
职位
"
,
prop
:
"
positionName
"
,
formatter
:
this
.
formatters
,
show
:
true
,
},
{
label
:
"
员工类型
"
,
prop
:
"
staffType
"
,
formatter
:
this
.
formatterType
,
show
:
true
,
},
{
label
:
"
员工状态
"
,
prop
:
"
status
"
,
formatter
:
this
.
formatter
,
show
:
true
,
},
{
label
:
"
是否在政务中心
"
,
prop
:
"
source
"
,
formatter
:
this
.
formatterSource
,
show
:
true
,
},
//未对
{
label
:
"
手机号
"
,
prop
:
"
phoneNumber
"
,
formatter
:
this
.
formatters
,
show
:
true
,
},
{
label
:
"
操作
"
,
width
:
240
,
show
:
true
,
formatter
:
(
row
)
=>
{
return
(
//
<
table
-
buttons
// noAdd
// noDel
// noEdit
// row={row}
// onView={this.toView}
// onEdit={this.toEdit}
// />
<
table
-
buttons
noAdd
noAuth
noDel
noEdit
row
=
{
row
}
onView
=
{
this
.
toView
}
onEdit
=
{
this
.
toEdit
}
/
>
);
},
},
],
isshowTabPane
:
false
,
},
isshowHome
:
false
,
personData
:
[],
isExport
:
false
,
staffInfo
:
{},
drawerhistory
:
false
,
checkList
:
[],
setcolum
:
[],
isdialog
:
false
,
};
},
computed
:
{
thirdList
()
{
if
(
!
this
.
$store
.
state
.
CurrentThirdArr
)
return
[];
return
this
.
$store
.
state
.
CurrentThirdArr
;
},
activeName
()
{
return
this
.
$store
.
state
.
ThirdPath
;
},
},
this
.
tableData
.
staff
.
refreshDate
=
timestampToTime
(
this
.
tableData
.
staff
.
refreshDate
,
6
);
this
.
$refs
.
layoutTable
.
showType
=
'
tableSelect
'
;
}
}
};
</
script
>
...
...
@@ -547,18 +511,12 @@ export default {
}
.
mytree
:
:
v-deep
{
.
el-tree--highlight-current
:
:
v-deep
.
el-tree-node
.
is-checked
>
.
el-tree-node__content
{
.
el-tree--highlight-current
:
:
v-deep
.
el-tree-node
.
is-checked
>
.
el-tree-node__content
{
background-color
:
rgb
(
255
,
255
,
255
);
color
:
rgb
(
64
,
158
,
255
);
}
.
el-tree--highlight-current
:
:
v-deep
.
el-tree-node
.
is-current
>
.
el-tree-node__content
{
.
el-tree--highlight-current
:
:
v-deep
.
el-tree-node
.
is-current
>
.
el-tree-node__content
{
background-color
:
rgb
(
255
,
255
,
255
);
color
:
rgb
(
64
,
158
,
255
);
}
...
...
@@ -594,7 +552,7 @@ export default {
}
.el-tree-node
:before
{
content
:
""
;
content
:
''
;
left
:
-4px
;
position
:
absolute
;
right
:
auto
;
...
...
@@ -602,7 +560,7 @@ export default {
}
.el-tree-node
:after
{
content
:
""
;
content
:
''
;
left
:
-4px
;
position
:
absolute
;
right
:
auto
;
...
...
@@ -631,7 +589,7 @@ export default {
align-items
:
center
;
}
.
titles
:
:
before
{
content
:
""
;
content
:
''
;
width
:
6px
;
height
:
16px
;
background-color
:
#409eff
;
...
...
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