This commit is contained in:
hezhidong
2025-04-23 18:00:35 +08:00
parent 44cba1950d
commit d2c8a95723
6 changed files with 609 additions and 459 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
const baseUrl = "http://192.168.31.166:8189"
// const baseUrl = "http://192.168.31.166:8188"
// 肖兴越开发环境
const baseUrl = "https://paystubs.vip.cpolar.top"
export default baseUrl
+18 -12
View File
@@ -1,25 +1,31 @@
/*首页*/
import { request } from "./index.js";
import { request, requestLogin } from "./index.js";
// 登录
export function getToken(code){
return request({
method: "get",
url: "/user/getToken",
export function getToken(authCode){
return requestLogin({
method: "GET",
url: `/login?code=${authCode}`,
data: {
code
},
Header1: {
}
})
}
// 创建工单
export function postCreatOrder(data){
// 获取用户信息
export function getUser(authCode){
return request({
method: "post",
url: "creatOrder/add",
data
method: "get",
url: "/user",
data: {
},
})
}
// 获取绩效考勤统计
export function getPerformanceAttendanceApi(year,month){
return request({
method: "get",
url: `/performance/attendance/detail/${year}/${month}`,
})
}
+81 -11
View File
@@ -1,31 +1,101 @@
// const baseUrl = "https://pandamimi.lzyyj.com/prod-api";
// const baseUrl = "http://192.168.31.121:9221";
import baseUrl from "./baseUrl.js"
import allUrl from "./baseUrl.js"
// const baseUrl = bootUrl
export function request ( optaions ) {
let { url, method, data, header1 } = optaions
method = method || "GET"
data = data || {}
let newData = {}
for( let key in data){
if( data[key] !== null && data[key] !== ''){
newData[key] = data[key]
}
}
data = newData || {}
header1 = header1 || {
Authorization: uni.getStorageSync('token')
Authorization: 'Bearer ' + uni.getStorageSync('token')
}
// console.log(com.getCacheToken("userInfo").token)
return new Promise((reslove,reject)=>{
uni.request({
url: baseUrl + url,
url: allUrl + url,
method,
header: header1,
data,
success: (res) => {
if(res.data.code == 401 ){
uni.showToast({ title: '登录已失效,重新登录!', icon: 'none' });
if(res.data.errcode == 401 ){
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
uni.removeStorageSync('userInfo');
uni.removeStorageSync('token');
setTimeout(()=>{
uni.navigateTo({ url: '/pages/user/login' });
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
}, 1000);
}else if(res.data.code != 200){
}else if(res.data.errcode != 0){
console.log('不正确走的')
reject(res)
uni.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 });
}else {
reslove(res.data)
}
},
fail: (err) => {
console.log('请求失败',err)
uni.hideLoading()
if(err.statusCode == 401 ){
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
uni.removeStorageSync('userInfo');
uni.removeStorageSync('token');
setTimeout(()=>{
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
}, 1000);
}
if(err.data.errcode == 401 ){
uni.showToast({ title: '登录已失效,即将重新登录!', icon: 'none' });
uni.removeStorageSync('userInfo');
uni.removeStorageSync('token');
setTimeout(()=>{
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
}, 1000);
}else{
uni.showToast({ title: err.data.errmsg, icon: 'none' });
}
reject()
},
complete: () => {
setTimeout(()=>{
uni.hideLoading()
}, 2000)
}
})
})
}
export function requestLogin ( optaions ) {
let { url, method, data } = optaions
method = method || "GET"
data = data || {}
let newData = {}
for( let key in data){
if( data[key] !== null && data[key] !== ''){
newData[key] = data[key]
}
}
data = newData || {}
return new Promise((reslove,reject)=>{
uni.request({
url: allUrl + url,
method,
data,
success: (res) => {
if(res.statusCode == 401 ){
uni.showToast({ title: '登录已失效,即将返回首页!', icon: 'none' });
uni.removeStorageSync('userInfo');
uni.removeStorageSync('token');
setTimeout(()=>{
uni.reLaunch({ url: '/pages/newHomePage/newHomePage' });
}, 1000);
}else if(res.statusCode != 200){
reject(res)
uni.showToast({ title: res.data.msg, icon: 'none', duration: 2000 });
}else {
@@ -41,4 +111,4 @@ export function request ( optaions ) {
}
})
})
}
}
+28 -13
View File
@@ -2,7 +2,7 @@ import App from './App'
import Inputli from './components/form/input-li.vue';
import Selectli from './components/form/select-li.vue';
import Dateli from './components/form/date-li.vue';
import { getToken } from './api/create.js'
import { getToken,getUser } from './api/create.js'
import { formatDate, calculator } from './com/index.js'
// #ifndef VUE3
@@ -33,23 +33,38 @@ const navTo = (url, skip = 'navigateTo') =>{
url
});
}
const login = () =>{
return new Promise((reslove,reject)=>{
const login = () => {
// uni.showLoading({
// mask: true,
// title: '登录中...'
// })
return new Promise((reslove, reject) => {
uni.getAuthCode({
success:(user)=>{
console.log(user)
getToken(user.authCode).then((res)=>{
if(res){
reslove(res.data)
console.log(res.data)
success: (user) => {
getToken(user.authCode).then((res) => {
if (res.errcode == 0) {
uni.setStorageSync('token', res.result.token)
getUser().then(data => {
console.log(data)
uni.setStorageSync('user',data)
uni.hideLoading()
// uni.showToast({
// title: '登录成功',
// icon: 'success'
// })
})
reslove(res)
}
}).catch(err =>{
reject(err)
}).catch(err => {
uni.showToast({
title: '登录失败,服务器出错了',
icon: 'error'
})
})
},
})
})
}
// 提示框 点击确定进入resolve 取消进入reject
const showModel = (content) =>{
@@ -72,7 +87,7 @@ const showModel = (content) =>{
})
}
Vue.prototype.$navTo = navTo // 页面跳转
Vue.prototype.$navTo = navTo //
Vue.prototype.$msg = msg
Vue.prototype.$setNavigationBar = setNavigationBar
Vue.prototype.$login = login
@@ -1,469 +1,516 @@
<template>
<view class="attendance-page">
<!-- 月份选择 -->
<view class="month-selector" @click="showDatePicker">
<view class="combination">
<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="attendance-page">
<!-- 月份选择 -->
<view class="month-selector" @click="showDatePicker">
<view class="combination">
<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="stat-section">
<view class="section-title">打卡统计</view>
<view class="stat-grid">
<view class="stat-item">
<text class="label">迟到</text>
<text class="value red-text">4</text>
</view>
<view class="stat-item">
<text class="label">严重迟到</text>
<text class="value red-text">3</text>
</view>
<view class="stat-item">
<text class="label">旷工迟到</text>
<text class="value">0</text>
</view>
<view class="stat-item">
<text class="label">早退</text>
<text class="value red-text">1</text>
</view>
<view class="stat-item">
<text class="label">未打卡</text>
<text class="value red-text">2</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>
<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">4</text>
</view>
<view class="stat-item">
<text class="label">病假</text>
<text class="value red-text">3</text>
</view>
<view class="stat-item">
<text class="label">婚假</text>
<text class="value">0</text>
</view>
<view class="stat-item">
<text class="label">产假</text>
<text class="value red-text">1</text>
</view>
<view class="stat-item">
<text class="label">陪产假</text>
<text class="value red-text">2</text>
</view>
<view class="stat-item">
<text class="label">丧假</text>
<text class="value red-text">2</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.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">4</text>
</view>
<view class="stat-item">
<text class="label">休息日加班</text>
<text class="value red-text">3</text>
</view>
<view class="stat-item">
<text class="label">工作日加班</text>
<text class="value">0</text>
</view>
<view class="stat-item">
<!-- 加班调休统计 -->
<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>
<text class="value red-text">1小时</text>
</view> -->
</view>
</view>
<!-- 底部说明 -->
<view class="bottom-tips">说明请核实当月考勤记录确认无误请签字确认</view>
<!-- 底部说明 -->
<view class="bottom-tips">说明请核实当月考勤记录确认无误请签字确认</view>
<!-- 员工签字 -->
<!-- 员工签字 -->
<view class="sign">
<view class="sign-tit">
员工签字
<text>/保留员工签字</text>
</view>
<view class="sign">
<view class="sign-tit">
员工签字
<text>/保留员工签字</text>
</view>
<view class="signatureVersion"></view>
</view>
<view class="signatureVersion"></view>
</view>
<!-- 签字确认按钮 -->
<view class="confirm-btn" @click="goSignIt"><text>签字确认</text></view>
<!-- 签字确认按钮 -->
<view class="confirm-btn" @click="goSignIt"><text>签字确认</text></view>
<!-- 日期选择模态框 -->
<view class="date-picker-modal" v-if="showModal" @click.stop="closeDatePicker">
<view class="modal-content" @click.stop>
<view class="modal-title">{{
currentStep === "year" ? "选择年份" : "选择月份"
}}</view>
<!-- 日期选择模态框 -->
<view class="date-picker-modal" v-if="showModal" @click.stop="closeDatePicker">
<view class="modal-content" @click.stop>
<view class="modal-title">{{ currentStep === 'year' ? '选择年份' : '选择月份' }}</view>
<!-- 年份选择 -->
<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 class="year-circle">
<text>{{ year }}</text>
</view>
</view>
</view>
<!-- 年份选择 -->
<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 class="year-circle">
<text>{{ year }}</text>
</view>
</view>
</view>
<!-- 月份选择 -->
<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 class="month-circle">
<text
>{{ tempSelectedYear }}{{ month < 10 ? "0" + month : month }}</text
>
</view>
</view>
</view>
<!-- 月份选择 -->
<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 class="month-circle">
<text>{{ tempSelectedYear }}{{ month < 10 ? '0' + month : month }}</text>
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="modal-footer" v-if="currentStep === 'month'">
<view class="back-btn" @click="backToYearSelect">返回年份选择</view>
</view>
</view>
</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() + 1,
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),
};
},
created() {
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,
});
console.log("选择月份触发");
},
backToYearSelect() {
this.currentStep = "year";
},
goSignIt(){
this.$navTo('/pages/sign/sign');
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: ' ',
// 事假
personalLeave: ' ',
// 病假
sickLeave: ' ',
// 婚假
marriageLeave: ' ',
// 产假
maternityLeave: ' ',
// 陪产假
paternityLeave: ' ',
// 丧假
bereavementLeave: ' ',
// 年休假
annualLeave: ' ',
// 年休假(管理岗)
managementAnnualLeave: ' ',
// 节假日加班
holidayOvertime: ' ',
// 休息日加班
restdayOvertime: ' ',
// 工作日加班
workdayOvertime: ' '
}
};
},
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;
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;
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;
}
.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;
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;
}
}
.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: #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-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-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;
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
.label {
font-size: 28rpx;
color: #4b5563;
margin-bottom: 15rpx;
}
.label {
font-size: 28rpx;
color: #4b5563;
margin-bottom: 15rpx;
}
.value {
font-size: 32rpx;
color: #666;
&.red-text {
color: #ff4d4f;
}
}
}
}
}
.value {
font-size: 32rpx;
color: #666;
&.red-text {
color: #ff4d4f;
}
}
}
}
}
.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;
}
}
.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;
}
}
.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;
}
.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;
.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-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;
}
.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;
.year-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
.year-item {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
.year-item {
height: 88rpx;
display: flex;
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;
.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;
}
}
text {
font-size: 28rpx;
color: #4b5563;
}
}
&.active {
.year-circle {
background: #eef2ff;
border-color: #2b5ce4;
&.active {
.year-circle {
background: #eef2ff;
border-color: #2b5ce4;
text {
color: #2b5ce4;
}
}
}
}
}
text {
color: #2b5ce4;
}
}
}
}
}
.month-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
padding: 0 20rpx;
.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;
.month-item {
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
.month-circle {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
border: 2rpx solid #e5e7eb;
.month-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;
}
}
text {
font-size: 28rpx;
color: #4b5563;
}
}
&.active {
.month-circle {
background: #eef2ff;
border-color: #2b5ce4;
&.active {
.month-circle {
background: #eef2ff;
border-color: #2b5ce4;
text {
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;
}
}
}
}
}
</style>
+17 -5
View File
@@ -10,7 +10,7 @@
<view class="right"><text class="blue-text">月度考勤</text></view>
</view>
<view class="section-content" style="display: flex; justify-content: space-between; align-items: center">
<text class="title">{{ selectedYear }}{{ selectedMonth < 10 ? '0' + selectedMonth : selectedMonth }}月考勤统计</text>
<text class="title">{{ thisYear }}{{ thisMonth }}月考勤统计</text>
<view class="combination" @click="viewDetails">
<text class="detail">查看详情</text>
<image class="icon" src="/static/arr.png" mode="aspectFit"></image>
@@ -71,24 +71,35 @@
</template>
<script>
export default {
data() {
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
return {
// 今年
thisYear:'',
// 今月
thisMonth:'',
showModal: false,
currentYear,
selectedYear: currentYear,
selectedMonth: currentDate.getMonth() + 1,
selectedMonth: currentDate.getMonth(),
months: Array.from({ length: 12 }, (_, i) => i + 1),
currentStep: 'year',
tempSelectedYear: currentYear,
tempSelectedMonth: currentDate.getMonth() + 1,
tempSelectedMonth: currentDate.getMonth(),
availableYears: Array.from({ length: 7 }, (_, i) => currentYear - 3 + i)
};
},
created() {
async created() {
this.thisYear = this.selectedYear
this.thisMonth = this.selectedMonth
this.$setNavigationBar('人资系统');
if (uni.getStorageSync('token')) {
} else {
let a = await this.$login();
}
},
methods: {
showDatePicker() {
@@ -126,7 +137,8 @@ export default {
},
viewSalaryDetails(){
this.$navTo('/pages/salaryDetails/salaryDetails');
}
},
}
};
</script>