OfficeApp/subpkg/personnel/personnel.vue

316 lines
8.4 KiB
Vue
Raw Normal View History

2023-07-19 11:58:18 +08:00
<template>
<view class="personnel">
2023-07-21 16:05:49 +08:00
<view class="personnel_list">
2023-07-22 14:41:42 +08:00
<block v-for="(item, index) in userList" :key="item.id">
<view class="personnel_item">
2023-08-04 12:04:32 +08:00
<view class="type" :class="item.is_contract?'type_blue':''">
<image v-if="item.is_contract" src="../../static/icons/ok_w.png"></image>
<image v-else src="../../static/icons/err_w.png"></image>
2023-07-21 16:50:34 +08:00
</view>
2023-08-04 12:04:32 +08:00
<view class="top" style="margin-bottom: 28rpx;">
2023-07-22 14:41:42 +08:00
<view class="left">
2023-08-04 12:04:32 +08:00
<u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'"
width="112.28rpx" height="112.28rpx" shape="circle"></u--image>
2023-07-21 16:50:34 +08:00
</view>
2023-07-22 14:41:42 +08:00
<view class="right">
<view class="info_top">
2023-07-31 14:07:20 +08:00
<view class="info_name">{{item.nickname}}</view>
2023-08-04 12:04:32 +08:00
<text class="phone">电话:</text>
<text class="tel">{{item.phone||item.account}}</text>
2023-07-21 16:50:34 +08:00
</view>
2023-07-22 14:41:42 +08:00
<view class="info_bottom">
2023-08-03 15:44:42 +08:00
<text class="item phone">
2023-08-04 12:04:32 +08:00
分管片区:
2023-08-03 15:44:42 +08:00
</text>
2023-07-22 14:41:42 +08:00
<view class="item">
2023-07-31 14:07:20 +08:00
<view class="location">{{ item.city_name+item.area_name+item.street_name }}</view>
2023-07-22 14:41:42 +08:00
</view>
2023-07-21 16:50:34 +08:00
</view>
2023-08-04 12:04:32 +08:00
<view class="company">
<text>
所属公司:
</text>
<view class="itm" v-if="item.company">{{item.company.company_name}}</view>
</view>
2023-07-21 16:50:34 +08:00
</view>
</view>
2023-08-04 12:04:32 +08:00
<!-- <view class="center">
2023-07-22 14:41:42 +08:00
<view class="top" v-for="(role, roleIndex) in item.roles" :key="roleIndex">
{{role}}
</view>
2023-08-04 12:04:32 +08:00
</view> -->
2023-08-01 10:08:26 +08:00
<u-line color="#999999FF"></u-line>
2023-08-03 15:44:42 +08:00
<view class="bottom" style="margin-top: 28rpx;float: right;">
2023-08-04 12:04:32 +08:00
<button class="look sign" v-if="item.is_contract==1">已签约</button>
<button class="look red" v-else>未签约</button>
2023-08-03 15:44:42 +08:00
<button class="look" @click="navTo('/subpkg/finance/finance?id='+item.id)">财务查看</button>
<button class="look" @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">信息查看</button>
2023-07-31 14:46:42 +08:00
</view>
2023-07-21 16:50:34 +08:00
</view>
2023-07-22 14:41:42 +08:00
</block>
2023-08-04 12:04:32 +08:00
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
2023-07-19 11:58:18 +08:00
</view>
2023-08-02 10:27:26 +08:00
<button class="new_btn" @click.stop="navTo('/subpkg/newPersonnel/newPersonnel')">创建账号</button>
2023-07-19 11:58:18 +08:00
</view>
</template>
<script>
2023-08-04 12:04:32 +08:00
import { Toast } from '@/libs/uniApi.js'
import { companyUser } from "@/api/company.js"
export default {
data() {
return {
loadConfig: {
page: 1,
limit: 15,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
userList: []
}
},
2023-08-04 12:04:32 +08:00
onLoad() {},
onShow() {
this.loadUserList()
},
methods: {
navTo(url) {
url ?
uni.navigateTo({
url: url,
}) : Toast('暂未开放')
},
async loadUserList() {
let that = this;
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"
let res = await companyUser({
page: this.loadConfig.page,
limit: this.loadConfig.limit,
company_id: this.$store.state.app.userInfo.company_id
})
this.loadConfig.status = "loadmore"
if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.userList = [...this.userList, ...res.data?.data]
}
2023-08-04 12:04:32 +08:00
},
onPullDownRefresh() {
2023-07-19 11:58:18 +08:00
uni.stopPullDownRefresh()
}
}
</script>
<style lang="scss">
2023-08-04 12:04:32 +08:00
.personnel {
.new_btn {
position: fixed;
bottom: 30rpx;
// margin-top: 32rpx;
// margin-bottom: 40rpx;
left: 50%;
transform: translate(-50%);
z-index: 999;
2023-07-21 16:05:49 +08:00
width: 694rpx;
2023-08-04 12:04:32 +08:00
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
.personnel_list {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 32rpx;
padding-bottom: 130rpx;
.personnel_item {
width: 694rpx;
// height: 407rpx;
background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-bottom: 32rpx;
overflow: hidden;
position: relative;
padding: 28rpx;
.type {
width: 50rpx;
height: 50rpx;
background-color: #F02828;
border-radius: 50%;
2023-07-21 16:50:34 +08:00
font-size: 25rpx;
font-weight: 400;
2023-08-04 12:04:32 +08:00
color: #FFFFFF;
line-height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 10rpx;
right: 10rpx;
image {
width: 18rpx;
height: 18rpx;
margin-right: 1rpx;
}
}
.type_blue {
background-color: #34A853;
}
.top {
// background-color: #3274F9;
display: flex;
.right {
2023-07-21 16:50:34 +08:00
display: flex;
2023-08-04 12:04:32 +08:00
flex-direction: column;
justify-content: space-around;
margin-left: 28rpx;
2023-07-21 16:50:34 +08:00
font-size: 25rpx;
font-weight: 400;
2023-08-04 12:04:32 +08:00
overflow: hidden;
color: #999999;
.info_top {
display: flex;
align-items: flex-end;
font-size: 25rpx;
2023-07-21 16:50:34 +08:00
font-weight: 400;
2023-08-04 12:04:32 +08:00
color: $theme-oa-color;
.info_name {
font-size: 32rpx;
font-weight: 400;
color: #333333;
margin-right: 18rpx;
}
.phone {
margin-left: 30rpx;
color: #999999;
}
.tel {
color: #000;
}
2023-07-21 16:50:34 +08:00
}
2023-08-04 12:04:32 +08:00
.info_bottom {
2023-07-21 16:50:34 +08:00
display: flex;
2023-08-04 12:04:32 +08:00
.item {
display: flex;
align-items: center;
}
.phone {
margin-right: 28rpx;
}
.location {
width: 250rpx;
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 将超出文本隐藏 */
text-overflow: ellipsis;
/* 使用省略号表示被隐藏的文本 */
color: #000;
}
2023-07-21 16:50:34 +08:00
}
2023-08-04 12:04:32 +08:00
.company {
display: flex;
text {
margin-right: 30rpx;
}
.itm {
color: #000;
}
2023-07-21 16:50:34 +08:00
}
}
}
2023-08-04 12:04:32 +08:00
.center {
padding: 28rpx 0;
.top {
font-size: 28rpx;
font-weight: 400;
color: #666666FF;
margin-bottom: 20rpx;
.green {
color: #34A853FF;
}
.yellow {
color: #F9AA32FF;
}
2023-07-21 16:50:34 +08:00
}
2023-08-04 12:04:32 +08:00
.bottom {
display: flex;
justify-content: space-around;
font-size: 25rpx;
font-weight: 400;
color: #999999;
image {
width: 18rpx;
height: 18rpx;
margin-right: 9rpx;
}
2023-07-21 16:50:34 +08:00
}
}
2023-08-04 12:04:32 +08:00
.bottom {
2023-07-21 16:50:34 +08:00
display: flex;
justify-content: center;
2023-08-04 12:04:32 +08:00
.look {
width: 128rpx;
height: 43rpx;
background: #FFFFFF;
border-radius: 26rpx 26rpx 26rpx 26rpx;
opacity: 1;
// border: 2rpx solid $theme-oa-color;
font-size: 28rpx;
font-weight: 400;
margin-left: 28rpx;
color: $theme-oa-color;
display: flex;
justify-content: center;
align-items: center;
}
.sign {
color: #34A853;
// border: 2rpx solid #34A853;
}
.red {
color: #F02828;
// border: 2rpx solid #F02828;
}
2023-07-21 16:50:34 +08:00
}
2023-07-19 11:58:18 +08:00
}
}
2023-08-04 12:04:32 +08:00
2023-07-19 11:58:18 +08:00
}
2023-08-04 12:04:32 +08:00
</style>