更新
This commit is contained in:
parent
bea8eea449
commit
3c71424ed7
@ -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,95 +115,101 @@
|
||||
align-items: center;
|
||||
color: white;
|
||||
background: linear-gradient(180deg, #054DF3 0%, #55A3FF 100%);
|
||||
}
|
||||
|
||||
.management-title-class {
|
||||
padding: 0 32rpx;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.management-title-class {
|
||||
padding: 0 32rpx;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.management-title-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.management-title-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.management-title-left-icon {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
background-color: white;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.management-title-left-icon {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
background-color: white;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
/* 保证圆形头像内不溢出 */
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
.management-title-left-text {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.text-top {
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.text-top {
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.text-bottom {
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
.text-bottom {
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.management-title-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.management-title-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.management-title-right-icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-bottom: 10rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.management-title-right-icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-bottom: 10rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.management-title-right-icon image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
/* 保持比例 */
|
||||
}
|
||||
|
||||
.msg-num {
|
||||
position: absolute;
|
||||
right: -15rpx;
|
||||
color: white;
|
||||
background: #d74a43;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
line-height: 35rpx;
|
||||
text-align: center;
|
||||
font-weight: 800;
|
||||
font-size: 11px;
|
||||
border-radius: 50%;
|
||||
top: -15rpx;
|
||||
}
|
||||
}
|
||||
.msg-num {
|
||||
position: absolute;
|
||||
right: -15rpx;
|
||||
top: -15rpx;
|
||||
color: white;
|
||||
background: #d74a43;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
line-height: 35rpx;
|
||||
text-align: center;
|
||||
font-weight: 800;
|
||||
font-size: 11px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.management-title-right-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
.management-title-right-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
</style>
|
@ -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',
|
||||
|
@ -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>
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user