平板端快衣店
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.
 
 
 
 
 

118 lines
2.9 KiB

<template>
<view>
<uni-card title="员工管理">
<u-grid :col="4" border>
<u-grid-item index="add" @tap="onDotClick('add','')">
<u-icon name="man-add" :size="size"></u-icon>
<view class="man-add">添加员工</view>
</u-grid-item>
<u-grid-item @tap="gotoClockPage">
<u-icon name="calendar" :size="size"></u-icon>
<view class="calendar">上班打卡</view>
</u-grid-item>
<u-grid-item @tap="gotoPerformancePage">
<u-icon name="list" :size="size"></u-icon>
<view class="list">业绩管理</view>
</u-grid-item>
<u-grid-item @tap="goGuide">
<u-icon name="lock" :size="size"></u-icon>
<view class="lock">打卡规则</view>
</u-grid-item>
</u-grid>
</uni-card>
<uni-card title="员工列表">
<uni-list>
<uni-list-item direction="row" clickable @tap="onDotClick('edit',item)" v-for="(item , index) in staffList"
:key="index">
<template #body>
<view class="tag-wrap">
<view v-if="item.departmentTitle">
<u-tag :text="item.departmentTitle" size="12" />
</view>
<!-- <view>
<u-tag text="店长" v-if="item.type==1" size="12" />
<u-tag text="员工" v-if="item.type==0" size="12" />
</view> -->
</view>
</template>
<template #header>
<view class="avatar-wrap">
<u-avatar :src="item.avatar" size="24">
</u-avatar>
<text class="staff-name">{{ item.nickname }}</text>
</view>
</template>
<template #footer>
<view><u-icon name="edit-pen-fill" size="28"></u-icon></view>
</template>
</uni-list-item>
</uni-list>
</uni-card>
</view>
</template>
<script>
export default {
data() {
return {
staffList: [],
avatar: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png',
size: 30,
};
},
onShow() {
this.getStaffList()
},
methods: {
onDotClick(type,item) {
uni.navigateTo({
url: `/pages/staff/addStaff/addStaff?type=${type}&item=`+ JSON.stringify(item)
})
},
getStaffList() {
this.tui.request('/app/common/user/findAllUserByShopId', 'get', {}, false, false, true).then((res) => {
if (res.code !== 200) return
this.staffList = res.result
})
},
gotoPerformancePage() {
uni.navigateTo({
url: '/pages/staff/performance/performance'
})
},
gotoClockPage() {
uni.navigateTo({
url: '/pages/staff/clock/clock'
})
},
goGuide(){
uni.navigateTo({
url: '/pages/staff/signRule/signRule'
})
}
}
}
</script>
<style lang="scss" scoped>
.staff-name {
padding: 0 15upx;
}
.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>