YNUtdPlatform/pages/realName/workbench/index.vue

282 lines
8.5 KiB
Vue

<template>
<view class="page">
<u-navbar title="工作台" placeholder bgColor="#00337A" @leftClick="leftClick" leftIconColor="#fff" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }">
<view class="u-nav-slot" slot="left">
<u-icon name="grid" size="24" color="#FFF" v-if="type.indexOf('4')>-1"></u-icon>
</view>
</u-navbar>
<view style="width: 100%;height: 84vh;">
<scroll-view scroll-y="true">
<view class="view-box">
<view class="view-item" v-for="(item,index) in menuList" :key="index" @click="goModule(item.name)">
<view><image class="img1" :src="`/static/realName/${item.css}.png`" style="width: 70rpx;height: 70rpx;" alt=""></view>
<view style="font-size: 26rpx;">{{item.name}}</view>
</view>
<!-- 监督端 -->
<!-- 作业计划与实名制管控情况 -->
<view class="view-item" @click="goPlan" v-if="type.indexOf('4')>-1">
<view><image class="img1" src="@/static/realName/attendance_statistics.png" style="width: 80rpx;height: 80rpx;" alt=""></view>
<view style="font-size: 28rpx;">作业计划与实...</view>
</view>
<!-- 人员信息录入 -->
<view class="view-item" @click="goPersonEnter" v-if="type.indexOf('4')>-1">
<view><image class="img1" src="@/static/realName/base_person.png" style="width: 70rpx;height: 70rpx;" alt=""></view>
<view style="font-size: 26rpx;">人员信息录入</view>
</view>
<!-- 人员资质库更新 -->
<view class="view-item" @click="goUpdateFace" v-if="type.indexOf('4')>-1">
<view><image class="img1" src="@/static/realName/update_face.png" style="width: 80rpx;height: 80rpx;" alt=""></view>
<view style="font-size: 28rpx;">人员资质库更新</view>
</view>
<!-- 人员资质检查 -->
<view class="view-item" @click="goQualifications" v-if="type.indexOf('4')>-1">
<view><image class="img1" src="@/static/realName/qualifications.png" style="width: 80rpx;height: 80rpx;" alt=""></view>
<view style="font-size: 28rpx;">人员资质检查</view>
</view>
<!-- 人员暂退 -->
<view class="view-item" @click="goOutPerson" v-if="type.indexOf('4')>-1">
<view><image class="img1" src="@/static/realName/out_person.png" style="width: 80rpx;height: 80rpx;" alt=""></view>
<view style="font-size: 28rpx;">人员暂退</view>
</view>
<!-- 施工端 -->
<view class="view-item" @click="goDayPlan" v-if="type.indexOf('3')>-1">
<view><image class="img1" src="@/static/realName/day_plan.png" style="width: 70rpx;height: 70rpx;" alt=""></view>
<view style="font-size: 26rpx;">准入信息查询</view>
</view>
<view class="view-item" @click="goExam" v-if="type.indexOf('3')>-1">
<view><image class="img1" src="@/static/realName/exam.png" style="width: 70rpx;height: 70rpx;" alt=""></view>
<view style="font-size: 26rpx;">安全教育培训</view>
</view>
</view>
</scroll-view>
</view>
<!-- 弹窗 -->
<u-popup :show="showPopup" mode="center" @close="closePopup">
<view style="width:500rpx;height: auto%;position: relative;background-color: #fff;">
<view style="width: 100%;height: 70rpx;margin: 0 auto;display: flex;justify-content: space-between;align-items: center;background-color: #fff;">
<view style="width: 50%;height: 70rpx;line-height: 70rpx;font-weight: bold;margin-left: 40rpx;">选择工程</view>
<u-icon style="width: 10%;" name="close" color="#000" size="24" @click="closePopup"></u-icon>
</view>
<scroll-view style="width: 100%;height: 50vh;background-color: #fff;" scroll-y="true">
<view v-for="(item,index) in proList" :key="index" style="padding: 20rpx;" v-if="item.isActive==1" @click="chosenPro(item)">{{item.abbreviation}}</view>
</scroll-view>
</view>
</u-popup>
<m-tabbar fixed fill :current="1" :tabbar="tabbar"></m-tabbar>
</view>
</template>
<script>
import TabbarConfig from '../util/tabbar.js'
import config from '@/config'
export default {
data() {
return {
tabbar: TabbarConfig,
type:uni.getStorageSync('realNameUser').type,
subId:uni.getStorageSync('realNameUser').subId,
showPopup:false,
proList:[],
menuList:[],
permissionList:uni.getStorageSync('realNamePermissions')
// userName: uni.getStorageSync('userName'),
// className: uni.getStorageSync('className'),
// facePath: config.fileUrl + uni.getStorageSync('facePath'),
// token: uni.getStorageSync('access_token')
}
},
onLoad() {
this.getPermission()
if(this.type.indexOf("4")>-1){//监督端
this.getPro()
}
},
onShow() {
if(this.type.indexOf("4")>-1){ //监督端
let hasChosenPro=uni.getStorageSync('hasChosenPro')
if(!hasChosenPro){
this.showPopup=true
}
}
},
methods: {
getPermission(){
this.permissionList.forEach((item,index)=>{
// console.log(item)
if(item.type==3){
this.menuList.push(item)
}
})
console.log(this.menuList)
},
goModule(name){
if(name=='合同见证'){
uni.navigateTo({
url: `/pages/realName/workbench/contractWitness/index`
})
}else if(name=='电子合同'){
uni.navigateTo({
url: `/pages/realName/workbench/electronicContract/contractVideo`
})
}else if(name=='电子合同签署'){
uni.navigateTo({
url: `/pages/realName/workbench/electronicContractSign/index`
})
}else if(name=='电子合同审核'){
uni.navigateTo({
url: `/pages/realName/workbench/electronicContractExam/index`
})
}else if(name=='人员库'){
uni.navigateTo({
url: `/pages/realName/workbench/peopleLibrary/index`
})
}else if(name=='欠薪维权申诉'){
uni.navigateTo({
url: `/pages/realName/workbench/safeguarding/index`
})
}else if(name=='工资卡见证'){
uni.navigateTo({
url: `/pages/realName/workbench/wageWitness/index`
})
}else if(name=='工资查看'){
uni.navigateTo({
url: `/pages/realName/workbench/wageRecord/index`
})
}else if(name=='出场申请'){
uni.navigateTo({
url: `/pages/realName/workbench/appearApply/index`
})
}else if(name=='出场审核'){
uni.navigateTo({
url: `/pages/realName/workbench/appearExam/index`
})
}else if(name=='人员转场'){
uni.navigateTo({
url: `/pages/realName/workbench/cutToPlace/index`
})
}
},
//监督端
//作业计划与实名制监控情况
goPlan(){
uni.navigateTo({//作业计划
url: `/pages/realName/workbench/workPlan/index`
})
},
//人员信息录入
goPersonEnter(){
uni.navigateTo({//人员录入
url: `/pages/realName/workbench/personEnter/index`
})
},
//人员资质库更新
goUpdateFace(){
uni.showToast({
title: "人员资质库更新中...",
icon: 'none',
duration:2000
})
},
//人员资质检查
goQualifications(){
uni.navigateTo({//人员资质检查
url: `/pages/realName/workbench/qualifications/index`
})
},
goOutPerson(){
uni.navigateTo({//人员资质检查
url: `/pages/realName/workbench/outPerson/index`
})
},
// 施工端
goDayPlan(){//准入信息查询
uni.navigateTo({
url: `/pages/realName/workbench/dayPlan/index`
})
},
goExam(){//安全教育培训
uni.navigateTo({
url: `/pages/realName/workbench/exam/index`
})
},
//监督端获取工程列表
getPro(){
let param={
id:-1,
subId:this.subId
}
console.log(param)
uni.request({
url: config.realAppUrl + '/offLine/getPro',
method: 'post',
data: param,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: uni.getStorageSync('realNameToken')
},
success: res => {
console.log(res)
res = res.data;
if(res.code==200){
this.proList = res.data;
}
},
fail: err => {
console.log(err)
}
})
},
//展示工程选择弹窗
leftClick() {
if(this.type.indexOf("4")>-1){
this.showPopup=true;
}
},
//选择工程
chosenPro(item){
let obj = uni.getStorageSync('realNameUser')
obj.proId=item.id
uni.setStorageSync('realNameUser', obj)
uni.setStorageSync('hasChosenPro', "1")
this.showPopup=false;
},
closePopup() {
this.showPopup=false;
},
}
}
</script>
<style lang="scss">
.page {
width: 100%;
height: 100vh;
// box-sizing: border-box;
// padding: 15vh 8vw;
.view-box{
width: 100%;height: auto;display: flex;flex-wrap: wrap;flex-direction: row;
margin-bottom: 100rpx;
}
.view-item{
width: 33%;height: 200rpx;display: flex;flex-direction:column;align-items: center;justify-content: center;
}
}
</style>