detection-business/pages/index/countEmployees.vue

327 lines
6.9 KiB
Vue
Raw Normal View History

2025-02-21 15:03:52 +08:00
<template>
2025-04-30 15:05:20 +08:00
<view class="">
<headersVue :titles="titles">
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
</headersVue>
<view class="content">
2025-05-30 16:54:55 +08:00
<view style="margin-top: 20rpx">
<uni-datetime-picker
v-model="queryParams.datetimeRange"
type="daterange"
rangeSeparator="至"
@change ="getStaffCount"
/>
</view>
2025-04-30 15:05:20 +08:00
<!-- 顶部选择区域 -->
2025-05-07 16:06:58 +08:00
<!-- <view class="top_">
2025-04-30 15:05:20 +08:00
<view class="select-container" @click="showDropdown">
<view class="select-text">
{{ queryStr != null ? queryStr : '请选择工作内容' }}
</view>
<u-icon style="margin-left: 10rpx;" name="arrow-down" size="18" color="#8D90A6"></u-icon>
</view>
<u-icon v-if="queryStr" name="close-circle" color="#8D90A6" size="18" @click="clearSelection"></u-icon>
2025-05-07 16:06:58 +08:00
</view> -->
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
<!-- 列表区域 -->
<view class="list_">
<view class="list_title">
<view class="list_ds">
<view style="margin-right: 50px;">排名</view>
<view>员工</view>
</view>
<view>服务台次</view>
</view>
<view class="list_box" v-for="(item, index) in List" :key="index">
2025-05-13 13:16:32 +08:00
<view class="list_box_top" @click="goDetail(item)">
2025-04-30 15:05:20 +08:00
<view class="pm_" v-if="index != 0 && index != 2 && index != 1">{{ index + 1 }}</view>
<view class="pm_ one" v-if="index == 0">{{ index + 1 }}</view>
<view class="pm_ two" v-if="index == 1">{{ index + 1 }}</view>
<view class="pm_ three" v-if="index == 2">{{ index + 1 }}</view>
<view class="list_ds">
<view class="tx_">
<image v-if="item.avatar" style="border-radius: 50%"
:src="baseImageUrl + '/' + item.avatar" mode=""></image>
<image src="/static/imgs/touxiang.png" v-else mode=""></image>
</view>
<view>
<view>{{ item.nickname }}</view>
<view class="num_hui">{{ item.mobile }}</view>
</view>
</view>
<view>{{ item.totalCount }}</view>
</view>
<scroll-view class="scroll-wrap" scroll-x>
<view class="scroll-item" v-for="data in item.children" :key="data.projectName">
<view class="scroll-label">{{ data.projectName }}</view>
<view class="scroll-value">{{ data.count }}</view>
</view>
</scroll-view>
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
</view>
</view>
</view>
<!-- 选择器 -->
<u-picker :show="isShowScreen" :columns="[columns]" @cancel="handleCancel" keyName="projectName"
@confirm="submitScreen"></u-picker>
</view>
2025-02-21 15:03:52 +08:00
</template>
<script>
2025-04-30 15:05:20 +08:00
import headersVue from '../../components/header/headers.vue';
import request from "@/utils/request";
import config from "config";
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
export default {
data() {
return {
titles: "员工统计",
List: [],
selectList: [],
useSelectList: [],
show: false,
status: 'loading',
baseImageUrl: config.baseImageUrl,
isShowScreen: false,
columns: [],
queryParams: {},
queryStr: null,
};
},
components: {
headersVue,
},
onLoad() {
2025-06-06 10:46:40 +08:00
const now = new Date();
this.queryParams.datetimeRange = [
new Date(now.getFullYear(), now.getMonth(), 1).getTime(),
now.getTime()
];
this.getStaffCount();
2025-04-30 15:05:20 +08:00
this.getInspectionProject();
},
methods: {
// 获取员工统计
getStaffCount() {
request({
url: '/partnerOwn/partner/getStaffCount',
method: 'post',
data: this.queryParams,
}).then((res) => {
this.$nextTick(() => {
this.List = res.data;
});
});
},
// 获取工作内容列表
getInspectionProject() {
request({
url: '/inspection/dl-inspection-project/page',
method: 'get',
params: {
pageNo: 1,
pageSize: 10000,
},
}).then((res) => {
this.columns = res.data.records;
});
},
2025-05-13 13:16:32 +08:00
goDetail(data) {
uni.navigateTo({
url: `/pages/index/staffProjectList/staffProjectList?userId=${data.userId}`
})
},
2025-04-30 15:05:20 +08:00
// 显示下拉框
showDropdown() {
this.isShowScreen = true;
},
// 处理选择器确认事件
submitScreen(e) {
this.isShowScreen = false;
this.queryParams.id = e.value[0].id;
this.queryStr = e.value[0].projectName;
this.getStaffCount();
},
// 处理选择器取消事件
handleCancel() {
this.isShowScreen = false;
},
// 清除选择
clearSelection() {
this.queryParams.id = null;
this.queryStr = null;
this.getStaffCount();
},
},
};
2025-02-21 15:03:52 +08:00
</script>
<style scoped lang="scss">
2025-04-30 15:05:20 +08:00
.content {
background: #f7f8fc;
width: 100%;
padding-top: 200rpx;
}
.top_ {
width: 100%;
height: 104rpx;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 30rpx;
border-bottom: 1rpx solid #f5f5f5;
.select-container {
display: flex;
align-items: center;
flex: 1; // 让这个区域撑满可用空间
}
.select-text {
font-size: 28rpx;
color: #101a3e;
}
}
.list_ {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
}
.list_title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #101a3e;
box-sizing: border-box;
padding: 0 30rpx;
margin-bottom: 20rpx;
}
.list_ds {
display: flex;
align-items: center;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.list_box {
width: 100%;
background: #ffffff;
border-radius: 8rpx;
margin-bottom: 30rpx;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.list_box_top {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx 50rpx;
border-bottom: 2rpx solid #f5f5f5;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.list_box_bottom {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 50rpx;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.tx_ {
width: 90rpx;
height: 90rpx;
margin-right: 5px;
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
image {
width: 100%;
height: 100%;
}
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.num_hui {
font-size: 24rpx;
color: #8d90a6;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.text_ {
font-size: 28rpx;
color: #8d90a6;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.num_ {
font-size: 28rpx;
color: #101a3e;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.pm_ {
width: 40rpx;
height: 40rpx;
background: #327dfb;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 28rpx;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.one {
background: url(../../static/imgs/oneStaff.png);
width: 55rpx;
/* height: 156px; */
background-repeat: no-repeat;
background-size: cover;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.two {
background: url(../../static/imgs/twoStaff.png);
width: 55rpx;
/* height: 156px; */
background-repeat: no-repeat;
background-size: cover;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.three {
background: url(../../static/imgs/threeStaff.png);
width: 55rpx;
background-repeat: no-repeat;
background-size: cover;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.scroll-wrap {
display: flex;
flex-direction: row;
white-space: nowrap;
overflow-x: auto;
padding: 16rpx;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.scroll-item {
flex-shrink: 0;
display: inline-block;
border-radius: 12rpx;
padding: 12rpx 20rpx;
margin-right: 20rpx;
min-width: 180rpx;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.scroll-label {
font-size: 26rpx;
font-weight: 500;
color: #555;
}
2025-02-26 18:08:08 +08:00
2025-04-30 15:05:20 +08:00
.scroll-value {
font-size: 28rpx;
color: #000;
margin-top: 6rpx;
}
</style>