Update .gitignore
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/unpackage/
|
||||
unpackage/*
|
||||
unpackage
|
||||
.idea
|
||||
/node_modules/
|
||||
node_modules/*
|
||||
node_modules
|
||||
yarn.lock
|
65
pages/statistics/common/common.css
Normal file
@ -0,0 +1,65 @@
|
||||
body * {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
body {
|
||||
font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma,
|
||||
Arial, PingFang SC-Light, Microsoft YaHei;
|
||||
}
|
||||
button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid transparent;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
button:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.flex-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.flex-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.justify-start {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.justify-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.justify-evenly {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.justify-around {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.justify-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.align-start {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.align-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.align-end {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
65
pages/statistics/common/common.less
Normal file
@ -0,0 +1,65 @@
|
||||
body * {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
body {
|
||||
font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma,
|
||||
Arial, PingFang SC-Light, Microsoft YaHei;
|
||||
}
|
||||
button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid transparent;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
button:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.flex-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.flex-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.justify-start {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.justify-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.justify-evenly {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.justify-around {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.justify-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.align-start {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.align-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.align-end {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
65
pages/statistics/common/common.scss
Normal file
@ -0,0 +1,65 @@
|
||||
body * {
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
body {
|
||||
font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma,
|
||||
Arial, PingFang SC-Light, Microsoft YaHei;
|
||||
}
|
||||
button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid transparent;
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
button:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.flex-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.flex-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.justify-start {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.justify-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.justify-evenly {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.justify-around {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.justify-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.align-start {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.align-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.align-end {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
281
pages/statistics/staffStatistics.vue
Normal file
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<view class="staff-statistics-container">
|
||||
<!-- 头部区域 -->
|
||||
<view class="header">
|
||||
<view class="title-container">
|
||||
<text class="main-title">员工统计</text>
|
||||
<text class="sub-title">员工排名与项目统计</text>
|
||||
</view>
|
||||
<view class="trophy-container">
|
||||
<image src="/static/imgs/trophy.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 日期筛选区域 -->
|
||||
<view class="date-filter">
|
||||
<view class="date-tabs">
|
||||
<view class="tab active">本日</view>
|
||||
<view class="tab">本月</view>
|
||||
</view>
|
||||
<view class="date-range">
|
||||
<text>2022-09-23 ~ 2023-04-12</text>
|
||||
<image src="/static/imgs/arrow-down.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 员工列表区域 -->
|
||||
<view class="staff-list">
|
||||
<!-- 员工项 -->
|
||||
<view class="staff-item" v-for="(staff, index) in staffData" :key="index">
|
||||
<view class="staff-rank">
|
||||
<image :src="'/static/imgs/num' + (index + 1) + '.png'" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="staff-info">
|
||||
<image :src="staff.avatar" mode="aspectFit"></image>
|
||||
<view class="staff-name">
|
||||
<text>{{ staff.name }}</text>
|
||||
<text class="service-count">服务{{ staff.serviceCount }}次</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="staff-stats">
|
||||
<view class="stat-item" v-for="stat in staff.stats" :key="stat.name">
|
||||
<text class="stat-name">{{ stat.name }}</text>
|
||||
<text class="stat-value">{{ stat.value }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
staffData: [
|
||||
{
|
||||
name: '张三三',
|
||||
avatar: '/static/icons/avatar.png',
|
||||
serviceCount: 4,
|
||||
stats: [
|
||||
{ name: '收费录', value: 5 },
|
||||
{ name: '接车拍照', value: 0 },
|
||||
{ name: '上门接车', value: 0 },
|
||||
{ name: '还车拍照', value: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '何米有',
|
||||
avatar: '/static/icons/avatar.png',
|
||||
serviceCount: 4,
|
||||
stats: [
|
||||
{ name: '底检', value: 4 },
|
||||
{ name: '接车拍照', value: 0 },
|
||||
{ name: '上门接车', value: 0 },
|
||||
{ name: '还车拍照', value: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '晨虹剑',
|
||||
avatar: '/static/icons/avatar.png',
|
||||
serviceCount: 3,
|
||||
stats: [
|
||||
{ name: '动态', value: 3 },
|
||||
{ name: '安检', value: 3 },
|
||||
{ name: '上门接车', value: 0 },
|
||||
{ name: '还车拍照', value: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '晨虹剑',
|
||||
avatar: '/static/icons/avatar.png',
|
||||
serviceCount: 3,
|
||||
stats: [
|
||||
{ name: '报告总检', value: 3 },
|
||||
{ name: '接车拍照', value: 0 },
|
||||
{ name: '上门接车', value: 0 },
|
||||
{ name: '还车拍照', value: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '威尔康',
|
||||
avatar: '/static/icons/avatar.png',
|
||||
serviceCount: 2,
|
||||
stats: [
|
||||
{ name: '报告总检', value: 3 },
|
||||
{ name: '接车拍照', value: 0 },
|
||||
{ name: '上门接车', value: 0 },
|
||||
{ name: '还车拍照', value: 0 }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 可以添加日期切换、筛选等方法
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.staff-statistics-container {
|
||||
padding: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
background-color: #4a90e2;
|
||||
border-radius: 10rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 24rpx;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.trophy-container {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.trophy-container image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.date-filter {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: white;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.date-tabs {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 10rpx 20rpx;
|
||||
margin-right: 10rpx;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
background-color: #4a90e2;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.date-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.date-range image {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.staff-list {
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.staff-item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.staff-rank {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.staff-rank image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.staff-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.staff-info image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.staff-name {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.staff-name text {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.service-count {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
background-color: #f5f5f5;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.staff-stats {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-left: 30rpx;
|
||||
margin-bottom: 10rpx;
|
||||
min-width: 100rpx;
|
||||
}
|
||||
|
||||
.stat-name {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
BIN
pages/statistics/staffStatistics/assets/banner.png
Normal file
After Width: | Height: | Size: 273 KiB |
BIN
pages/statistics/staffStatistics/assets/icon_tap.png
Normal file
After Width: | Height: | Size: 501 B |
BIN
pages/statistics/staffStatistics/assets/name.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
pages/statistics/staffStatistics/assets/top1.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
pages/statistics/staffStatistics/assets/top2.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
pages/statistics/staffStatistics/assets/top3.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
434
pages/statistics/staffStatistics/index.vue
Normal file
@ -0,0 +1,434 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="top_">
|
||||
<view class="icon_" @click="goBack()">
|
||||
<u-icon name="arrow-left" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view class="top_img">
|
||||
<image src="./assets/name.png" mode=""></image>
|
||||
<view class="top_i_text">员工排名与项目统计</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="cont_box">
|
||||
<view class="cont_top">
|
||||
<view class="ds_">
|
||||
<view class="tap_text" :class="{'acv':tapIndex == index}" v-for="(item,index) in tapList"
|
||||
:key="index" @click="tapIcon(index)">
|
||||
<view class="">{{item.label || "无"}}</view>
|
||||
<view class="tap_img" v-show="tapIndex == index">
|
||||
<image src="./assets/icon_tap.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-datetime-picker v-model="queryParams.datetimeRange" type="daterange" rangeSeparator="至"
|
||||
@change="getStaffCount" class="">
|
||||
<view class="cont_time">
|
||||
<view class="cont_size">{{queryParams.datetimeRange[0]}}</view>
|
||||
<view class="bule_size">~</view>
|
||||
<view class="cont_size">{{queryParams.datetimeRange[1]}}</view>
|
||||
<view class=""> <u-icon name="arrow-down-fill" color="#0357FF" size="12"></u-icon></view>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
|
||||
</view>
|
||||
<!-- 循环 -->
|
||||
<view class="user_box" v-for="(items,index) in List" :key="index">
|
||||
<view class="user_left" @click="goDetail(items)">
|
||||
<view class="user_img">
|
||||
<view class="user_p_img" v-show="index == 0">
|
||||
<image src="./assets/top1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="user_p_img" v-show="index == 1">
|
||||
<image src="./assets/top2.png" mode=""></image>
|
||||
</view>
|
||||
<view class="user_p_img" v-show="index == 2">
|
||||
<image src="./assets/top3.png" mode=""></image>
|
||||
</view>
|
||||
<image src="/static/imgs/yh.png" mode=""></image>
|
||||
</view>
|
||||
<view class="user_name">{{ items.nickname }}</view>
|
||||
<view class="user_ramk">服务{{ items.totalCount }}次</view>
|
||||
</view>
|
||||
<view class="user_right">
|
||||
<view class="user_kar" v-for="(item,index) in items.children" :key="index">
|
||||
<view class="">{{ item.projectName }}</view>
|
||||
<view class="num_">{{ item.count }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-calendar :show="show" minDate="2023-05-05" maxDate="2026-01-01" :mode="mode" @confirm="confirm"></u-calendar>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import config from "config";
|
||||
import {
|
||||
getDateRange
|
||||
} from "@/utils/utils";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tapList: [{
|
||||
label: "本日",
|
||||
value: "day",
|
||||
},
|
||||
{
|
||||
label: "本月",
|
||||
value: "month",
|
||||
},
|
||||
],
|
||||
tapIndex: 0,
|
||||
show: false,
|
||||
mode: 'range',
|
||||
titles: "员工统计",
|
||||
List: [],
|
||||
selectList: [],
|
||||
useSelectList: [],
|
||||
status: "loading",
|
||||
baseImageUrl: config.baseImageUrl,
|
||||
isShowScreen: false,
|
||||
columns: [],
|
||||
queryParams: {
|
||||
datetimeRange: []
|
||||
},
|
||||
queryStr: null,
|
||||
selected: "day",
|
||||
dateRangeList: [{
|
||||
label: "本日",
|
||||
value: "day",
|
||||
},
|
||||
{
|
||||
label: "本月",
|
||||
value: "month",
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const now = new Date();
|
||||
this.setCurrentMonthRange();
|
||||
|
||||
this.getStaffCount();
|
||||
this.getInspectionProject();
|
||||
},
|
||||
methods: {
|
||||
confirm(e) {
|
||||
console.log(e);
|
||||
},
|
||||
tapIcon(index) {
|
||||
this.tapIndex = index
|
||||
this.slectRange(index)
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
}, // 获取员工统计
|
||||
getStaffCount() {
|
||||
request({
|
||||
url: "/partnerOwn/partner/getStaffCount",
|
||||
method: "post",
|
||||
data: this.queryParams,
|
||||
}).then((res) => {
|
||||
this.$nextTick(() => {
|
||||
this.List = res.data;
|
||||
});
|
||||
});
|
||||
}, // 补零:1 → 01
|
||||
pad(n) {
|
||||
return n.toString().padStart(2, "0");
|
||||
},
|
||||
// Date → "YYYY-MM-DD"
|
||||
formatDate(d) {
|
||||
// 添加类型检查,确保 d 是 Date 对象
|
||||
if (!(d instanceof Date)) {
|
||||
console.error("formatDate() 期望接收 Date 对象,但收到:", d);
|
||||
d = new Date(d); // 尝试转换为 Date 对象
|
||||
if (isNaN(d.getTime())) {
|
||||
// 检查是否有效日期
|
||||
d = new Date(); // 如果转换失败,使用当前日期
|
||||
}
|
||||
}
|
||||
return `${d.getFullYear()}-${this.pad(d.getMonth() + 1)}-${this.pad(
|
||||
d.getDate()
|
||||
)}`;
|
||||
},
|
||||
|
||||
// 设置本月起止日期:月初到今天
|
||||
setCurrentMonthRange() {
|
||||
// 直接使用 Date 对象
|
||||
const now = new Date();
|
||||
|
||||
// 创建月初的 Date 对象
|
||||
const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
|
||||
this.queryParams.datetimeRange = [
|
||||
this.formatDate(now), // 月初
|
||||
this.formatDate(now), // 今天
|
||||
];
|
||||
},
|
||||
|
||||
// 辅助函数:补零
|
||||
pad(num) {
|
||||
return num.toString().padStart(2, "0");
|
||||
},
|
||||
// 获取工作内容列表
|
||||
getInspectionProject() {
|
||||
request({
|
||||
url: "/inspection/dl-inspection-project/page",
|
||||
method: "get",
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10000,
|
||||
},
|
||||
}).then((res) => {
|
||||
this.columns = res.data.records;
|
||||
});
|
||||
},
|
||||
slectRange(index) {
|
||||
this.selected = index;
|
||||
console.log(index, this.selected);
|
||||
const {
|
||||
value
|
||||
} = this.tapList[index];
|
||||
console.log(value);
|
||||
// this.queryParams.datetimeRange = [
|
||||
// this.formatDate(firstDay),
|
||||
// this.formatDate(now)
|
||||
// ];
|
||||
this.queryParams.datetimeRange = getDateRange(value);
|
||||
this.getStaffCount();
|
||||
},
|
||||
|
||||
goDetail(data) {
|
||||
uni.navigateTo({
|
||||
// url: `/pages/index/staffProjectList/staffProjectList?userId=${data.userId}&range=${encodeURIComponent(JSON.stringify(this.queryParams.datetimeRange))}`,
|
||||
url: `/pages/statistics/staffStatisticsDetail/index?userId=${data.userId}&range=${encodeURIComponent(JSON.stringify(this.queryParams.datetimeRange))}`,
|
||||
});
|
||||
},
|
||||
// 显示下拉框
|
||||
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();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.top_ {
|
||||
width: 100%;
|
||||
height: 340rpx;
|
||||
position: relative;
|
||||
background: #dea5ff;
|
||||
background: url(./assets/banner.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.icon_ {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 100rpx;
|
||||
}
|
||||
|
||||
.top_img {
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
left: 52rpx;
|
||||
width: 474rpx;
|
||||
height: 148rpx;
|
||||
z-index: 999;
|
||||
|
||||
image {
|
||||
width: 474rpx;
|
||||
height: 148rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.top_i_text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #0357FF;
|
||||
}
|
||||
|
||||
.cont_box {
|
||||
background: #F8F9FA;
|
||||
box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(12, 74, 157, 0.25);
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.cont_top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.ds_ {
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.tap_text {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #707677;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.cont_time {
|
||||
width: 422rpx;
|
||||
height: 60rpx;
|
||||
background: #F1F4F7;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #0357FF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0px 30rpx;
|
||||
}
|
||||
|
||||
.cont_size {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #686C7A;
|
||||
}
|
||||
|
||||
.bule_size {
|
||||
color: #0357FF;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin: 0px 10rpx;
|
||||
}
|
||||
|
||||
.tap_img {
|
||||
height: 3px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 34rpx;
|
||||
height: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.acv {
|
||||
font-weight: bold;
|
||||
color: #292D2E !important;
|
||||
}
|
||||
|
||||
.user_box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 15rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.user_right {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.user_left {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.user_img {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #FFDD89;
|
||||
position: relative;
|
||||
margin: 0px auto;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.user_p_img {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
position: absolute;
|
||||
top: -38rpx;
|
||||
left: 12rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.user_name {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #2F353B;
|
||||
margin: 5px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.user_ramk {
|
||||
width: 150rpx;
|
||||
height: 34rpx;
|
||||
background: #E3EAF8;
|
||||
border-radius: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #0357FF;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.user_kar {
|
||||
width: 230rpx;
|
||||
height: 80rpx;
|
||||
background: #F9F9FC;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #6D7377;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.num_ {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #2F353B;
|
||||
}
|
||||
</style>
|
BIN
pages/statistics/staffStatisticsDetail/assets/back.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
pages/statistics/staffStatisticsDetail/assets/icon1.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
pages/statistics/staffStatisticsDetail/assets/icon2.png
Normal file
After Width: | Height: | Size: 682 B |
BIN
pages/statistics/staffStatisticsDetail/assets/icon3.png
Normal file
After Width: | Height: | Size: 985 B |
BIN
pages/statistics/staffStatisticsDetail/assets/icon4.png
Normal file
After Width: | Height: | Size: 810 B |
282
pages/statistics/staffStatisticsDetail/index.vue
Normal file
@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<view class="top_">
|
||||
<view class="icon_" @click="goBack()">
|
||||
<u-icon name="arrow-left" color="#fff" size="24"></u-icon>
|
||||
</view>
|
||||
<view @click="goDetail(baseDataInfo.staffInfo)">
|
||||
<view class="name_">员工统计详情</view>
|
||||
<view class="user_img">
|
||||
<image :src="baseImageUrl + baseDataInfo.staffInfo.avatar"
|
||||
v-if="baseDataInfo.staffInfo &&baseDataInfo.staffInfo.avatar" mode="">
|
||||
</image>
|
||||
<image src="/static/imgs/yh.png" mode="" v-else></image>
|
||||
</view>
|
||||
<view class="user_name">{{baseDataInfo.staffInfo && baseDataInfo.staffInfo.nickname}}</view>
|
||||
</view>
|
||||
<uni-datetime-picker v-model="queryParams.datetimeRange" type="daterange" rangeSeparator="至"
|
||||
@change="selectDate">
|
||||
<view class="cont_time">
|
||||
<view class="cont_size">{{queryParams.datetimeRange[0]}}</view>
|
||||
<view class="bule_size">~</view>
|
||||
<view class="cont_size">{{queryParams.datetimeRange[1]}}</view>
|
||||
<view class=""> <u-icon name="arrow-down-fill" color="#0357FF" size="12"></u-icon></view>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
|
||||
<view class="kar_">
|
||||
<view class="ds_">
|
||||
<image src="./assets/icon1.png" mode=""></image>
|
||||
<view class="">车型数量统计</view>
|
||||
</view>
|
||||
<view class="wr_box">
|
||||
<view class="wr_boxs" v-for="(item,index) in baseDataInfo.goodsStatistics" :key="index"
|
||||
@click="selectGoodsTitle(item.goodsTitle)">
|
||||
<view class="num_">{{item.totalCount}}</view>
|
||||
<view class="size_">{{item.goodsTitle}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kar_">
|
||||
<view class="ds_">
|
||||
<image src="./assets/icon2.png" mode=""></image>
|
||||
<view class="">项目数量统计</view>
|
||||
</view>
|
||||
<view class="wr_box">
|
||||
<view class="wr_boxs" v-for="(item,index) in projectCount.children" :key="index">
|
||||
<view class="num_">{{item.count}}</view>
|
||||
<view class="size_">{{item.projectName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="db_">
|
||||
<view class="min_box">
|
||||
<view class="ds_" style="margin-bottom: 0px;">
|
||||
<image src="./assets/icon3.png" mode=""></image>
|
||||
<view class="">初次检测数量</view>
|
||||
</view>
|
||||
<view class="num_2">
|
||||
{{baseDataInfo.inspectionStatistics && baseDataInfo.inspectionStatistics.initialCheckCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="min_box">
|
||||
<view class="ds_" style="margin-bottom: 0px;">
|
||||
<image src="./assets/icon4.png" mode=""></image>
|
||||
<view class="">复检检测数量</view>
|
||||
</view>
|
||||
<view class="num_2">
|
||||
{{baseDataInfo.inspectionStatistics && baseDataInfo.inspectionStatistics.recheckCount}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import config from '../../../config';
|
||||
import request from '../../../utils/request';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
queryParams: {
|
||||
userId: undefined,
|
||||
datetimeRange: []
|
||||
},
|
||||
baseDataInfo: {
|
||||
staffInfo: undefined
|
||||
},
|
||||
projectCount: [],
|
||||
baseImageUrl: config.baseImageUrl + '/'
|
||||
};
|
||||
},
|
||||
async onLoad(option) {
|
||||
if (option.userId) {
|
||||
this.queryParams.userId = option.userId
|
||||
}
|
||||
if (option.range) {
|
||||
this.queryParams.datetimeRange = JSON.parse(decodeURIComponent(option.range))
|
||||
}
|
||||
await this.getBaseDataInfo()
|
||||
await this.getProjectCount()
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
async getBaseDataInfo() {
|
||||
const res = await request({
|
||||
url: `/inspection/statistics/queryStaffStatisticsInfo`,
|
||||
method: 'POST',
|
||||
data: this.queryParams
|
||||
})
|
||||
this.baseDataInfo = res.data
|
||||
},
|
||||
async getProjectCount() {
|
||||
const res = await request({
|
||||
url: `/inspection/statistics/queryStaffStatisticsGroupByGoods`,
|
||||
method: 'POST',
|
||||
data: this.queryParams
|
||||
})
|
||||
this.projectCount = res.data
|
||||
},
|
||||
selectDate() {
|
||||
this.getBaseDataInfo()
|
||||
this.getProjectCount()
|
||||
},
|
||||
selectGoodsTitle(title) {
|
||||
if (title == this.queryParams.goodsTitle) {
|
||||
this.queryParams.goodsTitle = undefined
|
||||
} else {
|
||||
this.queryParams.goodsTitle = title
|
||||
}
|
||||
this.getProjectCount()
|
||||
},
|
||||
goDetail(data) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/index/staffProjectList/staffProjectList?userId=${data.id}&range=${encodeURIComponent(JSON.stringify(this.queryParams.datetimeRange))}`,
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.top_ {
|
||||
width: 100%;
|
||||
height: 620rpx;
|
||||
position: relative;
|
||||
background: #dea5ff;
|
||||
background: url(./assets/back.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 100rpx;
|
||||
}
|
||||
|
||||
.icon_ {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 100rpx;
|
||||
}
|
||||
|
||||
.name_ {
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.cont_time {
|
||||
width: 80%;
|
||||
height: 60rpx;
|
||||
background: #fff;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #0357FF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0px 30rpx;
|
||||
margin: 15rpx auto;
|
||||
}
|
||||
|
||||
.cont_size {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #686C7A;
|
||||
}
|
||||
|
||||
.bule_size {
|
||||
color: #0357FF;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin: 0px 10rpx;
|
||||
}
|
||||
|
||||
.user_img {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 50%;
|
||||
margin: 15px auto;
|
||||
margin-top: 100rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.user_name {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
}
|
||||
|
||||
.min_box {
|
||||
background: linear-gradient(180deg, #E4EFFF 0%, #FFFFFF 100%);
|
||||
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(167, 179, 229, 0.25);
|
||||
width: 48%;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.kar_ {
|
||||
background: linear-gradient(180deg, #E4EFFF 0%, #FFFFFF 100%);
|
||||
box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(167, 179, 229, 0.25);
|
||||
width: 90%;
|
||||
margin: 30rpx auto;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.ds_ {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.wr_box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wr_boxs {
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #6D7377;
|
||||
margin: 10rpx 20rpx;
|
||||
width: 150rpx;
|
||||
}
|
||||
|
||||
.num_ {
|
||||
font-weight: bold;
|
||||
font-size: 26px;
|
||||
color: #2F353B;
|
||||
}
|
||||
|
||||
.num_2 {
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #2F353B;
|
||||
}
|
||||
|
||||
.db_ {
|
||||
width: 90%;
|
||||
margin: 30rpx auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
BIN
static/imgs/jiangbei.png
Normal file
After Width: | Height: | Size: 338 KiB |
BIN
static/imgs/select.png
Normal file
After Width: | Height: | Size: 907 B |
BIN
static/imgs/start.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
static/imgs/ygtj.png
Normal file
After Width: | Height: | Size: 38 KiB |