对接签名提交,工资详情查询

This commit is contained in:
1147680382@qq.com
2025-05-20 16:19:59 +08:00
parent d2c8a95723
commit 6545eed3f0
7 changed files with 1030 additions and 800 deletions
@@ -3,125 +3,139 @@
<!-- 月份选择 -->
<view class="month-selector" @click="showDatePicker">
<view class="combination">
<text class="current-month">{{ selectedYear }}{{ selectedMonth < 10 ? '0' + selectedMonth : selectedMonth }}</text>
<text
class="current-month">{{ selectedYear }}{{ selectedMonth < 10 ? '0' + selectedMonth : selectedMonth }}</text>
<image class="arrow" src="/static/arr.png" mode="aspectFit"></image>
</view>
<text class="month-text">月度</text>
</view>
<!-- 内容 -->
<view class="box" v-for="(attendanceData,index) in attendanceDataList" :key="index">
<view class="title">{{attendanceData.status=="1"?"试用":"正式"}}</view>
<!-- 打卡统计 -->
<view class="stat-section">
<view class="section-title">打卡统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">迟到</text>
<text class="value red-text">{{ attendanceData.late }}</text>
</view>
<view class="stat-item">
<text class="label">严重迟到</text>
<text class="value red-text">{{ attendanceData.seriousLate }}</text>
</view>
<view class="stat-item">
<text class="label">旷工</text>
<text class="value">{{ attendanceData.absenteeism }}</text>
</view>
<view class="stat-item">
<text class="label">早退</text>
<text class="value red-text">{{ attendanceData.early }}</text>
</view>
<view class="stat-item">
<text class="label">未打卡</text>
<text class="value red-text">{{ attendanceData.absenceCount }}</text>
</view>
<view class="stat-item">
<text class="label">未签到签退</text>
<text class="value red-text">{{ attendanceData.missedCount }}</text>
</view>
<view class="stat-item">
<text class="label">未提交日志</text>
<text class="value red-text">{{ attendanceData.missingLogCount }}</text>
</view>
</view>
</view>
<!-- 打卡统计 -->
<view class="stat-section">
<view class="section-title">打卡统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">迟到</text>
<text class="value red-text">{{ attendanceData.late }}</text>
<!-- 请假统计 -->
<view class="stat-section">
<view class="section-title">请假统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">事假</text>
<text class="value red-text">{{ attendanceData.personalLeave }}小时</text>
</view>
<view class="stat-item">
<text class="label">病假</text>
<text class="value red-text">{{ attendanceData.sickLeave }}</text>
</view>
<view class="stat-item">
<text class="label">婚假</text>
<text class="value">{{ attendanceData.marriageLeave }}</text>
</view>
<view class="stat-item">
<text class="label">产假</text>
<text class="value red-text">{{ attendanceData.maternityLeave }}</text>
</view>
<view class="stat-item">
<text class="label">陪产假</text>
<text class="value red-text">{{ attendanceData.paternityLeave }}</text>
</view>
<view class="stat-item">
<text class="label">丧假</text>
<text class="value red-text">{{ attendanceData.bereavementLeave }}</text>
</view>
<view class="stat-item">
<text class="label">年休假</text>
<text class="value red-text">{{ attendanceData.annualLeave }}</text>
</view>
<view class="stat-item">
<text class="label">年休假(管理岗)</text>
<text class="value red-text">{{ attendanceData.managementAnnualLeave }}</text>
</view>
</view>
<view class="stat-item">
<text class="label">严重迟到</text>
<text class="value red-text">{{ attendanceData.seriousLate }}</text>
</view>
<!-- 加班调休统计 -->
<view class="stat-section">
<view class="section-title">加班调休统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">节假日加班</text>
<text class="value red-text">{{ attendanceData.holidayOvertime }}小时</text>
</view>
<view class="stat-item">
<text class="label">休息日加班</text>
<text class="value red-text">{{ attendanceData.restdayOvertime }}小时</text>
</view>
<view class="stat-item">
<text class="label">工作日加班</text>
<text class="value">{{ attendanceData.workdayOvertime }}小时</text>
</view>
<!-- <view class="stat-item">
<text class="label">调休</text>
<text class="value red-text">1小时</text>
</view> -->
</view>
<view class="stat-item">
<text class="label">旷工</text>
<text class="value">{{ attendanceData.absenteeism }}</text>
</view>
<!-- 底部说明 -->
<view class="bottom-tips">说明请核实当月考勤记录确认无误请签字确认</view>
<!-- 员工签字 -->
<view class="sign">
<view class="sign-tit">
员工签字
<text>/保留员工签字</text>
</view>
<view class="stat-item">
<text class="label">早退</text>
<text class="value red-text">{{ attendanceData.early }}</text>
</view>
<view class="stat-item">
<text class="label">未打卡</text>
<text class="value red-text">{{ attendanceData.absenceCount }}</text>
</view>
<view class="stat-item">
<text class="label">未签到签退</text>
<text class="value red-text">{{ attendanceData.missedCount }}</text>
</view>
<view class="stat-item">
<text class="label">未提交日志</text>
<text class="value red-text">{{ attendanceData.missingLogCount }}</text>
<view class="signatureVersion">
<image :src="attendanceData.signatureImg" class="signImg" mode="scaleToFill">
</image>
</view>
</view>
<!-- 签字确认按钮 -->
<!-- view class=" confirm-btn" v-if="attendanceData.flag=='7'" @click="goSignIt(attendanceData)">
<text>签字确认</text>
</view> -->
<view class=" confirm-btn" @click="goSignIt(attendanceData)">
<text>签字确认</text>
</view>
</view>
<!-- 请假统计 -->
<view class="stat-section">
<view class="section-title">请假统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">事假</text>
<text class="value red-text">{{ attendanceData.personalLeave }}小时</text>
</view>
<view class="stat-item">
<text class="label">病假</text>
<text class="value red-text">{{ attendanceData.sickLeave }}</text>
</view>
<view class="stat-item">
<text class="label">婚假</text>
<text class="value">{{ attendanceData.marriageLeave }}</text>
</view>
<view class="stat-item">
<text class="label">产假</text>
<text class="value red-text">{{ attendanceData.maternityLeave }}</text>
</view>
<view class="stat-item">
<text class="label">陪产假</text>
<text class="value red-text">{{ attendanceData.paternityLeave }}</text>
</view>
<view class="stat-item">
<text class="label">丧假</text>
<text class="value red-text">{{ attendanceData.bereavementLeave }}</text>
</view>
<view class="stat-item">
<text class="label">年休假</text>
<text class="value red-text">{{ attendanceData.annualLeave }}</text>
</view>
<view class="stat-item">
<text class="label">年休假(管理岗)</text>
<text class="value red-text">{{ attendanceData.managementAnnualLeave }}</text>
</view>
</view>
</view>
<!-- 加班调休统计 -->
<view class="stat-section">
<view class="section-title">加班调休统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">节假日加班</text>
<text class="value red-text">{{ attendanceData.holidayOvertime }}小时</text>
</view>
<view class="stat-item">
<text class="label">休息日加班</text>
<text class="value red-text">{{ attendanceData.restdayOvertime }}小时</text>
</view>
<view class="stat-item">
<text class="label">工作日加班</text>
<text class="value">{{ attendanceData.workdayOvertime }}小时</text>
</view>
<!-- <view class="stat-item">
<text class="label">调休</text>
<text class="value red-text">1小时</text>
</view> -->
</view>
</view>
<!-- 底部说明 -->
<view class="bottom-tips">说明请核实当月考勤记录确认无误请签字确认</view>
<!-- 员工签字 -->
<view class="sign">
<view class="sign-tit">
员工签字
<text>/保留员工签字</text>
</view>
<view class="signatureVersion"></view>
</view>
<!-- 签字确认按钮 -->
<view class="confirm-btn" @click="goSignIt"><text>签字确认</text></view>
<!-- 日期选择模态框 -->
<view class="date-picker-modal" v-if="showModal" @click.stop="closeDatePicker">
@@ -130,7 +144,8 @@
<!-- 年份选择 -->
<view class="year-grid" v-if="currentStep === 'year'">
<view v-for="year in availableYears" :key="year" class="year-item" :class="{ active: tempSelectedYear === year }" @click="selectYear(year)">
<view v-for="year in availableYears" :key="year" class="year-item"
:class="{ active: tempSelectedYear === year }" @click="selectYear(year)">
<view class="year-circle">
<text>{{ year }}</text>
</view>
@@ -139,7 +154,8 @@
<!-- 月份选择 -->
<view class="month-grid" v-if="currentStep === 'month'">
<view v-for="month in months" :key="month" class="month-item" :class="{ active: tempSelectedMonth === month }" @click="selectMonth(month)">
<view v-for="month in months" :key="month" class="month-item"
:class="{ active: tempSelectedMonth === month }" @click="selectMonth(month)">
<view class="month-circle">
<text>{{ tempSelectedYear }}{{ month < 10 ? '0' + month : month }}</text>
</view>
@@ -147,370 +163,415 @@
</view>
<!-- 底部按钮 -->
<view class="modal-footer" v-if="currentStep === 'month'"><view class="back-btn" @click="backToYearSelect">返回年份选择</view></view>
<view class="modal-footer" v-if="currentStep === 'month'">
<view class="back-btn" @click="backToYearSelect">返回年份选择</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getPerformanceAttendanceApi } from '@/api/create.js';
export default {
data() {
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
return {
showModal: false,
currentYear,
selectedYear: currentYear,
selectedMonth: currentDate.getMonth(),
months: Array.from({ length: 12 }, (_, i) => i + 1),
currentStep: 'year', // 'year' 或 'month'
tempSelectedYear: currentYear,
tempSelectedMonth: currentDate.getMonth() + 1,
availableYears: Array.from({ length: 7 }, (_, i) => currentYear - 3 + i),
attendanceData: {
// 迟到
late: ' ',
// 严重迟到
seriousLate: ' ',
// 旷工
absenteeism: ' ',
// 早退
early: ' ',
// 未打卡
absenceCount: ' ',
// 未签到签退
missedCount: ' ',
// 未提交日志
missingLogCount: ' ',
import {
getPerformanceAttendanceApi
} from '@/api/create.js';
export default {
data() {
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
return {
showModal: false,
currentYear,
selectedYear: currentYear,
selectedMonth: currentDate.getMonth(),
months: Array.from({
length: 12
}, (_, i) => i + 1),
currentStep: 'year', // 'year' 或 'month'
tempSelectedYear: currentYear,
tempSelectedMonth: currentDate.getMonth() + 1,
availableYears: Array.from({
length: 7
}, (_, i) => currentYear - 3 + i),
attendanceDataList: [{
// 迟到
late: ' ',
// 严重迟到
seriousLate: ' ',
// 旷工
absenteeism: ' ',
// 早退
early: ' ',
// 未打卡
absenceCount: ' ',
// 未签到签退
missedCount: ' ',
// 未提交日志
missingLogCount: ' ',
// 事假
personalLeave: ' ',
// 病假
sickLeave: ' ',
// 事假
personalLeave: ' ',
// 病假
sickLeave: ' ',
// 婚假
marriageLeave: ' ',
// 婚假
marriageLeave: ' ',
// 产假
maternityLeave: ' ',
// 陪产假
paternityLeave: ' ',
// 丧假
bereavementLeave: ' ',
// 年休假
annualLeave: ' ',
// 年休假(管理岗)
managementAnnualLeave: ' ',
// 节假日加班
holidayOvertime: ' ',
// 休息日加班
restdayOvertime: ' ',
// 工作日加班
workdayOvertime: ' '
// 产假
maternityLeave: ' ',
// 陪产假
paternityLeave: ' ',
// 丧假
bereavementLeave: ' ',
// 年休假
annualLeave: ' ',
// 年休假(管理岗)
managementAnnualLeave: ' ',
// 节假日加班
holidayOvertime: ' ',
// 休息日加班
restdayOvertime: ' ',
// 工作日加班
workdayOvertime: ' '
}]
};
},
onShow() {
this.getPerformanceAttendance();
this.$setNavigationBar('考勤管理');
},
methods: {
showDatePicker() {
this.showModal = true;
this.currentStep = 'year';
this.tempSelectedYear = this.selectedYear;
this.tempSelectedMonth = this.selectedMonth;
},
closeDatePicker() {
this.showModal = false;
this.currentStep = 'year';
},
selectYear(year) {
this.tempSelectedYear = year;
this.currentStep = 'month';
},
selectMonth(month) {
this.tempSelectedMonth = month;
this.selectedYear = this.tempSelectedYear;
this.selectedMonth = month;
this.showModal = false;
this.currentStep = 'year';
this.$emit('dateSelected', {
year: this.selectedYear,
month: this.selectedMonth
});
this.getPerformanceAttendance()
},
backToYearSelect() {
this.currentStep = 'year';
},
goSignIt(attendanceData) {
this.$navTo('/pages/sign/sign?id=' + attendanceData.id);
},
async getPerformanceAttendance() {
uni.showLoading({
mask: true,
title: '查询中...'
})
let res = await getPerformanceAttendanceApi(this.selectedYear, this.selectedMonth);
uni.hideLoading();
if (res.result.length) {
this.attendanceDataList = res.result;
} else {
uni.showModal({
title: '温馨提示',
content: '暂无相关数据',
showCancel: false,
confirmText: "确定",
success: function(res) {
if (res.confirm) {
uni.navigateBack({
delta: 1
});
}
}
});
}
}
};
},
created() {
this.getPerformanceAttendance();
this.$setNavigationBar('考勤管理');
},
methods: {
showDatePicker() {
this.showModal = true;
this.currentStep = 'year';
this.tempSelectedYear = this.selectedYear;
this.tempSelectedMonth = this.selectedMonth;
},
closeDatePicker() {
this.showModal = false;
this.currentStep = 'year';
},
selectYear(year) {
this.tempSelectedYear = year;
this.currentStep = 'month';
},
selectMonth(month) {
this.tempSelectedMonth = month;
this.selectedYear = this.tempSelectedYear;
this.selectedMonth = month;
this.showModal = false;
this.currentStep = 'year';
this.$emit('dateSelected', {
year: this.selectedYear,
month: this.selectedMonth
});
this.getPerformanceAttendance()
},
backToYearSelect() {
this.currentStep = 'year';
},
goSignIt() {
this.$navTo('/pages/sign/sign');
},
async getPerformanceAttendance() {
uni.showLoading({
mask: true,
title: '查询中...'
})
let res = await getPerformanceAttendanceApi(this.selectedYear, this.selectedMonth);
this.attendanceData = res.result;
uni.hideLoading();
}
}
};
};
</script>
<style lang="scss" scoped>
.attendance-page {
min-height: 100vh;
background-color: #f8f9fa;
padding: 0 30rpx 0 30rpx;
.attendance-page {
min-height: 100vh;
background-color: #f8f9fa;
padding: 0 30rpx 0 30rpx;
.month-selector {
padding: 0 28rpx 0 10rpx;
display: flex;
align-items: center;
margin: 40rpx 0;
justify-content: space-between;
.combination {
height: 40rpx;
line-height: 40rpx;
.month-selector {
padding: 0 28rpx 0 10rpx;
display: flex;
align-content: center;
.current-month {
align-items: center;
margin: 40rpx 0;
justify-content: space-between;
.combination {
height: 40rpx;
line-height: 40rpx;
display: flex;
align-content: center;
.current-month {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #4b5563;
}
.arrow {
transform: rotate(90deg);
width: 40rpx;
height: 40rpx;
}
}
.month-text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #4b5563;
}
.arrow {
transform: rotate(90deg);
width: 40rpx;
height: 40rpx;
color: #2b5ce4;
}
}
.month-text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #2b5ce4;
}
}
.stat-section {
background: #fff;
border-radius: 12rpx;
padding: 35rpx 40rpx;
margin-bottom: 20rpx;
.section-title {
font-size: 32rpx;
color: #111827;
}
.stat-grid {
margin-top: 40rpx;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 40rpx 90rpx;
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
.label {
font-size: 28rpx;
color: #4b5563;
margin-bottom: 15rpx;
}
.value {
font-size: 32rpx;
color: #666;
&.red-text {
color: #ff4d4f;
}
}
.box {
.title {
padding-bottom: 28rpx;
}
}
}
.bottom-tips {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #b9b9c2;
}
.sign {
margin-top: 32rpx;
margin-bottom: 180rpx;
.sign-tit {
margin-bottom: 32rpx;
margin-left: 8rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 700;
font-size: 28rpx;
color: #000000;
text {
padding-left: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #b9b9c2;
}
}
.signatureVersion {
width: 690rpx;
height: 280rpx;
background: #ffffff;
border-radius: 20rpx;
}
}
.stat-section {
background: #fff;
border-radius: 12rpx;
padding: 35rpx 40rpx;
margin-bottom: 20rpx;
.confirm-btn {
position: fixed;
bottom: 45rpx;
left: 20rpx;
right: 20rpx;
height: 78rpx;
background: #ffffff;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 30rpx;
color: #0078ff;
font-size: 32rpx;
border: 2rpx solid #0078ff;
}
.date-picker-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
.modal-content {
width: 690rpx;
background: #ffffff;
border-radius: 20rpx;
padding: 40rpx 30rpx;
.modal-title {
.section-title {
font-size: 32rpx;
color: #111827;
text-align: center;
margin-bottom: 40rpx;
font-weight: 500;
}
.year-grid {
.stat-grid {
margin-top: 40rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
grid-template-columns: repeat(3, 1fr);
gap: 40rpx 90rpx;
.year-item {
height: 88rpx;
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.year-circle {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
border: 2rpx solid #e5e7eb;
text {
font-size: 28rpx;
color: #4b5563;
}
.label {
font-size: 28rpx;
color: #4b5563;
margin-bottom: 15rpx;
}
&.active {
.year-circle {
background: #eef2ff;
border-color: #2b5ce4;
.value {
font-size: 32rpx;
color: #666;
text {
color: #2b5ce4;
}
&.red-text {
color: #ff4d4f;
}
}
}
}
}
.month-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
.bottom-tips {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #b9b9c2;
}
.month-item {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
.sign {
margin-top: 32rpx;
margin-bottom: 32rpx;
.sign-tit {
margin-bottom: 32rpx;
margin-left: 8rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 700;
font-size: 28rpx;
color: #000000;
text {
padding-left: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #b9b9c2;
}
}
.signatureVersion {
width: 690rpx;
height: 280rpx;
background: #ffffff;
border-radius: 20rpx;
}
}
.confirm-btn {
left: 20rpx;
right: 20rpx;
height: 78rpx;
margin-bottom: 40rpx;
background: #ffffff;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 30rpx;
color: #0078ff;
font-size: 32rpx;
border: 2rpx solid #0078ff;
}
.date-picker-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
.modal-content {
width: 690rpx;
background: #ffffff;
border-radius: 20rpx;
padding: 40rpx 30rpx;
.modal-title {
font-size: 32rpx;
color: #111827;
text-align: center;
margin-bottom: 40rpx;
font-weight: 500;
}
.year-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
.month-circle {
width: 100%;
height: 100%;
.year-item {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
border: 2rpx solid #e5e7eb;
.year-circle {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
border: 2rpx solid #e5e7eb;
text {
font-size: 28rpx;
color: #4b5563;
}
}
&.active {
.year-circle {
background: #eef2ff;
border-color: #2b5ce4;
text {
font-size: 28rpx;
color: #4b5563;
text {
color: #2b5ce4;
}
}
}
}
}
.month-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
.month-item {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
&.active {
.month-circle {
background: #eef2ff;
border-color: #2b5ce4;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
border: 2rpx solid #e5e7eb;
text {
color: #2b5ce4;
font-size: 28rpx;
color: #4b5563;
}
}
&.active {
.month-circle {
background: #eef2ff;
border-color: #2b5ce4;
text {
color: #2b5ce4;
}
}
}
}
}
}
.modal-footer {
margin-top: 30rpx;
display: flex;
justify-content: center;
.modal-footer {
margin-top: 30rpx;
display: flex;
justify-content: center;
.back-btn {
padding: 20rpx 40rpx;
font-size: 28rpx;
color: #2b5ce4;
background: #eef2ff;
border-radius: 8rpx;
.back-btn {
padding: 20rpx 40rpx;
font-size: 28rpx;
color: #2b5ce4;
background: #eef2ff;
border-radius: 8rpx;
}
}
}
}
.signImg {
width: 280rpx;
height: 690rpx;
transform-origin: left top;
transform: rotate(-90deg) translateX(-280rpx);
}
}
}
</style>
</style>