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

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"
},
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
}
]

View File

@ -6,20 +6,21 @@
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>
<text style="color: #fff">首页</text>
</view>
</u-navbar>
<view class="header-fixed">
<view class="search-content">
<view style="width: 25%;">
<view style="width: 25%">
<uni-data-select v-model="selectType" :localdata="range" :clear="false"></uni-data-select>
</view>
<view style="width: 70%;">
<view style="width: 70%">
<uni-easyinput
suffixIcon="search"
v-model="keyWord"
@ -33,77 +34,113 @@
</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
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">
<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>
<text>{{ item.name }}-</text>
<text v-if="item.sex=='1.0'"></text>
<text v-if="item.sex=='0.0'"></text>
<text>-{{ item.age }}</text>(
<text v-if="item.workerType==0">临时用工</text>
<text v-if="item.workerType==1">固定用工</text>
<text v-if="item.workerType==2">分包管理人员</text>)
<text v-if="item.isAtt!=null" style="color: #06E7A3;margin-left: 80rpx;font-weight: 600;">已考勤</text>
<text v-if="item.isAtt==null" style="color: #FF2F2F;margin-left: 80rpx;font-weight: 600;">未考勤</text>
<text v-if="item.sex == '1.0'"></text>
<text v-if="item.sex == '0.0'"></text>
<text>-{{ item.age }}</text>
(
<text v-if="item.workerType == 0">临时用工</text>
<text v-if="item.workerType == 1">固定用工</text>
<text v-if="item.workerType == 2">分包管理人员</text>
)
<text v-if="item.isAtt != null" style="color: #06e7a3; margin-left: 80rpx; font-weight: 600">
已考勤
</text>
<text v-if="item.isAtt == null" style="color: #ff2f2f; margin-left: 80rpx; font-weight: 600">
未考勤
</text>
</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>
<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-3" @click="onViewWorkDetails(item)">
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view style="width: 100rpx;">工种</view>
<view style="font-weight: bold;margin-left: 40rpx;">{{item.postName}}</view>
<view style="width: 40%; margin: 0 20rpx; display: flex; align-items: center">
<view style="width: 100rpx">工种</view>
<view style="font-weight: bold; margin-left: 40rpx">{{ item.postName }}</view>
</view>
<view style="width: 45%;margin:0 20rpx;display: flex;align-items: center;">
<view style="width: 100rpx;">联系方式</view>
<view style="color: #3f9dfd; font-weight: bold;margin-left: 40rpx;">{{item.phone}}</view>
<view style="width: 45%; margin: 0 20rpx; display: flex; align-items: center">
<view style="width: 100rpx">联系方式</view>
<view style="color: #3f9dfd; font-weight: bold; margin-left: 40rpx">{{ item.phone }}</view>
</view>
</view>
<view class="item-3" @click="onViewWorkDetails(item)">
<view style="width: 40%;margin:0 20rpx;display: flex;align-items: center;">
<view style="width: 150rpx;">是否为作业打卡</view>
<view style="font-weight: bold;margin-left: 40rpx;">
<text style="color: #06E7A3;" v-if="item.isPlanWorker==1"></text>
<text style="color: #FF2F2F;" v-if="item.isPlanWorker==0"></text>
<view style="width: 40%; margin: 0 20rpx; display: flex; align-items: center">
<view style="width: 150rpx">是否为作业打卡</view>
<view style="font-weight: bold; margin-left: 40rpx">
<text style="color: #06e7a3" v-if="item.isPlanWorker == 1"></text>
<text style="color: #ff2f2f" v-if="item.isPlanWorker == 0"></text>
</view>
</view>
<view style="width: 45%;margin:0 20rpx;display: flex;align-items: center;">
<view style="width: 120rpx;">红绿灯状态</view>
<view style="font-weight: bold;margin-left: 40rpx;">
<text style="color: #06E7A3;" v-if="item.lightStatus==2">绿灯</text>
<text style="color: yellow;" v-if="item.lightStatus==1">黄灯</text>
<text style="color: #FF2F2F;" v-if="item.lightStatus==0">红灯</text>
<view style="width: 45%; margin: 0 20rpx; display: flex; align-items: center">
<view style="width: 120rpx">红绿灯状态</view>
<view style="font-weight: bold; margin-left: 40rpx">
<text style="color: #06e7a3" v-if="item.lightStatus == 2">绿灯</text>
<text style="color: yellow" v-if="item.lightStatus == 1">黄灯</text>
<text style="color: #ff2f2f" v-if="item.lightStatus == 0">红灯</text>
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;" @click="onViewWorkDetails(item)">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在班组</view>
<view style="width: 83%;">
{{item.teamName}}
<view
style="width: 100%; font-size: 24rpx; padding: 20rpx 0; border-bottom: 1px solid #eee"
@click="onViewWorkDetails(item)"
>
<view
style="width: 95%%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
>
<view style="width: 100rpx">所在班组</view>
<view style="width: 83%">
{{ item.teamName }}
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;" @click="onViewWorkDetails(item)">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在分包</view>
<view style="width: 83%;">
{{item.subName}}
<view
style="width: 100%; font-size: 24rpx; padding: 20rpx 0; border-bottom: 1px solid #eee"
@click="onViewWorkDetails(item)"
>
<view
style="width: 95%%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
>
<view style="width: 100rpx">所在分包</view>
<view style="width: 83%">
{{ item.subName }}
</view>
</view>
</view>
<view style="width: 100%;font-size: 24rpx;padding: 20rpx 0;border-bottom: 1px solid #eee;" @click="onViewWorkDetails(item)">
<view style="width:95%%;margin:0 20rpx;display: flex;align-items: center;justify-content: space-between;">
<view style="width: 100rpx;">所在工程</view>
<view style="width: 83%;">
{{item.proName}}
<view
style="width: 100%; font-size: 24rpx; padding: 20rpx 0; border-bottom: 1px solid #eee"
@click="onViewWorkDetails(item)"
>
<view
style="width: 95%%; margin: 0 20rpx; display: flex; align-items: center; justify-content: space-between"
>
<view style="width: 100rpx">所在工程</view>
<view style="width: 83%">
{{ item.proName }}
</view>
</view>
</view>
@ -121,7 +158,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in companyList" :key="index"
v-for="(item, index) in companyList"
:key="index"
:class="{ active: index === activeIndex }"
@tap="onSelectCompany(index, item.id)"
>
@ -135,7 +173,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in lightList" :key="index"
v-for="(item, index) in lightList"
:key="index"
:class="{ active: index === activeIndex2 }"
@tap="onSelectLight(index, item.id)"
>
@ -149,7 +188,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in workTypeList" :key="index"
v-for="(item, index) in workTypeList"
:key="index"
:class="{ active: index === activeIndex3 }"
@tap="onSelectWorkType(index, item.id)"
>
@ -163,7 +203,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in ageTypeList" :key="index"
v-for="(item, index) in ageTypeList"
:key="index"
:class="{ active: index === activeIndex4 }"
@tap="onSelectAgeType(index, item.id)"
>
@ -177,7 +218,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in sexTypeList" :key="index"
v-for="(item, index) in sexTypeList"
:key="index"
:class="{ active: index === activeIndex5 }"
@tap="onSelectSexType(index, item.id)"
>
@ -192,7 +234,8 @@
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
v-for="(item, index) in attTypeList" :key="index"
v-for="(item, index) in attTypeList"
:key="index"
:class="{ active: index === activeIndex6 }"
@tap="onSelectAttType(index, item.id)"
>
@ -203,10 +246,11 @@
</view>
<h2>作业打卡</h2>
<view>
<scroll-view class="company-container" scroll-y="true" style="padding-bottom: 150rpx;">
<scroll-view class="company-container" scroll-y="true" style="padding-bottom: 150rpx">
<view class="company-items">
<view
v-for="(item, index) in dayAttTypeList" :key="index"
v-for="(item, index) in dayAttTypeList"
:key="index"
:class="{ active: index === activeIndex7 }"
@tap="onSelectDayAttType(index, item.id)"
>
@ -239,8 +283,8 @@ export default {
activeIndex7: 0,
recordsTotal: 0,
token: uni.getStorageSync('tjToken'),
selectType:0,
keyWord:"",
selectType: 0,
keyWord: '',
range: [
{ value: 0, text: '姓名' },
{ value: 1, text: '分包' },
@ -253,33 +297,60 @@ export default {
offset: 0,
limit: 10,
params: {
userId:uni.getStorageSync('realNameUser').userId+"",
workerName:"",//
subName:"",//
teamName:"",//
postName:"", //
proId:"", //
subId:"", //
teamId:"", //
lightStatus:"", //
workerType:"", //
sex:"", //
isAtt:"", //
subComId:"", //
isPlanWorker:"", //
startAge:"", //
endAge:"", //
userId: uni.getStorageSync('realNameUser').userId + '',
workerName: '', //
subName: '', //
teamName: '', //
postName: '', //
proId: '', //
subId: '', //
teamId: '', //
lightStatus: '', //
workerType: '', //
sex: '', //
isAtt: '', //
subComId: '', //
isPlanWorker: '', //
startAge: '', //
endAge: '' //
}
},
isLoading:false,
isLoading: false,
companyList: [{ name: '全部', id: '' }],
lightList: [{name:'全部', id:'-1' },{name:'绿灯', id:'2' },{name:'黄灯', id:'1' },{name:'红灯', id:'0' }],
workTypeList: [{name:'全部', id:'-1' },{name:'固定用工', id:'1,2' },{name:'临时用工', id:'0' }],
ageTypeList: [{name:'全部', id:'-1' },{name:'<20', id:'0' },{name:'20-30', id:'1' },{name:'30-40', id:'2' },{name:'40-50', id:'3' },{name:'50-60', id:'4' }],
sexTypeList: [{name:'全部', id:'-1' },{name:'男', id:'1' },{name:'女', id:'0' }],
attTypeList: [{name:'全部', id:'-1' },{name:'已考勤', id:'0' },{name:'未考勤', id:'1' }],
dayAttTypeList: [{name:'全部', id:'-1' },{name:'日计划打卡', id:'1' },{name:'非日计划打卡', id:'0' }],
lightList: [
{ name: '全部', id: '-1' },
{ name: '绿灯', id: '2' },
{ name: '黄灯', id: '1' },
{ name: '红灯', id: '0' }
],
workTypeList: [
{ name: '全部', id: '-1' },
{ name: '固定用工', id: '1,2' },
{ name: '临时用工', id: '0' }
],
ageTypeList: [
{ name: '全部', id: '-1' },
{ name: '<20', id: '0' },
{ name: '20-30', id: '1' },
{ name: '30-40', id: '2' },
{ name: '40-50', id: '3' },
{ name: '50-60', id: '4' }
],
sexTypeList: [
{ name: '全部', id: '-1' },
{ name: '男', id: '1' },
{ name: '女', id: '0' }
],
attTypeList: [
{ name: '全部', id: '-1' },
{ name: '已考勤', id: '0' },
{ name: '未考勤', id: '1' }
],
dayAttTypeList: [
{ name: '全部', id: '-1' },
{ name: '日计划打卡', id: '1' },
{ name: '非日计划打卡', id: '0' }
],
companyInfoList: []
}
},
@ -288,94 +359,106 @@ export default {
},
onLoad(option) {
console.log(option)
this.queryParams.params.proId=option.proId||"";
this.queryParams.params.subId=option.subId||"";
this.queryParams.params.teamId=option.teamId||"";
if(option.isAtt&&option.isAtt==0&&option.isPlanWorker&&option.isPlanWorker==1){//
this.activeIndex6=1
this.activeIndex7=1
this.queryParams.params.isAtt = "0"
this.queryParams.params.isPlanWorker = "1"
this.queryParams.params.proId = option.proId || ''
this.queryParams.params.subId = option.subId || ''
this.queryParams.params.teamId = option.teamId || ''
if (option.isAtt && option.isAtt == 0 && option.isPlanWorker && option.isPlanWorker == 1) {
//
this.activeIndex6 = 1
this.activeIndex7 = 1
this.queryParams.params.isAtt = '0'
this.queryParams.params.isPlanWorker = '1'
this.getListData()
}else if(option.isAtt&&option.isAtt==0){//
this.activeIndex6=1
this.queryParams.params.isAtt = "0"
} else if (option.isAtt && option.isAtt == 0) {
//
this.activeIndex6 = 1
this.queryParams.params.isAtt = '0'
this.getListData()
}else if(option.workerType&&option.workerType==1){//
} else if (option.workerType && option.workerType == 1) {
//
this.activeIndex3 = 1
this.queryParams.params.workerType = "1,2"
this.queryParams.params.workerType = '1,2'
this.getListData()
}else if(option.workerType&&option.workerType==0){//
} else if (option.workerType && option.workerType == 0) {
//
this.activeIndex3 = 2
this.queryParams.params.workerType = "0"
this.queryParams.params.workerType = '0'
this.getListData()
}else if(option.sex&&option.sex==1){//
} else if (option.sex && option.sex == 1) {
//
this.activeIndex5 = 1
this.queryParams.params.sex = "1"
this.queryParams.params.sex = '1'
this.getListData()
}else if(option.sex&&option.sex==0){//
} else if (option.sex && option.sex == 0) {
//
this.activeIndex5 = 2
this.queryParams.params.sex = "0"
this.queryParams.params.sex = '0'
this.getListData()
}else if(option.lightStatus&&option.lightStatus==2){//绿
} else if (option.lightStatus && option.lightStatus == 2) {
//绿
this.activeIndex2 = 1
this.queryParams.params.lightStatus = "2"
this.queryParams.params.lightStatus = '2'
this.getListData()
}else if(option.lightStatus&&option.lightStatus==1){//
} else if (option.lightStatus && option.lightStatus == 1) {
//
this.activeIndex2 = 2
this.queryParams.params.lightStatus = "1"
this.queryParams.params.lightStatus = '1'
this.getListData()
}else if(option.lightStatus&&option.lightStatus==0){//
} else if (option.lightStatus && option.lightStatus == 0) {
//
this.activeIndex2 = 3
this.queryParams.params.lightStatus = "0"
this.queryParams.params.lightStatus = '0'
this.getListData()
}else if(option.isAtt&&option.isAtt==0&&option.workerType&&option.workerType==1){//-
this.activeIndex6=1
this.queryParams.params.isAtt = "0"
} else if (option.isAtt && option.isAtt == 0 && option.workerType && option.workerType == 1) {
//-
this.activeIndex6 = 1
this.queryParams.params.isAtt = '0'
this.activeIndex3 = 1
this.queryParams.params.workerType = "1,2"
this.queryParams.params.workerType = '1,2'
this.getListData()
}else if(option.isAtt&&option.isAtt==0&&option.workerType&&option.workerType==0){//-
this.activeIndex6=1
this.queryParams.params.isAtt = "0"
} else if (option.isAtt && option.isAtt == 0 && option.workerType && option.workerType == 0) {
//-
this.activeIndex6 = 1
this.queryParams.params.isAtt = '0'
this.activeIndex3 = 2
this.queryParams.params.workerType = "0"
this.queryParams.params.workerType = '0'
this.getListData()
}else if(option.selectType&&option.postName){//-
this.selectType=Number(option.selectType)
this.keyWord = option.postName||"";
} else if (option.selectType && option.postName) {
//-
this.selectType = Number(option.selectType)
this.keyWord = option.postName || ''
this.getListData()
}else if(option.ageType&&option.ageType!=""){//
if(option.ageType==0){
} else if (option.ageType && option.ageType != '') {
//
if (option.ageType == 0) {
this.activeIndex4 = 1
this.queryParams.params.startAge = '0'
this.queryParams.params.endAge = '20'
}else if(option.ageType==1){
} else if (option.ageType == 1) {
this.activeIndex4 = 2
this.queryParams.params.startAge = '20'
this.queryParams.params.endAge = '30'
}else if(option.ageType==2){
} else if (option.ageType == 2) {
this.activeIndex4 = 3
this.queryParams.params.startAge = '30'
this.queryParams.params.endAge = '40'
}else if(option.ageType==3){
} else if (option.ageType == 3) {
this.activeIndex4 = 4
this.queryParams.params.startAge = '40'
this.queryParams.params.endAge = '50'
}else if(option.ageType==4){
} else if (option.ageType == 4) {
this.activeIndex4 = 5
this.queryParams.params.startAge = '50'
this.queryParams.params.endAge = '60'
}
this.getListData()
}else{
} else {
this.getListData()
}
},
methods: {
scrolltolower(){
this.queryParams.limit=10
scrolltolower() {
this.queryParams.limit = 10
// *
if (this.queryParams.page * this.queryParams.limit >= this.recordsTotal) {
uni.$u.toast('数据加载完毕')
@ -383,34 +466,34 @@ export default {
}
this.queryParams.page++
//+1,
if(this.queryParams.page==0){
this.queryParams.offset=0;
}else{
this.queryParams.offset=this.queryParams.page * this.queryParams.limit;
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=[]
searchList() {
this.queryParams.page = 0
this.companyInfoList = []
this.getListData()
},
/* 获取列表 */
async getListData() {
if(this.selectType==0){
this.queryParams.params.workerName=this.keyWord
}else if(this.selectType==1){
this.queryParams.params.subName=this.keyWord
}else if(this.selectType==2){
this.queryParams.params.teamName=this.keyWord
}else if(this.selectType==3){
this.queryParams.params.postName=this.keyWord
if (this.selectType == 0) {
this.queryParams.params.workerName = this.keyWord
} else if (this.selectType == 1) {
this.queryParams.params.subName = this.keyWord
} else if (this.selectType == 2) {
this.queryParams.params.teamName = this.keyWord
} else if (this.selectType == 3) {
this.queryParams.params.postName = this.keyWord
}
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.isLoading=true
this.isLoading = true
uni.request({
url: config.realBmwUrl + '/homeSubPage/getAppWorkerMsg',
method: 'POST',
@ -421,18 +504,18 @@ export default {
},
success: res => {
console.log('res****', res)
if(res.data.data?.length>0){
if(this.queryParams.offset == 0){
if (res.data.data?.length > 0) {
if (this.queryParams.offset == 0) {
this.companyInfoList = res.data.data
}else{
this.companyInfoList = [...this.companyInfoList, ...res.data.data];
} else {
this.companyInfoList = [...this.companyInfoList, ...res.data.data]
}
this.recordsTotal = res.data.recordsTotal
}
this.isLoading=false
this.isLoading = false
},
fail: err => {
this.isLoading=false
this.isLoading = false
}
})
},
@ -442,7 +525,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() {
//
@ -464,7 +548,6 @@ export default {
onSelectWorkType(index, Id) {
this.activeIndex3 = index
this.queryParams.params.workerType = Id
},
onSelectAgeType(index, Id) {
this.activeIndex4 = index
@ -520,8 +603,8 @@ export default {
},
/* 查询 */
onQuery() {
this.queryParams.page=0
this.companyInfoList=[]
this.queryParams.page = 0
this.companyInfoList = []
this.getListData().then(() => {
this.$refs.popup.close()
})
@ -544,7 +627,7 @@ export default {
type: 4
}
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: {
@ -568,16 +651,16 @@ export default {
.page {
width: 100vw;
height: 100vh;
background-color: #EFEFEF;
background-color: #efefef;
box-sizing: border-box;
}
.header-fixed {
.header-fixed {
width: 94%;
margin: 20rpx auto;
background-color: #FFF;
background-color: #fff;
border-radius: 10rpx;
padding:20rpx;
padding: 20rpx;
.search-content {
display: flex;
@ -592,9 +675,9 @@ export default {
background-size: 100% 100%;
}
}
}
}
.data-container {
.data-container {
width: 100%;
height: 75vh;
@ -634,9 +717,9 @@ export default {
font-size: 24rpx;
justify-content: space-around;
}
}
}
.bottom-content {
.bottom-content {
height: 60vh;
overflow-y: auto;
@ -706,5 +789,5 @@ export default {
border: 1rpx solid #00337a;
}
}
}
}
</style>

View File

@ -6,12 +6,13 @@
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>
<text style="color: #fff">首页</text>
</view>
</u-navbar>
<view class="header-fixed">
@ -29,17 +30,33 @@
<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>
<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">
<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 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">
@ -118,7 +135,6 @@
</view>
</view>
</view>
</u-list-item>
</u-list>
</view>
@ -223,7 +239,7 @@ export default {
proType: ''
}
},
isLoading:false,
isLoading: false,
companyList: [{ name: '全部', id: '' }],
proStatusList: [{ name: '全部', id: '' }],
levelList: [{ name: '全部', id: '' }],
@ -258,20 +274,20 @@ export default {
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"
} else if (option.proStatus && option.proStatus == 0) {
//
this.activeIndex2 = 1
this.queryParams.params.proStatus = '0'
this.getListData()
}else{
} else {
this.getListData()
}
})
},
methods: {
//
scrolltolower(){
this.queryParams.limit=10
scrolltolower() {
this.queryParams.limit = 10
// *
if (this.queryParams.page * this.queryParams.limit >= this.recordsTotal) {
uni.$u.toast('数据加载完毕')
@ -279,25 +295,25 @@ export default {
}
this.queryParams.page++
//+1,
if(this.queryParams.page==0){
this.queryParams.offset=0;
}else{
this.queryParams.offset=this.queryParams.page * this.queryParams.limit;
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=[]
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){
if (res.data.data?.length > 0) {
if (this.queryParams.offset == 0) {
this.companyInfoList = res.data.data
}else{
this.companyInfoList = [...this.companyInfoList, ...res.data.data];
} else {
this.companyInfoList = [...this.companyInfoList, ...res.data.data]
}
this.recordsTotal = res.data.recordsTotal
this.companyInfoList.forEach(item=>{
this.companyInfoList.forEach(item => {
// console.log(item.proStatus)
let index = Number(item.proStatus)+1
item.proStatusName=this.proStatusList[index].name
let index = Number(item.proStatus) + 1
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)
},
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()
})
@ -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: {

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() {
//