<template>
|
<view class="container">
|
<view :class="identity=='enterprise'?'header-hide':'header'">
|
<view class="header-img">
|
<view class="header-image-left" @click='tologin'>
|
<up-avatar :src="userInfo.avatar" shape="circle" size='60'></up-avatar>
|
<view class="header-name">{{ userInfo.nickname || (isLogin ? '暂无信息' : '点击登录') }}</view>
|
</view>
|
<view @tap="changRole" class="header-image-right chuany-flex chuany-align-center chuany-justify-center"
|
data-ptpid="e758-138d-b914-343f">
|
<text>{{ identity=='enterprise' ? '我要找工作' : '我要招人' }}</text>
|
<text class='iconfont icon-qiehuan chuany-font28'></text>
|
</view>
|
</view>
|
<view class="num-box" v-if="identity!=='enterprise'">
|
<view @tap="goWallet" class="num-item" data-ptpid="ef57-17f4-bbea-280f">
|
<view class="num-bold">{{ balance }}元</view>
|
<view class="num-text">
|
<text class="c-m-r-10">{{ identity=='enterprise' ? '企业余额' : '立即提现' }}</text>
|
<up-icon name="arrow-right-double"></up-icon>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="money_bag" v-if="identity=='enterprise'">
|
<view class="tool_wrap">
|
<view class="tool_title">
|
企业服务
|
</view>
|
<view class="tool_content">
|
<view class="tool_item" @click="toRelease" v-if="isAdmin">
|
<image src="@/static/image/fabu.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
发布职位
|
</view>
|
</view>
|
<view class="tool_item" @click="toOrder" v-if="isAdmin">
|
<image src="@/static/image/guanli.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
职位管理
|
</view>
|
</view>
|
<view class="tool_item" @click="toEnterprise">
|
<image src="@/static/image/qiye.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
我的企业
|
</view>
|
</view>
|
<view class="tool_item" @click="toWorkerRecord" v-if="isAdmin">
|
<image src="@/static/image/record.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
工资审核
|
</view>
|
</view>
|
<view class="tool_item" @click="toSalary" v-if="isAdmin">
|
<image src="@/static/image/salary.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
工资查询
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="money_bag" v-if="identity=='enterprise'&&isWorker">
|
<view class="tool_wrap">
|
<view class="tool_title">
|
费用报销
|
</view>
|
<view class="tool_content">
|
<view class="tool_item" @click="toReimbursement" v-if="isWorker">
|
<image src="@/static/image/baoxiao.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
报销申请
|
</view>
|
</view>
|
<view class="tool_item" @click="toMyList" v-if="isWorker">
|
<image src="@/static/image/mybaoxiao.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
我的报销
|
</view>
|
</view>
|
<view class="tool_item" @click="toCaiwu" v-if="IsCaiWu">
|
<image src="@/static/image/caiwu.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
费用报销
|
</view>
|
</view>
|
<view class="tool_item" @click="toZhuguan" v-if="IsBaoxiaozhuguan">
|
<image src="@/static/image/zshenpi.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
主管审批
|
</view>
|
</view>
|
<view class="tool_item" @click="toJingli" v-if="Isbaoxiaojingli">
|
<image src="@/static/image/Jshenpi.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
报销审批
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="money_bag" v-if="identity=='enterprise'&&isWorker">
|
<view class="tool_wrap">
|
<view class="tool_title">
|
物流管理
|
</view>
|
<view class="tool_content">
|
<view class="tool_item" @click="toDelivergoods('reservationWorker')" v-if="isWorker">
|
<image src="@/static/image/reservation.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
预约送货
|
</view>
|
</view>
|
<view class="tool_item" @click="toDelivergoods('reservation')" v-if="isDeliverManage">
|
<image src="@/static/image/drivershouli.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
送货受理
|
</view>
|
</view>
|
<view class="tool_item" @click="toDelivergoods('arrange')" v-if="isDeliverManage">
|
<image src="@/static/image/arrange.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
送货安排
|
</view>
|
</view>
|
<view class="tool_item" @click="toDelivergoods('query')" v-if="isDeliverManage||isWorker">
|
<image src="@/static/image/query.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
送货查询
|
</view>
|
</view>
|
<view class="tool_item" @click="toDelivergoods('feedback')" v-if="isDriver">
|
<image src="@/static/image/feedback.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
送货反馈
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<!-- <view class="job-box">
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="0" data-ptpid="0d7e-1bd6-8311-5701">
|
<view class="num">{{ userApplyStatistics.allCount }}</view>
|
<view class="text">全部</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="1" data-ptpid="525a-1b59-a630-5431">
|
<view class="num">{{ userApplyStatistics.hasApplyCount }}</view>
|
<view class="text">已报名</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="2" data-ptpid="13ba-13a5-98dc-aba6">
|
<view class="num">{{ userApplyStatistics.applyOngoingCount }}</view>
|
<view class="text">已录取</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item" data-index="3" data-ptpid="df41-1bae-b01e-8c13">
|
<view class="num">{{ userApplyStatistics.applySuccessCount }}</view>
|
<view class="text">已完成</view>
|
</view>
|
</view> -->
|
<view class="nav-box" v-if="identity=='enterprise'">
|
<view class="" v-if="isAdmin">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in navList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view>
|
<!-- <view class="" v-if="isWorker">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in workerList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view> -->
|
<!-- <view class="" v-if="Isbaoxiaojingli">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in jingLiList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view> -->
|
<!-- <view class="" v-if="IsBaoxiaozhuguan">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in zhuGuanList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view> -->
|
<!-- <view class="" v-if="IsCaiWu">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in CaiWuList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view> -->
|
</view>
|
<view class="nav-box" v-else>
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in navList1" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
</template>
|
|
<script>
|
import {
|
mapActions,
|
mapGetters,
|
mapMutations
|
} from 'vuex'
|
export default {
|
data() {
|
return {
|
navList: [{
|
icon: 'icon-huabanfuben',
|
name: '员工管理',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/company/staff'
|
});
|
}
|
}],
|
workerList: [{
|
icon: 'icon-baoxiaoshenqing',
|
name: '费用报销申请',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/index'
|
});
|
}
|
}, {
|
icon: 'icon-baoxiao',
|
name: '我的费用报销',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/myreim'
|
});
|
}
|
}],
|
CaiWuList: [{
|
icon: 'icon-baoxiaodan',
|
name: '费用报销',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/reimbursement'
|
});
|
}
|
}],
|
zhuGuanList: [{
|
icon: 'icon-shenpicaigoudan',
|
name: '主管列表',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/examine?role=zhuGuan'
|
});
|
}
|
}],
|
jingLiList: [{
|
icon: 'icon-shenpi',
|
name: '经理列表',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/examine?role=jingLi'
|
});
|
}
|
}],
|
navList2: [{
|
icon: 'icon-dingdan',
|
name: '上班打卡',
|
cb: this.toMyWork
|
},
|
{
|
icon: 'icon-fuwutuandui',
|
name: '工作记录',
|
cb: this.toMyRecord
|
},
|
{
|
icon: 'icon-wanshanxinxi',
|
name: '完善资料',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
}
|
},
|
],
|
navList3: [{
|
icon: 'icon-dingdan',
|
name: '上班打卡',
|
cb: this.toMyWork
|
},
|
{
|
icon: 'icon-fuwutuandui',
|
name: '工作记录',
|
cb: this.toMyRecord
|
},
|
{
|
icon: 'icon-wanshanxinxi',
|
name: '修改资料',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
}
|
},
|
],
|
token: this.$db.get('userToken') || ''
|
};
|
},
|
onLoad: function() {
|
|
},
|
onShow: function() {
|
this.getUserInfo()
|
},
|
computed: {
|
...mapGetters(['userInfo', 'identity']),
|
isAdmin() {
|
return this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false
|
},
|
// 是否是员工
|
isWorker() {
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.memberId ? true : false
|
}
|
return false
|
},
|
//是否是送货管理管理员
|
isDeliverManage(){
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.bF_IsDeliverManage ? true : false
|
}
|
return false
|
},
|
// 是否为报销主管
|
IsBaoxiaozhuguan() {
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.bF_IsBaoxiaozhuguan ? true : false
|
}
|
return false
|
},
|
// 是否为报销经理
|
Isbaoxiaojingli() {
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.bF_Isbaoxiaojingli ? true : false
|
}
|
return false
|
},
|
// 财务
|
IsCaiWu() {
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.bF_IsCaiWu ? true : false
|
}
|
return false
|
},
|
// 是否是司机
|
isDriver() {
|
if (this.userInfo.oaPermissions) {
|
return this.userInfo.oaPermissions.bF_IsDriver ? true : false
|
}
|
return false
|
},
|
navList1() {
|
return this.userInfo.userWorker ? this.navList3 : this.navList2
|
},
|
isLogin() {
|
return this.token ? true : false;
|
},
|
balance() {
|
if (this.identity == 'worker') {
|
if (this.userInfo.userWorker) {
|
return this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo
|
.userWorker
|
.yiTiXianJine)
|
} else {
|
return '0.00'
|
}
|
} else {
|
if (this.userInfo.userCompany) {
|
return this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany
|
.chongZhiYue :
|
'0.00'
|
} else {
|
return '0.00'
|
}
|
}
|
}
|
},
|
methods: {
|
...mapActions([
|
'getUserInfo'
|
]),
|
...mapMutations(['setIdentity']),
|
tologin() {
|
if (this.isLogin) {
|
uni.navigateTo({
|
url: '/pages/mine/mine'
|
})
|
} else {
|
uni.navigateTo({
|
url: '/pages/login/index'
|
})
|
}
|
},
|
toOrder() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/order/order'
|
})
|
},
|
toRelease() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/release/index'
|
})
|
},
|
toEnterprise() {
|
uni.navigateTo({
|
url: '/pages/enterprise/index'
|
})
|
},
|
toWorkerRecord() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/company/index'
|
});
|
},
|
toSalary() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/worker/salary'
|
});
|
},
|
toMyWork() {
|
if (!this.userInfo.userWorker) {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
this.$util.showToast({
|
title: '请先完善资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/order/myorder'
|
});
|
},
|
toMyRecord() {
|
if (!this.userInfo.userWorker) {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
this.$util.showToast({
|
title: '请先完善资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/checkin/index'
|
});
|
},
|
changRole() {
|
this.$store.commit('setIdentity', this.identity === 'enterprise' ? 'worker' : 'enterprise')
|
// this.$db.set('identity', this.identity === 'enterprise' ? 'worker' : 'enterprise')
|
// this.identity = this.identity === 'enterprise' ? 'worker' : 'enterprise'
|
console.log(this.identity, this.$db.get('identity'), 'this.identity');
|
// uni.setStorage({
|
// key: 'identity',
|
// data: this.identity,
|
// });
|
// if (this.identity == 'worker') {
|
// if (this.userInfo.userWorker) {
|
// this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
|
// .yiTiXianJine)
|
// }
|
// } else {
|
// if (this.userInfo.userCompany) {
|
// this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue :
|
// '0.00'
|
// }
|
// }
|
},
|
goWallet() {
|
uni.navigateTo({
|
url: '/pages/wallet/index',
|
fail(err) {
|
console.log(err);
|
}
|
});
|
},
|
toReimbursement() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/index'
|
});
|
},
|
toMyList() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/myreim'
|
});
|
},
|
toCaiwu() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/reimbursement'
|
});
|
},
|
toZhuguan() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/examine?role=zhuGuan'
|
});
|
},
|
toJingli() {
|
uni.navigateTo({
|
url: '/pages/reimbursement/examine?role=jingLi'
|
});
|
},
|
toDelivergoods(val) {
|
uni.navigateTo({
|
url: `/pages/delivergoods/${val}?isAdmin=${this.isDeliverManage}`
|
});
|
}
|
|
}
|
};
|
</script>
|
<style lang="scss">
|
@import './mine.scss';
|
|
.money_bag {
|
background: #fff;
|
border-radius: 16rpx;
|
margin: 18rpx 26rpx;
|
padding: 16rpx 26rpx;
|
position: relative;
|
// top: 25rpx;
|
z-index: 2;
|
|
.up_wrap {
|
padding: 20rpx 0 0;
|
|
.left_img {
|
width: 80rpx;
|
height: 80rpx;
|
flex-shrink: 0;
|
border-radius: 50%;
|
overflow: hidden;
|
margin-right: 20rpx;
|
border: 4rpx solid #39A7FF;
|
|
.header_img {
|
width: 100%;
|
height: 100%;
|
border-radius: 50%;
|
}
|
}
|
|
.user_info_login {
|
.user_name {
|
width: 320rpx;
|
}
|
|
.user_bottom {
|
margin-top: 10rpx;
|
font-size: 24rpx;
|
line-height: 24rpx;
|
}
|
}
|
|
.up_btn {
|
flex-shrink: 0;
|
|
.user_btn {
|
margin-left: 20rpx;
|
flex-shrink: 0;
|
width: 80rpx;
|
height: 80rpx;
|
border-radius: 50%;
|
background-color: #39A7FF;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.user_btn_image {
|
width: 32rpx;
|
height: 32rpx;
|
}
|
|
.btn_text {
|
font-size: 20rpx;
|
line-height: 20rpx;
|
color: #fff;
|
}
|
|
}
|
}
|
|
.serve_item {
|
display: flex;
|
align-items: center;
|
padding: 40rpx 0;
|
border-bottom: 4rpx solid #eee;
|
|
&:last-child {
|
border-bottom: none;
|
}
|
|
.item_icon {
|
width: 40rpx;
|
height: 40rpx;
|
flex-shrink: 0;
|
}
|
|
.item_text {
|
font-size: 32rpx;
|
line-height: 32rpx;
|
color: #666;
|
flex: 1;
|
margin: 0 20rpx;
|
}
|
|
button {
|
background-color: #fff;
|
text-align: left;
|
padding: 0;
|
}
|
|
.icon-youjiantou {
|
font-size: 32rpx;
|
line-height: 32rpx;
|
color: #999;
|
}
|
}
|
|
.bag_header {
|
align-items: center;
|
color: #333;
|
display: flex;
|
font-size: 32rpx;
|
font-weight: 700;
|
justify-content: space-between;
|
padding: 10rpx 0 30rpx;
|
|
.bag_right {
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
|
.bag_content {
|
display: flex;
|
justify-content: space-between;
|
padding: 0 0 30rpx;
|
|
.content_item {
|
align-items: center;
|
background: #f8f8f8;
|
border-radius: 8px;
|
display: flex;
|
flex-direction: column;
|
height: 140rpx;
|
justify-content: center;
|
width: 200rpx;
|
|
.num {
|
color: #333;
|
font-size: 36rpx;
|
font-weight: 700;
|
letter-spacing: 0;
|
line-height: 36rpx;
|
text-align: center;
|
}
|
|
.label {
|
color: #999;
|
font-size: 22rpx;
|
letter-spacing: 0;
|
line-height: 28rpx;
|
padding: 10rpx 0 0;
|
text-align: center;
|
}
|
}
|
}
|
|
.tool_wrap {
|
.tool_title {
|
color: #333;
|
font-size: 32rpx;
|
font-weight: 700;
|
padding: 20rpx 0;
|
border-bottom: 2rpx solid #eee;
|
}
|
|
.tool_content {
|
display: flex;
|
// justify-content: space-between;
|
padding: 20rpx 0;
|
|
.tool_item {
|
align-items: center;
|
display: flex;
|
flex-direction: column;
|
height: 130rpx;
|
justify-content: center;
|
// margin: 0 50rpx 0 0;
|
width: 130rpx;
|
|
&:nth-child(4n) {
|
margin-right: 0;
|
}
|
|
.item_img {
|
height: 53rpx;
|
width: 53rpx;
|
}
|
|
.tool_label {
|
color: #333;
|
font-size: 24rpx;
|
line-height: 24rpx;
|
margin: 16rpx 0 0;
|
}
|
}
|
}
|
}
|
}
|
</style>
|