星油云站更新
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<staff-item class="cu-list menu-avatar" v-for="item in staffList" :key="item.cUserId" :staff="item" :admin="item.cType==1" />
|
||||
<staff-item class="cu-list menu-avatar" v-for="item in staffList" :key="item.cUserId" :staff="item" :admin="item.isAdmin==1" />
|
||||
</view>
|
||||
<view v-if="staffList.length<1">
|
||||
<Empty />
|
||||
@@ -30,9 +30,9 @@
|
||||
import UniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
|
||||
import staffApi from '@/packageStaff/api/staff.js'
|
||||
import StaffItem from '@/packageStaff/components/staff-item.vue'
|
||||
import oliSiteApi from '@/api/oli-site.js'
|
||||
export default {
|
||||
components: {
|
||||
|
||||
StaffItem,
|
||||
UniLoadMore
|
||||
},
|
||||
@@ -49,6 +49,7 @@
|
||||
value: '',
|
||||
isLoadMore: false,
|
||||
loadStatus: 'loading',
|
||||
channelId:uni.getStorageSync('channelId')
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -56,16 +57,16 @@
|
||||
this.currentPage = 1
|
||||
this.getList()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.staffList = []
|
||||
this.currentPage = 1
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (!this.isLoadMore) {
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
// onPullDownRefresh() {
|
||||
// this.staffList = []
|
||||
// this.currentPage = 1
|
||||
// this.getList()
|
||||
// },
|
||||
// onReachBottom() {
|
||||
// if (!this.isLoadMore) {
|
||||
// this.getList()
|
||||
// }
|
||||
// },
|
||||
methods: {
|
||||
toAddUser() {
|
||||
uni.setStorageSync('tempUid', {
|
||||
@@ -93,35 +94,56 @@
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
const data3 = {
|
||||
pageSize: this.pageSize,
|
||||
currentPage: this.currentPage,
|
||||
sorted: { // 排序方式
|
||||
createTime: 'desc'
|
||||
},
|
||||
params: {
|
||||
netPoint: this.oilSite.oilSiteCode, // 油站编号
|
||||
siteType: '1',
|
||||
value: this.value
|
||||
},
|
||||
columns: {
|
||||
|
||||
// const data3 = {
|
||||
// pageSize: this.pageSize,
|
||||
// currentPage: this.currentPage,
|
||||
// sorted: { // 排序方式
|
||||
// createTime: 'desc'
|
||||
// },
|
||||
// params: {
|
||||
// netPoint: this.oilSite.oilSiteCode, // 油站编号
|
||||
// siteType: '1',
|
||||
// value: this.value
|
||||
// },
|
||||
// columns: {
|
||||
|
||||
}
|
||||
// }
|
||||
// }
|
||||
const data = {
|
||||
searchStr: this.value,
|
||||
channelId: this.channelId
|
||||
}
|
||||
staffApi.getByPage(data3).then(res => {
|
||||
oliSiteApi.getAllStaffList(data).then((res)=>{
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.code === 20000) {
|
||||
this.staffList = this.staffList.concat(res.data.list)
|
||||
if (res.data.list.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.isLoadMore = true
|
||||
this.loadStatus = 'nomore'
|
||||
} else {
|
||||
this.currentPage++
|
||||
this.isLoadMore = false
|
||||
if (res.code === 20000) {
|
||||
this.staffList = this.staffList.concat(res.data)
|
||||
console.log(this.staffList)
|
||||
|
||||
if (res.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.isLoadMore = true
|
||||
this.loadStatus = 'nomore'
|
||||
} else {
|
||||
this.currentPage++
|
||||
this.isLoadMore = false
|
||||
}
|
||||
}
|
||||
console.log(this.isLoadMore, this.loadStatus, this.currentPage)
|
||||
}
|
||||
})
|
||||
// staffApi.getByPage(data3).then(res => {
|
||||
// uni.stopPullDownRefresh();
|
||||
// if (res.code === 20000) {
|
||||
// this.staffList = this.staffList.concat(res.data.list)
|
||||
// if (res.data.list.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
// this.isLoadMore = true
|
||||
// this.loadStatus = 'nomore'
|
||||
// } else {
|
||||
// this.currentPage++
|
||||
// this.isLoadMore = false
|
||||
// }
|
||||
// console.log(this.isLoadMore, this.loadStatus, this.currentPage)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user