人员 班组 等页面返回至首页问题修复

This commit is contained in:
BianLzhaoMin 2024-10-30 08:52:07 +08:00
parent e00fbfe5b1
commit 9d959593b6
4 changed files with 805 additions and 702 deletions

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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