人员 班组 等页面返回至首页问题修复
This commit is contained in:
parent
e00fbfe5b1
commit
9d959593b6
|
|
@ -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
|
|
@ -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>
|
||||
<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 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,
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
// 打开底部弹框
|
||||
|
|
|
|||
Loading…
Reference in New Issue