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.
139 lines
4.0 KiB
139 lines
4.0 KiB
<template>
|
|
<view>
|
|
<uni-card title="员工管理">
|
|
<view style="display: flex;">
|
|
<view @tap="onDotClick('add','')" style="width:25%;display: flex;flex-direction: column;text-align:center;">
|
|
<view>
|
|
<uni-icons type="personadd" size="10"></uni-icons>
|
|
</view>
|
|
<view style="line-height:23px;">添加员工</view>
|
|
</view>
|
|
<view @tap="gotoClockPage" style="width:25%;display: flex;flex-direction: column;text-align:center;">
|
|
<view style="display: inline-block;margin: 0 auto;">
|
|
<uni-icons type="calendar" size="10"></uni-icons>
|
|
</view>
|
|
<view style="line-height:23px;">上班打卡</view>
|
|
</view>
|
|
<view @tap="gotoPerformancePage" style="width:25%;display: flex;flex-direction: column;text-align:center;">
|
|
<view style="display: inline-block;margin: 0 auto;">
|
|
<uni-icons type="list" size="10"></uni-icons>
|
|
</view>
|
|
<view style="line-height:23px;">业绩管理</view>
|
|
</view>
|
|
<view @tap="goGuide" style="width:25%;display: flex;flex-direction: column;text-align:center;">
|
|
<view style="display: inline-block;margin: 0 auto;">
|
|
<uni-icons type="locked" size="10"></uni-icons>
|
|
</view>
|
|
<view style="line-height:23px;">打卡规则</view>
|
|
</view>
|
|
</view>
|
|
|
|
</uni-card>
|
|
<uni-card title="员工列表">
|
|
<view v-for="(item , index) in staffList" :key="index" style="display: flex;height: 40px;line-height: 40px;border-bottom: 1px solid #eee;">
|
|
<view style="width: 20%;padding-left: 10px;font-size: 16px;font-weight: bold;">{{ item.nickname }}</view>
|
|
<view style="width: 70%;">
|
|
<view class="biaoshi" v-if="item.type==0&&(shopOwnerPhone==item.username)">主账号</view>
|
|
<view class="biaoshi" v-if="item.type==0&&(shopOwnerPhone!=item.username)">管理员</view>
|
|
<view class="biaoshi" v-if="item.type==1">员工</view>
|
|
</view>
|
|
<view @tap="onDotClick('edit',item)"><u-icon name="edit-pen-fill" size="20"></u-icon></view>
|
|
</view>
|
|
</uni-card>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
staffList: [],
|
|
avatar: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png',
|
|
type:'',
|
|
shopOwnerPhone:uni.getStorageSync('shopOwnerPhone'),
|
|
username:uni.getStorageSync('username')
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.type = uni.getStorageSync('type')
|
|
},
|
|
onShow() {
|
|
this.getStaffList()
|
|
},
|
|
methods: {
|
|
onDotClick(type,item) {
|
|
|
|
if(this.type == 0 && this.shopOwnerPhone == this.username){
|
|
uni.navigateTo({
|
|
url: `/package1/staff/addStaff?type=${type}&item=`+ JSON.stringify(item)
|
|
})
|
|
}else{
|
|
this.tui.toast("暂无添加权限")
|
|
}
|
|
},
|
|
getStaffList() {
|
|
this.tui.request('/app/common/user/findAllUserByShopId', 'get', {}, false, false, true).then((res) => {
|
|
if (res.code !== 200) return
|
|
this.staffList = res.result
|
|
})
|
|
},
|
|
gotoPerformancePage() {
|
|
if(this.type == 0 && (uni.getStorageSync('shopOwnerPhone') == uni.getStorageSync('username'))){
|
|
uni.navigateTo({
|
|
url: '/package1/staff/performance'
|
|
})
|
|
}else{
|
|
this.tui.toast("暂无查看权限")
|
|
}
|
|
|
|
},
|
|
gotoClockPage() {
|
|
this.tui.toast("内测中,暂未开放")
|
|
// uni.navigateTo({
|
|
// url: '/package1/staff/clock'
|
|
// })
|
|
},
|
|
goGuide(){
|
|
this.tui.toast("内测中,暂未开放")
|
|
// if(this.type == 0){
|
|
// uni.navigateTo({
|
|
// url: '/package1/staff/signRule'
|
|
// })
|
|
// }else{
|
|
// this.tui.toast("暂无编辑权限")
|
|
// }
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.staff-name {
|
|
padding: 0 15px;
|
|
}
|
|
.biaoshi{
|
|
display: inline-block;
|
|
padding: 0 10px;
|
|
background: #60F3FF;
|
|
color: #fff;
|
|
border-radius: 10px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
.tag-wrap {
|
|
width: 100rpx;
|
|
flex: 1;
|
|
display: flex;
|
|
|
|
view {
|
|
margin: 0 2upx;
|
|
}
|
|
}
|
|
|
|
.avatar-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
font-size: 24upx;
|
|
}
|
|
</style>
|