<template>
|
<div class="app-container">
|
<el-row :gutter="40" class="panel-group">
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<div class="card-panel">
|
<div class="card-panel-icon-wrapper icon-people">
|
<svg-icon icon-class="visits" class-name="card-panel-icon" />
|
</div>
|
<div class="card-panel-description">
|
<div class="card-panel-text">
|
补卡未承认
|
</div>
|
<count-to
|
:start-val="0"
|
:end-val="100"
|
:duration="1"
|
class="card-panel-num"
|
/>
|
</div>
|
</div>
|
</el-col>
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<div class="card-panel">
|
<div class="card-panel-icon-wrapper icon-permission">
|
<svg-icon icon-class="people" class-name="card-panel-icon" />
|
</div>
|
<div class="card-panel-description">
|
<div class="card-panel-text">
|
请假未承认
|
</div>
|
<count-to
|
:start-val="0"
|
:end-val="100"
|
:duration="3000"
|
:decimals="2"
|
class="card-panel-num"
|
/>
|
</div>
|
</div>
|
</el-col>
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<div class="card-panel">
|
<div class="card-panel-icon-wrapper icon-message">
|
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
</div>
|
<div class="card-panel-description">
|
<div class="card-panel-text">
|
外出未承认
|
</div>
|
<count-to
|
:start-val="0"
|
:end-val="100"
|
:duration="3600"
|
class="card-panel-num"
|
/>
|
</div>
|
</div>
|
</el-col>
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<div class="card-panel">
|
<div class="card-panel-icon-wrapper icon-timings">
|
<svg-icon icon-class="timing" class-name="card-panel-icon" />
|
</div>
|
<div class="card-panel-description">
|
<div class="card-panel-text">
|
出差未承认
|
</div>
|
<count-to
|
:start-val="0"
|
:end-val="100"
|
:decimals="2"
|
:duration="3600"
|
class="card-panel-num"
|
/>
|
<span class="card-panel-texts">/</span>
|
<count-to
|
:start-val="0"
|
:end-val="100"
|
:duration="3600"
|
class="card-panel-num"
|
/>
|
</div>
|
</div>
|
</el-col>
|
</el-row>
|
<!--工具栏-->
|
<div class="head-container">
|
<div>
|
<el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
|
<el-option
|
v-for="item in users"
|
:key="item.id"
|
:label="item.nickName"
|
:value="item.id"
|
/>
|
</el-select>
|
<el-date-picker
|
v-model="query.attendanceDate"
|
type="daterange"
|
clearable
|
class="filter-item"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择考勤日期"
|
range-separator=" ~ "
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
style="width: 285px;"
|
/>
|
<rrOperation />
|
</div>
|
<!--表格渲染-->
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" row-key="id" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
<el-table-column type="selection" width="55" />
|
<el-table-column prop="userName" label="所属员工" fixed="left" width="100" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag>{{ scope.row.userName }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="attendanceDate" label="考勤日期" fixed="left" width="100" show-overflow-tooltip>
|
<template slot-scope="scope">
|
{{ crud.toDate(scope.row.attendanceDate) }}
|
</template>
|
</el-table-column>
|
<el-table-column prop="rosteringWorkStartTime" min-width="140" label="排班工作开始时间" show-overflow-tooltip />
|
<el-table-column prop="actualWorkStartTime" min-width="140" label="实际工作开始时间" show-overflow-tooltip />
|
<el-table-column prop="startLocationResults" min-width="100" label="开始位置结果" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.startLocationResults === dictlocationResultsNormal" type="success">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.startLocationResults === dictlocationResultsOutside" type="warning">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.startLocationResults === dictlocationResultsNotSigned" type="danger">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.startLocationResults === dictlocationResultsRest" type="warning">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="startClockResults" min-width="100" label="开始打卡结果" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateWaitFor" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateNormal" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateNotSigned" type="danger">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateGoOut" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateBusiness" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateLeave" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictAttendanceStateRest" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictEndanceStateLackOfTime" type="danger">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.startClockResults === dictStartLate" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="rosteringWorkEndTime" min-width="140" label="排班工作结束时间" show-overflow-tooltip />
|
<el-table-column prop="actualWorkEndTime" min-width="140" label="实际工作结束时间" show-overflow-tooltip />
|
<el-table-column prop="endLocationResults" min-width="100" label="结束位置结果" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.endLocationResults === dictlocationResultsNormal" type="success">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.endLocationResults === dictlocationResultsOutside" type="warning">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.endLocationResults === dictlocationResultsNotSigned" type="danger">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
|
<el-tag v-if="scope.row.endLocationResults === dictlocationResultsRest" type="warning">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="endClockResults" min-width="100" label="结束打卡结果" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateWaitFor" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateNormal" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateNotSigned" type="danger">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateGoOut" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateBusiness" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateLeave" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictAttendanceStateRest" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictEndanceStateLackOfTime" type="danger">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
<el-tag v-if="scope.row.endClockResults === dictStartEarly" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="dateType" min-width="80" label="日期类型" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-tag>{{ dict.label[dateType][scope.row.dateType] }}</el-tag>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!--分页组件-->
|
<pagination />
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import crudAttendance from '@/api/attendance/attendance'
|
import crudAttendanceCardreplacement from '@/api/attendance/attendanceCardreplacement'
|
import crudAttendanceGoOut from '@/api/attendance/attendanceGoOut'
|
import crudAttendanceBusinessTravel from '@/api/attendance/attendanceBusinessTravel'
|
import crudUser from '@/api/system/user'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import rrOperation from '@crud/RR.operation'
|
import pagination from '@crud/Pagination'
|
import constant from '@/utils/constant'
|
|
const defaultForm = { id: null, userId: null, attendanceDate: null, rosteringWorkStartTime: null, actualWorkStartTime: null, startLocationResults: null, startClockResults: null, rosteringWorkEndTime: null, actualWorkEndTime: null, endLocationResults: null, endClockResults: null, dateType: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
|
export default {
|
name: 'AttendanceTotal',
|
components: { pagination, rrOperation },
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
cruds() {
|
return CRUD({ title: '考勤记录', url: 'api/attendance/notNormal', idField: 'id', sort: 'attendanceDate,desc', crudMethod: { ...crudAttendance }})
|
},
|
// 数据字典
|
dicts: [constant.ATTENDANCE_STATE, constant.DATE_TYPE, constant.LOCATION_RESULTS, constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS, constant.LEAVE_TIME_TYPE, constant.GO_OUT_TYPE],
|
data() {
|
return {
|
permission: {
|
add: ['admin', 'attendance:add'],
|
edit: ['admin', 'attendance:edit'],
|
del: ['admin', 'attendance:del'],
|
download: ['admin', 'attendance:download'],
|
addAttendanceInfo: ['admin', 'attendance:addAttendanceInfo']
|
},
|
attendanceState: constant.ATTENDANCE_STATE,
|
lacationResules: constant.LOCATION_RESULTS,
|
dateType: constant.DATE_TYPE,
|
dictlocationResultsNormal: constant.LOCATION_RESULTS_NORMAL,
|
dictlocationResultsOutside: constant.LOCATION_RESULTS_OUTSIDE,
|
dictlocationResultsNotSigned: constant.LOCATION_RESULTS_NOTSIGNED,
|
dictlocationResultsRest: constant.LOCATION_RESULTS_REST,
|
dictAttendanceStateWaitFor: constant.ATTENDANCE_STATE_WAITFOR,
|
dictAttendanceStateNormal: constant.ATTENDANCE_STATE_NORMAL,
|
dictAttendanceStateNotSigned: constant.ATTENDANCE_STATE_NOTSIGNED,
|
dictAttendanceStateGoOut: constant.ATTENDANCE_STATE_GOOUT,
|
dictAttendanceStateBusiness: constant.ATTENDANCE_STATE_BUSINESS,
|
dictAttendanceStateLeave: constant.ATTENDANCE_STATE_LEAVE,
|
dictAttendanceStateRest: constant.ATTENDANCE_STATE_REST,
|
dictEndanceStateLackOfTime: constant.ATTENDANCE_STATE_LACK_OF_TIME,
|
dictStartEarly: constant.ATTENDANCE_STATE_EARLY,
|
dictStartLate: constant.ATTENDANCE_STATE_LATE,
|
users: [],
|
users1: [],
|
approvalUsers: [],
|
goOutVisible: false,
|
goSuccessLoading: false,
|
dictLeaveTimeType: constant.LEAVE_TIME_TYPE,
|
dictGoOutTypr: constant.GO_OUT_TYPE,
|
dictLeaveTimeTypeHour: constant.LEAVE_TIME_TYPE_HOUR,
|
dictLeaveTimeTypeDay: constant.LEAVE_TIME_TYPE_DAY,
|
}
|
},
|
methods: {
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
[CRUD.HOOK.beforeRefresh]() {
|
this.getUsers()
|
this.getUsers1()
|
this.getApprovalUsers()
|
return true
|
},
|
// 查询员工
|
getUsers() {
|
crudUser.getAll().then(res => {
|
this.users = res
|
})
|
},
|
// 查询员工
|
getUsers1() {
|
crudUser.getUserInfose().then(res => {
|
this.users1 = res
|
})
|
},
|
// 查询审核人
|
getApprovalUsers() {
|
crudUser.getApprovalUsers().then(res => {
|
this.approvalUsers = res
|
})
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
.attCss {
|
font-size: 12px;
|
text-align: center;
|
}
|
|
.panel-group {
|
margin-top: 18px;
|
|
.card-panel-col {
|
margin-bottom: 32px;
|
}
|
|
.card-panel {
|
height: 108px;
|
cursor: pointer;
|
font-size: 12px;
|
position: relative;
|
overflow: hidden;
|
color: #666;
|
background: #fff;
|
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
|
border-color: rgba(0, 0, 0, 0.05);
|
|
&:hover {
|
.card-panel-icon-wrapper {
|
color: #fff;
|
}
|
|
.icon-people {
|
background: #40c9c6;
|
}
|
|
.icon-message {
|
background: #36a3f7;
|
}
|
|
.icon-permission {
|
background: #34bfa3;
|
}
|
|
.icon-timings {
|
background: #f4516c;
|
}
|
}
|
|
.icon-people {
|
color: #40c9c6;
|
}
|
|
.icon-message {
|
color: #36a3f7;
|
}
|
|
.icon-permission {
|
color: #34bfa3;
|
}
|
|
.card-panel-icon-wrapper {
|
float: left;
|
margin: 14px 0 0 14px;
|
padding: 16px;
|
transition: all 0.38s ease-out;
|
border-radius: 6px;
|
}
|
|
.card-panel-icon {
|
float: left;
|
font-size: 48px;
|
}
|
|
.card-panel-description {
|
float: right;
|
font-weight: bold;
|
margin: 26px;
|
margin-left: 0px;
|
|
.card-panel-text {
|
line-height: 18px;
|
color: rgba(0, 0, 0, 0.45);
|
font-size: 16px;
|
margin-bottom: 12px;
|
}
|
|
.card-panel-texts {
|
font-size: 20px;
|
}
|
|
.card-panel-num {
|
font-size: 20px;
|
}
|
}
|
}
|
}
|
|
@media (max-width: 550px) {
|
.card-panel-description {
|
display: none;
|
}
|
|
.card-panel-icon-wrapper {
|
float: none !important;
|
width: 100%;
|
height: 100%;
|
margin: 0 !important;
|
|
.svg-icon {
|
display: block;
|
margin: 14px auto !important;
|
float: none !important;
|
}
|
}
|
}
|
</style>
|