This commit is contained in:
xyc 2025-08-25 13:46:36 +08:00
parent bea8eea449
commit 3c71424ed7
4 changed files with 132 additions and 107 deletions

View File

@ -6,25 +6,21 @@
<!-- 头像 -->
<view class="management-title-left" @click="showUserDetail">
<view class="management-title-left-icon">
<image :key="customerInfo.avatar" v-if="null!=customerInfo && null!=customerInfo.avatar"
:src="imageUrl+customerInfo.avatar" mode="scaleToFill"></image>
<image v-else src="../../static/icons/avatar.png" mode="scaleToFill"></image>
<image v-if="customerInfo && customerInfo.avatar" :src="imageUrl+customerInfo.avatar"
mode="aspectFill"></image>
<image v-else src="../../static/icons/avatar.png" mode="aspectFill"></image>
</view>
<view class="management-title-left-text">
<view class="management-title-left-text">
<!-- 名称 -->
<view class="text-top">
{{loginTitle}}工作台
</view>
<view class="text-top">{{loginTitle}}工作台</view>
<!-- 姓名-->
<view class="text-bottom" :key="customerInfo.nickname"
v-if="null!=customerInfo && customerInfo.nickname">
<view class="text-bottom" v-if="customerInfo && customerInfo.nickname">
{{ customerInfo.nickname }}
</view>
<view v-if="null!=customerInfo && customerInfo.roleNames && showRoleNames" class="text-bottom">
<view v-if="customerInfo && customerInfo.roleNames && showRoleNames" class="text-bottom">
{{customerInfo.roleNames}}
</view>
</view>
@ -32,10 +28,9 @@
<!-- 消息 -->
<view class="management-title-right" @click='gotoMsg'>
<view class="management-title-right-icon">
<image src="/static/imgs/xiaoxi.png" mode="scaleToFill"></image>
<view class="msg-num">{{noReadNum}}</view>
<image src="/static/imgs/xiaoxi.png" mode="aspectFit"></image>
<view class="msg-num" v-if="noReadNum > 0">{{noReadNum}}</view>
</view>
<view class="management-title-right-text">消息</view>
</view>
@ -53,8 +48,8 @@
export default {
props: {
loginTitle: {
type: String, //
default: '默认标题' //
type: String,
default: '默认标题'
},
noReadNum: {
type: Number,
@ -88,10 +83,8 @@
setUserInfo(res.data.user)
})
}
const staffInfo = getUserInfo();
this.customerInfo = staffInfo || {};
console
.log('用户信息加载成功', getUserInfo());
this.customerInfo = getUserInfo() || {};
console.log('用户信息加载成功', this.customerInfo);
} catch (e) {
console.error('加载用户信息失败:', e);
this.customerInfo = {
@ -122,6 +115,7 @@
align-items: center;
color: white;
background: linear-gradient(180deg, #054DF3 0%, #55A3FF 100%);
}
.management-title-class {
padding: 0 32rpx;
@ -130,10 +124,12 @@
display: flex;
align-items: center;
justify-content: space-between;
}
.management-title-left {
display: flex;
align-items: center;
}
.management-title-left-icon {
width: 90rpx;
@ -144,16 +140,21 @@
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
/* 保证圆形头像内不溢出 */
}
image {
.management-title-left-icon image {
width: 100%;
height: 100%;
border-radius: 50%;
}
object-fit: cover;
/* H5 有效,小程序用 mode=aspectFill */
}
.management-title-left-text {
padding-top: 20rpx;
}
.text-top {
font-weight: 400;
@ -167,13 +168,12 @@
font-size: 16px;
color: #FFFFFF;
}
}
}
.management-title-right {
display: flex;
flex-direction: column;
align-items: center;
}
.management-title-right-icon {
width: 50rpx;
@ -183,15 +183,19 @@
display: flex;
align-items: center;
justify-content: center;
}
image {
.management-title-right-icon image {
width: 100%;
height: 100%;
object-fit: contain;
/* 保持比例 */
}
.msg-num {
position: absolute;
right: -15rpx;
top: -15rpx;
color: white;
background: #d74a43;
width: 35rpx;
@ -201,8 +205,6 @@
font-weight: 800;
font-size: 11px;
border-radius: 50%;
top: -15rpx;
}
}
.management-title-right-text {
@ -210,7 +212,4 @@
font-size: 24rpx;
color: #FFFFFF;
}
}
}
}
</style>

View File

@ -262,22 +262,16 @@
uni.redirectTo({
url: '/pages/staff/staff'
})
return
}
if (this.shopinfo == 3 || this.shopinfo == 4) {
uni.showLoading({
title: '加载中'
});
uni.setStorageSync('roleSelect', 'businessManager')
uni.redirectTo({
url: '/pages/businessManager/businessManager'
})
return
}
if (this.shopinfo == 1) {
uni.showLoading({
title: '加载中'
});
request({
url: '/rescue/getJcgfInfo',
method: 'get',

View File

@ -25,7 +25,7 @@
<text style="color: red;">*</text>
汇报内容
</view>
<u--textarea v-model="report.reportContent" placeholder="请输入内容"></u--textarea>
<textarea maxlength="-1" auto-height v-model="report.reportContent" placeholder="请输入内容"></textarea>
<view class="x_"></view>
<view class="d_b" @click="handleUpload">
<view class="">附件</view>

View File

@ -32,6 +32,17 @@
</uni-datetime-picker>
</view>
<view class="user_box">
<view class="user_left">
<view class="user_name">总计</view>
</view>
<view class="user_right">
<view class="user_kar" v-for="(item,index) in allCounts" :key="index">
<view class="">{{ item.projectName }}</view>
<view class="num_">{{ item.total }}</view>
</view>
</view>
</view>
<!-- 循环 -->
<view class="user_box" v-for="(items,index) in List" :key="index">
<view class="user_left" @click="goDetail(items)">
@ -84,6 +95,7 @@
mode: 'range',
titles: "员工统计",
List: [],
allCounts: [],
selectList: [],
useSelectList: [],
status: "loading",
@ -132,6 +144,7 @@
}).then((res) => {
this.$nextTick(() => {
this.List = res.data;
this.allCounts = this.summarizeByProjectName(res.data);
});
});
}, // 1 01
@ -172,6 +185,25 @@
pad(num) {
return num.toString().padStart(2, "0");
},
summarizeByProjectName(data) {
const result = {};
data.forEach(user => {
user.children.forEach(item => {
const name = item.projectName || '未知项目';
const count = item.count || 0;
result[name] = (result[name] || 0) + count;
});
});
//
return Object.entries(result)
.map(([projectName, total]) => ({
projectName,
total
}))
.sort((a, b) => b.total - a.total);
},
//
getInspectionProject() {
request({