214 lines
5.1 KiB
Vue

<template>
<view class="projectList">
<view class="" style="position: fixed; top: 0; left: 0; width: 100%; z-index: 10;background-color: #f4f5fd;">
<view class="fixedheader">
<headers :themeType="true" :showBack="true">
<view class="headerName">
材料出场管理
</view>
</headers>
</view>
<input class="uni-input" name="searchName" v-model="search" placeholder="请搜索" @input="handleInput" />
</view>
<view v-if="dataList.length > 0" :style="{paddingTop: mobileTopHeight + 90 + 'px'}">
<view class="ukashList" v-for="item in dataList" :key="item.id" @click="jobMaterials(item.id)">
<view class="ukashList-what">
<span style="font-size: 28rpx;font-weight: 700;">{{item.name}}</span>
<span class="ukashList-look">查看明细</span>
</view>
<view class="ukashList-time">企业: {{item.enterpriseName}}</view>
<view class="ukashList-time">车牌号: {{item.carNumber}}</view>
<view class="ukashList-time">出场有效时间: {{item.entryBeginTime}}至{{item.entryEndTime}}</view>
</view>
</view>
<view class="no-data" v-else>
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
</template>
<script>
import levitatedsphere from "@/components/levitatedsphere/levitatedsphere.vue"
import headers from '../../../components/headers/headers.vue'
export default {
data() {
return {
mobileTopHeight: 0,
search: '',
pageNo: 1,
pageSize: 10,
isLoadMore: false,
dataList: [],
isFinished: false
}
},
onLoad() {
this.queryList()
},
mounted() {
var that = this
uni.getSystemInfo({
success(res) {
that.mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
uni.setStorageSync('systemInfo',res)
console.log(res)
}
})
console.log('this.mobileTopHeight',this.mobileTopHeight)
},
onReachBottom() {
console.log(99999);
// this.pageNo += 1
// this.queryList()
if (!this.isLoadMore) {
this.pageNo += 1;
this.queryList();
}
},
onPullDownRefresh() {
console.log(222);
this.pageNo = 1
this.dataList = []
this.queryList()
this.isFinished = false
},
methods: {
queryList() {
let data = {
pageNo: this.pageNo,
pageSize: this.pageSize,
type: 2
}
let _this = this
this.sendRequest({
url: 'xmgl/xzMaterial/page',
method: 'post',
data: data,
success: res => {
console.log(res);
// this.dataList = this.dataList.concat(res.result.records)
this.dataList = [...this.dataList, ...res.result.records]
// console.log(this.dataList , res.result.total);
// this.dataList = res.result.records
if (res.result.records.length < this.pageSize) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true
} else {
this.isLoadMore = false
// that.loadStatus='more'
}
uni.stopPullDownRefresh()
// console.log(res.result)
}
})
},
jobMaterials(id) {
uni.navigateTo({
url: './materials?itemS=' + id
})
},
handleInput(e) {
this.dataList = []
let data = {
pageNo: this.pageNo,
pageSize: this.pageSize,
type: 2
}
if(e.detail.value){
data.name = e.detail.value;
}
let _this = this
this.sendRequest({
url: 'xmgl/xzMaterial/page',
method: 'post',
data: data,
success: res => {
console.log(res);
// this.dataList = this.dataList.concat(res.result.records)
this.dataList = res.result.records
// console.log(this.dataList , res.result.total);
// this.dataList = res.result.records
if (res.result.records.length < this.pageSize) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true
} else {
this.isLoadMore = false
// that.loadStatus='more'
}
uni.stopPullDownRefresh()
// console.log(res.result)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.projectList {
min-height: 100%;
background: #f4f5fd;
.uni-input {
border-radius: 20rpx;
margin: 20rpx 20rpx;
background-color: #e6e7ef;
height: 70rpx;
line-height: 60rpx;
padding: 0 40rpx;
font-size: 28rpx;
}
.ukashList {
min-height: 180rpx;
background-color: #fff;
margin: 20rpx 20rpx;
border-radius: 30rpx;
padding: 20rpx 0rpx;
.ukashList-what {
display: flex;
justify-content: space-between;
margin: 0 40rpx;
.ukashList-look {
background-color: #5081f7;
border-radius: 20rpx;
padding: 0 4px;
font-size: 24rpx;
text-align: center;
color: #fff;
}
}
.ukashList-time {
margin-top: 20rpx;
margin-left: 40rpx;
font-size: 24rpx;
color: #b9bbc9;
}
}
.no-data {
text-align: center;
margin-top: 50%;
.img {
display: block;
height: 200rpx;
width: 200rpx;
margin: 0 auto;
margin-top: 60rpx;
margin-bottom: 60rpx;
}
.txt {
color: #C0C4CC;
}
}
}
</style>