545 lines
14 KiB
Vue
Raw Normal View History

2022-06-08 15:48:09 +08:00
<template>
<view class="fullHeight personContent">
<image src="/static/personManage/titleBG.png" class="titleBg"></image>
<headers :showBack="true" :themeType="'white'">
<view class="headerName">
劳务管理
</view>
</headers>
<view class="topBox" :style="{ 'margin-top': (200-statusBarHeight-44 - 110) + 'px' }">
<image src="/static/personManage/left.png" class="topBoxBG" v-show="tabIndex==0"></image>
<image src="/static/personManage/right.png" class="topBoxBG" v-show="tabIndex==1"></image>
<view class="item item1">
<view class="itemInner" @click="tabIndex=0">
<view class="">
<view class="txt" :class="tabIndex==0?'active':''">
在场施工人员
2022-06-08 15:48:09 +08:00
</view>
<view class="num">
{{statictisData.presencePerson.lwPersonTotal}}
</view>
</view>
</view>
<view class="itemInner" @click="tabIndex=1">
<view class="">
<view class="txt" :class="tabIndex==1?'active':''">
2024-04-17 00:44:17 +08:00
在场管理人员
2022-06-08 15:48:09 +08:00
</view>
<view class="num">
{{statictisData.presencePerson.glPersonTotal}}
</view>
</view>
</view>
</view>
<view class="item item2">
<view class="itemInner">
<view class="">
<view class="txt">
<text v-if="tabIndex === 0">施工人员出勤</text>
2024-04-17 08:58:58 +08:00
<text v-if="tabIndex === 1">管理人员出勤</text>
2022-06-08 15:48:09 +08:00
</view>
<view class="num">
{{tabIndex==0?statictisData.attendancePerson.lwPersonTotal:statictisData.attendancePerson.glPersonTotal}}
</view>
</view>
</view>
<view class="itemInner">
<view class="">
<view class="txt">
<text v-if="tabIndex === 0">施工人员总数</text>
2024-04-17 08:58:58 +08:00
<text v-if="tabIndex === 1">管理人员总数</text>
2022-06-08 15:48:09 +08:00
</view>
<view class="num">
{{tabIndex==0?statictisData.toaltPerson.lwPersonTotal:statictisData.toaltPerson.glPersonTotal}}
</view>
</view>
</view>
</view>
<view class="item item3">
<view class="itemInner">
<view class="">
<view class="txt">
2024-05-27 21:07:26 +08:00
<!-- <text v-if="tabIndex === 0">施工人员昨日出勤率</text> -->
<text v-if="tabIndex === 0">施工人员考勤环比</text>
<!-- <text v-if="tabIndex === 1">管理人员昨日出勤率</text> -->
<text v-if="tabIndex === 1">管理人员考勤环比</text>
2024-04-17 08:58:58 +08:00
2022-06-08 15:48:09 +08:00
</view>
2023-12-15 11:34:44 +08:00
<view class="" v-if="statictisData.yesterdayAttendancePerson.totalPerson != 0">
2022-06-08 15:48:09 +08:00
<view class="num" v-show="tabIndex==0">
2024-05-27 21:07:26 +08:00
<!-- {{((statictisData.yesterdayAttendancePerson.lwPersonTotal/Number(statictisData.toaltPerson.lwPersonTotal))*100).toFixed(2)}}% -->
2024-05-28 11:03:04 +08:00
<!-- {{(((statictisData.attendancePerson.lwPersonTotal-statictisData.yesterdayAttendancePerson.lwPersonTotal)/statictisData.yesterdayAttendancePerson.lwPersonTotal)*100).toFixed(2)}}% -->
<text v-if="lwRadio(statictisData) > 0">
<u-icon name="arrow-upward" color="#2979ff" size="40"></u-icon>
<text>{{Math.abs(lwRadio(statictisData))}}%</text>
</text>
<text v-if="lwRadio(statictisData) === 0">
<text>{{Math.abs(lwRadio(statictisData))}}%</text>
</text>
<text v-if="lwRadio(statictisData) === '--'">
<text>{{Math.abs(lwRadio(statictisData))}}</text>
</text>
<text v-if="lwRadio(statictisData) < 0">
<u-icon name="arrow-downward" color="#FF0000" size="40"></u-icon>
<text>{{Math.abs(lwRadio(statictisData))}}%</text>
</text>
2022-06-08 15:48:09 +08:00
</view>
<view class="num" v-show="tabIndex==1">
2024-05-27 21:07:26 +08:00
<!-- {{((statictisData.yesterdayAttendancePerson.glPersonTotal/Number(statictisData.toaltPerson.glPersonTotal))*100).toFixed(2)}}% -->
2024-05-28 11:03:04 +08:00
<!-- {{(((statictisData.attendancePerson.glPersonTotal-statictisData.yesterdayAttendancePerson.glPersonTotal)/statictisData.yesterdayAttendancePerson.glPersonTotal)*100).toFixed(2)}}% -->
<text v-if="glRadio(statictisData) > 0">
<u-icon name="arrow-upward" color="#2979ff" size="40"></u-icon>
<text>{{Math.abs(glRadio(statictisData))}}%</text>
</text>
<text v-if="glRadio(statictisData) === 0">
<text>{{Math.abs(glRadio(statictisData))}}%</text>
</text>
<text v-if="glRadio(statictisData) === '--'">
<text>{{Math.abs(glRadio(statictisData))}}</text>
</text>
<text v-if="glRadio(statictisData) < 0">
<u-icon name="arrow-downward" color="#FF0000" size="40"></u-icon>
<text>{{Math.abs(glRadio(statictisData))}}%</text>
</text>
2022-06-08 15:48:09 +08:00
</view>
2023-02-06 11:14:16 +08:00
2022-06-08 15:48:09 +08:00
</view>
<view class="num" v-else>
0%
</view>
</view>
</view>
<view class="itemInner">
<view class="">
<view class="txt">
现场工种()
</view>
<view class="num">
{{statictisData.presencePerson.total_worker_type_num}}
</view>
</view>
</view>
</view>
</view>
<view class="middleBox" v-if="COMPANY != 'longguang' && COMPANY != 'nanchang'">
<view class="box" @click="viewWorkerAnalysis">
<image src="/static/personManage/zggrfx.png" class="img" style="width: 20px;height: 19px;"></image>
在岗工人分析
</view>
<view class="box" @click="viewTeamList">
<image src="/static/personManage/cdw.png" class="img" style="width: 23px;height: 19px;"></image>
<view class="">
<view class="">
查队伍
</view>
<text class="num">{{statictisData.toaltPerson.total_team_num}}</text>
</view>
</view>
</view>
<view class="box operateBox">
2024-04-28 15:47:49 +08:00
<!-- <view class="item" @click="viewSafeMange">
2022-06-08 15:48:09 +08:00
<view class="imgBox">
<image src="/static/personManage/aqjy.png" mode="" style="width: 29px;height: 20px;"></image>
</view>
<view class="txt">
安全教育
</view>
2024-04-28 15:47:49 +08:00
</view> -->
<!-- <view v-if="COMPANY != 'longguang'" class="item" @click="goClockIn" v-show="mobileAttendance==0">
2022-06-08 15:48:09 +08:00
<view class="imgBox">
<image src="/static/personManage/ydkq.png" mode="" style="width: 22px;height: 22px;"></image>
</view>
<view class="txt">
移动考勤
</view>
</view>
<view class="item" v-if="COMPANY == 'longguang'" @click="viewTeamList" v-show="mobileAttendance==0">
<view class="imgBox">
<image src="/static/personManage/cdw.png" mode="" style="width: 22px;height: 22px;"></image>
</view>
<view class="txt">
查队伍
</view>
2024-04-28 15:47:49 +08:00
</view> -->
2022-06-08 15:48:09 +08:00
<view class="item" @click="viewAttendence">
<view class="imgBox">
<image src="/static/personManage/kqjl.png" mode="" style="width: 23px;height: 20px;"></image>
</view>
<view class="txt">
考勤记录
</view>
</view>
2024-04-28 15:47:49 +08:00
<!-- <view class="item" @click="safeMeeting" v-if="COMPANY !='sccr'&& COMPANY != 'sanjiang'">
2022-12-09 14:54:25 +08:00
<view class="imgBox">
<image src="/static/personManage/kqjl.png" mode="" style="width: 23px;height: 20px;"></image>
</view>
<view class="txt">
班前喊话
</view>
2024-04-28 15:47:49 +08:00
</view> -->
2023-06-19 09:02:35 +08:00
<view class="item" @click="viewVideo" v-if="COMPANY != 'nanchang'&& COMPANY != 'sccr'&& COMPANY != 'sanjiang'">
2022-06-08 15:48:09 +08:00
<view class="imgBox">
<image src="/static/personManage/video.png" mode="" style="width: 25px;height: 18px;"></image>
</view>
<view class="txt">
视频监控
</view>
</view>
</view>
<view class="tabBarBox">
<view class="item active">
<image src="/static/personManage/index.png" class="img"></image>
<view class="txt">
首页
</view>
</view>
<view class="item" @click="queryStaff">
<image src="/static/personManage/search.png" class="img"></image>
<view class="txt">
查人员
</view>
</view>
<!-- <view class="item">
<image src="/static/personManage/location.png" class="img"></image>
<view class="txt">
定位
</view>
</view> -->
</view>
2024-05-23 20:06:14 +08:00
<levitatedsphere :x="100" :y="80"></levitatedsphere>
2022-06-08 15:48:09 +08:00
</view>
</template>
<script>
2024-05-23 20:06:14 +08:00
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
2022-06-08 15:48:09 +08:00
import headers from "../../../components/headers/headers.vue"
export default {
data() {
return {
projectDetail: null,
statictisData: {
attendancePerson: {
glPersonTotal: 0,
lsPersonTotal: 0,
lwPersonTotal: 0,
totalPerson: 0
},
presencePerson: {
glPersonTotal: 0,
lsPersonTotal: 0,
total_worker_type_num: 0,
lwPersonTotal: 0,
totalPerson: 0
},
toaltPerson: {
glPersonTotal: 0,
total_team_num: 0,
lsPersonTotal: 0,
lwPersonTotal: 0,
totalPerson: 0
},
yesterdayAttendancePerson: {
glPersonTotal: 0,
lsPersonTotal: 0,
lwPersonTotal: 0,
2023-02-06 11:14:16 +08:00
totalPerson: 0,
2022-06-08 15:48:09 +08:00
}
},
statusBarHeight: 0,
tabIndex: 0,
mobileAttendance:1,//是否能移动考勤0是1否
};
2024-05-28 11:03:04 +08:00
},
computed:{
2022-06-08 15:48:09 +08:00
},
onLoad() {
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.mobileAttendance=JSON.parse(uni.getStorageSync('userInfo')).mobileAttendance
this.loadData()
},
methods: {
2024-05-28 11:03:04 +08:00
lwRadio(statictisData){
let today = statictisData.attendancePerson.lwPersonTotal
let yesterday = statictisData.yesterdayAttendancePerson.lwPersonTotal
if(yesterday === 0) return '--'
let radio = (((today - yesterday)/yesterday)*100).toFixed(2)
return radio
},
glRadio(statictisData){
let today = statictisData.attendancePerson.glPersonTotal
let yesterday = statictisData.yesterdayAttendancePerson.glPersonTotal
if(yesterday === 0) return '--'
let radio = (((today - yesterday)/yesterday)*100).toFixed(2)
return radio
},
2022-06-08 15:48:09 +08:00
loadData() {
var that = this
this.sendRequest({
url: 'xmgl/workerInfo/selectProjectSceneManageStatistics',
data: {
projectSn: this.projectDetail.projectSn
},
method: "POST",
success(res) {
2023-12-15 11:34:44 +08:00
that.statictisData = res.result
2023-02-06 11:14:16 +08:00
console.log('获取的数据',that.statictisData);
2022-06-08 15:48:09 +08:00
}
})
},
viewWorkerAnalysis() {
uni.navigateTo({
url: './workerAnalysis'
})
},
viewSafeMange() {
uni.navigateTo({
url: './safetyEducationManage/index'
})
},
viewTeamList() {
uni.navigateTo({
url: './searchTeam/teamList'
})
},
goClockIn() {
var userInfo = JSON.parse(uni.getStorageSync('userInfo'))
if (userInfo.accountType == 6) {
uni.navigateTo({
url: './clockIn?faceScore='
})
// uni.navigateTo({
// url:'./faceRecognition'
// })
} else {
uni.showModal({
title: '提示',
content: '只有项目子账号才能使用该功能!'
})
}
},
viewAttendence() {
uni.navigateTo({
url: 'attendanceManage'
})
},
2022-12-09 14:54:25 +08:00
safeMeeting(){
uni.navigateTo({
url:'../../videoManage/safeMeeting?sn='+this.projectDetail.projectSn
})
},
2022-06-08 15:48:09 +08:00
viewVideo(){
uni.navigateTo({
url: '../../videoManage/videoList?sn='+this.projectDetail.projectSn+'&pageType=backEnd'
})
},
//查询人员
queryStaff(){
uni.navigateTo({
url: './queryStaff'
})
},
}
}
</script>
<style lang="scss" scoped>
.personContent {
color: $uni-text-color2;
font-size: 15px;
/deep/.headerBox{
background-color: transparent;
border-bottom: none;
}
}
.titleBg {
width: 100%;
position: absolute;
top: 0;
left: 0;
height: 200px;
}
.middleBox {
display: flex;
align-items: center;
margin: 15px;
.box {
flex: 1;
display: inline-flex;
align-items: center;
height: 65px;
&:first-child {
margin-right: 5px;
}
.img {
margin-right: 8px;
margin-left: 20px;
}
.num {
font-size: 12px;
}
}
}
.box {
box-shadow: 0 4px 24px 0px rgba(212, 220, 236, 0.69);
border-radius: 8px;
}
.operateBox {
display: flex;
align-items: center;
font-size: 12px;
height: 96px;
margin: 0 15px;
.item {
flex: 1;
.imgBox {
height: 22px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
}
.txt {
text-align: center;
}
}
}
.tabBarBox {
display: flex;
align-items: center;
font-size: 12px;
border-top: 1px solid rgba(151, 151, 151, 0.2);
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 62px;
.item {
flex: 1;
// display: inline-flex;
text-align: center;
color: rgba(148, 149, 173, 1);
.img {
width: 35px;
height: 35px;
}
&.active {
color: rgba(72, 141, 236, 1);
}
}
}
.topBox {
margin: 0 5px;
position: relative;
height: 270px;
z-index: 4;
.topBoxBG {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.item {
margin: 0 10px;
display: flex;
.itemInner {
display: inline-flex;
flex: 1;
align-items: center;
justify-content: center;
&:first-child {
border-right: 1px solid rgba(55, 45, 102, 0.1);
}
}
.txt {
color: rgba(55, 45, 102, 0.6);
font-size: 15px;
text-align: center;
}
.active {
color: rgba(55, 45, 102, 1);
font-weight: bold;
}
.num {
font-size: 20px;
font-weight: bold;
text-align: center;
}
}
.item1 {
height: calc(33% - 10px);
padding-top: 10px;
.itemInner {
&:first-child {
border-right: none;
}
}
}
.item2 {
height: 20%;
margin: 4% 10px;
// padding-bottom: 2%;
// .itemInner{
// padding-bottom: 10px;
// }
}
.item3 {
padding-top: 4%;
height: 20%;
position: relative;
&::after {
content: "";
position: absolute;
left: 5%;
width: 90%;
top: 0px;
border-top: 1px solid rgba(55, 45, 102, 0.1);
}
}
}
</style>