添加生成工资条功能

This commit is contained in:
1147680382@qq.com
2025-05-29 11:30:31 +08:00
parent 71421052df
commit 943093ed5e
5 changed files with 178 additions and 519 deletions
@@ -5,47 +5,30 @@
<div class="card-header">
<span class="title">综合部复审列表</span>
<div class="header-right">
<el-date-picker
v-model="dateRange"
type="month"
placeholder="选择月份"
:default-time="defaultTime"
:shortcuts="dateShortcuts"
@change="handleDateChange"
style="width: 200px; margin-right: 8px;"
/>
<el-input
v-model="searchKeyword"
placeholder="请输入姓名搜索"
clearable
@input="handleSearch"
style="width: 200px; margin-right: 8px;"
>
<el-date-picker v-model="dateRange" type="month" placeholder="选择月份" :default-time="defaultTime"
:shortcuts="dateShortcuts" @change="handleDateChange" style="width: 200px; margin-right: 8px;" />
<el-input v-model="searchKeyword" placeholder="请输入姓名搜索" clearable @input="handleSearch"
style="width: 200px; margin-right: 8px;">
<template #prefix>
<el-icon><Search /></el-icon>
<el-icon>
<Search />
</el-icon>
</template>
</el-input>
</div>
</div>
</template>
<el-table
:data="attendanceList"
style="width: 100%"
height="calc(100vh - 280px)"
border
stripe
<el-table :data="attendanceList" style="width: 100%" height="calc(100vh - 280px)" border stripe
:header-cell-style="{
background: '#f5f7fa',
color: '#606266',
fontWeight: 'bold',
textAlign: 'center',
padding: '12px 0'
}"
:cell-style="{
}" :cell-style="{
padding: '8px 0'
}"
>
}">
<el-table-column label="头像" width="80" align="center" fixed="left">
<template #default="scope">
<el-avatar :size="40" :src="scope.row.avatar" />
@@ -67,7 +50,8 @@
<el-table-column prop="marriageLeave" label="婚假" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="bereavementLeave" label="丧假" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="annualLeave" label="年休假" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="managementAnnualLeave" label="年休假(管理岗)" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="managementAnnualLeave" label="年休假(管理岗)" width="120" align="center"
show-overflow-tooltip />
<el-table-column prop="compensatoryLeave" label="调休假" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="early" label="早退次数" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="late" label="迟到次数" width="100" align="center" show-overflow-tooltip />
@@ -84,20 +68,10 @@
<el-table-column prop="penaltyAmount" label="违纪扣奖" width="100" align="center" show-overflow-tooltip />
<el-table-column label="操作" width="200" fixed="right" align="center">
<template #default="scope">
<el-button
type="primary"
link
size="small"
@click="handleViewAbnormal(scope.row)"
>
异常考勤
<el-button type="primary" link size="small" @click="handleViewAbnormal(scope.row)">
详情
</el-button>
<el-button
type="success"
link
size="small"
@click="handleApprove(scope.row)"
>
<el-button type="success" link size="small" @click="handleApprove(scope.row)">
审批
</el-button>
</template>
@@ -106,19 +80,10 @@
</el-card>
<!-- 异常考勤详情对话框 -->
<el-dialog
v-model="abnormalDialogVisible"
title="异常考勤详情"
width="800px"
>
<el-dialog v-model="abnormalDialogVisible" title="异常考勤详情" width="800px">
<div v-for="(records, date) in abnormalList" :key="date" class="abnormal-date-group">
<div class="date-header">{{ date }}</div>
<el-table
:data="records"
style="width: 100%"
border
stripe
>
<el-table :data="records" style="width: 100%" border stripe>
<el-table-column prop="type" label="异常类型" width="120">
<template #default="scope">
<el-tag :type="getAbnormalTypeTag(scope.row.type)">
@@ -133,12 +98,8 @@
<div>考勤时间{{ scope.row.baseCheckTime }}</div>
<div class="result-row">
考勤结果
<el-select
v-model="scope.row.realResult"
size="small"
style="width: 100px; margin: 0 8px;"
@change="handleUpdateAbnormal(scope.row)"
>
<el-select v-model="scope.row.realResult" size="small" style="width: 100px; margin: 0 8px;"
@change="handleUpdateAbnormal(scope.row)">
<el-option label="正常" value="Normal" />
<el-option label="早退" value="Early" />
<el-option label="迟到" value="Late" />
@@ -151,26 +112,16 @@
<template v-else-if="scope.row.type === 'checkin'">
<div class="result-row">
缺卡次数
<el-input-number
v-model="scope.row.missedCount"
size="small"
style="width: 100px; margin: 0 8px;"
:min="0"
:max="10"
@change="handleUpdateAbnormal(scope.row)"
/>
<el-input-number v-model="scope.row.missedCount" size="small" style="width: 100px; margin: 0 8px;"
:min="0" :max="10" @change="handleUpdateAbnormal(scope.row)" />
</div>
</template>
<template v-else-if="scope.row.type === 'report'">
<div class="result-row">
日志状态
<el-select
v-model="scope.row.reportCount"
size="small"
style="width: 100px; margin: 0 8px;"
@change="handleUpdateAbnormal(scope.row)"
>
<el-select v-model="scope.row.reportCount" size="small" style="width: 100px; margin: 0 8px;"
@change="handleUpdateAbnormal(scope.row)">
<el-option label="未写日志" :value="0" />
<el-option label="正常" :value="1" />
</el-select>
@@ -289,7 +240,7 @@ const handleSearch = () => {
attendanceList.value = originalList.value;
return;
}
attendanceList.value = originalList.value.filter(item =>
attendanceList.value = originalList.value.filter(item =>
item.name.toLowerCase().includes(searchKeyword.value.toLowerCase())
);
};
@@ -440,7 +391,7 @@ const handleViewAbnormal = async (row) => {
const handleUpdateAbnormal = async (record) => {
// 保存原始值
const originalValue = record.realResult;
try {
await ElMessageBox.confirm(
'确认修改该考勤记录?',
@@ -451,7 +402,7 @@ const handleUpdateAbnormal = async (record) => {
type: 'warning',
}
);
const year = dateRange.value.getFullYear();
const month = dateRange.value.getMonth() + 1;
const data = {
@@ -533,7 +484,7 @@ onMounted(() => {
:deep(.el-table) {
flex: 1;
.el-table__body-wrapper {
height: 100%;
}
@@ -650,4 +601,4 @@ onMounted(() => {
align-items: center;
margin-top: 4px;
}
</style>
</style>