This commit is contained in:
zzyuan 2024-10-30 09:19:01 +08:00
commit d483fcff4c
4 changed files with 795 additions and 692 deletions

View File

@ -13,7 +13,7 @@
"type" : "uniCloud"
},
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -6,14 +6,15 @@
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
rightIcon="list" @rightClick="goIndex"
rightIcon="list"
@rightClick="goIndex"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
>
<view class="u-nav-slot" slot="right">
<text style="color: #FFF;">首页</text>
</view>
</u-navbar>
<view class="u-nav-slot" slot="right">
<text style="color: #fff">首页</text>
</view>
</u-navbar>
<view class="header-fixed">
<view class="search-content">
<view style="width: 90%">
@ -29,98 +30,113 @@
<view style="margin-top: 20rpx; color: #3f9dfd; letter-spacing: 2rpx">已查询{{ recordsTotal }}条数据</view>
</view>
<view style="padding: 0 20rpx">
<u-list class="data-container" @scrolltolower="scrolltolower" height="74vh" >
<view v-if="companyInfoList.length==0" style="width: 96%;height: 60vh;display: flex;flex-direction: column;justify-content: center;align-items: center;" >
<image src="../../../../static/realName/noData.png" style="width: 100rpx;height: 120rpx;" mode=""></image>
<view>暂无数据</view>
</view>
<u-list-item v-for="(item, index) in companyInfoList" v-if="companyInfoList.length>0" :key="index">
<view class="scroll-item">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view style="width: 80%;">{{ item.proName }}</view>
<uni-icons :type="item.isCollect == 1 ? 'star-filled' : 'star'" size="20" @click="onCollection($event, item)" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" style="position: absolute;right: 1%;"></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>{{ item.voltageLevel }}</view>
<view>{{ item.proType }}</view>
<view>{{ item.proStatusName }}</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goSubListPage(item)"
>
<view>分包</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.subNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goTeamListPage(item)"
>
<view>班组</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.teamNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goAttPersonListPage(item)"
>
<view>考勤人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.attPersonNum }}</view>
</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goAllPersonListPage(item)"
>
<view>在场</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.einPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goWorkPersonListPage(item)"
>
<view>固定</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.formalPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goTempPersonListPage(item)"
>
<view>临时</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.temporaryPersonNum }}</view>
</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 2)"
>
<view>绿灯</view>
<view style="color: #3fb779; font-weight: bold">{{ item.greenPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 1)"
>
<view>黄灯</view>
<view style="color: #e89c2d; font-weight: bold">{{ item.yellowPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 0)"
>
<view>红灯</view>
<view style="color: #e8717f; font-weight: bold">{{ item.redPersonNum }}</view>
</view>
</view>
</view>
</u-list-item>
</u-list>
<u-list class="data-container" @scrolltolower="scrolltolower" height="74vh">
<view
v-if="companyInfoList.length == 0"
style="
width: 96%;
height: 60vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
>
<image src="../../../../static/realName/noData.png" style="width: 100rpx; height: 120rpx" mode=""></image>
<view>暂无数据</view>
</view>
<u-list-item v-for="(item, index) in companyInfoList" v-if="companyInfoList.length > 0" :key="index">
<view class="scroll-item">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view style="width: 80%">{{ item.proName }}</view>
<uni-icons
:type="item.isCollect == 1 ? 'star-filled' : 'star'"
size="20"
@click="onCollection($event, item)"
:style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"
style="position: absolute; right: 1%"
></uni-icons>
</view>
<view class="item-2">
<view>{{ item.subComName }}</view>
<view>{{ item.voltageLevel }}</view>
<view>{{ item.proType }}</view>
<view>{{ item.proStatusName }}</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goSubListPage(item)"
>
<view>分包</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.subNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goTeamListPage(item)"
>
<view>班组</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.teamNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goAttPersonListPage(item)"
>
<view>考勤人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.attPersonNum }}</view>
</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goAllPersonListPage(item)"
>
<view>在场</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.einPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goWorkPersonListPage(item)"
>
<view>固定</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.formalPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goTempPersonListPage(item)"
>
<view>临时</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.temporaryPersonNum }}</view>
</view>
</view>
<view class="item-3">
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 2)"
>
<view>绿灯</view>
<view style="color: #3fb779; font-weight: bold">{{ item.greenPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 1)"
>
<view>黄灯</view>
<view style="color: #e89c2d; font-weight: bold">{{ item.yellowPersonNum }}</view>
</view>
<view
style="width: 25%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
@tap="goLightPersonListPage(item, 0)"
>
<view>红灯</view>
<view style="color: #e8717f; font-weight: bold">{{ item.redPersonNum }}</view>
</view>
</view>
</view>
</u-list-item>
</u-list>
</view>
<!-- 底部弹框 -->
@ -211,7 +227,7 @@ export default {
token: uni.getStorageSync('tjToken'),
//
queryParams: {
page: 0,
page: 0,
offset: 0,
limit: 10,
params: {
@ -223,7 +239,7 @@ export default {
proType: ''
}
},
isLoading:false,
isLoading: false,
companyList: [{ name: '全部', id: '' }],
proStatusList: [{ name: '全部', id: '' }],
levelList: [{ name: '全部', id: '' }],
@ -243,61 +259,61 @@ export default {
const { currentIndex, name } = voltageLevel
this.activeIndex3 = currentIndex + 1
this.queryParams.params.voltageLevel = this.levelList[currentIndex + 1].id
this.getListData()
this.getListData()
} else if (option.proType) {
//
const proType = JSON.parse(option.proType)
const { currentIndex, name } = proType
this.activeIndex4 = currentIndex + 1
this.queryParams.params.proType = this.proTypeList[currentIndex + 1].id
this.getListData()
this.getListData()
} else if (option.survey) {
//
const survey = JSON.parse(option.survey)
const { currentIndex, name } = survey
this.activeIndex2 = currentIndex
this.queryParams.params.proStatus = this.proStatusList[currentIndex].id
this.getListData()
} else if(option.proStatus&&option.proStatus==0){//
this.activeIndex2=1
this.queryParams.params.proStatus = "0"
this.getListData()
}else{
this.getListData()
}
this.getListData()
} else if (option.proStatus && option.proStatus == 0) {
//
this.activeIndex2 = 1
this.queryParams.params.proStatus = '0'
this.getListData()
} else {
this.getListData()
}
})
},
methods: {
//
scrolltolower(){
this.queryParams.limit=10
// *
if (this.queryParams.page * this.queryParams.limit >= this.recordsTotal) {
uni.$u.toast('数据加载完毕')
return
}
this.queryParams.page++
//+1,
if(this.queryParams.page==0){
this.queryParams.offset=0;
}else{
this.queryParams.offset=this.queryParams.page * this.queryParams.limit;
}
//
this.getListData()
},
searchList(){
this.queryParams.page=0
this.companyInfoList=[]
this.getListData()
},
//
scrolltolower() {
this.queryParams.limit = 10
// *
if (this.queryParams.page * this.queryParams.limit >= this.recordsTotal) {
uni.$u.toast('数据加载完毕')
return
}
this.queryParams.page++
//+1,
if (this.queryParams.page == 0) {
this.queryParams.offset = 0
} else {
this.queryParams.offset = this.queryParams.page * this.queryParams.limit
}
//
this.getListData()
},
searchList() {
this.queryParams.page = 0
this.companyInfoList = []
this.getListData()
},
/* 获取作业计划列表 */
async getListData() {
this.queryParams.offset=this.queryParams.offset+""
this.queryParams.limit=this.queryParams.limit+""
this.queryParams.offset = this.queryParams.offset + ''
this.queryParams.limit = this.queryParams.limit + ''
console.log('this.queryParams参数', this.queryParams)
this.isLoading=true
this.isLoading = true
uni.request({
url: config.realBmwUrl + '/homeSubPage/getAppBuildPro',
method: 'POST',
@ -308,22 +324,24 @@ export default {
},
success: res => {
console.log('res****', res)
if(res.data.data?.length>0){
if(this.queryParams.offset == 0){
this.companyInfoList = res.data.data
}else{
this.companyInfoList = [...this.companyInfoList, ...res.data.data];
}
this.recordsTotal = res.data.recordsTotal
this.companyInfoList.forEach(item=>{
// console.log(item.proStatus)
let index = Number(item.proStatus)+1
item.proStatusName=this.proStatusList[index].name
})
}
this.isLoading=false
if (res.data.data?.length > 0) {
if (this.queryParams.offset == 0) {
this.companyInfoList = res.data.data
} else {
this.companyInfoList = [...this.companyInfoList, ...res.data.data]
}
this.recordsTotal = res.data.recordsTotal
this.companyInfoList.forEach(item => {
// console.log(item.proStatus)
let index = Number(item.proStatus) + 1
item.proStatusName = this.proStatusList[index].name
})
}
this.isLoading = false
},
fail: err => {this.isLoading=false}
fail: err => {
this.isLoading = false
}
})
},
/* 获取公司数据 */
@ -336,7 +354,8 @@ export default {
this.levelList = this.levelList.concat(res.levelList)
},
leftClick() {
uni.navigateTo({ url: `/pages/realName/index/index` })
// uni.navigateTo({ url: `/pages/realName/index/index` })
uni.navigateBack()
},
onSearchFilter() {
//
@ -389,8 +408,8 @@ export default {
},
/* 查询 */
onQuery() {
this.queryParams.page=0
this.companyInfoList=[]
this.queryParams.page = 0
this.companyInfoList = []
this.getListData().then(() => {
this.$refs.popup.close()
})
@ -424,12 +443,12 @@ export default {
//绿2 1 0
uni.navigateTo({ url: `/pages/realName/index/pages/personList?proId=${row.proId}&lightStatus=${type}` })
},
goIndex() {
goIndex() {
uni.navigateTo({ url: `/pages/realName/index/index` })
},
/* 收藏与取消收藏 */
onCollection(e, row) {
console.log(row)
console.log(row)
const params = {
id: row.collectId,
userId: uni.getStorageSync('realNameUser').userId,
@ -437,7 +456,7 @@ export default {
type: 1
}
uni.request({
url: `${config.realAppUrl}${ row.isCollect == 0 ? '/offLine/insertCollect' : '/offLine/deleteCollect'}`,
url: `${config.realAppUrl}${row.isCollect == 0 ? '/offLine/insertCollect' : '/offLine/deleteCollect'}`,
method: 'POST',
data: JSON.stringify(params),
header: {
@ -492,11 +511,11 @@ export default {
height: 75vh;
.scroll-item {
width: 100%;
height: auto;
background-color: #fff;
border-radius: 10rpx;
margin: 20rpx 0;
width: 100%;
height: auto;
background-color: #fff;
border-radius: 10rpx;
margin: 20rpx 0;
}
.item-1,

View File

@ -231,7 +231,8 @@ export default {
this.companyList = this.companyList.concat(res.subList)
},
leftClick() {
uni.navigateTo({ url: `/pages/realName/index/index` })
// uni.navigateTo({ url: `/pages/realName/index/index` })
uni.navigateBack()
},
onSearchFilter() {
//