You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

300 lines
6.6 KiB

11 months ago
<template>
<view class="index-content">
<u-navbar back-icon-color='#fff' back-icon-name=''
:background="{ background: 'rgba(64, 158,255,'+bgOpacity+')'}" back-text="" title-color='#fff'
:immersive='true' :border-bottom='false' title="首页">
<!-- <template v-slot:right>
<u-icon name="bell" color="#fff" size="36" style="padding-right: 30rpx;"
@click="open('/pages/notaic/index')"></u-icon>
</template> -->
11 months ago
</u-navbar>
<view class="top">
<image src="../static/images/mobile_bg.png" class="bg" mode=""></image>
<view class="top-box">
<view class="number">
<view class="number-item">
<view>{{counts.allCount}}</view>
11 months ago
<view>设备总数</view>
</view>
<view class="number-item">
<view>{{counts.breakDownCount}}</view>
11 months ago
<view>故障中设备</view>
</view>
<view class="number-item">
<view>{{counts.repairCount}}</view>
11 months ago
<view>已报修设备</view>
</view>
</view>
<view class="status">
<view class="status-item">
<view>32</view>
<view>待接单</view>
</view>
<view class="status-item">
<view>32</view>
<view>待验证</view>
</view>
<view class="status-item">
<view>32</view>
<view>待审核</view>
</view>
</view>
</view>
</view>
<view class="box">
<view class="title">设备维护</view>
<u-row gutter="16" style="padding:0px 20rpx ;">
<u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=DEVICE')">
11 months ago
<image src="../static/images/icon4.svg" mode=""></image>
<view>设备报修</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')">
11 months ago
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=DEVICE')">
11 months ago
<image src="../static/images/icon3.svg" mode=""></image>
<view>检修工单</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/workOrderList/index?type=4')">
<image src="../static/images/icon2.svg" mode=""></image>
<view>点检工单</view>
</view>
</u-col>
<u-col span="3">
10 months ago
<view class="icon-item" @click="open('/pages/upkeepOrder/index?type=DEVICE')">
11 months ago
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
</view>
</u-col>
</u-row>
<view class="title">模具维护</view>
<u-row gutter="16">
<u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')">
11 months ago
<image src="../static/images/icon4.svg" mode=""></image>
<view>设备报修</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD')">
11 months ago
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=MOLD')">
11 months ago
<image src="../static/images/icon2.svg" mode=""></image>
<view>检修工单</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/maintenWorkOrderList/index')">
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
</view>
</u-col>
</u-row>
<view class="title">备件管理</view>
<u-row gutter="16">
<u-col span="3">
<view class="icon-item" @click="open('/pages/sparePartsApplication/index')">
11 months ago
<image src="../static/images/icon6.png" mode=""></image>
<view>领用申请</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/sparePartsServiceWorkOrderList/index')">
11 months ago
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
</u-row>
</view>
11 months ago
</view>
</template>
<script>
import {
getInfo
} from '@/api/login'
import {
getCounts
} from '@/api/index'
import { getAccessToken } from '@/utils/auth'
export default {
data() {
return {
bgOpacity: 0,
counts:''
}
},
11 months ago
methods: {
open(url) {
this.$tab.navigateTo(url)
},
getInfo() {
getInfo().then(res => {
console.log((res))
})
},
getPermissionInfo() {
this.$store.dispatch('GetPermissionInfo').then(res => {
})
},
getCounts() {
getCounts().then(res => {
console.log((res))
this.counts = res.data
})
},
},
onLoad: function() {
if (getAccessToken()) {
this.getInfo()
this.getPermissionInfo()
this.getCounts()
}
11 months ago
},
onPageScroll(e) {
if (e.scrollTop > 0) {
this.bgOpacity = e.scrollTop / 200;
} else {
this.bgOpacity = 0
}
11 months ago
},
}
</script>
<style scoped lang="scss">
.index-content {
background-color: white;
min-height: 100vh;
}
.bg {
width: 100%;
}
.top {
position: relative;
image {
height: calc(var(--status-bar-height) + 410rpx);
11 months ago
}
}
.top-box {
position: absolute;
width: 100%;
bottom: 0px;
.number {
padding: 30rpx 80rpx 50rpx;
display: flex;
align-items: center;
justify-content: space-between;
.number-item {
text-align: center;
view {
&:nth-child(1) {
color: white;
font-size: 40rpx;
font-weight: bold;
}
&:nth-child(2) {
color: rgba(255, 255, 255, 0.7);
font-size: 28rpx;
margin-top: 10rpx;
}
}
}
}
.status {
margin: 0px 40rpx;
padding: 40rpx 0rpx;
background: white;
border-radius: 20rpx 20rpx 0px 0px;
display: flex;
align-items: center;
justify-content: space-between;
.status-item {
text-align: center;
position: relative;
flex: 1;
view {
&:nth-child(1) {
color: black;
font-size: 40rpx;
font-weight: bold;
}
&:nth-child(2) {
color: rgba(0, 0, 0, 0.5);
font-size: 28rpx;
margin-top: 10rpx;
}
}
&::after {
content: "";
border-right: 1px solid #dedede;
position: absolute;
height: 60rpx;
right: 0px;
top: 50%;
margin-top: -30rpx;
}
&:nth-last-child(1)::after {
border: none;
}
}
}
}
.box {
.title {
11 months ago
font-size: 32rpx;
font-weight: bold;
padding: 50rpx 50rpx 30rpx;
11 months ago
}
.icon-item {
11 months ago
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin: 20rpx 0px;
image {
11 months ago
width: 80rpx;
height: 80rpx;
}
view {
11 months ago
margin-top: 20rpx;
color: #999999;
}
}
}
</style>