Commit de3d35c0 authored by 刘杰's avatar 刘杰

企业微信前端

parent 409a876c
<template>
<view class="daily-report">
<!-- 顶部统计 -->
<view class="report-stats">
<view class="stat-item" @click="selectReport('submit')">
<text class="number" style="color: #52c41a;">
{{ searchDatas.submitted }}
<text class="unit" style="color: #52c41a;"></text>
</text>
<text class="label">已提交</text>
</view>
<view class="stat-item" @click="selectReport('unSubmit')">
<text class="number" style="color: #ff4d4f;">
{{ searchDatas.unSubmitted }}
<text class="unit" style="color: #ff4d4f;"></text>
</text>
<text class="label">未提交</text>
</view>
<view class="stat-item" @click="selectReport('all')">
<text class="number" style="color: #1890ff;">{{ searchDatas.total }}
<text class="unit" style="color: #1890ff;"></text></text>
<text class="label">总人数</text>
</view>
</view>
<!-- 日报列表 -->
<scroll-view class="report-list" scroll-y :style="{ height: '80vh' }">
<view class="report-card" v-for="(report, index) in dailyReportList" :key="index">
<view class="card-header">
<view class="left">
<text class="name">{{ report.reporter }}</text>
<text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status==='submitted' ? '已提交' : '未提交' }}
</text>
</view>
<text class="time">{{ report.date || '-' }}</text>
</view>
<view class="card-content" v-if="report.status==='submitted'">
<view class="work-item">
<view class="work-header">
<text class="work-title">今日重点工作</text>
</view>
<view class="work-content">{{ report.todayWork }}</view>
</view>
<view class="work-item">
<view class="work-header">
<text class="work-title">本周重点工作</text>
</view>
<view class="work-content">{{ report.weekWork }}</view>
</view>
</view>
</view>
<view style="height: 10vh;"></view>
</scroll-view>
</view>
</template>
<script>
import {
selectDailyReport
} from '../../api/apiList'
import {
formatGMT
} from '../../utils/util'
export default {
data() {
return {
searchStatus: "all",
staffCode: "",
staffKind: "",
searchDatas: {},
commonName: "",
dailyReportList: []
}
},
mounted() {
this.initData()
},
onPullDownRefresh: function() {
console.log("下拉刷新")
this.onReload()
},
methods: {
selectReport(status) {
this.searchStatus = status
this.dailyReportList = []
this.initData()
},
initData() {
this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind');
this.commonName = uni.getStorageSync('commonName');
console.log("this.staffCode"+this.staffCode)
console.log("this.staffKind"+this.staffKind)
console.log("this.commonName"+this.commonName)
console.log('获取到的commonName:', this.commonName);
if (!this.staffCode || !this.staffKind) {
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
});
return;
}
const data = {
aux: {
staffCode: this.staffCode,
staffKind: this.staffKind,
searchStatus: this.searchStatus
}
}
uni.showLoading({
title: '加载中...',
});
selectDailyReport(data).then(res => {
uni.stopPullDownRefresh();
const data = res.data.data;
this.searchDatas = data;
this.dailyReportList = this.searchDatas.dailyReportList
}).catch(err => {
console.error('获取日报数据失败:', err);
uni.showToast({
title: '获取数据失败',
icon: 'none'
});
}).finally(() => {
uni.hideLoading();
});
},
onReload() {
this.initData()
}
}
}
</script>
<style lang="scss">
html, body {
height: 100%; /* 确保 html 和 body 高度为 100% */
margin: 0; /* 去掉默认的 margin */
overflow: hidden; /* 禁用滚动条 */
}
.daily-report {
padding: 15px;
background: #f5f7fa;
min-height: 90vh;
.report-stats {
// position: fixed;
display: flex;
justify-content: space-around;
background: #fff;
padding: 20px 15px;
border-radius: 8px;
margin-bottom: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
.stat-item {
text-align: center;
padding: 15px 24px;
background: #f9f9f9;
border-radius: 6px;
transition: background 0.3s, transform 0.3s;
/* 添加过渡效果 */
&:hover {
background: #e6f7ff;
/* 鼠标悬停时的背景色 */
transform: scale(1.05);
/* 鼠标悬停时的放大效果 */
}
.number {
display: block;
font-size: 28px;
font-weight: bold;
color: #333;
margin-bottom: 8px;
.unit {
font-size: 12px;
color: #999;
margin-left: 5px;
}
}
.label {
font-size: 14px;
color: #999;
}
}
}
.report-list {
.report-card {
display: block;
background: #fff;
border-radius: 8px;
padding: 15px;
margin-top: 15px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
&:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.left {
display: flex;
align-items: center;
gap: 10px;
.name {
font-size: 16px;
font-weight: bold;
color: #333;
position: relative;
padding-left: 12px;
&:before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 16px;
background: #1890ff;
border-radius: 2px;
}
}
.status {
padding: 4px 12px;
border-radius: 10px;
font-size: 12px;
&.submitted {
background: rgba(82, 196, 26, 0.1);
color: #52c41a;
border: 1px solid rgba(82, 196, 26, 0.2);
}
&.unSubmitted {
background: rgba(255, 77, 79, 0.1);
color: #ff4d4f;
border: 1px solid rgba(255, 77, 79, 0.2);
}
}
}
.time {
font-size: 14px;
color: #999;
}
}
.card-content {
.work-item {
display: block;
border-top: 1px solid #f0f0f0;
padding-top: 10px;
margin-bottom: 10px;
.work-header {
display: flex;
align-items: center;
margin-bottom: 8px;
position: relative;
padding-left: 12px;
&:before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 14px;
background: #1890ff;
opacity: 1;
border-radius: 1.5px;
}
}
.work-title {
font-size: 14px;
color: #333;
font-weight: 500;
}
.work-content {
font-size: 14px;
color: #666;
line-height: 1.6;
padding: 12px 15px;
background: #fafafa;
border-radius: 4px;
white-space: pre-wrap;
word-break: break-all;
text-align: justify;
}
}
}
}
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment