OfficeApp/subpkg/companyInfo/companyInfo.vue

290 lines
7.3 KiB
Vue
Raw Normal View History

<template>
<view class="">
2023-08-04 11:32:51 +08:00
<u-sticky bgColor="#fff">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
</u-sticky>
2023-08-04 17:43:13 +08:00
<view v-if="loadType">
2023-08-03 14:05:16 +08:00
<view class="company_info" v-show="current==0">
<company></company>
</view>
<view class="company_list" v-show="current==1">
<view class="info_card" v-for="item in companyList" :key="item.id">
<view class="top" @click="naviTo('/subpkg/companySign/companySign?id='+item.id)">
<view>
<view class="info_name" :class="item.is_contract?'have':'no'">{{item.company_name}}</view>
<view class="info_type">{{item.company_type_name}}</view>
</view>
<view class="btn">详情<uni-icons type="forward" color="#666666"></uni-icons></view>
</view>
2023-08-04 11:32:51 +08:00
<u-line></u-line>
2023-08-03 14:05:16 +08:00
<view class="bottom">
<image src="../../static/img/contract/company.png"></image>
<view class="text">
<view>主要联系人{{item.master_name}}</view>
<view @click="copyPhone(item.master_phone)">联系方式{{item.master_phone}}</view>
<view style="display: flex;">
<view class="">区县乡镇</view>
<view>{{item.city_name+'/'+item.area_name+'/'+item.street_name}}</view>
</view>
<!-- <view>片区经理</view> -->
</view>
</view>
</view>
2023-08-04 11:32:51 +08:00
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
<mybtn text="新建签约" @click="naviTo('/subpkg/companyUnsign/companyUnsign')"></mybtn>
2023-08-03 14:05:16 +08:00
</view>
<view class="company_info" v-show="current==2">
<companyFinance></companyFinance>
</view>
2023-08-04 18:11:49 +08:00
<view v-show="current==3">
2023-08-05 10:22:22 +08:00
<task style="width: 100vw;"></task>
2023-08-04 11:32:51 +08:00
</view>
</view>
2023-08-04 17:43:13 +08:00
<u-empty v-else icon="/static/img/empty/data.png" text="没有数据"></u-empty>
</view>
</template>
<script>
2023-08-04 11:32:51 +08:00
import { companyIndex } from "@/api/company.js"
import { Toast } from '@/libs/uniApi.js'
2023-08-03 14:05:16 +08:00
import companyFinance from "@/components/companyFinance/companyFinance.vue"
2023-08-04 11:32:51 +08:00
import task from "@/components/task/index.vue"
export default {
2023-08-04 11:32:51 +08:00
components: { companyFinance, task },
data() {
return {
current: 0,
2023-08-03 14:05:16 +08:00
currentChild: 0,
2023-08-04 17:43:13 +08:00
loadType: true,// 当公司不存在时显示
2023-08-04 11:32:51 +08:00
tabLists: [{
name: '我的公司',
}, {
name: '签约公司'
}, {
name: '公司财务'
}, {
name: '任务情况'
}],
loadConfig: {
page: 1,
limit: 15,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
companyList: []
}
},
onLoad() {},
onShow() {
2023-08-04 17:43:13 +08:00
if(this.$store.state.app.userInfo.company_id){
this.loadCompanyList();
}else {
this.loadType = false;
}
},
onReachBottom() {
this.loadCompanyList();
},
methods: {
2023-08-06 16:27:59 +08:00
async initLoad() {
2023-08-03 14:05:16 +08:00
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.companyList = [];
2023-08-06 16:27:59 +08:00
await this.loadCompanyList();
uni.stopPullDownRefresh()
2023-08-03 14:05:16 +08:00
},
// 加载公司列表
2023-08-04 11:32:51 +08:00
async loadCompanyList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let res = await companyIndex({
2023-08-03 14:05:16 +08:00
page: this.loadConfig.page,
limit: this.loadConfig.limit
})
2023-08-04 11:32:51 +08:00
this.loadConfig.status = "loadmore"
if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.companyList = [...this.companyList, ...res.data?.data]
},
naviTo(url) {
url ?
uni.navigateTo({
url: url
}) : Toast('暂未开放')
},
2023-08-04 11:32:51 +08:00
naviBack() {
uni.navigateBack()
},
2023-08-04 11:32:51 +08:00
copyPhone(str = "", type = "号码") {
if (str) uni.setClipboardData({
data: str + "",
success: (e) => {
2023-08-04 11:32:51 +08:00
Toast(type + '已复制')
},
fail: (e) => {
Toast('复制失败')
}
})
2023-08-04 11:32:51 +08:00
},
changeCurrent(e){
this.current = e.index;
}
},
onPullDownRefresh() {
2023-08-06 16:27:59 +08:00
this.initLoad()
}
}
</script>
<style lang="scss">
2023-08-09 11:18:45 +08:00
page{
}
2023-08-04 11:32:51 +08:00
.fixed_box {
width: 100%;
position: fixed;
/* #ifdef APP-PLUS */
top: 0;
/* #endif */
/* #ifdef H5 */
top: 44px;
/* #endif */
left: 0;
z-index: 999;
}
2023-08-03 17:44:02 +08:00
2023-08-04 11:32:51 +08:00
.top_box {
background-color: #fff;
display: flex;
2023-08-04 11:32:51 +08:00
.item {
flex-shrink: 0;
/* 禁止缩小 */
width: 155rpx;
height: 53rpx;
background: #F5F5F5FF;
color: #999999FF;
border-radius: 35rpx 35rpx 35rpx 35rpx;
opacity: 1;
display: flex;
justify-content: center;
align-items: center;
margin: 28rpx 0;
margin-left: 28rpx;
}
.active {
background: $theme-oa-color;
color: #fff;
}
}
2023-08-04 11:32:51 +08:00
.top_box2 {
.item {
margin-top: 0;
width: 120rpx;
}
}
2023-08-04 11:32:51 +08:00
.company_info {
// margin-top: 110rpx;
2023-08-03 14:05:16 +08:00
}
2023-08-04 11:32:51 +08:00
.company_list {
padding-bottom: 32rpx;
// margin-top: 190rpx;
display: flex;
flex-direction: column;
align-items: center;
.info_card {
width: 694rpx;
// height: 300rpx;
background: #FFFFFF;
border-radius: 21rpx 21rpx 21rpx 21rpx;
margin-top: 28rpx;
padding: 24rpx;
.top {
display: flex;
2023-08-04 11:32:51 +08:00
justify-content: space-between;
align-items: center;
2023-08-04 11:32:51 +08:00
margin-bottom: 28rpx;
.info_name {
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.have {
&::before {
content: "已签约";
border-radius: 14rpx;
border: 5rpx solid #5ac725;
color: #5ac725;
padding: 3rpx 6rpx;
font-size: 28rpx;
margin-right: 10rpx;
}
}
.no {
&::before {
content: "未签约";
border-radius: 14rpx;
border: 5rpx solid #f56c6c;
color: #f56c6c;
padding: 3rpx 6rpx;
font-size: 28rpx;
margin-right: 10rpx;
}
}
.info_type {
font-size: 25rpx;
font-weight: 500;
color: $theme-oa-color;
margin-top: 10rpx;
}
.btn {
2023-08-07 16:49:42 +08:00
flex-shrink: 0;
2023-08-04 11:32:51 +08:00
font-size: 25rpx;
font-weight: 400;
color: #666666;
display: flex;
align-items: center;
2023-08-07 10:19:52 +08:00
justify-content: right;
2023-08-04 11:32:51 +08:00
}
}
2023-08-04 11:32:51 +08:00
.bottom {
display: flex;
2023-08-04 11:32:51 +08:00
margin-top: 28rpx;
image {
height: 140rpx;
width: 140rpx;
margin-right: 28rpx;
}
.text {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
}
2023-08-04 11:32:51 +08:00
}
</style>