diff --git a/pages/attendanceStatus/attendanceStatistics.vue b/pages/attendanceStatus/attendanceStatistics.vue
index e31b584..1fa656f 100644
--- a/pages/attendanceStatus/attendanceStatistics.vue
+++ b/pages/attendanceStatus/attendanceStatistics.vue
@@ -32,16 +32,17 @@
-
+
+
+
{{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') :
""
}}
-
-
+
+
+
@@ -172,10 +173,12 @@
-
-
+
+
+ 📊
暂无考勤数据
请选择其他时间或服务区查看
+
@@ -200,7 +203,9 @@ export default {
attendanceStatisticsData: [],
isFirst: true,
seatInfo: {},
- loading: false
+ loading: false,
+ hasLoaded: false, // 是否已经完成过初始加载
+ retryCount: 0
}
},
onLoad() {
@@ -224,6 +229,19 @@ export default {
return name ? name.charAt(0).toUpperCase() : '?'
},
+ // 重试加载
+ retryLoad() {
+ if (this.retryCount < 3) {
+ this.retryCount++
+ this.handleGetData(this.serviceInfo.SERVERPART_NAME)
+ } else {
+ uni.showToast({
+ title: '多次重试失败,请检查网络连接',
+ icon: 'none'
+ })
+ }
+ },
+
// 格式化时长(分钟转小时分钟)
formatDuration(minutes) {
if (!minutes || minutes <= 0) return ''
@@ -286,7 +304,11 @@ export default {
"content-type": "application/x-www-form-urlencoded",
},
success(res) {
- resolve(res.data.data)
+ if (res.data && res.data.data) {
+ resolve(res.data.data)
+ } else {
+ reject(new Error('数据格式错误'))
+ }
},
fail(err) {
reject(err)
@@ -303,7 +325,7 @@ export default {
})
}
this.attendanceStatisticsData = list
- console.log('最终数据:', this.attendanceStatisticsData)
+ this.hasLoaded = true // 标记已完成加载
} catch (error) {
console.error('获取考勤数据失败:', error)
uni.showToast({
@@ -359,7 +381,7 @@ export default {
},
// 修改日期
async handleChangeDate(type) {
- this.attendanceStatisticsData = []
+ // 月份切换时不清空数据,保持当前显示直到新数据加载完成
// type 1 加一天 2 减一天
// 兼容 iOS,把 2025-08-15 转成 2025/08/15
const cur = new Date((this.selectDate || '').replace(/-/g, '/'));
@@ -376,6 +398,7 @@ export default {
const d = String(last.getDate()).padStart(2, '0');
this.selectDate = `${y}-${m}-${d}`;
+ this.retryCount = 0 // 重置重试次数
await this.handleGetData(this.serviceInfo.SERVERPART_NAME)
},
}
@@ -509,9 +532,19 @@ export default {
// border: 2rpx solid #27B35F;
// background: rgba(255, 255, 255, .15);
- .arrowIcon {
- width: 40rpx;
- height: 40rpx;
+ .arrowBtn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ // background: rgba(39, 178, 95, 0.1);
+
+ .arrowIcon {
+ width: 40rpx;
+ height: 40rpx;
+ }
}
.center {
@@ -740,7 +773,6 @@ export default {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
- // gap: 24rpx 16rpx;
.statItem {
display: flex;
@@ -870,26 +902,45 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
- padding: 120rpx 40rpx;
+ padding: 80rpx 40rpx;
+ text-align: center;
+ background: #fff;
+ border-radius: 16rpx;
+ margin-bottom: 32rpx;
+ box-shadow: @shadow;
.emptyIcon {
- width: 120rpx;
- height: 120rpx;
- margin-bottom: 32rpx;
+ font-size: 80rpx;
+ margin-bottom: 24rpx;
opacity: 0.6;
}
.emptyText {
font-size: 32rpx;
- color: @muted;
+ color: #2c3e50;
+ font-weight: 600;
margin-bottom: 16rpx;
}
.emptyDesc {
font-size: 24rpx;
- color: #bbb;
- text-align: center;
+ color: #666;
line-height: 1.5;
+ margin-bottom: 32rpx;
+ }
+
+ .retryBtn {
+ background: @primary;
+ color: #fff;
+ border: none;
+ border-radius: 24rpx;
+ padding: 16rpx 32rpx;
+ font-size: 24rpx;
+ font-weight: 600;
+
+ &::after {
+ border: none;
+ }
}
}
}
diff --git a/pages/attendanceStatus/roster.vue b/pages/attendanceStatus/roster.vue
index 40bd60a..63cf732 100644
--- a/pages/attendanceStatus/roster.vue
+++ b/pages/attendanceStatus/roster.vue
@@ -27,16 +27,17 @@
-
+
+
+
{{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') :
""
- }}
-
+ }}
+
+
+
-
@@ -61,14 +62,41 @@
- {{ selectedEmployee.userName }}
- {{ selectedEmployee.psnJob }}
-
- {{ selectedEmployee.phone }}
+ {{ getFirstChar(selectedEmployee.userName) }}
+
+
+
+ {{ selectedEmployee.userName || '-' }}
+
+
+
+
+ {{ selectedEmployee.phone || '-' }}
+
+
+
+ {{ selectedEmployee.psnJob }}
+
+
+
+
+ 📋
+ 暂无员工数据
+ 请检查服务区设置或联系管理员
+
+
+
+
+
+ 📅
+ 暂无排班数据
+ 该员工在当前月份暂无排班安排
+
+