<template>
|
<view class="content">
|
<u-sticky>
|
<view class="ptb10 search">
|
<view class="plr20">
|
<u-search placeholder="搜索企业名称" bgColor="#fff" :showAction="false" v-model="searchForm.companyName"
|
@search="scrolltoupper" @clear="scrolltoupper"></u-search>
|
</view>
|
<u-tabs :list="status" :is-scroll="false" :activeStyle="{ transform: 'scale(1.05)', color: '#222'}"
|
itemStyle="min-width: 106px; line-height:40rpx; font-size: 20rpx; height: 88rpx" lineColor="#216EEE"
|
@change="changeStatus()">
|
</u-tabs>
|
</view>
|
</u-sticky>
|
<!-- :height="statusbarHeight + navHeight + 60 + 'px'" -->
|
<u-list @scrolltolower="scrolltolower" :height="windowHeight - 110 + 'px'">
|
<u-list-item v-for="(item, index) in commpanyList" :key="index">
|
<view class="plr30 mb20">
|
<view class="project-item bg_w bbox p30 rd8 ">
|
<view class="project-title beyondO">{{ item.companyName }}</view>
|
<view class="project-time">所在区域:{{ item.areaName }}</view>
|
<view class="project-time">服务机构:{{ item.serviceName || '-' }}</view>
|
<view class="project-time">服务次数:{{ item.upServerCount }}次</view>
|
<view class="project-time">诊断得分:{{ item.roleScore ? `${item.roleScore}分` : '-' }}</view>
|
<view class="fixedTR project-status plr15" :style="{
|
backgroundColor: !(item.status<7||item.status===11) ? '#E8F0FE' : '#CCCCCC',
|
color: !(item.status<7||item.status===11) ? '#216EEE' : '#fff',
|
}">
|
{{ statusToStr(item.status) }}
|
</view>
|
<view class="rX">
|
<view class="btn btn-sel ml20" @click="uploadService(item)"
|
v-if="(userInfo.type==2||userInfo.type==3) && (item.status===7||item.status===8)">
|
上传服务数据
|
</view>
|
<view class="btn btn-sel ml20" @click="uploadCheck(item)"
|
v-if="(userInfo.type==4||userInfo.type==5) && (item.status===7||item.status===8)">
|
上传诊断数据
|
</view>
|
<view class="btn btn-normal" @click="showDetail(item)">
|
查看服务数据
|
</view>
|
</view>
|
</view>
|
|
</view>
|
</u-list-item>
|
</u-list>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getPageByProjectId
|
} from '@/util/api/index.js'
|
import {
|
mapState
|
} from 'vuex'
|
export default {
|
data() {
|
return {
|
windowHeight: '',
|
searchForm: {
|
projectId: '',
|
companyName: '',
|
status: ''
|
},
|
status: [{
|
name: '全部',
|
value: ''
|
}, {
|
name: '已分配服务机构',
|
value: '7'
|
}, {
|
name: '诊断中',
|
value: '8'
|
}],
|
setupTypes: [
|
// 0已保存、1待审核、2审核通过、3退回修改、4审核驳回、5待服务机构确认、6服务机构拒绝、7已分配服务机构、
|
// 8诊断中(成功上传第一份服务资料)、9服务完成、10已分配评分专家、11已完成(专家上传评分). 12 (退回修改)诊断服务退回修改
|
{
|
name: '已保存',
|
value: 0
|
},
|
{
|
name: '待审核',
|
value: 1
|
},
|
{
|
name: '审核通过',
|
value: 2
|
},
|
{
|
name: '退回修改',
|
value: 3
|
},
|
{
|
name: '审核驳回',
|
value: 4
|
},
|
{
|
name: '待服务机构确认',
|
value: 5
|
},
|
{
|
name: '服务机构拒绝',
|
value: 6
|
},
|
{
|
name: '已分配服务机构',
|
value: 7
|
},
|
{
|
name: '诊断中',
|
value: 8
|
},
|
{
|
name: '服务完成',
|
value: 9
|
},
|
{
|
name: '已分配评分专家',
|
value: 10
|
},
|
{
|
name: '已完成',
|
value: 11
|
},
|
{
|
name: '诊断服务退回修改',
|
value: 12
|
},
|
],
|
commpanyList: [],
|
page: {
|
pageIndex: 1,
|
pageSize: 10,
|
total: 0
|
}
|
};
|
},
|
computed: {
|
...mapState(['statusbarHeight', 'navHeight', 'userInfo']),
|
},
|
onLoad({
|
projectId
|
}) {
|
uni.getSystemInfo({
|
success: res => {
|
this.windowHeight = res.windowHeight
|
}
|
})
|
this.searchForm.projectId = projectId
|
this.getDataList()
|
uni.$on("success", () => {
|
this.scrolltoupper()
|
})
|
},
|
methods: {
|
statusToStr(status) {
|
let tempStatus = this.setupTypes.find(item => item.value === status)
|
return tempStatus ? tempStatus.name : '-'
|
},
|
scrolltoupper() {
|
this.page.pageIndex = 1
|
this.getDataList()
|
},
|
scrolltolower() {
|
if (this.page.total <= this.commpanyList.length) {
|
return
|
}
|
this.loadmore()
|
},
|
loadmore() {
|
this.page.pageIndex += 1
|
this.getDataList()
|
},
|
|
getDataList() {
|
getPageByProjectId({
|
capacity: this.page.pageSize,
|
model: this.searchForm,
|
page: this.page.pageIndex
|
})
|
.then(res => {
|
this.page.pageIndex = res.page
|
this.page.total = res.total
|
if (this.page.pageIndex === 1) {
|
this.commpanyList = []
|
}
|
this.commpanyList.push(...res.records)
|
})
|
.catch(err => {
|
|
})
|
},
|
|
changeStatus({
|
value
|
}) {
|
// console.log(v);
|
this.searchForm.status = value
|
this.page.pageIndex = 1
|
this.getDataList()
|
},
|
|
|
// 页面跳转
|
showDetail(item) {
|
uni.navigateTo({
|
url: `/pages/applyDetail/applyDetail?declareId=${item.id}&projectId=${item.projectId}&companyId=${item.companyId}`
|
})
|
},
|
uploadService(item) {
|
uni.navigateTo({
|
url: `/pages/uploadServiceData/uploadServiceData?declareId=${item.id}&upServerCount=${item.upServerCount}`
|
})
|
},
|
uploadCheck(item) {
|
uni.navigateTo({
|
url: `/pages/uploadCheckData/uploadCheckData?declareId=${item.id}&hcServerCount=${item.hcServerCount}`
|
})
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.content {
|
height: 100vh;
|
background-color: #F3F6F9;
|
|
.project-item {
|
position: relative;
|
|
.project-title {
|
height: 44rpx;
|
max-width: 480rpx;
|
font-size: 32rpx;
|
font-weight: 500;
|
color: #222222;
|
line-height: 44rpx;
|
margin-bottom: 20rpx;
|
}
|
|
.project-time {
|
height: 36rpx;
|
font-size: 26rpx;
|
font-weight: 400;
|
color: #666666;
|
line-height: 36rpx;
|
margin-bottom: 12rpx;
|
}
|
|
.apply-count {
|
height: 36rpx;
|
font-size: 26rpx;
|
font-weight: 400;
|
color: #216EEE;
|
line-height: 36rpx;
|
}
|
|
.project-status {
|
border-top-right-radius: 8rpx;
|
border-bottom-left-radius: 24rpx;
|
height: 46rpx;
|
line-height: 46rpx;
|
text-align: center;
|
font-weight: 400;
|
font-size: 24rpx;
|
background-color: #E8F0FE;
|
color: #216EEE;
|
}
|
|
.btn-width {
|
width: 190rpx;
|
}
|
|
.btn-height {
|
height: 56rpx;
|
}
|
}
|
|
}
|
|
// ::v-deep .u-tabs__wrapper__nav {
|
// justify-content: space-between;
|
// }
|
.btn {
|
width: 188rpx;
|
height: 56rpx;
|
border-radius: 8rpx;
|
|
font-size: 24rpx;
|
font-weight: 400;
|
line-height: 56rpx;
|
text-align: center;
|
}
|
.btn-normal {
|
color: #333333;
|
// background-color: #f1f1f1;
|
border: 1rpx solid #999999;
|
// border: 1rpx solid #f1f1f1;
|
}
|
.btn-sel {
|
color: #fff;
|
background-color: #216EEE;
|
border: 1rpx solid #216EEE;
|
}
|
</style>
|